View Full Version : blink led 12f683
mel4853
- 18th January 2010, 01:25
trying to blink led & pullin relay on a 12f683 this code doesn't work.
fanon var GPIO.0
ledflasher var GPIO.1
CMCON0=%00000111
ANSEL=%00000000
TRISIO=%111100
GPIO=%000000
Fan:
high fanon
high ledflasher
pause 1000
low fanon
low ledflasher
goto fan
end
Nicmus
- 18th January 2010, 03:25
Add a "Pause 1000" right before your "Goto fan" line.
Regards,
Nick
ScaleRobotics
- 18th January 2010, 03:28
Try adding another pause statement. It is probably going low for about 1/4000000th of a second or so.
to this:
Fan:
high fanon
high ledflasher
pause 1000
low fanon
low ledflasher
pause 1000
goto Fan
end
Oops, yeah, what Nicmus said!
hoyles
- 18th January 2010, 23:32
use: CMCON =%00000111
ScaleRobotics
- 18th January 2010, 23:44
use: CMCON =%00000111
With the PIC12F683 it should actually be CMCON0 =%00000111
mel4853
- 19th January 2010, 21:43
Sorry didn't post back sooner. It was just the other pause. Works fine now. Looked at that 1,000 times and just didn't see it. Thanks.
Mike
Dennis
- 19th January 2010, 22:39
Mike ... (and anyone else reading this!)
Congrats on getting your PIC blinking :-) YAY
Thanks a million for the feedback !
I think more than anything else it's awesome for anyone and everyone reading these posts to see your feedback , especially when things are working!
So sad how certain threads have guys helping on a problem and the thread is kind of left with someone saying they will eventually give feedback about a certain problem and then there is nothing back :-(.
Obviously feedback could take some time (yes sadly for most of us everyday life forces us to put things on hold for a while ;-) ) but it's so nice to see feedback (and/or solutions) for problems.
So this is a thank you to Mike and everyone who always provides feedback :-)
And of course a big thank you to everyone who assists and gets involved with the threads on here :-)
Kind regards
Dennis
Powered by vBulletin® Version 4.1.7 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.