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
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
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.