
CHAPTER 20 DMA FUNCTIONS (DMA CONTROLLER)
Preliminary User’s Manual U16541EJ1V0UM
731
(b) Repeatedly setting INITn bit until DMA transfer is forcibly stopped
[Procedure]
<1> Clear the Enn bit of the DCHCn register of the channel to be forcibly stopped to 0.
<2> Clear the Enn bit of the above channel to 0 again. If data is transferred from or to the internal RAM
to or from the channel to be forcibly stopped, execute step <2> again.
<3> Copy the initial number of transfers of the channel to be forcibly stopped to a general-purpose
register.
<4> Set the INITn bit of the DCHCn register of the channel to be forcibly stopped to 1.
<5> Read the value of the DMA transfer count register (DBCn) of the channel to be forcibly stopped, and
compare that value with the value copied in step <3> above. If the two values do not match, repeat
steps <4> and <5>.
Cautions 1. If the DBCn register is read in step <5>, and if DMA transfer is stopped due to trouble, the
remaining number of transfers will be read. If DMA transfer has been forcibly stopped
correctly, the initial number of transfers will be read.
2. This procedure may take time in an application where DMA transfer of a channel other
than that to be forcibly stopped is frequently executed until the channel in question is
forcibly stopped.
(6) Program execution of internal RAM and DMA transfer
If the following condition is satisfied, the CPU may not operate correctly. If this happens, only the reset signal
can be acknowledged.
[Condition]
When DMA is executed to transfer data to/from the internal RAM
Therefore, take either of the following remedial measures.
[Remedy]
To execute DMA transfer to transfer data to/from the internal RAM, do not execute the bit manipulation
instructions (SET1, CLR1, NOT1) located on the internal RAM, and do not execute data access instruction
that accesses a misaligned address.
When executing the bit manipulation instructions (SET1, CLR1, NOT1) located on the internal RAM or data
access instruction that accesses a misaligned address, do not execute DMA transfer to transfer data to/from
the internal RAM.
(7) Notes on TCn bit (n = 0 to 3) of DMA channel control registers 0 to 3 (DCHC0 to DCHC3)
The TCn bit is not automatically cleared even if it is read at the specified timing. This can be avoided by the
following two methods.
(a) Polling TCn bit to wait for completion of DMA transfer
After confirming that the TCn bit has been set, read the TCn bit three times.
(b) Reading TCn bit by interrupt servicing routine
Read the TCn bit three times.
20.11.1 Interrupt factors
DMA transfer is interrupted if a bus hold is issued.
If the factor (bus hold) interrupting DMA transfer disappears, DMA transfer promptly restarts.