"); //-->
CSL-lib相关文件夹下有C5509——timer1例程;
工具软件:CCS8.3;win10
1.基本控制配置宏定定义完成:
//---------Global data definition---------
#define TIMER_CTRL TIMER_TCR_RMK(\
TIMER_TCR_IDLEEN_DEFAULT,/* IDLEEN == 0 */ \
TIMER_TCR_FUNC_OF(0), /* FUNC == 0 */ \
TIMER_TCR_TLB_RESET,/* TLB == 1 */ \
TIMER_TCR_SOFT_BRKPTNOW,/* SOFT == 0 */ \
TIMER_TCR_FREE_WITHSOFT,/* FREE == 0 */ \
TIMER_TCR_PWID_OF(0),/* PWID == 0 */ \
TIMER_TCR_ARB_RESET,/* ARB == 1 */ \
TIMER_TCR_TSS_START,/* TSS == 0 */ \
TIMER_TCR_CP_PULSE, /* CP == 0 */ \
TIMER_TCR_POLAR_LOW,/* POLAR == 0 */ \
TIMER_TCR_DATOUT_0 /* DATOUT == 0 */ \
)
2.定时器速率:
TIMER_Config timCfg0 = {
TIMER_CTRL,/*TIMER_CTRL此为宏定义值指示:TCR0 */
0x0400u,/* PRD0:寄存器赋值 */
0x0000 /* PRSC:寄存器赋值 */
};
3.定时器中断函数:
interrupt void timer0Isr(void)
{
++timer0_cnt;
IRQ_clear(eventId0);/*清中断标志*/
}
*博客内容为网友个人发布,仅代表博主个人观点,如有侵权请联系工作人员删除。