16f877A not working after power switch

General discussion on mikroC.
Post Reply
Author
Message
vince76
Posts: 17
Joined: 22 May 2011 18:18

16f877A not working after power switch

#1 Post by vince76 » 30 May 2011 12:26

Hi there,
I'm not skilled in PIC programming.
I wrote a working code for 16f877A using interrupt on timer0 and a counter.
Some days after I want to add WDT. So I used timer 1 to get the counter working and timer0 for the WDT.
Now, even without using WDT the PIC works only after programming. i.e.: If I switch power off and then on again the PIC doesn't work. When I switch power off/on the only way to get the PIC working again is to reprogram it with another code and then again with my code.
I can't understand why this happens.

Anyone can explain, please?

Thankyou,
~V

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: 16f877A not working after power switch

#2 Post by Dany » 30 May 2011 13:12

vince76 wrote:Hi there,
I'm not skilled in PIC programming.
I wrote a working code for 16f877A using interrupt on timer0 and a counter.
Some days after I want to add WDT. So I used timer 1 to get the counter working and timer0 for the WDT.
Now, even without using WDT the PIC works only after programming. i.e.: If I switch power off and then on again the PIC doesn't work. When I switch power off/on the only way to get the PIC working again is to reprogram it with another code and then again with my code.
I can't understand why this happens.

Anyone can explain, please?

Thankyou,
~V
Most probably forgotten to initialise a variable.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

vince76
Posts: 17
Joined: 22 May 2011 18:18

Re: 16f877A not working after power switch

#3 Post by vince76 » 31 May 2011 16:00

Rewritten code using TIMER 2.
Now it works.
~V

Post Reply

Return to “mikroC General”