选择通道0,设定定时时间为500ms,P1口接发光二级管实现1s周期闪烁
关键代码:
__interrupt static void r_tau0_channel0_interrupt(void)
{
/* Start user code. Do not edit comment generated here */
TMIF00 = 0U;
PM1=0x00;
P1=~P1;
/* End user code. Do not edit comment generated here */
}
2、定时器输出PWM波
选定channel 0,PWM波的周期为100us,占空比为20%
P16脚PWM波形为输出,接逻辑分析仪

可观察到如下波形
