T89C5115_08 ATMEL [ATMEL Corporation], T89C5115_08 Datasheet - Page 30

no-image

T89C5115_08

Manufacturer Part Number
T89C5115_08
Description
Low Pin Count 8-bit Microcontroller with A/D Converter and 16 KBytes Flash Memory
Manufacturer
ATMEL [ATMEL Corporation]
Datasheet
Examples
30
AT89C5115
;*F*************************************************************************
;* NAME: api_rd_eeprom_byte
;* DPTR contain address to read.
;* Acc contain the reading value
;* NOTE: before execute this function, be sure the EEPROM is not BUSY
;***************************************************************************
api_rd_eeprom_byte:
; Save and clear EA
; Restore EA
ret
;*F*************************************************************************
;* NAME: api_ld_eeprom_cl
;* DPTR contain address to load
;* Acc contain value to load
;* NOTE: in this example we load only 1 byte, but it is possible upto
;* 128 Bytes.
;* before execute this function, be sure the EEPROM is not BUSY
;***************************************************************************
api_ld_eeprom_cl:
; Save and clear EA
; Restore EA
ret
;*F*************************************************************************
;* NAME: api_wr_eeprom
;* NOTE: before execute this function, be sure the EEPROM is not BUSY
;***************************************************************************
api_wr_eeprom:
; Save and clear EA
; Restore EA
ret
MOV
MOVX A, @DPTR
MOV
MOV
MOVX @DPTR, A
MOVEECON, #00h; unmap EEPROM
MOV
MOV
EECON, #02h; map EEPROM in XRAM space
EECON, #00h; unmap EEPROM
EECON, #02h ; map EEPROM in XRAM space
EECON, #050h
EECON, #0A0h
4128G–8051–02/08

Related parts for T89C5115_08