DatasheetQ Logo
Electronic component search and free download site. Transistors,MosFET ,Diode,Integrated circuits

PIC16LC8X View Datasheet(PDF) - Microchip Technology

Part Name
Description
Manufacturer
PIC16LC8X
Microchip
Microchip Technology 
PIC16LC8X Datasheet PDF : 117 Pages
First Prev 21 22 23 24 25 26 27 28 29 30 Next Last
5.2 PORTB and TRISB Registers
PORTB is an 8-bit wide bi-directional port. The
corresponding data direction register is TRISB. A '1' on
any bit in the TRISB register puts the corresponding
output driver in a hi-impedance mode. A '0' on any bit
in the TRISB register puts the contents of the output
latch on the selected pin(s).
Each of the PORTB pins have a weak internal pull-up.
A single control bit can turn on all the pull-ups. This is
done by clearing the RBPU (OPTION<7>) bit. The
weak pull-up is automatically turned off when the port
pin is configured as an output. The pull-ups are
disabled on a Power-on Reset.
Four of PORTB’s pins, RB7:RB4, have an interrupt on
change feature. Only pins configured as inputs can
cause this interrupt to occur (i.e., any RB7:RB4 pin
configured as an output is excluded from the interrupt
on change comparison). The pins value in input mode
are compared with the old value latched on the last
read of PORTB. The “mismatch” outputs of the pins are
OR’ed together to generate the RB port
change interrupt.
FIGURE 5-3: BLOCK DIAGRAM OF PINS
RB7:RB4
RBPU
Data bus
WR Port
WR TRIS
Data Latch
DQ
CK
TRIS Latch
DQ
CK
VDD
P
weak
pull-up
I/O pin
TTL
Input
Buffer
Set RBIF
RD TRIS
RD Port
Latch
QD
EN
From other
RB7:RB4 pins
QD
EN
RD Port
Note 1: TRISB = '1' enables weak pull-up
(if RBPU = '0' in the OPTION register).
2: I/O pins have diode protection to VDD and
VSS.
PIC16C8X
This interrupt can wake the device from SLEEP. The
user, in the interrupt service routine, can clear the
interrupt in the following manner:
a) Read (or write) PORTB. This will end the mis-
match condition.
b) Clear flag bit RBIF.
A mismatch condition will continue to set the RBIF bit.
Reading PORTB will end the mismatch condition, and
allow the RBIF bit to be cleared.
This interrupt on mismatch feature, together with
software configurable pull-ups on these four pins allow
easy interface to a key pad and make it possible for
wake-up on key-depression (see AN552 in the
Embedded Control Handbook).
Note 1: For the PIC16C84 Only;
If a change on the I/O pin should occur
when a read operation of PORTB is being
executed (start of the Q2 cycle), the RBIF
interrupt flag bit may not be set.
Note 2: For all other PIC16C8X devices;
For a change on the I/O pin to be
recognized, the pulse width must be at
least TCY wide.
The interrupt on change feature is recommended for
wake-up on key depression operation and operations
where PORTB is only used for the interrupt on change
feature. Polling of PORTB is not recommended while
using the interrupt on change feature.
FIGURE 5-4: BLOCK DIAGRAM OF PINS
RB3:RB0 (PIC16C84 ONLY)
RBPU
Data bus
WR Port
Data Latch
DQ
CK
VDD
P
weak
pull-up
I/O pin
TRIS Latch
DQ
WR TRIS
CK
Input
Buffer
RD TRIS
RD Port
QD
EN
RB0/INT(3)
Note 1: TRISB = '1' enables weak pull-up
(if RBPU = '0' in the OPTION register).
RD Port
2: I/O pins have diode protection to VDD and VSS.
© 1995 Microchip Technology Inc.
DS30081F-page 23

Share Link: 

datasheetq.com  [ Privacy Policy ]Request Datasheet ] [ Contact Us ]