Electronic Components Datasheet Search |
|
AN1502 Datasheet(PDF) 5 Page - STMicroelectronics |
|
AN1502 Datasheet(HTML) 5 Page - STMicroelectronics |
5 / 7 page 5/7 EMULATED DATA EEPROM WITH ST7 HDFLASH MEMORY LD FLASH_PTRH, A ; located at address 8000h (sector 2). LD A, #$00 LD FLASH_PTRH, A LD A, #$55 ; 55h is the new data to be write in emulated data LD FLASH_DATA, A ; EEPROM byte located at 8000h address CALL HDemulE2_ByteProg ; Result: status returned in FLASH_CMD high nibble ; < USER APPLICATION PROGRAM > ; ----------------------------------------------------------------------------- ; ROUTINE: HDemulE2_ByteRead ; DESCRIPTION: Emulated data EEPROM byte read driver routine ; BEFORE: FLASH_PTRH:L = pointer corresponding to the start address of the ; memory table allocated to the emulated data EEPROM ; byte to read ; AFTER: A = current emulated data EEPROM byte value ; FLASH_PTRH:L = address of the current emulated data EEPROM byte value ; RESSOURCES: ; Program size: 15 bytes ; Used RAM area: 2 bytes for PTRH:PTRL. ; ----------------------------------------------------------------------------- .HDemulE2_ByteRead LD A,[FLASH_PTRH.w] ; Read emulated data EEPROM table content CP A, #$FF ; If the value is FFh check next location JRNE HDemulE2_ByteRead_end ; Else A = current value. INC FLASH_PTRL JRNE HDemulE2_ByteRead INC FLASH_PTRH JRT HDemulE2_ByteRead .HDemulE2_ByteRead_end RET ; ----------------------------------------------------------------------------- ; ROUTINE: HDemulE2_ByteProg ; DESCRIPTION: Emulated data EEPROM byte programming driver routine ; BEFORE: FLASH_PTRH:L = pointer corresponding to the start address of the ; memory table allocated to the emulated data EEPROM ; byte to update ; FLASH_DATA = data to be programmmed ; AFTER: FLASH_CMD = status result of the programming (see embedded status ; return code definition of the Embedded Command) ; RESSOURCES: ; Program size: 24 bytes ; Used RAM area: same as HDFlash Embedded Command ; - 16 bytes from 00F0h to 00FFh ; - 116 byte stack ; (see dedicated chapter for more details) ; ----------------------------------------------------------------------------- .HDemulE2_ByteProg CALL HDemulE2_ByteRead ; To look for the current value address CP A, FLASH_DATA ; If the data to be written is the same as JREQ HDemulE2_ByteProg_end ; current one, skip programming TNZ FLASH_PTRL ; Set the new current value address JRNE HDemulE2_ByteProg_next ; => previous current - 1 DEC FLASH_PTRH .HDemulE2_ByteProg_next DEC FLASH_PTRL CLR FLASH_CMD ; Set Embedded Command to "Byte programming" |
Similar Part No. - AN1502 |
|
Similar Description - AN1502 |
|
|
Link URL |
Privacy Policy |
ALLDATASHEET.NET |
Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link Exchange | Manufacturer List 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 |