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

📄 init.asm

📁 8051 ASM source code for MLX90614 tempture sensor
💻 ASM
字号:
		
				
					SUBTITLE "MCU INITIALIZATION SUBROUTINE"
										
;***********************************************************************************************				
MCUinit	
;MCU port initialization	
	MOVLW	B'00001000'
	TRIS	6				; GP0,GP1 and GP2 -outputs,GP3 is always input
	MOVLW	b'11011111'		; <7>-Disabled Wake-up on Pin Change bit(GP0, GP1, GP3)
	OPTION					; <6>-Disabled Weak Pull-ups bit(GP0, GP1, GP3)
							; <5>-Timer 0 transition on internal instruction cycle clock, FOSC/4
							; <3>-Prescaler assigned to the WDT
							; <2:0>-Prescaler Rate Select bits 1:128
							
	ifndef	PIC10F202
							
	BCF		CMCON0,CMPON	;Comparator is off(Only for PIC10F206)
		
	endif
	
;SMBus initialization	
	_SDA_HIGH				; Set
	_SCL_HIGH				; SMbus in idle mode
	
	CLRF	flagreg0	
	MOVLW	WDTCOUNT		;
	MOVWF	WDTcounter		;Set WDTcounter 
	MOVLW	SA<<1			;Slave address occupy MSB<7:1>
	MOVWF	SlaveAddress	;Set SMBus address
		
	RETLW 	0

⌨️ 快捷键说明

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