Menu

12F683 GPIO.2 Output

Help
justingra
2008-01-01
2013-05-30
  • justingra

    justingra - 2008-01-01

    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

     
    • Nobody/Anonymous

      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.

       
    • justingra

      justingra - 2008-01-05

      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!

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.