Funky I/O pin behavior on PIC12F629???


Closed Thread
Results 1 to 2 of 2
  1. #1
    charliez's Avatar
    charliez Guest

    Question Funky I/O pin behavior on PIC12F629???

    Problem 1. For some reason, pin 0 and pin 1 will not latch the output value when another pin output follows it. Other pins work fine (I know pin 3 is input only).

    The code is as follows:

    i var byte

    loop: 'turn on LEDs
    HIGH 0
    pause 5000 ' led 0 will stay on for 5 seconds
    HIGH 1 ' but will turn off here, and led 1 comes on
    pause 5000 ' led 1 will then stay on for 5 seconds
    HIGH 2 ' led 1 will turn off here, and led 2 comes on
    pause 5000
    HIGH 4 ' led 4 on, led 2 stays on, while 0 and 1 are off.
    pause 5000
    HIGH 5 ' led 5,4,2 stays on, while 0 and 1 are off
    pause 10000

    For i = 0 to 5 'turn off LEDs
    LOW i
    next
    pause 10000

    goto loop

    End

    Problem 2. Pin 1 for some reason can not be made an input.

    The code is as follows

    PINS VAR PORTL

    PIN0 VAR PINS.0
    PIN1 VAR PINS.1

    INPUT 1

    IF PIN1 THEN
    HIGH 0
    ENDIF

    END

    What am I missing?

  2. #2
    charliez's Avatar
    charliez Guest


    Did you find this post helpful? Yes | No

    Talking Solved

    Ha, found the cause. GP0 and GP1 are comparator inputs.

    To make them true I/O pins I needed to add the following line:

    CMCON=%00000111

    at the beginning
    Last edited by charliez; - 26th July 2004 at 01:47.

Similar Threads

  1. Is this a K Type sensor?
    By jessey in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 21st November 2009, 14:55
  2. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 18:27
  3. Another RTC, DS1287
    By DavidK in forum Code Examples
    Replies: 0
    Last Post: - 12th December 2006, 18:07
  4. Grounding Negative voltage through I/O pin
    By Squibcakes in forum Schematics
    Replies: 2
    Last Post: - 31st July 2006, 13:12
  5. I/O pin and MCLR
    By Dwayne in forum FAQ - Frequently Asked Questions
    Replies: 1
    Last Post: - 15th July 2004, 11:52

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts