at89c51cc02ua-tdsum ATMEL Corporation, at89c51cc02ua-tdsum Datasheet - Page 32

no-image

at89c51cc02ua-tdsum

Manufacturer Part Number
at89c51cc02ua-tdsum
Description
At89c51cc02, T89c51cc02 Enhanced 8-bit Microcontroller With Can Controller And Flash
Manufacturer
ATMEL Corporation
Datasheet
Examples
32
AT/T89C51CC02
;*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
4126L–CAN–01/08

Related parts for at89c51cc02ua-tdsum