PIC16F872-I/SO Microchip Technology, PIC16F872-I/SO Datasheet - Page 28

IC MCU FLASH 2KX14 EE 28SOIC

PIC16F872-I/SO

Manufacturer Part Number
PIC16F872-I/SO
Description
IC MCU FLASH 2KX14 EE 28SOIC
Manufacturer
Microchip Technology
Series
PIC® 16Fr

Specifications of PIC16F872-I/SO

Program Memory Type
FLASH
Program Memory Size
3.5KB (2K x 14)
Package / Case
28-SOIC (7.5mm Width)
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
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 ~ 85°C
Processor Series
PIC16F
Core
PIC
Data Bus Width
8 bit
Data Ram Size
128 B
Interface Type
I2C/SPI/SSP
Maximum Clock Frequency
20 MHz
Number Of Programmable I/os
22
Number Of Timers
3
Operating Supply Voltage
4 V to 5.5 V
Maximum Operating Temperature
+ 85 C
Mounting Style
SMD/SMT
3rd Party Development Tools
52715-96, 52716-328, 52717-734
Development Tools By Supplier
PG164130, DV164035, DV244005, DV164005, PG164120, ICE2000, DM163022
Minimum Operating Temperature
- 40 C
On-chip Adc
5-ch x 10-bit
Package
28SOIC W
Device Core
PIC
Family Name
PIC16
Maximum Speed
20 MHz
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With
XLT28SO-1 - SOCKET TRANSITION 28SOIC 300MIL309-1073 - ADAPTER 28-SOIC TO 28-SOIC309-1024 - ADAPTER 28-SOIC TO 28-DIP309-1023 - ADAPTER 28-SOIC TO 28-DIP
Lead Free Status / Rohs Status
Lead free / RoHS Compliant

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC16F872-I/SO
Manufacturer:
MICROCHI
Quantity:
470
Part Number:
PIC16F872-I/SO
Manufacturer:
TI
Quantity:
5
Part Number:
PIC16F872-I/SO
Manufacturer:
MIC
Quantity:
20 000
Company:
Part Number:
PIC16F872-I/SO
Quantity:
5 000
PIC16F872
3.4
Reading FLASH Program memory is much like that of
EEPROM Data memory, only two NOP instructions
must be inserted after the RD bit is set. These two
instruction cycles that the NOP instructions execute will
be used by the microcontroller to read the data out of
program memory and insert the value into the
EEDATH:EEDATA registers. Data will be available fol-
lowing the second NOP instruction. EEDATH and
EEDATA will hold their value until another read opera-
tion is initiated, or until they are written by firmware.
EXAMPLE 3-3:
3.5
Writing to FLASH Program memory is unique in that the
microcontroller does not execute instructions while pro-
gramming is taking place. The oscillator continues to
run and all peripherals continue to operate and queue
interrupts, if enabled. Once the write operation com-
pletes (specification #D133), the processor begins exe-
cuting code from where it left off. The other important
difference when writing to FLASH Program memory is
that the WRT configuration bit, when clear, prevents
any writes to program memory (see Table 3-1).
Just like EEPROM Data memory, there are many steps
in writing to the FLASH Program memory. Both
address and data values must be written to the SFRs.
The EEPGD bit must be set and the WREN bit must be
set to enable writes. The WREN bit should be kept
DS30221C-page 26
Reading the FLASH Program
Memory
Writing to the FLASH Program
Memory
BSF
BCF
MOVF
MOVWF
MOVF
MOVWF
BSF
BSF
BSF
NOP
NOP
BCF
MOVF
MOVWF
MOVF
MOVWF
FLASH PROGRAM READ
EECON1, EEPGD
STATUS, RP1
STATUS, RP0
ADDRL, W
EEADR
ADDRH,W
EEADRH
STATUS, RP0
EECON1, RD
STATUS, RP0
EEDATA, W
DATAL
EEDATH,W
DATAH
;
;Bank 2
;Write the
;address bytes
;for the desired
;address to read
;Bank 3
;Point to Program memory
;Start read operation
;Required two NOPs
;
;Bank 2
;DATAL = EEDATA
;
;DATAH = EEDATH
;
The steps to reading the FLASH Program Memory are:
1.
2.
3.
4.
5.
clear at all times, except when writing to the FLASH
Program memory. The WR bit can only be set if the
WREN bit was set in a previous operation, i.e., they
both cannot be set in the same operation. The WREN
bit should then be cleared by firmware after the write.
Clearing the WREN bit before the write actually com-
pletes will not terminate the write in progress.
Writes to program memory must also be prefaced with
a special sequence of instructions that prevent inad-
vertent write operations. This is a sequence of five
instructions that must be executed without interruption
for each byte written. These instructions must then be
followed by two NOP instructions to allow the microcon-
troller to setup for the write operation. Once the write is
complete, the execution of instructions starts with the
instruction after the second NOP.
Write the address to EEADRH:EEADR. Make
sure that the address is not larger than the mem-
ory size of the device.
Set the EEPGD bit to point to FLASH Program
memory.
Set the RD bit to start the read operation.
Execute two NOP instructions to allow the micro-
controller to read out of program memory.
Read the data from the EEDATH:EEDATA
registers.
© 2006 Microchip Technology Inc.

Related parts for PIC16F872-I/SO