PIC16F819 Microchip Technology Inc., PIC16F819 Datasheet - Page 33
![no-image](/images/manufacturer_photos/0/4/440/microchip_technology_inc__sml.jpg)
PIC16F819
Manufacturer Part Number
PIC16F819
Description
18/20-pin Enhanced Flash Microcontrollers With Nanowatt Technology
Manufacturer
Microchip Technology Inc.
Datasheet
1.PIC16F819.pdf
(176 pages)
Available stocks
Company
Part Number
Manufacturer
Quantity
Price
Company:
Part Number:
PIC16F819
Manufacturer:
MIC
Quantity:
699
Part Number:
PIC16F819-1/P
Manufacturer:
MIC
Quantity:
20 000
Company:
Part Number:
PIC16F819-E/SO
Manufacturer:
ZETTLER
Quantity:
201
Company:
Part Number:
PIC16F819-E/SS
Manufacturer:
MICROCHIP
Quantity:
12 000
Company:
Part Number:
PIC16F819-E/SS
Manufacturer:
Microchip Technology
Quantity:
135
Company:
Part Number:
PIC16F819-I/P
Manufacturer:
MICROCHIP
Quantity:
1 000
Part Number:
PIC16F819-I/SS
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
An example of the complete four-word write sequence
is shown in Example 3-5. The initial address is loaded
into the EEADRH:EEADR register pair; the four words
of data are loaded using indirect addressing, assuming
that a row erase sequence has already been
performed.
EXAMPLE 3-5:
2004 Microchip Technology Inc.
; This write routine assumes the following:
; 1. The 32 words in the erase block have already been erased.
; 2. A valid starting address (the least significant bits = '00') is loaded into EEADRH:EEADR
; 3. This example is starting at 0x100, this is an application dependent setting.
; 4. The 8 bytes (4 words) of data are loaded, starting at an address in RAM called ARRAY.
; 5. This is an example only, location of data to program is application dependent.
; 6. word_block is located in data memory.
LOOP
BANKSEL EECON1
BSF
BSF
BCF
BANKSEL word_block
MOVLW
MOVWF
BANKSEL EEADRH
MOVLW
MOVWF
MOVLW
MOVWF
BANKSEL ARRAY
MOVLW
MOVWF
BANKSEL EEDATA
MOVF
MOVWF
INCF
MOVF
MOVWF
INCF
BANKSEL EECON1
MOVLW
MOVWF
MOVLW
MOVWF
BSF
NOP
NOP
BANKSEL EEADR
INCF
BANKSEL word_block
DECFSZ
GOTO
BANKSEL EECON1
BCF
BSF
EECON1, EEPGD
EECON1, WREN
EECON1, FREE
.4
word_block
0x01
EEADRH
0x00
EEADR
ARRAY
FSR
INDF, W
EEDATA
FSR, F
INDF, W
EEDATH
FSR, F
0x55
EECON2
0xAA
EECON2
EECON1, WR
EEADR, f
word_block, f
loop
EECON1, WREN
INTCON, GIE
WRITING TO FLASH PROGRAM MEMORY
;prepare for WRITE procedure
;point to program memory
;allow write cycles
;perform write only
;prepare for 4 words to be written
;Start writing at 0x100
;load HIGH address
;load LOW address
;initialize FSR to start of data
;indirectly load EEDATA
;increment data pointer
;indirectly load EEDATH
;increment data pointer
;required sequence
;set WR bit to begin write
;instructions here are ignored as processor
;load next word address
;have 4 words been written?
;NO, continue with writing
;YES, 4 words complete, disable writes
;enable interrupts
PIC16F818/819
DS39598E-page 31