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

Back to Subject List

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


 
#99632 - Critical error
Responding to: ???'s previous message


You have a critical error whilst using the variable 'count'. Since you have declared the variable as in 'int' you must be careful when sharing a variable between an interrupt and your main code as an int is two bytes - the processor is only 8 bit so it has to do two reads to get the variable. An interrupt may happen between these two reads and corrupt the value read. Do the following in your main code:

EA = 0;
copy_of_count = count;
EA = 1;

use copy_of_count.

Whilst the above may not be the problem you are observing, it will cause other problems - random problems at that.


List of 4 messages in thread
TopicAuthorDate
my timer dosen't work.            01/01/70 00:00      
   Missing brackets            01/01/70 00:00      
   Critical error            01/01/70 00:00      
   This works for me.            01/01/70 00:00      

Back to Subject List