Not applicable
Oct 09, 2015
02:35 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 09, 2015
02:35 AM
Hi, I am working on xmc4100 Timers (CCU4). I am facing problem in running the timer. I have followed the initialization sequence given in the data sheet as follows.
/* GPIO configuration of timer event period check */
GPIO_ConfigurePin(&st_gGPIO_PORT1_PIN3_CONFIG_DATA);
RCU_RESET_Peripheral(RCU_CCU40RS);
RCU_RESET_ClearPeripheral(RCU_CCU40RS);
SCU_PeripheralCLKEN(CCU_CCU_CLK);
/* Enable Prescalar Value */
CCU40->GIDLC = CCU4_GIDLC_SPRB_MASK;
/* Prescalar clear by SW */
CCU40->GCTRL = 0;
/* Prescalar Initial Value (div by 64) */
CCU40_CC40->PSC = 6;
/* Shadow Transfer Enable */
CCU40->GCSS = 0x05;
/* Period Shadow value */
CCU40_CC40->PRS = 8000;
/* Compare Shadow Value */
CCU40_CC40->CRS = 4000;
/* Enabling Interrupts for compare and period */
CCU40_CC40->INTE = CCU4_CC4_INTE_PME_MASK|CCU4_CC4_INTE_CMUE_MASK;
/* SR0 for period match/ SR1 for comp match*/
CCU40_CC40->SRS = 0x10|0x00;
CCU4_NVICInterruptEnable(CC4y_TIM_0_0);
NVIC_SetPriorityTE(CCU40_0_IRQn, 63);
/* Idle Mode CleAR for slice 0*/
CCU40->GIDLC = 0x01;
/* Start the timer */
CCU40_CC40->TCSET = 0x01;
I am checking the register's status in System viewer for debugging. The main problem i am facing here is TCSET (run bit) is not getting set no matter what ! In Global register I can see prescalar bit running but not TCSET run bit !!! Please help
/* GPIO configuration of timer event period check */
GPIO_ConfigurePin(&st_gGPIO_PORT1_PIN3_CONFIG_DATA);
RCU_RESET_Peripheral(RCU_CCU40RS);
RCU_RESET_ClearPeripheral(RCU_CCU40RS);
SCU_PeripheralCLKEN(CCU_CCU_CLK);
/* Enable Prescalar Value */
CCU40->GIDLC = CCU4_GIDLC_SPRB_MASK;
/* Prescalar clear by SW */
CCU40->GCTRL = 0;
/* Prescalar Initial Value (div by 64) */
CCU40_CC40->PSC = 6;
/* Shadow Transfer Enable */
CCU40->GCSS = 0x05;
/* Period Shadow value */
CCU40_CC40->PRS = 8000;
/* Compare Shadow Value */
CCU40_CC40->CRS = 4000;
/* Enabling Interrupts for compare and period */
CCU40_CC40->INTE = CCU4_CC4_INTE_PME_MASK|CCU4_CC4_INTE_CMUE_MASK;
/* SR0 for period match/ SR1 for comp match*/
CCU40_CC40->SRS = 0x10|0x00;
CCU4_NVICInterruptEnable(CC4y_TIM_0_0);
NVIC_SetPriorityTE(CCU40_0_IRQn, 63);
/* Idle Mode CleAR for slice 0*/
CCU40->GIDLC = 0x01;
/* Start the timer */
CCU40_CC40->TCSET = 0x01;
I am checking the register's status in System viewer for debugging. The main problem i am facing here is TCSET (run bit) is not getting set no matter what ! In Global register I can see prescalar bit running but not TCSET run bit !!! Please help
- Tags:
- IFX
2 Replies
Oct 12, 2015
08:15 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 12, 2015
08:15 PM
Hello,
The timer run bit TRBS in TCSET register is a write-only register. Read is always 0 so this is not a problem.
Regards,
Min Wei
The timer run bit TRBS in TCSET register is a write-only register. Read is always 0 so this is not a problem.
Regards,
Min Wei
Not applicable
Oct 13, 2015
02:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 13, 2015
02:21 AM
Yea checked it in the data sheet. But got the solution for that problem. Actually the clock was not getting enabled for ccu4 module. Thanks for the response