AT89C51CC02CA-TDSUM ATMEL [ATMEL Corporation], AT89C51CC02CA-TDSUM Datasheet - Page 32

no-image

AT89C51CC02CA-TDSUM

Manufacturer Part Number
AT89C51CC02CA-TDSUM
Description
Enhanced 8-bit Microcontroller with CAN Controller and Flash
Manufacturer
ATMEL [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
4126J–CAN–05/06

Related parts for AT89C51CC02CA-TDSUM