Hi,
I’m curious if there’s a suggested way to send the parity bit using SPI on a STM32 uC. Can I send and receive an extra byte via SPI. or will that create problems? The issue is that the SPI peripheral supports 8-bit and 16-bit data sizes, but not arbitrary lengths like 17 bits.
Otherwise I just manually toggle the clock and MOSI pins?
Thanks!
Hey Dan,
The MA600 uses a parity bit for error checking by setting PRT in register 28 to a bit value of 1.
Additionally, the datasheet specifies that the controller must send one parity bit after the 16-bit command. The MA600 also returns one parity bit after the 16-bit data.
This parity bit may be sent in a separate 8-bit transfer in conjunction with a 16-bit data packet instead of manually toggling.
If for some reason this doesn’t work for your application and you defer to manually toggling the MOSI pins, I suppose you could calculate the parity bit manually and append it to the data payload. Double check the timing / synchronization allows when toggling the MOSI pins.
Hope this helps.
Best,
Krishan
Hi Krishan,
Thanks for the quick response.
You’re saying that if I send an extra byte the MA600 will ignore the 7 extra bits?
Thanks
-Dan
Hello again Dan,
Yes, if an extra 8-bit data is sent, the MA600 ignores the extra 7 bits.