《防爆磁力启动器原理与维修》 * 技术教程集合 * PLC入门教程 电工基础教程
论坛使用帮助 PLC视频教程下载 升级VIP用户的方法成伟新帖

PIC单片机的I2C读写源程序

[复制链接]
查看1349 | 回复0 | 2011-9-7 22:59:24 | 显示全部楼层 |阅读模式
<




TITLE \" TWO WIRE/I2C BUS INTERFACE WITH PIC16C5x \"
;
LIST P=16C54

;*****************************************************************************
;** Two wire/I2C Bus READ/WRITE Sample Routines of Microchip's
;** 24Cxx / 85Cxx serial CMOS EEPROM interfacing to a
;** PIC16C54 8-bit CMOS single chip microcomputer
;** Revsied Version 2.0 (4/2/92).
;**
;** Part use = PIC16C54-XT/JW
;** Note: 1) All timings are based on a reference crystal frequency of 2MHz
;** which is equivalent to an instruction cycle time of 2 usec.
;** 2) Address and literal values are read in octal unless otherwise
;** specified.
;
;
; Program: I2CBUS.ASM
; Revision Date:
; 12-12-95 Compatibility with MPASMWIN 1.30
;
;**********************************************************************
;
;*****************************************************************************
;
;-----------------------------------------------------------------------------
; Files Assignment
;-----------------------------------------------------------------------------
;
PC EQU 2 ; Program counter
STAT EQU 3 ; PIC status byte
FSR EQU 4 ; File Select Register
RA EQU 5 ; Port A use to select device address
RB EQU 6 ; RB7 = SDA, RB6 = SCL
;
STATUS EQU 08 ; Status register
FLAG EQU 09 ; Common flag bits register
EEPROM EQU 0A ; Bit buffer
ERCODE EQU 0B ; Error code (to indicate bus status)
ADDR EQU 10 ; Address register
本新闻共9页,当前在第1页 [1] [2] [3] [4] [5] [6] [7] [8] [9]
热帖推荐
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则