CTIMER4

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
383 Views
kavya_akas
Contributor II

Hi,there is no MCR register available for ctimer4 ,how can I use it  for the ctimer4?

0 Kudos
1 Solution
372 Views
_Leo_
NXP TechSupport
NXP TechSupport

Could you tell us which device are you using please?

View solution in original post

0 Kudos
3 Replies
359 Views
kavya_akas
Contributor II
Hi,there is no MCR register available for ctimer4 in LPC55s16 controller ,how can I use it for the ctimer4

CTIMER4 Configuration
SYSCON->AHBCLKCTRLSET[2]= 1<<22;
SYSCON->CTIMERCLKSEL.CTIMERCLKSEL4=0x00;

CTIMER4->CTCR = 0x00;
CTIMER4->TC = 0x00;
CTIMER4->PR = 0x00;
CTIMER4->PC = 0x00;

CTIMER4->MR[0] = 96000000;
CTIMER4->MCR |= 1U<<0;
CTIMER4->MCR |= 1U<<1;
CTIMER4->TCR |= 1U<<1;
CTIMER4->TCR &= ~(1U<<1);
CTIMER4->IR |= 0xFF;

CTIMER4->TCR |= 1<<0;



For Handler function

void CTIMER4_IRQHandler(void)
{

if(CTIMER4->IR & 0x01) // MR3 interrupt
{
CTIMER4->IR|=1u<<1;
{
if(tflag==1)
{
GPIO->SET[0]|=1<<31;
tflag=0;
}
else
{
GPIO->CLR[0]|=1<<31;
tflag=1;
}
}
}
}

0 Kudos
356 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @kavya_akas 

There is an issue with UM, please refer to the driver under SDK.

 

BR

Alice

0 Kudos
373 Views
_Leo_
NXP TechSupport
NXP TechSupport

Could you tell us which device are you using please?

0 Kudos