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

no-image

PIC18F24

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

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC18F2410-E/SO
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC18F2410-I/ML
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC18F2410-I/S0
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC18F2410-I/SO
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC18F2410-I/SP
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC18F2410T-I/ML
Manufacturer:
MIC
Quantity:
1 831
Part Number:
PIC18F242-E/SP
Manufacturer:
Microchip Technology
Quantity:
135
Part Number:
PIC18F242-I/SO
Manufacturer:
SKYWORKSS
Quantity:
101
Company:
Part Number:
PIC18F242-I/SO
Quantity:
9
Company:
Part Number:
PIC18F242-I/SP
Quantity:
14
Part Number:
PIC18F2420-I/SO
Manufacturer:
MICROCHIP
Quantity:
1 560
Part Number:
PIC18F2420-I/SO
0
Part Number:
PIC18F2423-I/SP
Manufacturer:
MICROCHIP
Quantity:
1 290
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.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
situations, users can check the WRERR bit and rewrite
the location.
 2004 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
; 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
DS41159D-page 73

Related parts for PIC18F24