Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

help using RA4 of 16f628 as output

Status
Not open for further replies.

janosandi

Full Member level 4
Joined
Jan 23, 2010
Messages
210
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Activity points
2,788
Hello guys
wanted to use pin RA4 of 16f628 as output
but i've noticed its a TOCKI pin but i couldnt disable it to be a normal output pin
& what that means Open (Drain Output) ? cant it drive a transistor ?
any information will be great
thx
 
Last edited:

The following recommendation is for the PIC16F628 and PIC16F628A.

wanted to use pin RA4 of 16f628 as output
but i've noticed its a TOCKI pin but i couldnt disable it to be a normal output pin

You need to disable any other peripherals with share that particular pin.

Reference: PIC16F62X Data Sheet, page 29, Section 5.0 I/O PORTS

5.0 I/O PORTS

The PIC16F62X have two ports, PORTA and PORTB.
Some pins for these I/O ports are multiplexed with an
alternate function for the peripheral features on the
device. In general, when a peripheral is enabled, that
pin may not be used as a general purpose I/O pin.

You can disable the other peripherals by initializing PORTA with the following code:

Assembly:
Code:
CLRF PORTA         ;Initialize PORTA by
                         ;setting output data latches

BANKSEL CMCON
MOVLW 0x07       ;Turn comparators off and
MOVWF CMCON    ;enable pins for I/O
                         ;functions
BANKSEL TRISA
MOVLW 0x0F        ;Value used to initialize
                         ;data direction
MOVWF TRISA      ;Set RA<3:0> as inputs RA4 as output
                         ;TRISA<5> always
                         ;read as ‘1’.
                         ;TRISA<7:6>
                         ;depend on oscillator mode

C:
Code:
PORTA = 0x00;

CMCON = 0x07;

TRISA = 0x0F;

what that means Open (Drain Output) ? cant it drive a transistor ?

It is not recommended and will usually not produce the desired out come.
Open Drain Outputs typically do not source current and when set high will take on a high impedance state.

PIC Microcontroller Note

Hope the info helps in your endeavors,

BigDog
 
  • Like
Reactions: FvM

    FvM

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top