PIC16F872-I/SP Microchip Technology, PIC16F872-I/SP Datasheet - Page 29

IC MCU FLASH 2KX14 EE 28DIP

PIC16F872-I/SP

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

Specifications of PIC16F872-I/SP

Program Memory Type
FLASH
Program Memory Size
3.5KB (2K x 14)
Package / Case
28-DIP (0.300", 7.62mm)
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
Through Hole
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
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Lead free / RoHS Compliant

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC16F872-I/SP
Manufacturer:
PIC
Quantity:
270
Part Number:
PIC16F872-I/SP
Manufacturer:
PIC
Quantity:
270
Part Number:
PIC16F872-I/SP
Manufacturer:
SILICON
Quantity:
1 000
Part Number:
PIC16F872-I/SP
Manufacturer:
MIC
Quantity:
20 000
The steps to write to program memory are:
1.
2.
3.
4.
5.
6.
EXAMPLE 3-4:
3.6
The PIC16F87X devices do not automatically verify the
value written during a write operation. Depending on
the application, good programming practice may dic-
tate that the value written to memory be verified against
the original value. This should be used in applications
where excessive writes can stress bits near the speci-
fied endurance limits.
2002 Microchip Technology Inc.
Write the address to EEADRH:EEADR. Make
sure that the address is not larger than the mem-
ory size of the device.
Write the 14-bit data value to be programmed in
the EEDATH:EEDATA registers.
Set the EEPGD bit to point to FLASH Program
memory.
Set the WREN bit to enable program operations.
Disable interrupts (if enabled).
Execute the special five instruction sequence:
• Write 55h to EECON2 in two steps (first to W,
then to EECON2)
Write Verify
BSF
BCF
MOVF
MOVWF
MOVF
MOVWF
MOVF
MOVWF
MOVF
MOVWF
BSF
BSF
BSF
BCF
MOVLW
MOVWF
MOVLW
MOVWF
BSF
NOP
NOP
BSF
BCF
FLASH PROGRAM WRITE
STATUS, RP1
STATUS, RP0
ADDRL, W
EEADR
ADDRH, W
EEADRH
VALUEL, W
EEDATA
VALUEH, W
EEDATH
STATUS, RP0
EECON1, EEPGD
EECON1, WREN
INTCON, GIE
0x55
EECON2
0xAA
EECON2
EECON1, WR
INTCON, GIE
EECON1, WREN
;
;Bank 2
;Write address
;of desired
;program memory
;location
;Write value to
;program at
;desired memory
;location
;Bank 3
;Point to Program memory
;Enable writes
;Only disable interrupts
;if already enabled,
;otherwise discard
;Write 55h to
;EECON2
;Write AAh to
;EECON2
;Start write operation
;Two NOPs to allow micro
;to setup for write
;Only enable interrupts
;if using interrupts,
;otherwise discard
;Disable writes
7.
8.
9.
At the completion of the write cycle, the WR bit is
cleared and the EEIF interrupt flag bit is set. (EEIF
must be cleared by firmware). Since the microcontroller
does not execute instructions during the write cycle, the
firmware does not necessarily have to check either
EEIF or WR to determine if the write had finished.
3.7
There are conditions when the device may not want to
write to the EEPROM Data memory or FLASH program
memory. To protect against these spurious write condi-
tions various mechanisms have been built into the
device. On power-up, the WREN bit is cleared and the
Power-up Timer (if enabled) prevents writes.
The write initiate sequence and the WREN bit together
help prevent any accidental writes during brown-out,
power glitches or firmware malfunction.
• Write AAh to EECON2 in two steps (first to W,
• Set the WR bit
Execute two NOP instructions to allow the micro-
controller to setup for write operation.
Enable interrupts (if using interrupts).
Clear the WREN bit to disable program
operations.
then to EECON2)
Protection Against Spurious Writes
PIC16F872
DS30221B-page 27

Related parts for PIC16F872-I/SP