
R01UH0336EJ0102 Rev.1.02
Page 778 of 1538
Jul 17, 2014
V850E2/PG4-L
Section 15 TSG2 (TSG20)
15.5.3
Compare Register Rewrite Operation
The following compare registers are rewritten by reload (TSnCTL3.TSnRMC =
0) or anytime rewrite (TSnCTL3.TSnRMC = 1).
• TSnCMP0
• TSnCMP1 to TSnCMP12 (TSnCMP1W, TSnCMP3W, TSnCMP5W,
TSnCMP7W, TSnCMP9W, TSnCMP11W)
• TSnPAT0W, TSnPAT1W
• TSnDTC0W, TSnDTC1W
• TSnDCMP0W, TSnDCMP2
• TSnCTL2, TSnCTL4
• TSnIOC3
Anytime rewrite
mode
In this mode, the compare registers are rewritten independently. Whenever a
value is written to the compare register, the written value is reflected
immediately.
Caution
In HT-PWM mode and in anytime rewrite mode, if rewrite is performed again
before a transfer to the buffer register is completed, the written value is not
reflected immediately.
If the rewrite is performed while the 16-bit counter is counting up, the value is
reflected at the next peak timing of the 16-bit sub-counter. If the rewrite is
performed while the 16-bit counter is counting down, the value is reflected at
the next valley timing of the 16-bit sub-counter.
Reload mode
(simultaneous
rewrite function)
Writing to TSnCMP1 (TSnCMP1W, TSnCMPU, TSnUPW) enables reload
(sets the reload request flag (TSnSTR0.TSnRSF)), and the values of all the
pertinent registers are updated simultaneously at the next reload timing
(reload).
The reload timing is the peak or valley timing of the 16-bit counter when the
TSnTRG0.TSnTS bit is changed from 0 to 1. Reloading is controlled by
TSnCTL4.TSnPRE and TSnVRE.
Writing to any register other than TSnCMP1 (TSnCMP1W, TSnCMPU,
TSnUPW) does not enable reloading.
Do not write to the registers to be reloaded until the next reload timing after
reloading is enabled by writing to TSnCMP1 (TSnCMP1W, TSnCMPU,
TSnUPW). The pertinent registers should be rewritten when the reload request
flag (TSnSTR0.TSnRSF) is 0.
Rewriting registers
to be reloaded by
DMA transfer
Some of the registers to be reloaded can be rewritten by DMA transfer. DMA
transfer is performed as follows.