No interrupt by CCU40_C41

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hello,

I do need two CCU40-Timer Interrupts. The Interrupt of Timer of CCU40 works well but not CC41.
Here is the code for CCU40_CC41:

Thank you for any help!!

void CCU40_1_IRQHandler(){
static uint16_t cnt;
cnt++;
if(cnt == 15){
P0_0_toggle();
cnt = 0;
}//End < if >
}// End < CCU40_1_IRQHandler >


//Disable the clock gating for CCU4 module
SCU_GENERAL->PASSWD = 0xC0U;
SET_BIT(SCU_CLK->CGATCLR0, SCU_CLK_CGATCLR0_CCU40_Pos);
SCU_GENERAL->PASSWD = 0xC3UL;

//Enable the prescaler block
SET_BIT(CCU40->GIDLC, CCU4_GIDLC_SPRB_Pos);
//Set the prescaler value
WR_REG(CCU40_CC41->PSC, CCU4_CC4_PSC_PSIV_Msk, CCU4_CC4_PSC_PSIV_Pos, (uint32_t)20U); //!
//Control of CCU4 timer slices
CCU40->GCTRL = (uint32_t)0;
//Set the period of the timer
WR_REG(CCU40_CC41->PRS, CCU4_CC4_PRS_PRS_Msk, CCU4_CC4_PRS_PRS_Pos, (uint32_t)3000U); //!
//Enable the synchronized transfer of the period value into the active register
SET_BIT(CCU40->GCSS, CCU4_GCSS_S1SE_Pos); //!
//Set which interrupt line the timer interrupt is directed toward
WR_REG(CCU40_CC41->SRS, CCU4_CC4_SRS_CMSR_Msk, CCU4_CC4_SRS_CMSR_Pos, (uint32_t)0x02);//!
//Enable interrupt generation on comparison match
SET_BIT(CCU40_CC41->INTE, CCU4_CC4_INTE_PME_Pos); //!
//Enables the timer
SET_BIT(CCU40->GIDLC, CCU4_GIDLC_CS1I_Pos); //!
//Start the timer
SET_BIT(CCU40_CC41->TCSET, CCU4_CC4_TCSET_TRBS_Pos); //!

NVIC_SetPriority(CCU40_1_IRQn, 0xC0);
NVIC_ClearPendingIRQ(CCU40_1_IRQn);
NVIC_EnableIRQ(CCU40_1_IRQn);
0 Likes
0 Replies