Sending data to SPI via DMA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-07-26 2:08 AM
I'm using STM32F429 and trying to use HAL library to communicate to SPI slave via DMA channel.
I'd like to ask how is resolved problem with for example sending data to SPI via DMA? Is there any kind of synchronization between SPI and DMA to disallow overwritting SPI DATA register by DMA when SPI is sending previous SPI DATA register? In other words - how DMA knows how fast it should move data from source buffer to SPI DATA register to not overwrite its contents?
Is there any synchronization protocol which tells DMA to stop transmitting to SPI DATA register because SPI is currently busy with transmitting previous SPI DATA register?
Solved! Go to Solution.
- Labels:
-
DMA
-
SPI
-
STM32F4 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-07-26 2:38 AM
The DMA is triggered byte the SPI TXE flag, the DR holding register​ is separate from the internal shift register that puts the data on the wire.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-07-26 2:37 AM
The DMAs on STM32 microcontrollers can generate two interruptions: HalfTransfer and TransferComplete.
You can use the latter to know when the data is sent and start sending new data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-07-26 2:38 AM
The DMA is triggered byte the SPI TXE flag, the DR holding register​ is separate from the internal shift register that puts the data on the wire.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-07-26 2:47 AM
Thank you for rapid answer.
