Usage example

Use timer as One-shot timer.

[GUI setting example]

Timer

Used

TMKC

Used

Operation mode setting

Standalone mode

TMKC0

TKCO00

Unused

TKCO01

Unused

TKCO02

Unused

TKCO03

Unused

TKCO04

Unused

TKCO05

Unused

Cycle value

50(Actual value50)

TKCO00 duty

0(%)(Actual value0%)

TKCO01 duty

0(%)(Actual value0%)

TKCO02 duty

0(%)(Actual value0%)

TKCO03 duty

0(%)(Actual value0%)

TKCO04 duty

0(%)(Actual value0%)

TKCO05 duty

0(%)(Actual value0%)

End of timer channel 0 count, generate an interrupt (INTTMKC0)

Used

Priority (INTTMKC0)

Low

[API setting example]

r_main.c

void main(void)

{

R_MAIN_UserInit();

/* Start user code. Do not edit comment generated here */

/* Start TMKC channel 0 counter */

R_TMR_KC0_Start();

while (1U)

{

;

}

/* End user code. Do not edit comment generated here */

}

r_cg_timer_user.c

static void __near r_tmr_kc0_interrupt(void)

{

/* Start user code. Do not edit comment generated here */

/* Stop TMKC channel 0 counter */

R_TMR_KC0_Stop();

/* End user code. Do not edit comment generated here */

}