Datenblatt-Suchmaschine für elektronische Bauteile
  German  ▼
ALLDATASHEETDE.COM

X  

PIC16F570 Datenblatt(PDF) 23 Page - Microchip Technology

Teilenummer PIC16F570
Bauteilbeschribung  20-Pin, 8-Bit Flash Microcontroller
PDF  134 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Hersteller  MICROCHIP [Microchip Technology]
Direct Link  http://www.microchip.com
Logo MICROCHIP - Microchip Technology

PIC16F570 Datenblatt(HTML) 23 Page - Microchip Technology

Back Button PIC16F570 Datasheet HTML 19Page - Microchip Technology PIC16F570 Datasheet HTML 20Page - Microchip Technology PIC16F570 Datasheet HTML 21Page - Microchip Technology PIC16F570 Datasheet HTML 22Page - Microchip Technology PIC16F570 Datasheet HTML 23Page - Microchip Technology PIC16F570 Datasheet HTML 24Page - Microchip Technology PIC16F570 Datasheet HTML 25Page - Microchip Technology PIC16F570 Datasheet HTML 26Page - Microchip Technology PIC16F570 Datasheet HTML 27Page - Microchip Technology Next Button
Zoom Inzoom in Zoom Outzoom out
 23 / 134 page
background image
 2012-2014 Microchip Technology Inc.
DS40001652C-page 23
PIC16F527
5.0
SELF-WRITABLE FLASH DATA
MEMORY CONTROL
Flash Data memory consists of 64 bytes of self-
writable memory and supports a self-write capability
that can write four bytes of memory at one time. Data
to be written to the self-writable data memory is first
written into four write latches before writing the data to
Flash memory.
Although each Flash data memory location is 12 bits
wide, access is limited to the lower eight bits. The
upper four bits will automatically default to ‘1’ in any
self-write procedure. The lower eight bits are fully
readable and writable during normal operation and
throughout the full VDD range.
The self-writable Flash data memory is not directly
mapped in the register file space. Instead, it is
indirectly addressed through the Special Function
Registers, EECON, EEDATA and EEADR.
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 5-1 for sample
code.
EXAMPLE 5-1:
READING FROM FLASH
DATA MEMORY
5.1.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.
Disable interrupts.
5.
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 5-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 5-2:
ERASING A FLASH DATA
MEMORY ROW
Note: Only a BSF command will work to enable
the Flash data memory read documented in
Example 5-1.
No
other
sequence
of
commands will work, no exceptions.
MOVLB
0x01
; Switch to Bank 1
MOVF
DATA_EE_ADDR,W;
MOVWF
EEADR
; Data Memory
; Address to read
BSF
EECON, RD
; EE Read
MOVF
EEDATA, W
; W = EEDATA
Note 1: 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 5-2 and Example 5-3,
depending on the operation requested.
2: In order to prevent any disruptions of self-
writes or row erases performed on the
self-writable
Flash
data
memory,
interrupts should be disabled prior to
executing those routines.
MOVLB
0x01
; Switch to Bank 1
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


Datenblatt Download

Go To PDF Page


Link URL



War ALLDATASHEET hilfreich?  [ DONATE ] 

Über Alldatasheet   |   Werbung   |   Kontakt   |   Privatsphäre und Datenschutz   |   Link zum Datenblatt    |   Linktausch   |   Hersteller
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