2018-03-19 02:09 PM
Hello,
Could someone tell me what I am doing wrong here?
I would like to transmit on SPI (as slave) using DMA, and so have tied SPI transmit to a DMA channel, and set up an ISR to capture 'transmit completed' interrupt from the DMA. But this interrupt gets called even though there are no SPI clocks present.
To test this I set up my DMA pointers and then set the counter to 2. Now, as soon as I enable the DMA, the count goes to zero.
Shouldn't the counter decrement after a byte gets transmitted? And isn't it that a byte gets transmitted on SPI only when a clock byte has been received from the master? I am scoping the clock line and I see no clocks, obviously since the host has been stopped.
Why is this counter getting reset?
This is on an STM32F072VBT6.
Thanks very much.
2018-03-20 08:25 AM
The 'F0 SPI has a FIFO which can accomodate 4 bytes, so as soon as you enable SPI, up to 4 bytes are transferred by the DMA into SPI's buffer before the first data gets transmitted.
JW
2018-03-28 06:52 AM
Thank you.