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

📄 f52x_blinky.asm

📁 8051试验程序 基础教材
💻 ASM
字号:
;-----------------------------------------------------------------------------
; Blink.ASM
;-----------------------------------------------------------------------------
;  Copyright (C) 2006 Silicon Laboratories, Inc.
;  All rights reserved.
;
;  FILE NAME   :  BLINK.ASM 
;  DATE        :  19 Sep 2006
;  TARGET MCU  :  C8051F52x/53x 
;  DESCRIPTION :  This program illustrates how to disable the watchdog timer,
;                 configure the Crossbar, configure a port and write to a port
;                 I/O pin.
;
; 	NOTES: 
;
;-----------------------------------------------------------------------------

#include <ioC8051F520.h>               ; Include register definition file.

;-----------------------------------------------------------------------------
; EQUATES
;-----------------------------------------------------------------------------

GREEN_LED   equ   P1.3                 ; Green LED: '1' is ON	

;-----------------------------------------------------------------------------
; RESET and INTERRUPT VECTORS
;-----------------------------------------------------------------------------

            ; Reset Vector
            ASEGN CSEG01:CODE,0
            ljmp Main                  ; Locate a jump to the start of
                                       ; code at the reset vector.

;-----------------------------------------------------------------------------
; CODE SEGMENT
;-----------------------------------------------------------------------------


	    RSEG BLINK:CODE ; declare new code segment

Main:
            ; Disable the WDT.
            anl   PCA0MD, #NOT(040h)   ; clear Watchdog Enable bit

            ; Enable the Port I/O Crossbar
            mov   XBR1, #40h
            orl   P1MDOUT, #08h        ; make LED pin output push-pull
            orl   P1MDIN, #08h         ; make LED pin input mode digital

            ; Initialize LED to OFF
            clr   GREEN_LED

            ; Simple delay loop.
Loop2:      mov   R7, #01h			
Loop1:      mov   R6, #00h
Loop0:      mov   R5, #00h
            djnz  R5, $
            djnz  R6, Loop0
            djnz  R7, Loop1
            cpl   GREEN_LED            ; Toggle LED.
            jmp   Loop2

;-----------------------------------------------------------------------------
; End of file.

	    END

⌨️ 快捷键说明

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