数据搜索系统,热门电子元器件搜索
  Chinese  ▼
ALLDATASHEETCN.COM

X  

PIC16F877ATI/P 数据表(PDF) 39 Page - Microchip Technology

部件名 PIC16F877ATI/P
功能描述  28/40-pin Enhanced FLASH Microcontrollers
PDF  234 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
制造商  MICROCHIP [Microchip Technology]
网页  http://www.microchip.com
标志 MICROCHIP - Microchip Technology

PIC16F877ATI/P 数据表(HTML) 39 Page - Microchip Technology

Back Button PIC16F877ATI/P Datasheet HTML 35Page - Microchip Technology PIC16F877ATI/P Datasheet HTML 36Page - Microchip Technology PIC16F877ATI/P Datasheet HTML 37Page - Microchip Technology PIC16F877ATI/P Datasheet HTML 38Page - Microchip Technology PIC16F877ATI/P Datasheet HTML 39Page - Microchip Technology PIC16F877ATI/P Datasheet HTML 40Page - Microchip Technology PIC16F877ATI/P Datasheet HTML 41Page - Microchip Technology PIC16F877ATI/P Datasheet HTML 42Page - Microchip Technology PIC16F877ATI/P Datasheet HTML 43Page - Microchip Technology Next Button
Zoom Inzoom in Zoom Outzoom out
 39 / 234 page
background image
 2003 Microchip Technology Inc.
DS39582B-page 37
PIC16F87XA
3.6
Writing to Flash Program Memory
Flash program memory may only be written to if the
destination address is in a segment of memory that is
not write-protected, as defined in bits WRT1:WRT0 of
the device configuration word (Register 14-1). Flash
program memory must be written in four-word blocks. A
block consists of four words with sequential addresses,
with a lower boundary defined by an address, where
EEADR<1:0> = 00. At the same time, all block writes to
program memory are done as erase and write opera-
tions. The write operation is edge-aligned and cannot
occur across boundaries.
To write program data, it must first be loaded into the
buffer registers (see Figure 3-1). This is accomplished
by first writing the destination address to EEADR and
EEADRH and then writing the data to EEDATA and
EEDATH. After the address and data have been set up,
then the following sequence of events must be
executed:
1.
Set the EEPGD control bit (EECON1<7>).
2.
Write 55h, then AAh, to EECON2 (Flash
programming sequence).
3.
Set the WR control bit (EECON1<1>).
All four buffer register locations MUST be written to with
correct data. If only one, two or three words are being
written to in the block of four words, then a read from
the program memory location(s) not being written to
must be performed. This takes the data from the pro-
gram location(s) not being written and loads it into the
EEDATA and EEDATH registers. Then the sequence of
events to transfer data to the buffer registers must be
executed.
To transfer data from the buffer registers to the program
memory, the EEADR and EEADRH must point to the last
location in the four-word block (EEADR<1:0> = 11).
Then the following sequence of events must be
executed:
1.
Set the EEPGD control bit (EECON1<7>).
2.
Write 55h, then AAh, to EECON2 (Flash
programming sequence).
3.
Set control bit WR (EECON1<1>) to begin the
write operation.
The user must follow the same specific sequence to ini-
tiate the write for each word in the program block, writ-
ing each program word in sequence (00,01,10,11).
When the write is performed on the last word
(EEADR<1:0> = 11), the block of four words are
automatically erased and the contents of the buffer
registers are written into the program memory.
After the “BSF EECON1,WR” instruction, the processor
requires two cycles to set up the erase/write operation.
The user must place two NOP instructions after the WR
bit is set. Since data is being written to buffer registers,
the writing of the first three words of the block appears
to occur immediately. The processor will halt internal
operations for the typical 4 ms, only during the cycle in
which the erase takes place (i.e., the last word of the
four-word block). This is not Sleep mode as the clocks
and peripherals will continue to run. After the write
cycle, the processor will resume operation with the third
instruction after the EECON1 write instruction. If the
sequence is performed to any other location, the action
is ignored.
FIGURE 3-1:
BLOCK WRITES TO FLASH PROGRAM MEMORY
14
14
14
14
Program Memory
Buffer Register
EEADR<1:0> = 00
Buffer Register
EEADR<1:0> = 01
Buffer Register
EEADR<1:0> = 10
Buffer Register
EEADR<1:0> = 11
EEDATA
EEDATH
75
07
0
6
8
First word of block
to be written
Four words of
to Flash
automatically
after this word
is written
are transferred
Flash are erased,
then all buffers



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


链接网址



ALLDATASHEET是否为您带来帮助?  [ DONATE ] 

关于 Alldatasheet   |   广告服务   |   联系我们   |   隐私政策   |   数据表链接    |   链接交换   |   制造商名单
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