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

X  

PIC16F526-I/P 数据表(PDF) 23 Page - Microchip Technology

部件名 PIC16F526-I/P
功能描述  14-Pin, 8-Bit Flash Microcontroller
PDF  122 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
制造商  MICROCHIP [Microchip Technology]
网页  http://www.microchip.com
标志 MICROCHIP - Microchip Technology

PIC16F526-I/P 数据表(HTML) 23 Page - Microchip Technology

Back Button PIC16F526-I/P Datasheet HTML 19Page - Microchip Technology PIC16F526-I/P Datasheet HTML 20Page - Microchip Technology PIC16F526-I/P Datasheet HTML 21Page - Microchip Technology PIC16F526-I/P Datasheet HTML 22Page - Microchip Technology PIC16F526-I/P Datasheet HTML 23Page - Microchip Technology PIC16F526-I/P Datasheet HTML 24Page - Microchip Technology PIC16F526-I/P Datasheet HTML 25Page - Microchip Technology PIC16F526-I/P Datasheet HTML 26Page - Microchip Technology PIC16F526-I/P Datasheet HTML 27Page - Microchip Technology Next Button
Zoom Inzoom in Zoom Outzoom out
 23 / 122 page
background image
 2010 Microchip Technology Inc.
DS41326D-page 23
PIC16F526
5.0
FLASH DATA MEMORY
CONTROL
The Flash data memory is readable and writable during
normal operation (full VDD range). This memory is not
directly mapped in the register file space. Instead, it is
indirectly addressed through the Special Function
Registers (SFRs).
5.1
Reading Flash Data Memory
To read a Flash data memory location the user must:
• Write the EEADR register
• Set the RD bit of the EECON register
The value written to the EEADR register determines
which Flash data memory location is read. Setting the
RD bit of the EECON register initiates the read. Data
from the Flash data memory read is available in the
EEDATA register immediately. The EEDATA register
will hold this value until another read is initiated or it is
modified by a write operation. Program execution is
suspended while the read cycle is in progress.
Execution will continue with the instruction following the
one that sets the WR bit. See Example 1 for sample
code.
EXAMPLE 1:
READING FROM FLASH
DATA MEMORY
5.2
Writing and Erasing Flash Data
Memory
Flash data memory is erased one row at a time and
written one byte at a time. The 64-byte array is made
up of eight rows. A row contains eight sequential bytes.
Row boundaries exist every eight bytes.
Generally, the procedure to write a byte of data to Flash
data memory is:
1.
Identify the row containing the address where
the byte will be written.
2.
If there is other information in that row that must
be saved, copy those bytes from Flash data
memory to RAM.
3.
Perform a row erase of the row of interest.
4.
Write the new byte of data and any saved bytes
back to the appropriate addresses in Flash data
memory.
To prevent accidental corruption of the Flash data
memory, an unlock sequence is required to initiate a
write or erase cycle. This sequence requires that the bit
set instructions used to configure the EECON register
happen exactly as shown in Example 2 and Example 3,
depending on the operation requested.
5.2.1
ERASING FLASH DATA MEMORY
A row must be manually erased before writing new
data. The following sequence must be performed for a
single row erase.
1.
Load EEADR with an address in the row to be
erased.
2.
Set the FREE bit to enable the erase.
3.
Set the WREN bit to enable write access to the
array.
4.
Set the WR bit to initiate the erase cycle.
If the WREN bit is not set in the instruction cycle after
the FREE bit is set, the FREE bit will be cleared in
hardware.
If the WR bit is not set in the instruction cycle after the
WREN bit is set, the WREN bit will be cleared in
hardware.
Sample code that follows this procedure is included in
Example 2.
Program execution is suspended while the erase cycle
is in progress. Execution will continue with the
instruction following the one that sets the WR bit.
EXAMPLE 2:
ERASING A FLASH DATA
MEMORY ROW
Note: Only a BSF command will work to enable the
Flash data memory read documented in
Example 1.
No
other
sequence
of
commands will work, no exceptions.
BANKSEL EEADR
;
MOVF DATA_EE_ADDR, W
;
MOVWF EEADR
;Data Memory
;Address to read
BANKSEL EECON1
;
BSF EECON, RD
;EE Read
MOVF EEDATA, W
;W = EEDATA
Note 1: The FREE bit may be set by any com-
mand normally used by the core. How-
ever, the WREN and WR bits can only be
set using a series of BSF commands, as
documented in Example 1. No other
sequence of commands will work, no
exceptions.
2: Bits <5:3> of the EEADR register indicate
which row is to be erased.
BANKSEL
EEADR
MOVLW
EE_ADR_ERASE
; LOAD ADDRESS OF ROW TO
; ERASE
MOVWF
EEADR
;
BSF
EECON,FREE
; SELECT ERASE
BSF
EECON,WREN
; ENABLE WRITES
BSF
EECON,WR
; INITITATE ERASE



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