AnsweredAssumed Answered

STM32F0- triggering DMA by a timer.

Question asked by wolff.roger on Oct 24, 2015
Latest reply on Oct 27, 2015 by wolff.roger
  
I want to have a timer trigger a DMA transfer. I have a STM32F072RB processor. 


I currently have TIM1 as the timer. I have the timer running and reloading and that seems to work. It is currently also triggering an interrupt allowing me to count the reloads in software, verifying that the timer runs. 


I have set up the DMA controller and that seems to work except that it isn't seeing any DMA transfer requests. When I stop the CPU, disable the DMA channel, enable Mem2mem, enable the DMA again, then I can see a whole buffer get transferred at maximum speed (even though my destination is a peripheral). So, the DMA module is just waiting for requests. 


Dumping the timer (most numbers in hex): 
CR1: 5 : URS + CEN
CR2: 0x28: CCDS + MMS=2
SMCR:  0 Slave mode disabled
DIER: 0x4101: UIE + UDE  + TDE
SR 0x1F: CC4IF   CC3IF CC2IF CC1IF UIF (compares have triggerd, but interrupt has not been cleared: I don't expect those interrupts. UIF is not cleared as my CPU is halted.)
EGR: 0 : writeonly
CCMR1/2: 0  Capture compare off?
CCER: 0   Capture compare off?
CNT: 0x24  "random" value. 
PSC: 0x13 prescale at decimal 20, main clock / 20. 
ARR: 0x1f3: maximum value, 499, reload every 500 ticks. 
RCR: 0
CCR1-4: 0 
BDTR: 0
DCR: 0  DMA control: allows the DMA unit to DMA new values into TIM registers. Not used. 
DMAR: 5 I don't know how that came there. 





Outcomes