поискавой системы для электроныых деталей
  Russian  ▼
ALLDATASHEETRU.COM

X  

PIC18F242 датащи(PDF) 62 Page - Microchip Technology

номер детали PIC18F242
подробное описание детали  High-Performance, Enhanced Flash Microcontrollers with 10-Bit A/D
PDF  332 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
производитель  MICROCHIP [Microchip Technology]
домашняя страница  http://www.microchip.com
Logo MICROCHIP - Microchip Technology

PIC18F242 датащи(HTML) 62 Page - Microchip Technology

Back Button PIC18F242 Datasheet HTML 58Page - Microchip Technology PIC18F242 Datasheet HTML 59Page - Microchip Technology PIC18F242 Datasheet HTML 60Page - Microchip Technology PIC18F242 Datasheet HTML 61Page - Microchip Technology PIC18F242 Datasheet HTML 62Page - Microchip Technology PIC18F242 Datasheet HTML 63Page - Microchip Technology PIC18F242 Datasheet HTML 64Page - Microchip Technology PIC18F242 Datasheet HTML 65Page - Microchip Technology PIC18F242 Datasheet HTML 66Page - Microchip Technology Next Button
Zoom Inzoom in Zoom Outzoom out
 62 / 332 page
background image
PIC18FXX2
DS39564C-page 60
© 2006 Microchip Technology Inc.
5.4
Erasing FLASH Program memory
The minimum erase block is 32 words or 64 bytes. Only
through the use of an external programmer, or through
ICSP control can larger blocks of program memory be
bulk erased. Word erase in the FLASH array is not
supported.
When initiating an erase sequence from the micro-
controller itself, a block of 64 bytes of program memory
is erased. The Most Significant 16 bits of the
TBLPTR<21:6> point to the block being erased.
TBLPTR<5:0> are ignored.
The EECON1 register commands the erase operation.
The EEPGD bit must be set to point to the FLASH pro-
gram memory. The WREN bit must be set to enable
write operations. The FREE bit is set to select an erase
operation.
For protection, the write initiate sequence for EECON2
must be used.
A long write is necessary for erasing the internal
FLASH. Instruction execution is halted while in a long
write cycle. The long write will be terminated by the
internal programming timer.
5.4.1
FLASH PROGRAM MEMORY
ERASE SEQUENCE
The sequence of events for erasing a block of internal
program memory location is:
1.
Load table pointer with address of row being
erased.
2.
Set EEPGD bit to point to program memory,
clear CFGS bit to access program memory, set
WREN bit to enable writes, and set FREE bit to
enable the erase.
3.
Disable interrupts.
4.
Write 55h to EECON2.
5.
Write AAh to EECON2.
6.
Set the WR bit. This will begin the row erase
cycle.
7.
The CPU will stall for duration of the erase
(about 2 ms using internal timer).
8.
Re-enable interrupts.
EXAMPLE 5-2:
ERASING A FLASH PROGRAM MEMORY ROW
MOVLW
CODE_ADDR_UPPER
; load TBLPTR with the base
MOVWF
TBLPTRU
; address of the memory block
MOVLW
CODE_ADDR_HIGH
MOVWF
TBLPTRH
MOVLW
CODE_ADDR_LOW
MOVWF
TBLPTRL
ERASE_ROW
BSF
EECON1,EEPGD
; point to FLASH program memory
BCF
EECON1,CFGS
; access FLASH program memory
BSF
EECON1,WREN
; enable write to memory
BSF
EECON1,FREE
; enable Row Erase operation
BCF
INTCON,GIE
; disable interrupts
MOVLW
55h
Required
MOVWF
EECON2
; write 55h
Sequence
MOVLW
AAh
MOVWF
EECON2
; write AAh
BSF
EECON1,WR
; start erase (CPU stall)
BSF
INTCON,GIE
; re-enable interrupts



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  ...More


датащи скачать

Go To PDF Page


ссылки URL



Вашему бизинису помогли Аллдатащит?  [ DONATE ] 

Что такое Аллдатащит   |   реклама   |   контакт   |   Конфиденциальность   |   Ссылка на техническое описание    |   обмен ссыками   |   поиск по производителю
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com