⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 877i2ca.asm

📁 PIC16F877A 中断实现I2C程序
💻 ASM
字号:
;****************************************************
;* 877I2CA.asm                                      *
;* Very simple I2C sample program without Display   *
;****************************************************
;*                                                  *
;* Written by:  Calvin Ho                           *
;*              Senior Applications Engr.           *
;*              Microchip Technology Inc.           *
;* Date:        12 April 2000                       *
;* Revision:	1.00                                *
;****************************************************


;*********************************************************************************************
; This source code provides a demonstration of the MSSP peripheral
; on the PIC16F877 MCU.  
; The additional external subroutine are used for LCD Module
; PIC16F877 磅︽繵瞯 : 4 Mhz
;
;	The subroutines for I2C
;	:I2C_BYTE_READ		; Read a Byte from Address I2C_Addr and put into I2C_Data
;	:I2C_BYTE_WRITE		; Write to I2C_Addr with data @ I2C_Data
;	:I2C_ACK_CHECK		; Wait until I2C device can accept further command
;	:InitI2C		; Initial I2C Module
;	:StartI2C		; Set START Condition !!
;	:StopI2C		; Set STOP Condition
;	:RstartI2C		; Set Restart Condition
;	:RecI2C			; Enable I2C Receive
;	:ACKI2C			; Initial ACK response
;	:NACKI2C 		; Initial NACK response
;	:WaitI2C		; Wait until SSPIF Set 
;********************************************************************************************* 

	list p=16f877
	#include <p16f877.inc>

 		CBLOCK	0x20

		I2C_Data	 
		I2C_Addr	 
		
		ENDC

w_temp		EQU	0x72
status_temp	EQU	0x73
pclath_temp	EQU	0x74 

  
;********************************************
; Locates startup code @ the reset vector
;********************************************
Reset_Addr
	org	0x00
	nop
	goto	Prog_Main
	nop
	nop
 
	;***************************************************************************
	;****	The Start Address of ISR is 0x004
	;****	"PUSH" & "POP" 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -