微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 硬件工程师文库 > 读写24LCxx系列的EEPROM的实例程序

读写24LCxx系列的EEPROM的实例程序

时间:02-16 来源:匠人的百宝箱 点击:

读写24LCxx系列的EEPROM的实例程序

;******************************************************** 
;*                     *
;*    ? PIC16F877A($4.6800) ?I2C Master 家&Alpha($5.2300);???﹃?&Alpha($5.2300); EEPROM ?絛ㄒ祘&Alpha($5.2300);  *
;*                                                   *
;* Written by:  Richard Yang                                *
;*              Sr. Corporate Application Engineer($26.0000)            *
;*              Microchip Technology Inc.                *
;* Date:        Oct. 2nd '2002                            *
;* Revision: 1.00                                     *
;********************************************************


;*************************************************
; This source code provides a demonstration of the MSSP peripheral
; on the PIC16F87x MCU. 
;
;
;***********      The subroutines for EEPROM      *****************
;
; EE_Random_Read  ; EEPROM Random address Read from EEPROM
; EE_SEQU_Read  ; EEPROM Sequential Read form EEPROM
; EE_Ack_Check  ; Polling current status of EEPROM
; EE_Page_Write  ; Page Write function for EEPROM
; EE_Byte_Write  ; Write a byte to EEPROM with address setting
;
;***********      The subroutines for I2C      *****************
;
; Init_I2C_Master  ; Initial I2C Module for Master Mode , 7-bit address
; START($0.5760)I2C  ; Send a START($0.5760) Condition !!
; StopI2C   ; Send s STOP Condition
; RSTART($0.5760)I2C  ; Send a Repeat START($0.5760) conditional to I2C
; Non_Ack   ; Send a Non-acknowledge signal to I2C
; An_Ack   ; Send a acknowledge signal to I2C
; Sebd_Byte  ; Send a byte to I2C bus
; RecI2C    ; Enable Read a byte form slave device
; I2C_Done  : Wait the I2C completed the currect process
;
;***************************************************

  list p=16f877a
  #i nclude <p16f877a.inc>

;
;***************************************
;       ﹚竡跑计?RAM???
;
   CBLOCK 0x20

  I2C_Ctrl 
  I2C_Addr
  I2C_Data
  I2C_Page_Length
  D_Count
  ENDC
  cblock 0x40
  I2C_Page_Buffer:8
  I2C_SEQU_Buffer:8
  endc
;
;***************************************
;       ﹚竡い耞?既?竟??

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top