portA.4 on a 16f628A?


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2005
    Location
    Toronto, Canada
    Posts
    46

    Question portA.4 on a 16f628A?

    how do I get portA.4 to work on a 16f628A?

    High 12
    and HIGH portA.4 both will not turn an LED on...

    and I am using: CMCON = 7 to turn off the comparators and use A as I/O.

    what am I missing?

    thanks!

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    PortA.4 requires a pull-up to +Vdd. It's the ONLY pin on this PIC that is open drain (open collector). This means it CANNOT SOURCE any current, but it CAN SINK current...

    Try this... Connect a Resistor (any value between 220R and 390R) between +Vdd and the Anode of your LED (Long Leg). Connect the Kathode (short leg) of your LED to PortA.4.

    CMCON=7
    Loop:
    High PortA.4 ' LED will be OFF
    Pause 500
    Low PortA.4 ' LED will be ON
    Pause 500
    Goto Loop

    Read I/O Ports section in the PIC's DATASHEET.

  3. #3
    Join Date
    Feb 2005
    Location
    Toronto, Canada
    Posts
    46


    Did you find this post helpful? Yes | No

    Default

    thanks! I'm sorta consused why this one pin is so different.. but I shall work around it I guess.

    thanks for the info! appreciated!

Similar Threads

  1. 16f628a porta.5 as input
    By naga in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 31st October 2009, 12:18
  2. PORTA.4 as analog input
    By kblim in forum mel PIC BASIC Pro
    Replies: 21
    Last Post: - 2nd December 2008, 01:22
  3. 16F628A using PORTA.4, and it works, but...
    By zx81 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th August 2005, 08:45
  4. MPLAB ICD ver 1 & 16F628A
    By Tissy in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 26th February 2005, 00:44
  5. HSEROUT and 16F628A
    By fredblah in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 6th May 2004, 00:07

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