I am attempting to set gpio.2 as an output on a 12F683 but I can't seem to do it. My code is modeled after the blink example in the demo directory. I can get gpio.0 and gpio.1 to blink just fine, but gpio.2 refuses to do anything. Any ideas?
Here is the code I have so far:
'Chip model
#chip 12F683, 8
#config INTOSC
ADOff
'Set the pin directions
dir GPIO.0 out
dir GPIO.1 out
dir GPIO.2 out
Start:
'Turn one LED on, the other off
SET GPIO.0 ON
SET GPIO.2 OFF
wait 1 sec
'Now toggle the LEDs
SET GPIO.0 OFF
SET GPIO.2 ON
wait 1 sec
'Jump back to the start of the program
goto Start
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
have you tried removing the ADOff and #config INTOSC lines? I dont use those in my code, and the GPIO.2 output works fine. Also, i have my chip frequency set to 4, not 8. Is there a way to know which one to use? I believe the chip does both, but I'm not sure.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I resolved the output issues, I think it was just a bad led. I also took out the ADOff line since it is not needed according to some messages in this forum. Thanks for the advice!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am attempting to set gpio.2 as an output on a 12F683 but I can't seem to do it. My code is modeled after the blink example in the demo directory. I can get gpio.0 and gpio.1 to blink just fine, but gpio.2 refuses to do anything. Any ideas?
Here is the code I have so far:
'Chip model
#chip 12F683, 8
#config INTOSC
ADOff
'Set the pin directions
dir GPIO.0 out
dir GPIO.1 out
dir GPIO.2 out
Start:
'Turn one LED on, the other off
SET GPIO.0 ON
SET GPIO.2 OFF
wait 1 sec
'Now toggle the LEDs
SET GPIO.0 OFF
SET GPIO.2 ON
wait 1 sec
'Jump back to the start of the program
goto Start
have you tried removing the ADOff and #config INTOSC lines? I dont use those in my code, and the GPIO.2 output works fine. Also, i have my chip frequency set to 4, not 8. Is there a way to know which one to use? I believe the chip does both, but I'm not sure.
I resolved the output issues, I think it was just a bad led. I also took out the ADOff line since it is not needed according to some messages in this forum. Thanks for the advice!