Renesas REJ06B0732-0100 Computer Hardware User Manual


 
SH7211 Group
Data Transfer between On-chip RAM Areas with DMAC (Cycle-Stealing Mode)
REJ06B0732-0100/Rev.1.00 March 2008 Page 7 of 13
2.3 Procedure for Setting Modules
This section describes the procedure for making initial settings when the DMAC is to be used to transfer data between
locations within the on-chip RAM. Auto request mode is used for the transfer requests.
By default, the on-chip peripheral modules of this MCU are in module standby mode. Whenever any of these modules
is to be used, be sure to take it out of module standby mode before making the initial settings. Although processing to
delete the end of DMA transfer is typically handled by interrupts, polling is used in this sample application. A
flowchart of the sample program is shown in figure 5. In addition, a flowchart of DMAC initialization is shown in
figure 6.
For details on registers, refer to the SH7211 Group Hardware Manual.
main
DMAC0.CHCR.BIT.DE = 1
DMAC0.CHCR.BIT.DE = 0
STB.CR2.BIT._DMAC = 0
END
[3]
[4]
[5]
[1]
[2]
No
Yes
No
Yes
DMAC_init
512-byte Initialization
completed?
Transfer completed?
[1] Cancel module standby mode
Activate the DMAC
[2] Initialize the DMAC (channel 0)
[3] Initialize the transfer destination
Clear a 512-byte area to 0
[4] Enable DMA transfer
Set DMA enable flag
[5] Perform DMA transfer end processing
Disable DMA transfer after confirmation
of the tranfer end.
* In this sample application, sleep processing is performed after the main routine is complete.
Figure 5 Flowchart of Sample Program