340
CHAPTER 15 DMAC
PDRR register
The suppression function for a DMA transfer operation specified via the HRCL register is val id
only when an interrupt request with higher priority is active. Therefor e, if th e interr upt reques t is
cleared by the interrupt handler program, suppression of the DMA transfe r operation via the
HRCL register is canceled and the CPU may lose bus control.
The PDRR register in the clock control unit is used to clear an interrupt request, receive another
request, and suppress the DMA transfer operation.
When it is set to a value other than 0, DMA transfer is suppressed. For releasing the
suppression of DMA transfer, set the PDRR to 0.
DMA Transfer Operation in Sleep Mode
When the CPU is in sleep state and a DMA transfer request is issued from an internal resource,
the DMAC performs a DMA transfer operation.
As the DMA transfer request signal from the internal resourc e serves as an interrupt request
signal, the CPU is released from sleep state. The sleep state i s cleared even if the interrupt
level is set to interrupt inhibition level. When the DMA transfer operation ends, the CPU
resumes execution of the next instruction after that during w hich sleep state was entered.
When performing a transfer operation while the CPU is in sle ep state, ensure through the
design of the program that the CPU checks the appropriate conditions and enters again sleep
state if required.
Control proceeds to the next processing step onl y when a specific addr ess contains a sp ecific
value.
If another cause was responsible, for example, if the CPU was released from s leep state
because of a DMA transfer operation after UART reception, slee p state is entered again.
Transfer to DMC Internal Register
Do not specify a DMAC internal register as a transfer destinat ion address.
Continuous Transfer
In continuous transfer mode, write-back to the descriptor may occur even during a transfer ,
depending on the internal bus buffer status of the device. In this case, th e transfer operation
sleep_ mode:
ldi #50h, r0 ; Set SLEP bit.
ldi #481h, r1 ; STCR address
stb r0, @r0 ; Enter s leep mode.
;
; Determine the cause the CPU woke up.
; We assume here that an external interrupt has released t he sleep
state.
ldi # address, r0
ldi # compared data, r1
ldub @r1, r0
and r0, r1
beq sleep_mode