Menu

12F683, GPIO.4 and .5 as outputs

Help
Jonny!!!
2008-01-26
2013-05-30
  • Jonny!!!

    Jonny!!! - 2008-01-26

    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!

     
    • Nobody/Anonymous

      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"

       
    • Jonny!!!

      Jonny!!! - 2008-01-27

      As I suspected, it was something to do with that osc. LOL. I tried that OCS = INT, and that fixed it.

      Thanks!

       

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.