| Zakładka z wyszukiwarką danych komponentów |
|
PIC16F-E/ML Arkusz danych(PDF) 94 Page - Microchip Technology |
|
|
|||||||||||||||||||||||||||||
PIC16F-E/ML Arkusz danych(HTML) 94 Page - Microchip Technology |
|
94 / 178 page ![]() PIC16F627A/628A/648A DS40044F-page 92 © 2007 Microchip Technology Inc. 13.7 Using the Data EEPROM The data EEPROM is a high endurance, byte addressable array that has been optimized for the storage of frequently changing information (e.g., program variables or other data that are updated often). When variables in one section change frequently, while variables in another section do not change, it is possible to exceed the total number of write cycles to the EEPROM (specification D124) without exceeding the total number of write cycles to a single byte (specifications D120 and D120A). If this is the case, then an array refresh must be performed. For this reason, variables that change infrequently (such as constants, IDs, calibration, etc.) should be stored in Flash program memory. A simple data EEPROM refresh routine is shown in Example 13-4. EXAMPLE 13-4: DATA EEPROM REFRESH ROUTINE Note: If data EEPROM is only used to store constants and/or data that changes rarely, an array refresh is likely not required. See specification D124. BANKSEL 0X80 ;select Bank1 CLRF EEADR ;start at address 0 BCF INTCON, GIE ;disable interrupts BTFSC INTCON, GIE ;see AN576 GOTO $ - 2 BSF EECON1, WREN ;enable EE writes Loop BSF EECON1, RD ;retrieve data into EEDATA MOVLW 0x55 ;first step of ... MOVWF EECON2 ;... required sequence MOVLW 0xAA ;second step of ... MOVWF EECON2 ;... required sequence BSF EECON1, WR ;start write sequence BTFSC EECON1, WR ;wait for write complete GOTO $ - 1 #IFDEF __16F648A ;256 bytes in 16F648A INCFSZ EEADR, f ;test for end of memory #ELSE ;128 bytes in 16F627A/628A INCF EEADR, f ;next address BTFSS EEADR, 7 ;test for end of memory #ENDIF ;end of conditional assembly GOTO Loop ;repeat for all locations BCF EECON1, WREN ;disable EE writes BSF INTCON, GIE ;enable interrupts (optional) |
|
Link URL |
| Czy Alldatasheet okazała się pomocna? [ DONATE ] |
O Alldatasheet | Reklama | Kontakt | Polityka prywatności | Link do karty katalogowej | Linki | Lista producentów All Rights Reserved©Alldatasheet.com |
| 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 |