Use timer as One-shot timer.
[GUI setting example]
Timer |
Used | |||
TMKB |
Used | |||
A/D trigger setting |
Timer KB0 trigger source | |||
TMKB0 |
||||
TMKB0 |
Standalone mode | |||
TMKB_STANDALONE_0 | ||||
TKBO00 |
Unused | |||
TKBO01 |
Unused | |||
Cycle value |
50ms (Actual value:50) | |||
TKBO00 duty |
0(%) (Actual value:0%) | |||
TKBO01 duty |
0(%) (Actual value:0%) | |||
TKBO01delay |
0μs (Actual value:0) | |||
Use trigger input |
Unused | |||
Use output gate function by TKC00 |
Unused | |||
Use output gate function by TKC01 |
Unused | |||
A/D conversion starttiming setting |
0μs (Actual value:0) | |||
End of timer channel 0 count, generate an interrupt (INTTMKB0) |
Used | |||
Priority (INTTMKB0) |
Low | |||
Smooth start function setting TKBO00 |
Unused | |||
Smooth start function setting TKBO01 |
Unused | |||
Dithering function setting TKBO00 |
Unused | |||
Dithering function setting TKBO01 |
Unused | |||
Forced output stop function setting TKBO00 |
Unused | |||
Forced output stop function setting TKBO01 |
Unused |
[API setting example]
r_main.c
void main(void)
{
R_MAIN_UserInit();
/* Start user code. Do not edit comment generated here */
/* Start TMKB0 counter */
R_TMR_KB0_Start();
while (1U)
{
;
}
/* End user code. Do not edit comment generated here */
}
r_cg_timer_user.c
static void __near r_tmr_kb0_interrupt(void)
{
/* Start user code. Do not edit comment generated here */
/* Stop TMKB0 counter */
R_TMR_KB0_Stop();
/* End user code. Do not edit comment generated here */
}