Timer Problem...

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

Timer Problem...

2,562 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ranaya on Tue Jun 26 12:29:33 MST 2012
Hi every1....

     Actually what is the maximum delay can we obtain using timers in 1769 ? Without using alarms in RTC, can I use timer0 or something to achieve 10-30 mins delays, interrupts ? And what are the consequences of using internal timers for long period delays ?? Quick responses'll be greatly appreciated...

Thank You
0 Kudos
Reply
8 Replies

2,543 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Leji on Fri Jun 29 04:13:17 MST 2012
Thanks for the clarification Polux !
0 Kudos
Reply

2,543 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ranaya on Wed Jun 27 10:07:52 MST 2012
Hey thank both of u for quick replies. My application is a data acquisition system, I use RTC alarm to specify the record time of the data. A delay is required to make adc sampling intervals. :)
0 Kudos
Reply

2,543 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Polux rsv on Wed Jun 27 08:17:15 MST 2012
Precision is not resolution, it is a common confusion.
Resolution is (1/120MHz) x 2^32. it is the prescaler output. Then you count this resolution with a 32 bit counter.

Then you have a deviation due to the quartz PPMs.

Angelo
0 Kudos
Reply

2,543 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Leji on Wed Jun 27 07:42:51 MST 2012
I'm curious how you got that precision value of 35s ? it should be 1/120MHz + crystal ppm, no ?
0 Kudos
Reply

2,543 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Polux rsv on Wed Jun 27 03:03:04 MST 2012
With LPC1769 at 120MHz, it makes 48 centuries = 4869 years = 1779199 days = ......:D:D:D:D But resolution is only 35.79 seconds.
And your complete timer is stuck with the 2^32 prescaler.
Precision could be affected by components quality. Check the crystal ppm parameter.

Angelo
0 Kudos
Reply

2,543 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Leji on Wed Jun 27 01:46:21 MST 2012
the timers are 32bits, with a 32 bits prescaler, that is huge, you can probably have an interrupt every year with that.
The max you can get is CLK*2^64
0 Kudos
Reply

2,543 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Polux rsv on Wed Jun 27 01:20:09 MST 2012
For such long delays, it is better to implement a "software timer", which use a HW timer or the Systick timer as a main timebase. The HW timer will trigger an interrupt every 10 or 100 ms, depending of the needed resolution.
The interrupt routine will implement the software timer which could count in various ways: seconds only, minutes only, minutes and seconds, etc...
You could implement multiple software timers, based on a single HW resource. And on top of that, you could implement high level functions like "execute this in x minutes y seconds", "execute this every x minutes", "execute this for x minutes", ......

Angelo
0 Kudos
Reply

2,543 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by researchinnovation on Wed Jun 27 00:26:10 MST 2012

Quote: ranaya
Hi every1....

     Actually what is the maximum delay can we obtain using timers in 1769 ? Without using alarms in RTC, can I use timer0 or something to achieve 10-30 mins delays, interrupts ? And what are the consequences of using internal timers for long period delays ?? Quick responses'll be greatly appreciated...

Thank You



Hi..!!!


Long delay may not match up with your peripherals or for your application.
And delay depends on your application and on requirement.

Sometime due to long delay you may not get data properly.

Can you please explain your application and project.


Thanks & Regards....:)
0 Kudos
Reply