32 Bit capture accuracy in LPC546xx

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

32 Bit capture accuracy in LPC546xx

714 Views
prasannanaik
Contributor III

Hi,

   I am using LPC54608 development board(OM13092) for evaluation of 32 bit capture in Standard counter/Timer module of LPC54608 controller. I have modified the "simple match interrupt" demo code of ctimer module to capture a square wave of freq(20-70 Hz) at pin P2_0 of CT1_CP0(Timer 1 , channel 0). The error seems to be slightly on the higher side. I have triggered capture on both the edges so for a 50 Hz signal i would get 100 Hz output. I am expecting an accuracy of +-0.005 Hz. I have tried with 48 MHz as well as 96 MHz APB Clock frequency but still unable to acheive the desired accuracy. I have attached the code and test results for reference. Please help.

Thanks and best regards,

Prasanna

Labels (1)
0 Kudos
4 Replies

598 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Prasanna,

Regarding your question that you test the external signal cycle time with CTimer capture faeture, from your code, it appears that you count the tick which is 48MHz internal clock, pls check the following FRO section, after trimming, the internal clock is of 1% accuracy, and the stability is bad.

I suggest you connect an external clock source as the tick clock source, the CTimer can count the external clock source, the external clock has high accuracy and stability. From the Table 376, you can connect both the tested signal and clock source to the capture pins, it is okay.

If you need JeremyZhou help, I will assign the case to him.

Hope it can help you

BR

Xiangjun Rong

pastedImage_1.png

pastedImage_2.png

0 Kudos

598 Views
prasannanaik
Contributor III

Hi xiangjun,

   i have tried using external clock as input to PLL to drive both main clock and APB clock but the error is still on the higher side. Are you suggesting to connect the clock signal at input of capture pin and drive the internal timer using this clock?. Can't i use PLL with external clock as the external clock signal will be stable right?

pastedImage_1.jpg

Thanks and best regards,

Prasanna

0 Kudos

598 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Prasanna,

First of all, I think it is good to use external clock source as tick, but I do not know whether there is difference between the tick clock which you use internal PLL to times the low frequency external clock to get and the external high frequency clock source which is used as a tick directly. I think you can have a try. For the second method, you can connect both the high frequency clock tick signal for example 48MHz and the tested signal to the CTimer capture pins.

Hope it can help you

BR

Xiangjun Rong

0 Kudos

598 Views
prasannanaik
Contributor III

Hi jeremyzhou‌,

   Could you please help me resolve this issue?

Thanks and best regards,

Prasanna

0 Kudos