Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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: 275
  • Capture.JPG
    Capture.JPG
    134.1 KB · Views: 280
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: 264
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.
 
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
I love these kind of threads.... The watchdog is obviously causing your issue.... ISIS is showing you this in your first post...

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.

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.

Latest threads

New Articles From Microcontroller Tips

Back
Top