DSP-C5509A-定時器
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.定時器中斷函數(shù):
interrupt void timer0Isr(void)
{
++timer0_cnt;
IRQ_clear(eventId0);/*清中斷標志*/
}
*博客內容為網(wǎng)友個人發(fā)布,僅代表博主個人觀點,如有侵權請聯(lián)系工作人員刪除。