PIC18F258 MICROCHIP [Microchip Technology], PIC18F258 Datasheet - Page 75

no-image

PIC18F258

Manufacturer Part Number
PIC18F258
Description
High Performance, 28/40-Pin Enhanced FLASH Microcontrollers with CAN
Manufacturer
MICROCHIP [Microchip Technology]
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC18F258-E/SO
Manufacturer:
MIC
Quantity:
20 000
Part Number:
PIC18F258-I/P
Manufacturer:
ST
Quantity:
320
Part Number:
PIC18F258-I/SO
Manufacturer:
MICROCHIP
Quantity:
2 000
Part Number:
PIC18F258-I/SO
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC18F2580
Manufacturer:
MIC
Quantity:
20 000
Part Number:
PIC18F2580-E/ML
Manufacturer:
Microchip Technology
Quantity:
135
Part Number:
PIC18F2580-E/SO
Manufacturer:
Microchi
Quantity:
2 952
Part Number:
PIC18F2580-E/SP
Manufacturer:
Microchip Technology
Quantity:
135
Part Number:
PIC18F2580-I/SO
Manufacturer:
MICRO
Quantity:
10
Part Number:
PIC18F2580-I/SO
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC18F2580-I/SO
0
Part Number:
PIC18F2585-I/SO
Quantity:
2
EXAMPLE 6-3:
6.5.2
Depending on the application, good programming
practice may dictate that the value written to the mem-
ory 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.The WRERR bit is set when a write
operation is interrupted by a MCLR Reset, or a WDT
Time-out Reset during normal operation. In these situ-
ations, users can check the WRERR bit and rewrite the
location.
 2002 Microchip Technology Inc.
WRITE_WORD_TO_HREGS
PROGRAM_MEMORY
Required
Sequence
WRITE VERIFY
UNEXPECTED TERMINATION OF
WRITE OPERATION
MOVFW
MOVWF
TBLWT+*
DECFSZ COUNTER
BRA
BSF
BCF
BSF
BCF
MOVLW
MOVWF
MOVLW
MOVWF
BSF
NOP
BSF
DECFSZ COUNTER_HI
BRA
BCF
WRITING TO FLASH PROGRAM MEMORY (CONTINUED)
POSTINC0, W
TABLAT
WRITE_WORD_TO_HREGS
EECON1,EEPGD
EECON1,CFGS
EECON1,WREN
INTCON,GIE
55h
EECON2
0AAh
EECON2
EECON1,WR
INTCON,GIE
PROGRAM_LOOP
EECON1,WREN
Preliminary
; get low byte of buffer data
; present data to table latch
; write data, perform a short write
; to internal TBLWT holding register.
; loop until buffers are full
; point to FLASH program memory
; access FLASH program memory
; enable write to memory
; disable interrupts
; write 55H
; write 0AAH
; start program (CPU stall)
; re-enable interrupts
; loop until done
; disable write to memory
6.5.4
To reduce the probability against spurious writes to
FLASH program memory, the write initiate sequence
must also be followed. See Section 24.0, Special
Features of the CPU for more detail.
6.6
See Section 24.0, Special Features of the CPU for
details on code protection of FLASH program memory.
FLASH Program Operation During
Code Protection
PROTECTION AGAINST SPURIOUS
WRITES
PIC18FXX8
DS41159B-page 73

Related parts for PIC18F258