Time between ext interrupt calls
2005-04-28 by jase_ko
Yahoo Groups archive
Index last updated: 2026-04-28 23:31 UTC
Thread
2005-04-28 by jase_ko
Hi, I'm new at this. Can someone tell me the best way to measure the time between external interrupt calls? just point me in the right direction as to what to use.. thanks! Jason
2005-04-28 by jase_ko
--- In lpc2000@yahoogroups.com, "jase_ko" <jase.ko@g...> wrote: > Hi, > > I'm new at this. Can someone tell me the best way to measure the time > between external interrupt calls? > just point me in the right direction as to what to use.. > thanks! > > Jason anyone?.. how bout using a timer and increment a variable? or somehow tapping into an onboard clock?
2005-04-28 by Robert Adsett
At 04:36 AM 4/28/05 +0000, jase_ko wrote: >I'm new at this. Can someone tell me the best way to measure the time >between external interrupt calls? >just point me in the right direction as to what to use.. >thanks! It depends on what you are trying to do, your question is a little general. Usually I just toggle an external pin and measure the result on a 'scope. Robert " 'Freedom' has no meaning of itself. There are always restrictions, be they legal, genetic, or physical. If you don't believe me, try to chew a radio signal. " -- Kelvin Throop, III http://www.aeolusdevelopment.com/
2005-04-28 by jase_ko
--- In lpc2000@yahoogroups.com, Robert Adsett <subscriptions@a...> wrote: > At 04:36 AM 4/28/05 +0000, jase_ko wrote: > >I'm new at this. Can someone tell me the best way to measure the time > >between external interrupt calls? > >just point me in the right direction as to what to use.. > >thanks! > > It depends on what you are trying to do, your question is a little > general. Usually I just toggle an external pin and measure the result on a > 'scope. > > Robert > > > " 'Freedom' has no meaning of itself. There are always restrictions, be > they legal, genetic, or physical. If you don't believe me, try to chew a > radio signal. " -- Kelvin Throop, III > http://www.aeolusdevelopment.com/ well i have calls to an external interrupt method every time a pin is grounded.. This happens extremely quickly and i need an accurate way of measuring the time between the successive calls of this same method. I'm using an LPC2129 Thanks
2005-04-29 by Robert Adsett
At 09:47 PM 4/28/05 +0000, jase_ko wrote: >--- In lpc2000@yahoogroups.com, Robert Adsett <subscriptions@a...> >wrote: > > At 04:36 AM 4/28/05 +0000, jase_ko wrote: > > >I'm new at this. Can someone tell me the best way to measure the >time > > >between external interrupt calls? > > >just point me in the right direction as to what to use.. > > >thanks! > > > > It depends on what you are trying to do, your question is a little > > general. Usually I just toggle an external pin and measure the >result on a > > 'scope. >well i have calls to an external interrupt method every time a pin >is grounded.. This happens extremely quickly and i need an accurate >way of measuring the time between the successive calls of this same >method. I'm using an LPC2129 In that case I'd definitely lean towards toggling an external pin. That'll get you a number of useful pieces of information with two channels on a decent DSO. Latency from pin going low to entering your procedure, length of your procedure, time between successive interrupts etc... A decent DSO will have an envelope function and allow you to get a reasonable estimate of minimums and tell if you've missed any events. Maximum information with minimal effort. Robert " 'Freedom' has no meaning of itself. There are always restrictions, be they legal, genetic, or physical. If you don't believe me, try to chew a radio signal. " -- Kelvin Throop, III http://www.aeolusdevelopment.com/
2005-04-29 by Richard Duits
Hello Jase, I would suggest to use a capture pin on timer 0 or timer 1 to capture the falling edge. This is more accurate because it eliminates the interrupt lattency. Richard. jase_ko wrote:
> --- In lpc2000@yahoogroups.com, Robert Adsett <subscriptions@a...> > wrote: > > At 04:36 AM 4/28/05 +0000, jase_ko wrote: > > >I'm new at this. Can someone tell me the best way to measure the > time > > >between external interrupt calls? > > >just point me in the right direction as to what to use.. > > >thanks! > > > > It depends on what you are trying to do, your question is a little > > general. Usually I just toggle an external pin and measure the > result on a > > 'scope. > > > > Robert > > > > > > " 'Freedom' has no meaning of itself. There are always > restrictions, be > > they legal, genetic, or physical. If you don't believe me, try to > chew a > > radio signal. " -- Kelvin Throop, III > > http://www.aeolusdevelopment.com/ > > well i have calls to an external interrupt method every time a pin > is grounded.. This happens extremely quickly and i need an accurate > way of measuring the time between the successive calls of this same > method. I'm using an LPC2129 > > Thanks > > > > > ------------------------------------------------------------------------ > *Yahoo! Groups Links* > > * To visit your group on the web, go to: > http://groups.yahoo.com/group/lpc2000/ > > * To unsubscribe from this group, send an email to: > lpc2000-unsubscribe@yahoogroups.com > <mailto:lpc2000-unsubscribe@yahoogroups.com?subject=Unsubscribe> > > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of > Service <http://docs.yahoo.com/info/terms/>. > >
2005-04-29 by Robert Adsett
At 08:56 AM 4/29/05 +0200, Richard Duits wrote: >Hello Jase, > >I would suggest to use a capture pin on timer 0 or timer 1 to capture >the falling edge. This is more accurate because it eliminates the >interrupt lattency. Umm, how does interrupt_occurred_at = timer_value; have any less latency than portset = 0x20; ?? Robert " 'Freedom' has no meaning of itself. There are always restrictions, be they legal, genetic, or physical. If you don't believe me, try to chew a radio signal. " -- Kelvin Throop, III http://www.aeolusdevelopment.com/
2005-04-29 by Richard Duits
If you want to know when a falling or rising edge occurs the timer capture function copies to timer counter to the capture register when the edge is detected. If you use an interrupt to read the timer counter, you get the timer counter at the moment the timer counter is read and not the timer counter when the edge was detected. So when you read TC in the interrupt, the value is edge time + interrupt latency. If you read the capture register, it is always the edge time. This works only for edge sensitive external interrupts and not for level sensitive or internal interrupts. You would also need to connect the external signal to a timer capture pin for this to work. Richard. Robert Adsett wrote:
> At 08:56 AM 4/29/05 +0200, Richard Duits wrote: > >Hello Jase, > > > >I would suggest to use a capture pin on timer 0 or timer 1 to capture > >the falling edge. This is more accurate because it eliminates the > >interrupt lattency. > > Umm, how does > > interrupt_occurred_at = timer_value; > > have any less latency than > > portset = 0x20; > > ?? > > Robert > > " 'Freedom' has no meaning of itself. There are always > restrictions, be > they legal, genetic, or physical. If you don't believe me, try to chew a > radio signal. " -- Kelvin Throop, III > http://www.aeolusdevelopment.com/ > > > ------------------------------------------------------------------------ > *Yahoo! Groups Links* > > * To visit your group on the web, go to: > http://groups.yahoo.com/group/lpc2000/ > > * To unsubscribe from this group, send an email to: > lpc2000-unsubscribe@yahoogroups.com > <mailto:lpc2000-unsubscribe@yahoogroups.com?subject=Unsubscribe> > > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of > Service <http://docs.yahoo.com/info/terms/>. > >
2005-04-29 by Robert Adsett
At 05:01 PM 4/29/05 +0200, Richard Duits wrote: >If you want to know when a falling or rising edge occurs the timer >capture function copies to timer counter to the capture register when >the edge is detected. If you use an interrupt to read the timer counter, >you get the timer counter at the moment the timer counter is read and >not the timer counter when the edge was detected. So when you read TC in >the interrupt, the value is edge time + interrupt latency. If you read >the capture register, it is always the edge time. > >This works only for edge sensitive external interrupts and not for level >sensitive or internal interrupts. You would also need to connect the >external signal to a timer capture pin for this to work. > > >Richard. > > >Robert Adsett wrote: > > > At 08:56 AM 4/29/05 +0200, Richard Duits wrote: > > >Hello Jase, > > > > > >I would suggest to use a capture pin on timer 0 or timer 1 to capture > > >the falling edge. This is more accurate because it eliminates the > > >interrupt lattency. > > > > Umm, how does > > > > interrupt_occurred_at = timer_value; > > > > have any less latency than > > > > portset = 0x20; > > > > ?? Methinks we are answering different questions. That doesn't measure the interrupt response. That measures the pulse. Likewise toggling an external pin doesn't measure the pulse it measures the interrupt response. I think the original question was how to measure the interrupt response characteristics. Robert " 'Freedom' has no meaning of itself. There are always restrictions, be they legal, genetic, or physical. If you don't believe me, try to chew a radio signal. " -- Kelvin Throop, III http://www.aeolusdevelopment.com/