CMS32L051 User Manual |Chapter 16 Enhanced DMA
www.mcu.com.cn 598 / 703
(1) Example of the use of repeat mode: Use the stepper motor of the port to control the pulse output
The DMA is started using the Channel 0 interval timer function of the Timer40, and the mode of the
motor control pulse saved in the code flash memory is transferred to the universal port.
is allocated at
20000120H~2000012PH.
Figure 16-19 Example use of repeat mode: A stepper motor using a port is used to control the pulse output
internal handling automatically executed by DMA
DMABAR=20000000H
vector address (200000010H)=10H
DMACR19(20000120H)=0003H
DMBLS19(20000122H)=0008H
DMACT19(20000124H)=0008H
DMSAR19(20000128H)=2000H
DMDAR19(2000012CH)=40040301H
DMAEN2=08H
configure Timer
Timer channel 0 count completion
interrupt?
data tarnsmit
data tarnsmit
Yes
port register 1
program
flash
2000H
2007H
configure P10~P13 as output mode
Start Timer operation
DMACT19=01H?
Yes
No
No
DMACT19=DMRLD19
P13
P12
P11
P10