MPC56xx - DSPI : transmit a 19-bit SPI word?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MPC56xx - DSPI : transmit a 19-bit SPI word?

816 Views
sandrine_labois
Contributor II

Hello,

I'm using a MPC5646C and MPC5645S with a SCA100T Dual axis inclinometer.

I want to send a 19-bit frame using SPI : 8 bits instruction (or command) and 11 bits acceleration data.

But in configuration register I see, than I can send only 16 bit words.

 

Do you have a solution for sending the 19 bits.

 

Thank you in advance for your help

Tags (3)
2 Replies

635 Views
yibbidy
Contributor V

Sending an odd number of bits over sixteen seems like a tricky one.

I'm not familiar with the SCA100T but many SPI slaves will only latch the trailing number of bits that they are expecting, so you might be able to pad your 19 bit message with a leading zero bit to make up a 20 bit frame.
You could then set the FMSZ in the CTAR register to 10 bits, and do two transfers, making sure to set the CONT bit in the PUSHR register for the first push, that'll keep the CS active for the whole 20 bit frame.  That should work.

Cheers, Shaun

635 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

I would just add you may use two concatenated transfer with using of two CTAR configurations. For instance in your case configure CTAR0 for 8-bit and CTAR1 for 11-bit.

PUSH command with CTAR0, CONT=1  -> Sending 8bits
PUSH command with CTAR1, CONT=0  -> Sending 11bits 

This sequence will basically act as 19-bit transfer and it'll work for you.