General Category > Discussion - Software

Zeros in output from FT220X (C#)

(1/2) > >>

9ghtX:
 I tried to get data from my FT220X using ftDevice.Read() and ftDevice.Purge(ref readData), but there is only zeros in data. I checked hardware signals and there is everything OK.
 So, the question. May be there problem in code (I've attached it to this topic) that causes this problem?

Hardware specifics:
 Clock: 40 Mhz
 Receiving package has 4 bytes
 Connected 2 devices FT234XD via 485 (using Serial.IO C# lib) and FT220X via SPI (using FTD2XX.dll).

FTDI Community:
Hello,

Please refer to the FT220X Product Page:

https://www.ftdichip.com/Products/ICs/FT220X.html

Please note that this is not an SPI master.

FT220X implements FT1248 which is a proprietary FTDI interface that allows for a synchronous parallel/ serial interface where the data bus may be 1, 2, 4 or 8 bit wide.
This is not a standard SPI slave.

Data transfer rates up to 1MByte/s.

These app notes should help you:

AN_206 FT1248-1 Bit SPI
AN_167 FT1248 Dynamic Parallel/Serial Interface Basics
AN_173 Establishing FT1248 Communications using a Morph-IC-II

Have you considered our latest SPI slave product the FT4222H?
Do you require an SPI master or slave?

Best Regards,
FTDI Community

9ghtX:
Recently I tried to write program on C++, guided by your instructions on official cite. So, after completing writing I got on RxBytesBuffer strange data package. I get, for example, 0x00AFF738 and this bytes always change in ever iteration of using program.

Also I notice that this values have difference in 12. If I printf() them in %lu, I get RxBytes: 0x6421720, TxBytes: 0x6421732 and RxBuffer: 0x6421444. Is this kinda encrypting? And if this packages always change and they are encrypted, how I can uncrypt them?

In my device this chip in Slave mode. I need get 5 bytes, that contains answers from my SPI-Master device. And after getting command I need to write an answer to Master and continue communicate with it at same time with 485 port (but with communicating with 2 devices I have no problem).

FTDI Community:
Hello

Thank you for your update.
There is no encryption used on the FT220X, what API call are you using when the following happens:
 
--- Quote from: 9ghtX on December 07, 2020, 05:18:08 AM ---Also I notice that this values have difference in 12. If I printf() them in %lu, I get RxBytes: 0x6421720, TxBytes: 0x6421732 and RxBuffer: 0x6421444. Is this kinda encrypting? And if this packages always change and they are encrypted, how I can uncrypt them?

--- End quote ---

Can I see this code snippet?

Best Regards,
FTDI Community

9ghtX:
I found a problem about this random numbers.

After solving all problems with reading, now I get zeros as via C# lib. I write all readed data in byte array and write in console every byte from it. And all bytes in array are zeros. As you can see at screenshot, there is bytes in RxBytes (that displays allowed to read bytes in buffer). There is 4 of them, readed data bytes have only 0 value.

Navigation

[0] Message Index

[#] Next page

Go to full version