I had a difficult situation that i could not comment on it.
I have some program codes that uses only LCD subfunction and transmitting some values through the serial port.
I am using timer1 interrupt to generate 100ms period, that is 10*100ms =1second. Then after every 1 sec pin_a5 changes its state.
Here is the problem :
The parts of my codes are working except the part that is related to timer1. The output LED (connected to pin_a5) sometimes work properly but mostly it is not.
A strange thing: if I disconnect the supply voltage for a while then connect it sometimes cause to run properly.
(note the code works on simulation program properly)
Thanks...
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
Posted: Thu Feb 19, 2009 2:58 am
Without more information it is impossible to say what causes your problem.
Try starting with a simple as possible program, for example blinking a led. If this works you know your hardware is correct.
Then add a module and test again. Continue adding functionality until it stops working, then you know the last added code is (part) of the problem.
Just a wild guess is that your program contains not-initialised variables. At power up the RAM memory contains random data and this may be the reason you see the program sometimes work and other times fail.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum