STM32F030 - SPI, slave mode: what is sent when TX fifo is empty?
Hello,
I use SPI on STM32F030xx in slave mode, 8 bit data size.
Master clocks in two bytes, depending on them software loads SPI-DR with 2 bytes, eg:
SPI1->DR = 0xA5C3;
Then master clocks in two more bytes to get these two data bytes and gets them first C3 then A5.
So far everything works fine.
Now masters clocks in the next two bytes to request new data and along with these two bytes slave outputs two times the previous lower byte, C3 in our example. I changed the value so I am sure that it is the previous lower byte.
Why is that? I'd prefer 0x00. But if I feed Tx fifo with 0x00 I'd have to clock out 2 times 0x00 before getting C3 and then A5, because TX fifo is then filled with 4 bytes.
How can I get 0x00 when TX fifo is empty?
PS: After reset it is two times as desire, only then it starts as described.
Any idea is welcome
Thanks a lot
Martin
