16F627A PortA.4 trouble?


Closed Thread
Results 1 to 22 of 22

Hybrid View

  1. #1
    Join Date
    Apr 2007
    Location
    Pennsylvania, USA
    Posts
    158

    Default 16F627A PortA.4 trouble?

    I can't drive porta.4 high on this 16f627A, what am I missing?

    All other pins on port A work fine (A.5 is input only)
    Comparators are disabled
    The TRISA is set to all 0's for output

    Code:
    define OSC 04               '4MHz internal oscilator 
    clear
    cmcon = 7                   
    OPTION_REG.7 = 1            
    trisa = 0
    trisb = 0
    
    main:
    porta=255
    pause 1000
    porta=0
    pause 1000
    goto main
    
    end
    Shawn

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default Re: 16F627A PortA.4 trouble?

    Hi,
    Checked the datasheet lately? ;-)
    PORTA is an 8-bit wide latch. RA4 is Schmitt Trigger input and an open drain output.
    Open drain output, only switches to GND, floating when set "high".

    /Henrik.

  3. #3
    Join Date
    Apr 2007
    Location
    Pennsylvania, USA
    Posts
    158


    Did you find this post helpful? Yes | No

    Default Re: 16F627A PortA.4 trouble?

    Thank you Henrik! I saw the OD under output type, and wasn't putting it together for some reason.
    Shawn

  4. #4
    Join Date
    Apr 2011
    Location
    Kent, UK
    Posts
    52


    Did you find this post helpful? Yes | No

    Default Re: 16F627A PortA.4 trouble?

    Add a pull up resistor, then it will work. Depends on what you are driving as to what value to use.

  5. #5
    Join Date
    Apr 2007
    Location
    Pennsylvania, USA
    Posts
    158


    Did you find this post helpful? Yes | No

    Default Re: 16F627A PortA.4 trouble?

    Right you are. No easy way to add that to these PCB's though...
    Shawn

  6. #6
    Join Date
    Apr 2007
    Location
    Pennsylvania, USA
    Posts
    158


    Did you find this post helpful? Yes | No

    Default Re: 16F627A PortA.4 trouble?

    I am not liking this chip! Maybe I should go back to my more familiar 18F parts!

    New problem, I was trying to setup the capture module using timer1 and I accidentally configured timer1 to use an external osc which made me loose control of those pins as general I/O's. Problem is, now my programmer can't re-program the chip to change it. It doesn't detect the PIC. Not sure why an MCLR reset won't allow me to use the timer1 OSC pins as PGC and PGD, but it isn't working. Any ideas?
    Shawn

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