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

📄 temp.asm

📁 利用holtek的HT49R50编写的热敏感应温度计的使用
💻 ASM
字号:
;;Client:
;;ID Code:
;;HT_ICE Version:
;;HT_IDE Version: V6.6
;;Program Name: Temp.Prj
;;Program Version:
;;Established Date: 2005/08/11
;;Programmer: Song
;;--------------------------------------------
;;Main Function: **Test Temperature**
;;MCU Body:Ht49r50
;;VDD: 5V
;;MCU Frequency: 8MHz
;;--------------------------------------------
;;Mask Option:
;Vdd : 5.00V
;Osc: Crystal
;Fsys: 8MHz
;Package: 100 QFP-A
;Wdt: Disable
;Clr Wdt: One Clear Instruction
;Wake_Up PA0-7: Non Wake Up
;Pull-high PA: Nmos&PULL-HIGH
;Pull-high PC: Nmos&NON-PULL-HIGH
;Timer0 clock source: System clock
;Timer1 clock source: Timer0 overflow
;TMR0&TMR1 PFD: Disable
;Clock source: WDT OSC(12K)
;BZ/BZB: Disable
;LCD duty: 1/4 duty
;LVR: Disable
;LVD: Disable
;;================================================
#INCLUDE	HT49R50A-1.INC
#INCLUDE 	MACRO.ASM
#INCLUDE 	CALCULATE.INC
;;================================================
#DEFINE		P_A		PA
#DEFINE		P_B		PB
#DEFINE		P_C		PC
#DEFINE 	ZERO_H	0BH				;;the high byte of RT as T=0 degree
#DEFINE     ZERO_L	3AH				;;the low byte of RT as T=0 degree
#DEFINE     TEMP_START_ADDR	0F0AH		;;the start address of temperature table
#DEFINE     TEMP_END_ADDR	TEMP_START_ADDR+100-(-40)	
									;;the end address of temperature table 
									;;100:the highest temperature tested;
#DEFINE     NUM		TEMP_START_ADDR-(-40)	;;-40 :the lowest temperature tested
;;================================================
DATA.SECTION	'DATA'
ACCBAK		DB	?					 ;;save acc registor value
STATUSBAK	DB	?					 ;;save status registor value
FLAG_EQU    DBIT                 	 ;;compare temperature flag
R_P_C		DB	?					 ;;rigistro for pc
BUF1		DB	?					 ;;registor for delay
BUF2		DB	?					 ;;registor for delay
BUF3		DB	?					 ;;registor for delay
R_TBLP		DB	?					 ;;save tblp  value
R_TBLH		DB	?					 ;;save the high byte of rom table code registor value
R_TABLE_L	DB	?					 ;;save the low byte of rom table code
R_RT_L		DB	?					 ;;the low byte of RT summation & RT
R_RT_H		DB	?					 ;;the high byte of RT summation & RT &temperature
R_RT		DB	?					 ;;the (16-23)bit of RT summation
R_ITEM		DB	?					 ;;registor for diaplay subroutine
R_TO0		DB	?					 ;;save to0
R_TO1		DB	?					 ;;save to1
R_TO2		DB	?					 ;;save to2
R_TO3		DB	?					 ;;save to3
R_COMPARE	DB	?					 ;;for RT compare
R_NUM		DB	?					 ;;for RT calculate&interrupt time
R_NUM1		DB	?					 ;;for RT calculate
R_NUM2		DB	?					 ;;for RT calculate
R_SUM1		DB	?					 ;;for RT calculate
R_SUM2		DB	?					 ;;for RT calculate
R_DOT		DB	?					 ;;the decimal of temperature
R_COUN_8	DB	?					 ;;for 8 times cycle
R_COUN_4	DB	?					 ;;for 4 times cycle
R_TMR0		DB	?					 ;;the low byte of charging time summation
R_TMR1		DB	?					 ;;the high byte of charging time summation
RC_NUM		DB	?					 ;;the (16_23)bite of charging time summation

MAIN.SECTION	AT	0	'CODE'
	JMP		MAIN

ORG		04H							;;external int0 interrupt vector
	JMP		ISR_EXTINT0

ORG		08H							;;external int1 interrupt vector
	JMP		ISR_EXTINT1

ORG		0CH							;;timer0 interrupt vector
	JMP		ISR_TMR0

ORG		10H							;;timer1 interrupt vector
	JMP		ISR_TMR1

ORG		14H							;;timebase interrupt vector
	JMP		ISR_TIMEBASE

ORG		18H							;;rtc interrupt vector
	JMP		ISR_RTCC
;;=========================================================
;;=========================================================
MAIN:
	CALL	INI_LCD_RAM				;;initial bank1 of ram
	CALL	INI_RAM					;;initial band0 of ram
	CALL	INI_IO          		;;initial io
	CALL	SBR_RT					;;get the value of RT
	CALL	SBR_TEMP_DISPLAY		;;display the temperature with LCD
	JMP		$-4						;;run again
;;=====================================================
ISR_EXTINT0:						;;(no used)04 interrupt
	PUSH
	POP
	RETI
;;=====================================================
ISR_EXTINT1:						;;(no used)08 interrupt
	PUSH
	POP
	RETI
;;====================================================
ISR_TMR0:							;;(no used)0c interrupt
	PUSH
	POP
	RETI
;;===================================================
ISR_TMR1:							;;10 interrupt
	PUSH
	INC		R_NUM
	POP
	RETI
;;==================================================
ISR_TIMEBASE:						;;(no used)14 interrupt
	PUSH
	POP
	RETI
;;==================================================
ISR_RTCC:							;;(no used)18 interrupt
	PUSH
	POP
	RETI
;;==================================================
#INCLUDE	SUBROUTINE.ASM

⌨️ 快捷键说明

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