SPI slave TX FIFO clearing....
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2016-06-30 7:20 AM
Posted on June 30, 2016 at 16:20
I have an SPI slave. The master may request data at a faster pace than I can handle in software, so I've set up DMA. I've prepared a buffer etc.
Now after one transfer, I get an interrupt of the DMA having finished (i.e. master asked for more data than I prepared. In that case, the data sent is ''don't care'': Don't do that then....) But then the CS goes inactive, and later on the master wants a new pack of data. I need to start the transmission at the beginning again. So on the CS edge interrupts I can reset the DMA module, but the SPI module seems to have a bunch of bytes (3 in the current logic analyser trace) still in the TX fifo. Do I really need to reset the whole SPI module and reinitialize everything? Or can I clear the TX buffer in some way?Hmm. Workaround I might try: switch to master mode with a very fast clock. (disable the MOSI pin first). P.S. I'm working with STM32F030.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2016-07-01 2:53 AM
Posted on July 01, 2016 at 11:53resetting and reinitializing the whole SPI module seems to work.
