Datasheet

2012 Microchip Technology Inc. Preliminary DS41652A-page 29
PIC16F527
6.0 I/O PORT
As with any other register, the I/O register(s) can be
written and read under program control. However, read
instructions (e.g., MOVF PORTB,W) always read the I/O
pins independent of the pin’s Input/Output modes. On
Reset, all I/O ports are defined as input (inputs are at high-
impedance) since the I/O control registers are all set.
6.1 PORTA
PORTA is a 6-bit I/O register. Only the low-order six
bits are used (RA<5:0>). Bits 7 and 6 are
unimplemented and read as ‘0s. Please note that RA3
is an input-only pin. The Configuration Word can set
several I/Os to alternate functions. When acting as
alternate functions, the pins will read as ‘0’ during a
port read. Pins RA0, RA1, RA3 and RA4 can be
configured with weak pull-ups and also for wake-up on
change. The wake-up on change and weak pull-up
functions are not pin selectable. If RA3/MCLR
is
configured as MCLR
, weak pull-up is always on and
wake-up on change for this pin is not enabled.
6.2 PORTB
PORTB is a 4-bit I/O register. Only the high-order four
bits are used (RB<7:4>). Bits 0 through 3 are
unimplemented and read as ‘0’s.
6.3 PORTC
PORTC is a 8-bit I/O register.
6.4 TRIS Register
The Output Driver Control register is loaded with the
contents of the W register by executing the TRIS
instruction. A ‘1’ from a TRIS register bit puts the
corresponding output driver in a High-Impedance
mode. A ‘0’ puts the contents of the output data latch
on the selected pins, enabling the output buffer. The
exceptions are RA3, which is input-only and the T0CKI
pin, which may be controlled by the OPTION register
(see Register 4-2).
TRIS registers are “write-only”. Active bits in these
registers are set (output drivers disabled) upon Reset.