PIC18F2423 MICROCHIP [Microchip Technology], PIC18F2423 Datasheet - Page 83

no-image

PIC18F2423

Manufacturer Part Number
PIC18F2423
Description
28/40/44-Pin, Enhanced Flash Microcontrollers with 12-Bit A/D and nanoWatt Technology
Manufacturer
MICROCHIP [Microchip Technology]
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC18F2423-I/SP
Manufacturer:
MICROCHIP
Quantity:
1 290
Part Number:
PIC18F2423-I/SP
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
EXAMPLE 6-3:
6.5.2
Depending on the application, good programming
practice may dictate that the value written to the
memory should be verified against the original value.
This should be used in applications where excessive
writes can stress bits near the specification limit.
6.5.3
If a write is terminated by an unplanned event, such as
loss of power or an unexpected Reset, the memory
location just programmed should be verified and repro-
grammed if needed. If the write operation is interrupted
by a MCLR Reset or a WDT Time-out Reset during
normal operation, the user can check the WRERR bit
and rewrite the location(s) as needed.
© 2007 Microchip Technology Inc.
PROGRAM_MEMORY1
Req
Seq
WRITE_BUFFER_BACK2
WRITE_BYTE_TO_HREGS2
PROGRAM_MEMORY2
Req
Seq
MOVWF
MOVLW
MOVWF
MOVLW
BSF
BCF
BSF
BCF
MOVLW
MOVWF
BSF
BSF
BCF
MOVLW
MOVWF
MOVFF
MOVWF
TBLWT+*
DECFSZ COUNTER, F
BRA WRITE_BYTE_TO_HREGS2
BSF
BCF
BSF
BCF
MOVLW
MOVWF
BSF
BSF
BCF
WRITE VERIFY
UNEXPECTED TERMINATION OF
WRITE OPERATION
EECON2
0Aah
EECON2
0AAh
EECON1, EEPGD
EECON1, CFGS
EECON1, WREN
INTCON, GIE
55h
EECON2
EECON1, WR
INTCON, GIE
EECON1, WREN
D’32’
COUNTER
POSTINC0, WREG
TABLAT
EECON1, EEPGD
EECON1, CFGS
EECON1, WREN
INTCON, GIE
55h
EECON2
EECON1, WR
INTCON, GIE
EECON1, WREN
WRITING TO FLASH PROGRAM MEMORY (CONTINUED)
PIC18F2423/2523/4423/4523
; write 55h
; write 55h
; point to Flash program memory
; access Flash program memory
; enable write to memory
; disable interrupts
; write 0AAh
; start program (CPU stall)
; re-enable interrupts
; disable write to memory
; write remaining 32 bytes to Flash
; get low byte of buffer data
; present data to table latch
; short write to holding
; register using pre-increment
; loop until buffers are full
; point to Flash program memory
; access Flash program memory
; enable write to memory
; disable interrupts
; write 0AAh
; start program (CPU stall)
; re-enable interrupts
; disable write to memory
; number of bytes in holding register
Preliminary
6.5.4
To protect against unintended and spurious writes to
Flash program memory, the write initiate sequence
must be followed. In Example 6-3, the “Required
Sequence” acts to protect memory from unintended
writes by requiring this very specific sequence of five
instructions. This sequence must be executed exactly
as shown or the write will not occur.
6.6
Additional protection may be implemented using the
code protection features described in Section 23.5
“Program Verification and Code Protection”.
Flash Program Operation During
Code Protection
PROTECTION AGAINST
SPURIOUS WRITES
DS39755B-page 81

Related parts for PIC18F2423