how to configure the counter ?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to configure the counter ?

873 Views
aravindpb5009
Contributor III

Hai  

           I am using LPC824 MCUXPRESSO IDE  , i need to act one GPIO PIN as counter if there is an example code for counter , i searched in example code but i din't got any thing in code . plz let me give some solution for counter 

Thanks & Regards 

Aravind P

0 Kudos
1 Reply

719 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Aravind,

As you know that the LPC824 has SCTimer/PWM module, which can count the tick from external pad, so you use the SCTimer as a free-running counter.

Pls refer to the CONFIG register, for example you can use the one of SCT_PIN[0:3] signal as tick signal, for example, you use SCT_PIN0 signal as tick source, you can set the CONFIG[CLKMODE]=0x3, CONFIG[CKSEL]=0x0 0r 0x1.

You have to set up the SCT0_INMUX[0] to selcet the SCT_PIN0 by SCT0_INMUX[0]=0x00;

for example, you connect the external clock signal to pin PIO0_7 as SCT0_PIN0 signal, you can write PINASSIGN6=7<<24. it is okay.

Pls refer to the application note an11538, which has simple example code as free-running Timer.

Hope it can help you

BR

Xiangjun Rong

pastedImage_1.png

pastedImage_2.png

pastedImage_3.png

0 Kudos