PIC16F872-E/SS Microchip Technology, PIC16F872-E/SS Datasheet - Page 142

no-image

PIC16F872-E/SS

Manufacturer Part Number
PIC16F872-E/SS
Description
IC,MICROCONTROLLER,8-BIT,PIC CPU,CMOS,SSOP,28PIN,PLASTIC
Manufacturer
Microchip Technology
Series
PIC® 16Fr

Specifications of PIC16F872-E/SS

Rohs Compliant
YES
Core Processor
PIC
Core Size
8-Bit
Speed
20MHz
Connectivity
I²C, SPI
Peripherals
Brown-out Detect/Reset, POR, PWM, WDT
Number Of I /o
22
Program Memory Size
3.5KB (2K x 14)
Program Memory Type
FLASH
Eeprom Size
64 x 8
Ram Size
128 x 8
Voltage - Supply (vcc/vdd)
4 V ~ 5.5 V
Data Converters
A/D 5x10b
Oscillator Type
External
Operating Temperature
-40°C ~ 125°C
Package / Case
28-SSOP
Package
28SSOP
Device Core
PIC
Family Name
PIC16
Maximum Speed
20 MHz
Operating Supply Voltage
5 V
Data Bus Width
8 Bit
Number Of Programmable I/os
22
Interface Type
I2C/SPI
On-chip Adc
5-chx10-bit
Number Of Timers
3
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
PICmicro MID-RANGE MCU FAMILY
9.1
DS31009A-page 9-2
Introduction
General purpose I/O pins can be considered the simplest of peripherals. They allow the
PICmicro™ to monitor and control other devices. To add flexibility and functionality to a device,
some pins are multiplexed with an alternate function(s). These functions depend on which
peripheral features are on the device. In general, when a peripheral is functioning, that pin may
not be used as a general purpose I/O pin.
For most ports, the I/O pin’s direction (input or output) is controlled by the data direction register,
called the TRIS register. TRIS<x> controls the direction of PORT<x>. A ‘1’ in the TRIS bit corre-
sponds to that pin being an input, while a ‘0’ corresponds to that pin being an output. An easy
way to remember is that a ‘1’ looks like an I (input) and a ‘0’ looks like an O (output).
The PORT register is the latch for the data to be output. When the PORT is read, the device reads
the levels present on the I/O pins (not the latch). This means that care should be taken with
read-modify-write commands on the ports and changing the direction of a pin from an input to an
output.
Figure 9-1
be multiplexed onto the I/O pin. Reading the PORT register reads the status of the pins whereas
writing to it will write to the port latch. All write operations (such as BSF and BCF instructions) are
read-modify-write operations. Therefore a write to a port implies that the port pins are read, this
value is modified, and then written to the port data latch.
Figure 9-1: Typical I/O Port
WR PORT
WR TRIS
RD PORT
Data bus
Note: I/O pin has protection diodes to V
shows a typical I/O port. This does not take into account peripheral functions that may
Data Latch
TRIS Latch
D
CK
D
CK
RD TRIS
Q
Q
Q
Q
DD
and V
Q
SS
EN
.
D
V
V
P
N
DD
SS
1997 Microchip Technology Inc.
Trigger
Schmitt
TTL or
I/O pin

Related parts for PIC16F872-E/SS