PIC16C765 Microchip Technology Inc., PIC16C765 Datasheet - Page 33

no-image

PIC16C765

Manufacturer Part Number
PIC16C765
Description
8-bit Cmos Microcontrollers With Usb
Manufacturer
Microchip Technology Inc.
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC16C765-I/L
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC16C765-I/P
Manufacturer:
MICROCHIP
Quantity:
12 000
Part Number:
PIC16C765-I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC16C765/JW
Manufacturer:
MIC
Quantity:
60
Part Number:
PIC16C765/JW
Manufacturer:
MIC
Quantity:
60
Part Number:
PIC16C765/JW
Manufacturer:
MIC
Quantity:
5
Part Number:
PIC16C765/JW
Manufacturer:
MICROCH
Quantity:
20 000
Part Number:
PIC16C765T-I/L
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC16C765T-I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
5.2
PORTB is an 8-bit wide bi-directional port. The corre-
sponding data direction register is TRISB. Setting a bit
in the TRISB register puts the corresponding output
driver in a hi-impedance input mode. Clearing a bit in
the TRISB register puts the contents of the output latch
on the selected pin(s).
Each of the PORTB pins has a weak internal pull-up. A
single control bit can turn on all the pull-ups. This is per-
formed by clearing bit RBPU (OPTION_REG<7>). The
weak pull-up is automatically turned off when the port
pin is configured as an output. The pull-ups are dis-
abled on a Power-on Reset.
FIGURE 5-3:
Four of PORTB’s pins, RB<7:4>, have an interrupt-on-
change feature. Only pins configured as inputs can
cause this interrupt to occur (i.e., any RB<7:4> pin con-
figured as an output is excluded from the interrupt-on-
change comparison). The input pins (of RB<7:4>) are
compared with the value latched on the last read of
PORTB. The “mismatch” outputs of RB<7:4> are
OR’ed together to generate the RB Port Change Inter-
rupt with flag bit RBIF (INTCON<0>).
This interrupt can wake the device from SLEEP. The
user, in the interrupt service routine, can clear the inter-
rupt in the following manner:
a)
b)
RBPU
Data
Bus
WR
Port
WR
TRIS
RB0/INT
2000 Microchip Technology Inc.
Note 1: To enable weak pull-ups, set the appropriate TRIS bit(s)
Any read or write of PORTB. This will end the
mismatch condition.
Clear flag bit RBIF.
(1)
and clear the RBPU bit (OPTION_REG<7>).
PORTB and TRISB Registers
RD TRIS
RD Port
TRIS Latch
Data Latch
D
D
CK
CK
Schmitt Trigger
Buffer
BLOCK DIAGRAM OF RB<3:0>
PINS
Q
Q
Q
EN
TTL
Input
Buffer
D
V
P
DD
RD Port
weak
pull-up
V
DD
I/O
pin
Preliminary
A mismatch condition will continue to set flag bit RBIF.
Reading PORTB will end the mismatch condition, and
allow flag bit RBIF to be cleared.
This interrupt-on-mismatch feature, together with soft-
ware configureable pull-ups on these four pins, allow
easy interface to a keypad and make it possible for
wake-up on key depression. Refer to the Embedded
Control Handbook, “Implementing Wake-Up on Key
Stroke” (AN552).
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.
RB0/INT is an external interrupt input pin and is config-
ured using the INTEDG bit (OPTION_REG<6>).
RB0/INT is discussed in detail in Section 13.5.1.
FIGURE 5-4:
Note 1: To enable weak pull-ups, set the appropriate TRIS bit(s)
RBPU
Data Bus
WR Port
WR TRIS
Set RBIF
From other
RB<7:4> pins
RB<7:6> in serial programming mode
(1)
and clear the RBPU bit (OPTION_REG<7>).
RD TRIS
RD Port
TRIS Latch
Data Latch
PIC16C745/765
D
D
CK
CK
BLOCK DIAGRAM OF
RB<7:4> PINS
Q
Q
Q
Q
Latch
EN
EN
D
D
TTL
Input
Buffer
DS41124C-page 33
V
P
DD
weak
pull-up
RD Port
Buffer
Q1
ST
Q3
V
DD
I/O
pin

Related parts for PIC16C765