Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2100] Re: A tale of timing and short pulses

2004-02-07 by Robert Adsett

At 12:16 AM 2/7/04 +0000, you wrote:
>     Could explain why this is a race condition in the timer?  I too
>am trying abosrb what you are describing.  Excellent description, I
>could feel the hair pulling, especially with the pulse behind the
>graticle!  Ugh!
Thanks.

As far as explaining the race condition.  Microcontrollers (all that I'm 
aware of) are essentially synchronous devices, everything happens on a 
clock edge.  One of the biggest reasons for doing this is to ensure 
everything happens in a predictable fashion (i.e. if bits from an addition 
operation arrive over several nS it doesn't matter as long as they all 
arrive before the clock edge).

Now the output from the match register is essentially a programmable 
flip-flop.  The output on a match depends on the match occurring, and the 
condition set for match (do nothing, set, clear, toggle, sounds like a j-k 
flip-flop).  This should always produce a well defined output.  The problem 
occurs when the match condition changes at the same time as the match 
occurs (the fact that microcontrollers are synchronous slightly increases 
the chance of this occurring).  The logic output will glitch with its 
output depending on the time through various gates and small differences in 
timing and parasitic delays will change the output.  If you know HW digital 
logic this will be familiar, if not then a simple digital logic 
introduction that discuss flip-flops should introduce the concept.

Could this be fixed in the HW?  Almost certainly.  Is it worth fixing?  I 
doubt it.  It is, however, worth knowing about.

On the other hand it probably would have taken me longer to find the 
problem if the race condition didn't exist and produce a glitch.  Sometimes 
apparent flaws are your friend.

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

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.