SPI cannot use 16Bits words

Placement, modules, components and accessories; the ones that exist and the the nice-to-be's
Post Reply
Toubilou
Posts: 2
Joined: Mon Feb 27, 2017 6:39 am

SPI cannot use 16Bits words

Post by Toubilou » Wed Mar 22, 2017 1:44 am

Hi,
I am trying to control a function generator (AD9833) via SPI protocol and I saw that I am sending 8Bits words, which is actually stopping me from succeding the communication (it needs 16bits words). I tried a lot of different codes found on the internet, made my owns tests, including rasperry pi codes sometimes, and I cannot send 16 bits words.

The main problem is that when I try to change the bpw parameter to 16, it does not work(invalid argument). Of course, I saw on the datasheets that only 8 and 9 bits per words can be selected.

status1 = ioctl(fd1, SPI_IOC_WR_BITS_PER_WORD, &bits);
if (status1 < 0) {
perror("SPI_IOC_MESSAGE bla");
return 0;
}
I would like to know if you maybe knew a solution for my problem. I also tried sending char[2} at the same time with two8 bits words, doesn't work either. I think the best would be to have manually access to the CS pin, in order to maintain the low state longer? http://www.quanser.com/Products/quarc/d ... tocol.html
Sorry for the poor english, I am a young french engineer.
Thank you,
Clément =)

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 27 guests