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.

Sleep problem with 16F74

Status
Not open for further replies.

imhereithink

New Member
Hi guys,

I have written a short piece of code for the PIC16F74 that uses the sleep function. This is the first time i have used the sleep function on any PIC and have come accross a small problem. What the program does is switch on an led before going into sleep, when the wdt times out it causes the PIC to wake up, at this point i switch off the led and return the PIC into sleep which wakes up again on the wdt time out, at this point the program loops. As you can see it is a simple program that basically flashes an led on and off. But when running it on one of my PIC boards, after a short time it stops working. I put it through the MPLab simulator and everytime the wdt times out this messgae appears:

CORE-W0004: Watchdog Timer has generated a wakeup signal

then when it halts this error message comes up:

MAXIMUM number of warnings/errors exceeded 200, program execution halted.

Has anyone come accross this before? and can someone point me in the right direction to sort this. I have read the data sheet numerous times and cannot see what i am doing wrong (but i obviously am doing something wrong :p ) I have attached my asm file so you can see what i am doing.

Thanks in advance!
 

Attachments

  • sleep1.asm
    3.1 KB · Views: 124
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top