Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/08/05 17:13
Read: times


 
#91266 - Atomic and Synchronous
Responding to: ???'s previous message
When Erik said "a test of an int that is mutilated by an ISR" that is the shared data problem caused by the fact that you cannot do an atomic read if an int on the 8051.

In most programmes the chance that the ISR happens half way throught he test is small and tends to happen at random (usually on Friday evening just as you are about to go home).

In the code posted by the OP the situation is much worse because main sits in a tight loop testing the int over and over and over and so the chance that the ISR occurs part way through this code:

while ( msTick_1 < DelayVal);

is very high indeed because you have effectively synchronised main to the ISR..

Hope that makes things clearer.

Ian

List of 7 messages in thread
TopicAuthorDate
A timing issue            01/01/70 00:00      
   Atomicity?            01/01/70 00:00      
   curious            01/01/70 00:00      
      Synchonocity was the issue            01/01/70 00:00      
      Synchonocity and Atmomicity?            01/01/70 00:00      
         Let me try?            01/01/70 00:00      
            Atomic and Synchronous            01/01/70 00:00      

Back to Subject List