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;
}
}
}
}