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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/07/05 17:33
Modified:
  04/07/05 17:35

Read: times


 
#91185 - curious
Responding to: ???'s previous message
768 occurs randomly = 300h
1902 happens randomly = 76eh

The 300h makes me accuse the "while ( msTick_1 < DelayVal);" a test of an int that is mutilated by an ISR. You can not test an int in a '51 with the interrupts enabled. With test like the one you have designed there is a synchonicity issue (when the counter pass e.g. 100h, the main() will be at exactly the same place every time) thus you may see that no catch happen at 100h and 200h.

The way I overcome this problem is with a global bit (here TimerExpired) set in the isr
if (delay_counter == 0)
{
  TimerExpired = TRUE;
}
The 1902 I have no idea about

Erik




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