|
PIC16F526 Datasheet, PDF (27/122 Pages) Microchip Technology – 14-Pin, 8-Bit Flash Microcontroller | |||
|
◁ |
PIC16F526
6.0 I/O PORT
6.2 PORTC
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 PORTB
PORTB is a 6-bit I/O register. Only the low-order 6 bits
are used (RB<5:0>). Bits 7 and 6 are unimplemented
and read as â0âs. Please note that RB3 is an input-only
pin. The Configuration Word can set several I/Oâs to
alternate functions. When acting as alternate functions,
the pins will read as â0â during a port read. Pins RB0,
RB1, RB3 and RB4 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 RB3/MCLR is configured as MCLR, weak
pull-up is always on and wake-up on change for this pin
is not enabled.
PORTC is a 6-bit I/O register. Only the low-order 6 bits
are used (RC<5:0>). Bits 7 and 6 are unimplemented
and read as â0âs.
6.3 TRIS Register
The Output Driver Control register is loaded with the
contents of the W register by executing the TRIS f
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 RB3, 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.
TABLE 6-1: WEAK PULL-UP ENABLED PINS
Device
RB0 Weak Pull-up RB1 Weak Pull-up RB3 Weak Pull-up(1)
PIC16F526
Yes
Yes
Yes
Note 1: When MCLREN = 1, the weak pull-up on RB3/MCLR is always enabled.
RB4 Weak Pull-up
Yes
REGISTER 6-1: PORTB: PORTB REGISTER
U-0
â
bit 7
U-0
R/W-x
R/W-x
â
RB5
RB4
R/W-x
RB3
R/W-x
RB2
R/W-x
RB1
R/W-x
RB0
bit 0
Legend:
R = Readable bit
-n = Value at POR
W = Writable bit
â1â = Bit is set
U = Unimplemented bit, read as â0â
â0â = Bit is cleared
x = Bit is unknown
bit 7-6
bit 5-0
Unimplemented: Read as â0â
RB<5:0>: PORTB I/O Pin bits
1 = Port pin is >VIH min.
0 = Port pin is <VIL max.
ï£ 2010 Microchip Technology Inc.
DS41326D-page 27
|
▷ |