I am trying to use GPIO.4 and GPIO.5 as outputs to LEDs, however, they do not power the LEDs when told to do so.
My code:
#CHIP 12F683, 4
DIR GPIO.4 OUT
DIR GPIO.5 OUT
Set GPIO.4 = on
set GPIO.5 = on
The data sheet shows these pins as also being used as OSC1 and OSC2. Could this be causing the problem? It's doing this with both of my 12F683's, hopefully ruling out hardware failure.
How do I get them working as outputs?
I'm still very much a newb with all this, so I apologize for my stupid questions!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am trying to use GPIO.4 and GPIO.5 as outputs to LEDs, however, they do not power the LEDs when told to do so.
My code:
#CHIP 12F683, 4
DIR GPIO.4 OUT
DIR GPIO.5 OUT
Set GPIO.4 = on
set GPIO.5 = on
The data sheet shows these pins as also being used as OSC1 and OSC2. Could this be causing the problem? It's doing this with both of my 12F683's, hopefully ruling out hardware failure.
How do I get them working as outputs?
I'm still very much a newb with all this, so I apologize for my stupid questions!
All i can suggest is add
#config OSC = INT, BODEN = OFF, MCLR = OFF, PWRT = OFF
after the #chip line
also, maybe the equal signs are whats fubaring the program, have you tried the code with just "set GPIO.4 on"
As I suspected, it was something to do with that osc. LOL. I tried that OCS = INT, and that fixed it.
Thanks!