Timer -> DMA -> SPI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-07-03 3:22 PM - edited ‎2023-07-04 9:31 AM
Hi,
I am having trouble getting the Timer to trigger a DMA -> SPI operation. Namely, I want to set the timer up to run,. Then, get every overflow event to trigger the DMA to move a byte into the SPI. The SPI should auto-send. Then, the cycle repeats until the DMA has moved a N-bytes.
I am feeling really blind, because I cannot figure out the problem. At first, I was trying to find the right setting to get the Timer to trigger a DMA request upon UEV generation. However, I could not find such a feature. So instead, I setup DMA1 Channel 3. TIM6 should map to this DMA. Then I setup TIM6 to generate a UEV upon Overflow (URS = 1, UDIS = 0). Finally, I setup TIM6 to generate a DMA request upon update (UDE = 1).
Still nothing.
Can I get some input?
--------------------------------------------------------------------------------------------------------------------------
What I am trying to do may not be possible in the way that I thought.
Would the DMA rapid fire send N-bytes to the SPI upon the first successful DMA request? Is there a way to get it to send only 1 byte at a time, triggered by the timer?
--------------------------------------------------------------------------------------------------------------------------
And auto-increment through memory? So..
- Timer6 -> Overflow -> UEV -> DMA -> Byte 0 -> SPI
- Timer6 -> Overflow -> UEV -> DMA -> Byte 1 -> SPI
- Timer6 -> Overflow -> UEV -> DMA -> Byte 2 -> SPI
- ...
- Timer6 -> Overflow -> UEV -> DMA -> Byte N -> SPI
Solved! Go to Solution.
- Labels:
-
STM32L4 series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-07-04 9:24 AM - edited ‎2023-07-04 9:35 AM
Content shuffled down
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-07-04 9:29 AM - edited ‎2023-07-04 9:37 AM
Question responded in order:
- STM32L4
- I am trying to trigger the DMA with TIM6_Up
- I did not have CSELR set, I do now.
As a result, the DMA triggers. I also set the DMA to circular buffer mode (CIRC = 1) and N-bytes to 28 (CNDTR3 = 28).
Will the DMA move 1 byte per request (TIM6 UEV) or 28 bytes?
thanks
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-07-04 10:03 AM
> Will the DMA move 1 byte per request (TIM6 UEV) or 28 bytes?
One.
JW

- « Previous
-
- 1
- 2
- Next »