Eric Pooch
unread,Mar 11, 2012, 6:12:27 PM3/11/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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.