CTIMER4

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决
758 次查看
kavya_akas
Contributor II

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

0 项奖励
回复
1 解答
747 次查看
_Leo_
NXP TechSupport
NXP TechSupport

Could you tell us which device are you using please?

在原帖中查看解决方案

0 项奖励
回复
3 回复数
734 次查看
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 项奖励
回复
731 次查看
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 项奖励
回复
748 次查看
_Leo_
NXP TechSupport
NXP TechSupport

Could you tell us which device are you using please?

0 项奖励
回复