lpc2378 timer
Discussion in "ARM Development" started by bonois_dailleurs May 15, 2011.
Sun May 15 2011, 09:53 pm
hi everybody ,
i wanted to know how to put true values into match registers of a timer
for exemple T0MR0 or T0MR1 ,
for exemple i want to generate an interrupt after 20 ms and the period (T0MR0 = 60ms)
what would i put into T0MR0 and T0MR1 ???
thank you in advance
i wanted to know how to put true values into match registers of a timer
for exemple T0MR0 or T0MR1 ,
for exemple i want to generate an interrupt after 20 ms and the period (T0MR0 = 60ms)
what would i put into T0MR0 and T0MR1 ???
thank you in advance
Mon May 16 2011, 11:53 pm
The lpc2378 is not a device used by many here, so you are unlikely to get a detailed reply unless
DavesGarage visits.
I found this thread that seems to cover the question you asked.
It is not for exactly the same device but should be close enough.
http://www.embeddedrelated.com/groups/lpc2000/show/14210.php
DavesGarage visits.
I found this thread that seems to cover the question you asked.
It is not for exactly the same device but should be close enough.
http://www.embeddedrelated.com/groups/lpc2000/show/14210.php
Wed May 18 2011, 10:15 pm
simplest way is..
TMR0 = TIME_MS * TMRCLOCK/1000 - 1; // this will generate almost exact delay as you want. try it. this applies to all.. timers.
in above equation,
TIME_MS = delay in miliseconds you want e.g. 20 for 20ms
TMRCLOCK = clock in Hz you set during startup for that timer e.g. if 12Mhz then 12000000
Hope this will help you
TMR0 = TIME_MS * TMRCLOCK/1000 - 1; // this will generate almost exact delay as you want. try it. this applies to all.. timers.
in above equation,
TIME_MS = delay in miliseconds you want e.g. 20 for 20ms
TMRCLOCK = clock in Hz you set during startup for that timer e.g. if 12Mhz then 12000000
Hope this will help you
Thu May 19 2011, 12:55 am
The lpc2378 is not a device used by many here, so you are unlikely to get a detailed reply unless
DavesGarage visits.ExperimenterUK
Okay.. or Ajay of course
Thu May 19 2011, 08:09 pm
@Phil hehe.... thanks
After ARM7, I moved on to ARM9 now Armada100 Family... Linux is nice, still learning.
After ARM7, I moved on to ARM9 now Armada100 Family... Linux is nice, still learning.
Tue Jun 07 2011, 10:39 pm
Ha! You guys crack me up... I too have moved on from my brief experimenting with the LPC2478, and am now deeply into the LPC1788 Cortex M3 processor...
I would recommend downloading the examples from the NXP website. They go over every peripheral the device has to offer, complete with working code examples. You can find them at NXP.COM - check it out.
I would recommend downloading the examples from the NXP website. They go over every peripheral the device has to offer, complete with working code examples. You can find them at NXP.COM - check it out.
Powered by e107 Forum System