full duplex and loopback

24 views
Skip to first unread message

Eric Pooch

unread,
Mar 11, 2012, 6:12:27 PM3/11/12
to libftdispi
I am struggling to get SPI loopback mode working with libftdispi and
UM232H (using FT232H). I want to do full duplex SPI transfers, so I
thought the loopback would be a good way to test my settings.
Unfortunately, I can't get it to work right regardless of how I set up
my clock edges, etc. The spi mode settings do affect the input, but
not in a way that reflects the data that is input. Even more
concerning, I get different input if I physically connect the DO and
DI pins than if I set the internal loopback. I can post more code,
but I am basically doing:

ftdispi_open(&fsc, &fc, INTERFACE_A);
ftdispi_setmode(&fsc, 1, 0, 0, 0, 0, 0);
ftdispi_setclock(&fsc, 5000);
ftdispi_setloopback(&fsc, 1);

i=ftdispi_write_read(&fsc, wbuf, 16, rbuf, 16, 0);

for results, do not get an error, but I get an empty read buffer,
except for the first two characters, which are always the same as each
other, but vary depending on the mode settings and clock speed. I
know my module properly reads data and appears to write properly
also. It just can't do them both at the same time.
thanks for any help you can provide.

Stany MARCEL

unread,
Mar 29, 2012, 5:06:29 AM3/29/12
to libft...@googlegroups.com
Hello,

Sorry for the delay, have you found a solution ?

Regards,

Reply all
Reply to author
Forward
0 new messages