CTIMER4

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
425件の閲覧回数
kavya_akas
Contributor II

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

0 件の賞賛
1 解決策
414件の閲覧回数
_Leo_
NXP TechSupport
NXP TechSupport

Could you tell us which device are you using please?

元の投稿で解決策を見る

0 件の賞賛
3 返答(返信)
401件の閲覧回数
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 件の賞賛
398件の閲覧回数
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 件の賞賛
415件の閲覧回数
_Leo_
NXP TechSupport
NXP TechSupport

Could you tell us which device are you using please?

0 件の賞賛