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

📄 prog44.asm

📁 包括了各种常用的8051单片机的程序
💻 ASM
字号:
;  PROG44 - Making Music from an AT89C2051  
;
;  Simple Application to Test Powerdown/Power Up Code.
;
;  This Application after power up, places the AT89C2051 into 
;   "Power Down" mode and Sees if the Transistor Pull-Up Circuit Can Turn it
;   Back On.  
;
;  Myke Predko
;  98.05.29
;
;  Hardware Notes:
;  AT89C2051 is used as the Microcontroller
;   - Oscillator Speed is 10 MHz
;  P1.0 is used as a Pull Down to Ground
;  P1.3 is connected as a Pull Up to the Reset Transistor's Base
;  P1.7 is Used as a Voltage Source for Reset
;  
;  P3.0 Is the Start Up LED
;  P3.1 Is a Reset From Power Down Indicator LED

;  Constant Declarations

;  Variable Declarations


;  Macros


;  Mainline
 org 0                          ;  Execution Starts Here
MainLine:                       ;  Mainline of the Program

  clr     P1.7                  ;  Make Sure Reset Can't Be Set

  xrl     0,#055h               ;  Does R0 = 055h?
  xrl     1,#0AAh               ;  Does R1 = 0AAh?
  xrl     2,#000h               ;  Does R2 = 000h?
  xrl     3,#0FFh               ;  Does R3 = 0FFh?

  mov     A,R0
  orl     A,R1
  orl     A,R2
  orl     A,R3

  jz      WarmBoot              ;  If they Are, Then Warm Boot

  mov     R0,#055h              ;  Setup for the Warm Boot
  mov     R1,#0AAh
  mov     R2,#000h
  mov     R3,#0FFh

  clr     P3.0                  ;  Turn On the Power Up LED
  setb    P3.1

  clr     P1.0                  ;  Enable the Reset Condition
  setb    P1.7

  orl     PCON,#%00000010       ;  Set the Power Down Bit in PCON

  ajmp    Mainline              ;  After Power Up, Jump to Mainline (if No Reset)


WarmBoot:                       ;  Have Executed Here After Reset

  setb    P3.0                  ;  Indicate the Situation
  clr     P3.1

  clr     P1.0                  ;  Can We Bounce Back and Forth?
  setb    P1.7

  orl     PCON,#%00000010       ;  Set the Power Down Bit in PCON

  ajmp    Mainline

⌨️ 快捷键说明

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