RL78/G13 Safety Function (Frequency Detection)
5.8.7 Interval Timer Setup
Figure 5.8 shows the flowchart for setting up the interval timer.
R_IT_Create()
return
Supply clock to interval timer
RTCEN bit 1
Stop interval timer
ITMC register 0000H
Disable interval timer interrupts
ITMK bit 1
Set interval timer compare value
(10 ms)
ITMC register 0095H
Clear interval timer interrupt request flag
ITIF bit 0
: Interval timer operates on low-speed on-chip
oscillator clock (f
IL
= 15 kHz) because the OSMC
register is set to 0x10.
Set interval timer interrupt priority level to
2
ITPR1 bit 1
ITPR0 bit 0
Figure 5.8 Interval Timer Setup
R01AN0956EJ0100 Rev. 1.00 Page 36 of 70
Feb. 27, 2012