How to send 16 bits data on SPI?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hello,

   

I measure a current with a ADC_delsig and I want to send the measure 16bit with the SPI.

   

I have an SPI-SLAVE that communicates with a PIC18F97J60. The communcication works with 8-bit words, and I would also send in my frame a 16-bit words.

   

Thanks for your answer

0 Likes
3 Replies
Anonymous
Not applicable
        Would you use this... void SPIM_PutArray(const uint8/uint16 buffer[], uint8 byteCount) Description: Places an array of data into the transmit buffer ...   
0 Likes
Anonymous
Not applicable

Thanks for your answer.

   

I have found a solution i have convert the 16bits data into two 8bits data.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

You can configure the SPI component to use 16bit words (right on the first page of the configuration). But this means you always send and receive 16bit words, which might not what you need.

0 Likes