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

X  

PIC16F628-20/SS датащи(PDF) 93 Page - Microchip Technology

номер детали PIC16F628-20/SS
подробное описание детали  FLASH-Based 8-Bit CMOS Microcontrollers
PDF  160 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
производитель  MICROCHIP [Microchip Technology]
домашняя страница  http://www.microchip.com
Logo MICROCHIP - Microchip Technology

PIC16F628-20/SS датащи(HTML) 93 Page - Microchip Technology

Back Button PIC16F628-20/SS Datasheet HTML 89Page - Microchip Technology PIC16F628-20/SS Datasheet HTML 90Page - Microchip Technology PIC16F628-20/SS Datasheet HTML 91Page - Microchip Technology PIC16F628-20/SS Datasheet HTML 92Page - Microchip Technology PIC16F628-20/SS Datasheet HTML 93Page - Microchip Technology PIC16F628-20/SS Datasheet HTML 94Page - Microchip Technology PIC16F628-20/SS Datasheet HTML 95Page - Microchip Technology PIC16F628-20/SS Datasheet HTML 96Page - Microchip Technology PIC16F628-20/SS Datasheet HTML 97Page - Microchip Technology Next Button
Zoom Inzoom in Zoom Outzoom out
 93 / 160 page
background image
PIC16F62X
© 1999 Microchip Technology Inc.
Preliminary
DS40300B-page 93
13.3
READING THE EEPROM DATA
MEMORY
To read a data memory location, the user must write
the address to the EEADR register and then set con-
trol bit RD (EECON1<0>). The data is available, in the
very next cycle, in the EEDATA register; therefore it
can be read in the next instruction. EEDATA will hold
this value until another read or until it is written to by
the user (during a write operation).
EXAMPLE 13-1: DATA EEPROM READ
BCF
STATUS, RP0
; Bank 0
MOVLW
CONFIG_ADDR
;
MOVWF
EEADR
; Address to read
BSF
STATUS, RP0
; Bank 1
BSF
EECON1, RD
; EE Read
BCF
STATUS, RP0
; Bank 0
MOVF
EEDATA, W
; W = EEDATA
13.4
WRITING TO THE EEPROM DATA
MEMORY
To write an EEPROM data location, the user must first
write the address to the EEADR register and the data
to the EEDATA register. Then the user must follow a
specific sequence to initiate the write for each byte.
EXAMPLE 13-2: DATA EEPROM WRITE
BSF
STATUS, RP0
; Bank 1
BSF
EECON1, WREN
; Enable write
BCF
INTCON, GIE
; Disable INTs.
MOVLW
55h
;
MOVWF
EECON2
; Write 55h
MOVLW
AAh
;
MOVWF
EECON2
; Write AAh
BSF
EECON1,WR
; Set WR bit
; begin write
BSF
INTCON, GIE
; Enable INTs
.
The write will not initiate if the above sequence is not
exactly followed (write 55h to EECON2, write AAh to
EECON2, then set WR bit) for each byte. We strongly
recommend that interrupts be disabled during this
code segment. A cycle count is executed during the
required sequence. Any number what is not equal to
the required cycles to execute the required sequence
will cause the data not to be written into the EEPROM.
Additionally, the WREN bit in EECON1 must be set to
enable write. This mechanism prevents accidental
writes to data EEPROM due to errant (unexpected)
code execution (i.e., lost programs). The user should
keep the WREN bit clear at all times, except when
updating EEPROM. The WREN bit is not cleared
by hardware
After a write sequence has been initiated, clearing the
WREN bit will not affect this write cycle. The WR bit
will be inhibited from being set unless the WREN bit is
set.
At the completion of the write cycle, the WR bit is
cleared in hardware and the EE Write Complete
Interrupt Flag bit (EEIF) is set. The user can either
enable this interrupt or poll this bit. The EEIF bit in the
PIR1 registers must be cleared by software.
13.5
WRITE VERIFY
Depending on the application, good programming
practice may dictate that the value written to the Data
EEPROM should be verified (Example 13-3) to the
desired value to be written. This should be used in
applications where an EEPROM bit will be stressed
near the specification limit.
EXAMPLE 13-3: WRITE VERIFY
BCF
STATUS, RP0 ; Bank 0
:
; Any code can go here
:
;
MOVF
EEDATA, W
; Must be in Bank 0
BSF
STATUS, RP0 ; Bank 1 READ
BSF
EECON1, RD
; YES, Read the
; value written
BCF
STATUS, RP0 ; Bank 0
;
; Is the value written (in W reg) and
; read (in EEDATA) the same?
;
SUBWF EEDATA, W
;
BTFSS STATUS, Z
; Is difference 0?
GOTO
WRITE_ERR
; NO, Write error
:
; YES, Good write
:
; Continue program
13.6
PROTECTION AGAINST SPURIOUS
WRITE
There are conditions when the device may not want to
write to the data EEPROM memory. To protect against
spurious EEPROM writes, various mechanisms have
been built in. On power-up, WREN is cleared. Also,
the Power-up Timer (72 ms duration) prevents
EEPROM write.
The write initiate sequence and the WREN bit together
help prevent an accidental write during brown-out,
power glitch, or software malfunction.
13.7
DATA EEPROM OPERATION DURING
CODE PROTECT
When the device is code protected, the CPU is able to
read and write unscrambled data to the Data
EEPROM.



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