Accurate timebase on KL05

cancel
Showing results for 
Search instead for 
Did you mean: 

Accurate timebase on KL05

Jump to solution
199 Views
Contributor II

Hello,

 

I am designing a project where I need to have accurate (to the available limit) timebase on KL05.

I plan to use internal 32.768kHz oscillator multiplied to near 48MHz by FLL block.

 

Now I need to setup somehow a timebase with 1us resolution.

What peripherals are best suited for the job?

 

Is it going to be systick or rather some free running counter?

 

How to set it up in KDS?

 

Thanks in advance for any hints.

Grzegorz

Labels (1)
Tags (2)
0 Kudos
1 Solution
23 Views
NXP TechSupport
NXP TechSupport

Hi Grzegorz,

one solution is to trim internal clock to 37.5KHz,  set FLL Multiplication factor as 1280, it can generate 37.5K*1280=48MHz FLL output.

I don;t know what you will do with timebase with 1us resolution?  systick is ok to generate 1MHz output, we need set SYST_RVR( Systick reload value register ) as 48. 48MHz/48=1MHz systick output, which is 1us resolution timebase.


Have a great day,
Zhang Jun

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
3 Replies
24 Views
NXP TechSupport
NXP TechSupport

Hi Grzegorz,

one solution is to trim internal clock to 37.5KHz,  set FLL Multiplication factor as 1280, it can generate 37.5K*1280=48MHz FLL output.

I don;t know what you will do with timebase with 1us resolution?  systick is ok to generate 1MHz output, we need set SYST_RVR( Systick reload value register ) as 48. 48MHz/48=1MHz systick output, which is 1us resolution timebase.


Have a great day,
Zhang Jun

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
23 Views
Contributor II

Hello Zhang Jun,

thank you for your hint with trimming slow internal oscillator.

What I want to achieve is to have an accurate timebase to serve reference time signal inside my wireless sensor network which I am designing now from scratch.

Because transmissions will take place with TDMA time slots technique I need to have a timebase with good accuracy and resolution to air good synchronization signals on one hand, and to have a possibility (as a host) to determine boundaries of each time slot and timestamp data time of arrival from my network endpoints (which will have less accurate on-board clocks) on the other hand.

I plan to synchronize my host/s to external 1PPS signal taken from GPS timing receiver.

If network will work without any external synchronization I would also like to have pretty good quality timebase to enable reliable transmissions inside my network (host is to be airing it's synchronization signal every 1s - so without its external synchronization all slaves, synchronized to it, should have no problem with catching their appropriate transmission time slot and keeping allowable transmission time window).

Is there anything I have forgot or missing in my concept from any reader point of view?

Thank you for your comments.

Grzegorz

0 Kudos
23 Views
NXP TechSupport
NXP TechSupport

Hi, Grzegorz,

We are familiar with neither GPS nor TDMA, but this is the utilization of systick module, when you set up the SYST_RVR as 48 and core run in 48MHz, the chip will generate interrupt for every  1uS. The on-chip PIT module can have the same function.

Hope it can help you

BR

XiangJun Rong

.

0 Kudos