Thanks for Reply...
1)
What is a " Glow LED"?
Means ON LED with PIC12F508 uC.
2)
Please define what you mean by " reset" pic
Restart from Scratch when power is ON
Karan
Thanks for Reply...
1)
What is a " Glow LED"?
Means ON LED with PIC12F508 uC.
2)
Please define what you mean by " reset" pic
Restart from Scratch when power is ON
Karan
To restart"from scratch" would require a power off or MCLR reset, maybe a brownout recovery, but I doubt it. So to reset you can use the mclr pin with a 5k resistor pulling it high and tie one of the other pins set as input to it, to reset just say LOW for that pin and PIC will reset. Other way would involve opening the VDD with a transistor or relay. Glow_LED var GPIO.0
HIGH Glow_LED
Lastly you could put a label at the very beginning of you code and execute a goto label, that will not however reset every register unless you have set every register in code.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
The watchdog timer will timeout in around 2.3 seconds and cause a device reset. If youCode:@ device pic12F508, intrc_osc, wdt_on, mclr_off, protect_off X VAR BYTE OPTION_REG = %10001111 ' pull-ups disabled, 1:128 prescaler assigned to WDT GPIO = 0 ' pins clear on POR TRISIO = 0 ' all outputs (except for GPIO.3, which is input only) Main: FOR X = 0 TO 9 ' toggle LED on GPIO.0 10 times GPIO.0 = 1 PAUSE 500 GPIO.0 = 0 PAUSE 500 NEXT X ' sleep until WDT causes a device reset (around 2.3 seconds) @ SLEEP
just want to start over from 0, just replace @ SLEEP with @ GOTO 0.
Hi Bruce, I'm reading reading about WDT and was wondering if you (or anyone else) could explain how you arrived at 2.3s...(if possible using Mr.E's multicalc...as thats what I normally use)...
Hi, Michael
just use:
2.60 Manual, page 116 ... range x = 0 ... 7 and duration is 18 ms * 2^xCode:NAP 7
No calculations needed ...
for calculations ...
soooo ...
Parameter : 31 WDT Watchdog Timer Time-out Period
(no prescaler)
min: 9* ; Typ : 18 ; Max 30 ms @ VDD = 5.0V (Industrial)
128 * 18 ms = 2304 ms ... ...
CQFD !
BTW ... I do not think those calculators are really useful here ... nor handy !!!
Last edited by Acetronics2; - 1st October 2009 at 13:47.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks