Help with PIC16F886 Timer

Status
Not open for further replies.

Naren Rover

New Member
Hi guys I have a doubt with Timer 0 of PIC16F886 or moreover with Watchdog Timer ,I'm Changing the value on a 7 segment for every seconds using Timer_0
What my Problem is Watchdog is Initially Disabled in 886 , but my controller is being reset by Watch dog timer. Can anyone Point out where i have made a mistake
I have used 886 before but i haven't got this problem. thank you. I have attached C file and Proteus Error message. Thank you
 

Attachments

  • 7_Seg_Timer.c
    1.7 KB · Views: 191
  • Capture.JPG
    134.1 KB · Views: 209
You don't appear to have any config settings which is where you would disable the WDT. Either add config setting or put a clrwdt instruction in you display routine.

Mike.
 
actually I was working before without Config Settings and it was working good, i have attached a c file which i used to increment and Decrement value on 7 segment using 886 without config register. it is working good.
And What i read from data sheet(if I'm right) , Watchdog timer is disabled initially
 

Attachments

  • 7_Seg_INC_DEC.c
    1.1 KB · Views: 183
I dont use simulators so can't help but I do know that the wdt is setup in config registers.

Mike.
 
I dont use simulators so can't help but I do know that the wdt is setup in config registers.

Likewise, I don't use simulators (if you're doing electronics how does playing a computer game help? - particularly when it has only a passing resemblance to real life) , but in any PIC program it's absolutely essential that you set the config fuses correctly, the default settings are usually absolutely useless - and as far as I'm aware the default setting for the WDT is ON.
 
I love these kind of threads.... The watchdog is obviously causing your issue.... ISIS is showing you this in your first post...


Likewise... But when you are VERY familiar with hardware, simulation is a software boon.... I can debug 10 x quicker....

If you are a newby, then simulators can cause more heartache... Partly because certain features are not modelled.... Crystal for one.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…