English
Language : 

PIC12CE518 Datasheet, PDF (78/88 Pages) Microchip Technology – 8-Pin, 8-Bit CMOS Microcontroller with EEPROM Data Memory
PIC12CE5XX
;
; NOPs have been added to meet the timing specs for the memory at 4 MHz
; and low voltage. Applications running at slower clock rates and those
; operating within 4.5-5.5V may be able to remove some of the NOPs.
;
; This code is specifically written for the interface hardware of the
; 12CE51x parts. See AN571 for the unmodified routines.
;***************************************************************************
;*************************** EEPROM Subroutines **************************
;***************************************************************************
; Communication for EEPROM based on I2C protocol, with Acknowledge.
;
; Byte_Write: Byte write routine
;
Inputs: EEPROM Address
EEADDR
;
EEPROM Data
EEDATA
;
Outputs: Return 01 in W if OK, else return 00 in W
;
; Read_Current: Read EEPROM at address currently held by EE device.
;
Inputs: NONE
;
Outputs: EEPROM Data
EEDATA
;
Return 01 in W if OK, else return 00 in W
;
; Read_Random:
Read EEPROM byte at supplied address
;
Inputs: EEPROM Address
EEADDR
;
Outputs: EEPROM Data
EEDATA
;
Return 01 in W if OK, else return 00 in W
;
; Note: EEPROM subroutines will set bit 7 in PC_OFFSET register if the
;
EEPROM acknowledged OK, else that bit will be cleared. This bit
;
can be checked instead of refering to the value returned in W
;***************************************************************************
;
; OPERATION:
;
Byte Write:
;
load EEADDR and EEDATA
;
then CALL BYTE_WRITE
;
;
Read Random:
;
Load EEADDR
;
then CALL READ_RANDOM
;
data read returned in EEDATA
;
;
Read Current
;
no setup necessary
;
CALL READ_CURRENT
;
data read returned in EEDATA
;
;***************************************************************************
;
; These functions consume:
; 77 words Programming Memory
; 5 file registers which are overlayable. That is, they can share with
; other functions as long as they are mutually exclusive in time. See
; udata_ovr in the linker manual.
; 1 stack level (the call to the function itself. These functions do not
; call any lower level functions).
;
;
DS40172A-page 78
Preliminary
© 1997 Microchip Technology Inc.