General Category > Discussion - Software
Zeros in output from FT220X (C#)
FTDI Community:
Hello,
Thanks for your code, I cannot see any glaring issues with it immediately.
However I did notice you are trying to print the 'RxBuffer' data as a unsigned long:
--- Code: ---printf("Data Recieved: 0x%lu\n", RxBuffer[i]);
--- End code ---
But RxBuffer is defined as a char array.
Could you also double check the data being received by the FT220? I.e what is the expected 4 bytes?
Best Regards,
FTDI Community
9ghtX:
I tried to define RxBuffer differently: integer, char, DWORD just for experiment. That doesn't change nothing
As I checked, there must be at least one 4 (or 5, that's another question, why I get 4 bytes instead 5, when timings are Ok) bytes package {0x9E, 0x00, 0x00, 0x00, 0x03}.
Another question. There is MIOSIs in FT1248 controller. The 0s' one is only for OUTPUT or for both of them?
FTDI Community:
Hello,
It was more in relation to the prinft statement using the unsigned long identifier, and not how the rxBuffer is defined.
Can you take a logic capture of the device receiving this data?
MIOSIO[0] is the bi-directional data line, which the master must read or write to.
Best Regards,
FTDI Community
9ghtX:
I found out that I needed to write in FT220X 0x00 bit first to initialize Master Write Slave Read mode.
"Write 0x00 Write request command" - From FT220X Datasheet
Do I need to write to FT220X in my program first bit 0x01 to init Master Read Slave Write mode? Or it does this bt itself and I don't need to write anything?
"Read 0x01 Read request command" - From FT220X Datasheet
Or for easily for me to understand you could write little example, how to Write via FT220X correctly.
Here is my thoughts:
If I want to read message from Master, I need to send to my FT220X 0x00 in first bit of my byte data.
If I want to write data from my FT220X to Master, what should I do? Write first bit 0x01? Or it happens automatically? Does it add first bit 0x01-write-command and will my Master see this bit?
So many questions..)
anoopkyadav:
Sir / Madam ,
Has anybody found the solution for ZERO's Received .
I am using UMFT221XE-01 module for Receiving SPI Data from my custom board(Master).
I have made a GUI in C# to receive the SPI data from my Custom Board(Master).
When I am reading the SPI data in the Rx Buffer It's Showing 0000 (All Zeros) , Even Though the available bytes to read are showing Non Zeros .
Pls suggest how to read data in SPI Slave mode.
Pls share a sample code if available
Navigation
[0] Message Index
[*] Previous page
Go to full version