Menu

12F683 Inputs

2019-09-06
2019-09-08
  • Dermot Donnelly

    Dermot Donnelly - 2019-09-06

    Hi,
    I'm using GCB 6.22.2290 and the 12F683. I need to have two inputs and 4 outputs. I'm using GPIO.5 and GPIO.3 as inputs and GPIO.0, GPIO.1, GPIO.2 amd GPIO.4 as outputs. When I bring an input high I want to get an output to go high. When I do this with GPIO.3 I get one of my outputs to go high no problem. When I do the same thing with GPIO.5 it doesn't work. I think it's because GPIO.5 is a serial in pin as well as an input pin.

    Is there some command I can use to turn GPIO.5 into an input pin like GPIO.3?

    I attach the code. Thank you in advance.
    Regards
    Dermot

     
    • Dermot Donnelly

      Dermot Donnelly - 2019-09-06

      Sorry folks. Everything works fine. I had a pull down resistor on my breadboard for GPIO.5 and it was a bit loose. DOH!

       
  • Anobium

    Anobium - 2019-09-07

    No problem.

    A quick scan of your code. I would move the setup before Start:

    Dir GPIO.0 Out
    Dir GPIO.1 Out
    Dir GPIO.2 Out
    Dir GPIO.3 In
    Dir GPIO.4 Out
    Dir GPIO.5 In
    Dim SwState1 as Byte   'o=off  8=on
    Dim SwState2 as Byte
    
    
    Start:
    

    Cheers

     
  • Dermot Donnelly

    Dermot Donnelly - 2019-09-08

    Thanks for the help. Really fast response. Great forum. I've donated the £23 for the Pickit Plus even though I don't need it. The free stuff you give is easily worth that.
    Regards
    Dermot

     
    • Anobium

      Anobium - 2019-09-08

      You are a gentleman. Every penny helps and I do hope you will take advantage of the new features.

      Thank you.

       

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.