PIC16C622A-20I/P Microchip Technology, PIC16C622A-20I/P Datasheet - Page 27

no-image

PIC16C622A-20I/P

Manufacturer Part Number
PIC16C622A-20I/P
Description
IC,MICROCONTROLLER,8-BIT,PIC CPU,CMOS,DIP,18PIN,PLASTIC
Manufacturer
Microchip Technology
Series
PIC® 16Cr
Datasheets

Specifications of PIC16C622A-20I/P

Rohs Compliant
YES
Core Processor
PIC
Core Size
8-Bit
Speed
20MHz
Peripherals
Brown-out Detect/Reset, POR, WDT
Number Of I /o
13
Program Memory Size
3.5KB (2K x 14)
Program Memory Type
OTP
Ram Size
128 x 8
Voltage - Supply (vcc/vdd)
2.5 V ~ 5.5 V
Oscillator Type
External
Operating Temperature
-40°C ~ 85°C
Package / Case
18-DIP (0.300", 7.62mm)
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With
ISPICR1 - ADAPTER IN-CIRCUIT PROGRAMMINGDVA16XP180 - ADAPTER DEVICE FOR MPLAB-ICEAC164010 - MODULE SKT PROMATEII DIP/SOIC
Eeprom Size
-
Data Converters
-
Connectivity
-
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
5.0
The PIC16C62X have two ports, PORTA and PORTB.
Some pins for these I/O ports are multiplexed with an
alternate function for the peripheral features on the
device. In general, when a peripheral is enabled, that
pin may not be used as a general purpose I/O pin.
5.1
PORTA is a 5-bit wide latch. RA4 is a Schmitt Trigger
input and an open drain output. Port RA4 is multiplexed
with the T0CKI clock input. All other RA port pins have
Schmitt Trigger input levels and full CMOS output
drivers. All pins have data direction bits (TRIS regis-
ters), which can configure these pins as input or output.
A '1' in the TRISA register puts the corresponding out-
put driver in a Hi-impedance mode. A '0' in the TRISA
register puts the contents of the output latch on the
selected pin(s).
Reading the PORTA 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.
The PORTA pins are multiplexed with comparator and
voltage reference functions. The operation of these
pins are selected by control bits in the CMCON
(comparator control register) register and the VRCON
(voltage reference control register) register. When
selected as a comparator input, these pins will read
as '0's.
FIGURE 5-1:
 2003 Microchip Technology Inc.
WR
TRISA
WR
PORTA
Data
Bus
RD PORTA
I/O PORTS
PORTA and TRISA Registers
To Comparator
TRIS Latch
D
Data Latch
D
CK
CK
RD TRISA
Q
Q
Q
Q
BLOCK DIAGRAM OF
RA1:RA0 PINS
Input Mode
Schmitt Trigger
Q
Input Buffer
Analog
EN
V
V
P
N
DD
SS
D
V
SS
V
DD
Pin
I/O
TRISA controls the direction of the RA pins, even when
they are being used as comparator inputs. The user
must make sure to keep the pins configured as inputs
when using them as comparator inputs.
The RA2 pin will also function as the output for the
voltage reference. When in this mode, the V
very high impedance output and must be buffered prior
to any external load. The user must configure
TRISA<2> bit as an input and use high impedance
loads.
In one of the Comparator modes defined by the
CMCON register, pins RA3 and RA4 become outputs
of the comparators. The TRISA<4:3> bits must be
cleared to enable outputs to use this function.
EXAMPLE 5-1:
FIGURE 5-2:
CLRF
MOVLW
MOVWF
BSF
MOVLW
MOVWF
Note:
Data
Bus
WR
PORTA
WR
TRISA
RD PORTA
PORTA
0X07
CMCON
STATUS, RP0
0x1F
TRISA
On RESET, the TRISA register is set to all
inputs. The digital inputs are disabled and
the comparator inputs are forced to ground
to reduce excess current consumption.
To Comparator
D
D
TRIS Latch
Data Latch
CK
CK
RD TRISA
V
V
ROE
REF
BLOCK DIAGRAM OF RA2 PIN
Q
Q
Q
Q
INITIALIZING PORTA
;Initialize PORTA by setting
;output data latches
;Turn comparators off and
;enable pins for I/O
;functions
;Select Bank1
;Value used to initialize
;data direction
;Set RA<4:0> as inputs
;TRISA<7:5> are always
;read as '0'.
Input Mode
PIC16C62X
Schmitt Trigger
Analog
Q
Input Buffer
EN
V
V
P
N
D
DD
SS
DS30235J-page 25
V
SS
V
REF
DD
RA2
Pin
pin is a

Related parts for PIC16C622A-20I/P