• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

16f876a RA4 question

Not open for further replies.


Going through Nigel's tutorials, I've got each pin of PORTA wired to an LED (and a resistor), everything works but RA4 does not light up. Someone has suggested sinking current and driving the LED's with a transistor since the chip can sink more than it can send but I would like to figure this out.

In the data sheet for this PIC...

"Pin RA4 is multiplexed with the Timer0 module clock input to become the RA4/T0CKI pin. The RA4/T0CKI pin is a Schmitt Trigger input and an open-drain output. All other PORTA pins have TTL input levels and full CMOS output drivers."

What does that mean exactly? Setting PORTA to output is not enough for RA4?

Thanks, enjoyed my time on the site and have learned alot already.

    list        p=16F876a
    #include    <P16F876a.inc>

    org        0x0000
    movlw    0x07
    movwf     CMCON

    bsf        STATUS,    RP0
    movlw    b'00000000'
    movwf    TRISB
    movlw    b'000000'
    movwf    TRISA
    bcf        STATUS,    RP0

    movlw    0xff
    movwf    PORTA
    movwf    PORTB
    movlw    0x00
    movwf    PORTA
    movwf    PORTB
    goto    Loop



Well-Known Member
The 16F887 is pin compatible and so is the 18F4620, so if you don't want to rewire...

Both have internal osc and the 18F is so much nicer to program than a 16F IMHO.
Not open for further replies.

Latest threads

EE World Online Articles