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
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
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.