INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

PIC Microcontroller Watchdog timer

PIC Microcontroller Watchdog timer

(OP)
I am not sure if the topic fits here. Is there any microcontroller forum here?? ponder

Any ways i have my PIC16F685 on which i have watchdog enabled and it works fine and resets the pic on time out, but once i enable the GIE or PEIE (that is the interrupt - timer 1 actually) now the watchdog does not resets the pic but the pic goes on running with the timer 1 doing the regular interrupt.

Am i missing something or is this the way it is suppose to happen.

Thanks
Regards
Gokkul

RE: PIC Microcontroller Watchdog timer

No that's not what's supposed to happen. I believe you have a reset-the-WD instruction in your interrupt service routines somewhere. So, when you enable the GIE and PEIE the code is once again kicking the dog.

Keith Cress
kcress - http://www.flaminsystems.com

RE: PIC Microcontroller Watchdog timer

(OP)

I solved the prob.

Quote (itsmoked)

No that's not what's supposed to happen. I believe you have a reset-the-WD instruction in your interrupt service routines somewhere

You are right so i went deep down onto the disassembly listing and found that "__delay_us(20)" function, which is a function provided by the compiler for delay inserts a CLRWDT in the code

If i change the delay form 20us to 10 or 30 us its does not add the CLRWDT.

But any way found the culprit. bigglasses
Now the program resets fine.

Thanks
Regards
Gokkul

RE: PIC Microcontroller Watchdog timer

Great! Glad you found it. That sounds like a compiler/library bug. What compiler are you using?

Keith Cress
kcress - http://www.flaminsystems.com

RE: PIC Microcontroller Watchdog timer

(OP)
Hitech-C Compiler

Thanks
Regards
Gokkul

RE: PIC Microcontroller Watchdog timer

Huh. Same one I use.

Normally I'd say email them with this. They've fixed 3 compiler errors I've found in the past. Usually in less than 24hrs. But since Microjerk bought them to murder them and damage all their competitors I have no idea whether they can fix anything or not. Might be worth at least shooting them an email with all the details.

Keith Cress
kcress - http://www.flaminsystems.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close