CHAPTER 6 16-BIT TIMER 90
User’s Manual U15075EJ2V1UD
136
<Prevention method B> Rewriting by 16-bit access
<1> Disable interrupts (TMMK90 = 1), and disable inversion control of timer output (TOC90 = 0)
<2> Rewrite CR90 (16 bits)
<3> Wait for more than one cycle of the count clock
<4> Clear the interrupt request flag (TMIF90)
<5> Enable timer interrupts and timer output inversion
<Program example B> (When count clock = 64/f
X
, CPU clock = f
X
)
TM90_VCT: SET1
TMMK90
;Timer interrupt disable
CLR1 TMC90.3
;Timer output inversion disable
MOVW AX,#xxyyH
;CR90 rewrite value setting
MOVW CR90,AX
;CR90
rewriting
NOP
NOP
:
NOP
NOP
CLR1 TMIF90
;Interrupt request flag clearing
CLR1 TMMK90
;Timer interrupt enable
SET1 TMC90.3
;Timer output inversion enable
Note
Wait for more than one cycle of the count clock after the instruction rewriting CR90 (MOVW CR90, AX)
before clearing the interrupt request flag (TMIF90).
32 NOP (Wait for 64/f
X
)
Note
Содержание U789436 Series
Страница 2: ...2 User s Manual U15075EJ2V1UD MEMO ...
Страница 7: ...User s Manual U15075EJ2V1UD 7 MEMO ...