PIC16C620 Microchip Technology, PIC16C620 Datasheet - Page 28

no-image

PIC16C620

Manufacturer Part Number
PIC16C620
Description
EPROM-Based 8-Bit CMOS Microcontroller
Manufacturer
Microchip Technology
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC16C620-04/SS
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC16C620-04I/P
Quantity:
8
Part Number:
PIC16C620/JW
Manufacturer:
MICROCH
Quantity:
20 000
Part Number:
PIC16C620A-04/P
Quantity:
19
Part Number:
PIC16C620A-04/P
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC16C620A-04/SO
Manufacturer:
MICROCHI
Quantity:
84
Part Number:
PIC16C620A-04/SO
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC16C620A-041/P
Quantity:
358
Part Number:
PIC16C620A-04I/P
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC16C620A-04I/SS
Manufacturer:
Microchip Technology
Quantity:
135
Part Number:
PIC16C620A-40/P
Manufacturer:
Microchip Technology
Quantity:
135
PIC16C62X
5.2
PORTB is an 8-bit wide bi-directional port. The
corresponding data direction register is TRISB. A '1' in
the TRISB register puts the corresponding output driver
in a high impedance mode. A '0' in the TRISB register
puts the contents of the output latch on the selected
pin(s).
Reading PORTB register reads the status of the pins,
whereas writing to it will write to the port latch. All write
operations are read-modify-write operations. So a write
to a port implies that the port pins are first read, then
this value is modified and written to the port data latch.
Each of the PORTB pins has a weak internal pull-up
( 200 A typical). 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 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 input pins (of RB7:RB4)
are compared with the old value latched on the last
read of PORTB. The “mismatch” outputs of RB7:RB4
are OR’ed together to generate the RBIF interrupt (flag
latched in INTCON<0>).
FIGURE 5-5:
DS30235G-page 28
Set RBIF
Data bus
Note 1: I/O pins have diode protection to V
WR TRISB
Note 2: TRISB = 1 enables weak pull-up if RBPU = '0'
WR PortB
RBPU
RB7:RB6 in serial programming mode
(2)
PORTB and TRISB Registers
From other
RB7:RB4 pins
(OPTION<7>).
BLOCK DIAGRAM OF
RB7:RB4 PINS
RD TRISB
RD PortB
Data Latch
TRIS Latch
D
D
CK
CK
Q
Q
Q
Q
Q
Q
Latch
EN
EN
DD
D
D
and V
TTL
Input
Buffer
SS
V
RD Port
P
.
DD
ST
Buffer
weak
pull-up
I/O
pin
(1)
Preliminary
This interrupt can wake the device from SLEEP. The
user, in the interrupt service routine, can clear the
interrupt in the following manner:
a)
b)
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
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
Microchip Embedded Control Handbook .)
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-6:
Data bus
WR TRISB
WR PortB
RBPU
RB0/INT
Note:
Note 1: I/O pins have diode protection to V
Note 2: TRISB = 1 enables weak pull-up if RBPU = '0'
Any read or write of PORTB. This will end the
mismatch condition.
Clear flag bit RBIF.
(2)
(OPTION<7>).
If a change on the I/O pin should occur
when the read operation is being executed
(start of the Q2 cycle), then the RBIF inter-
rupt flag may not get set.
BLOCK DIAGRAM OF
RB3:RB0 PINS
RD TRISB
RD PortB
Data Latch
D
D
CK
CK
ST
Buffer
1998 Microchip Technology Inc.
Q
Q
Q
Q
Q
DD
EN
and V
TTL
Input
Buffer
D
SS
.
V
P
RD Port
DD
weak
pull-up
I/O
pin
(1)

Related parts for PIC16C620