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

📄 init.asm

📁 一个秒表的程序
💻 ASM
字号:
$include (c8051f000.inc)					; Include regsiter definition file.
$include (TP.inc)									; Include TP definition file.	
PROG  		segment  CODE
PUBLIC   	init

					RSEG		PROG    	
					; Disable the WDT. (IRQs not enabled at this point.)
					; If interrupts were enabled, we would need to explicitly disable
					; them so that the 2nd move to WDTCN occurs no more than four clock 
					; cycles after the first move to WDTCN.
init:			mov			WDTCN, #0DEh
					mov			WDTCN, #0ADh

					; Enable the Port I/O Crossbar
					mov			XBR0, #00000100B  ; TXD P0.0;RXD P0.1.
					mov			XBR1, #11011110B	; T0 P0.2;INT0 P0.3;T1 P0.4;INT1 P0.5;T2EX P0.6;SYSCLK P0.7			  				
					mov			XBR2, #01000000B	; CrossBar enable.

					; Set P0,P1 et P2 open-drain.	 
					mov 		PRT1CF,#01001111B 
					mov 		PRT2CF,#00000000B
					mov 		PRT0CF,#10000000B

					;Oscillateur: choix du quartz externe a 12 MHz.
					mov			OSCXCN, #67h 
					mov			OSCICN, #08h 
;-----------------------------------------------------------
					;Initialisations du TP.
				

					ret

;********************************************************************
; End of file.
END

⌨️ 快捷键说明

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