60S countdown assembly language for single chip microcomputer

Publisher:MysticalEssenceLatest update time:2015-07-07 Source: 51heiKeywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
ORG 0000H  
   AJMP MAIN
   ORG  000BH
   AJMP INTT0
   ORG 0030H
MAIN: MOV R7,#60
      MOV R6,#00H
   MOV DPTR,#TABLE
   MOV TMOD,#01H       
          MOV TL0, #0B0H
   MOV TH0,#3CH ; Set the timer working mode and initial value
   SETB OF
   SETB ET0
   SETB TR0
NEXT: MOV A,R7
      MOV B,#0AH
   DIV AB
   SETB P1.3
   MOVC A,@A+DPTR
   MOV P0,A
   CLR P1.4 ; turn on the position display
   ACALL DELAY
   MOV A,B
   SETB P1.4
   MOVC A,@A+DPTR
       
   MOV P0,A
   CLR P1.3 ; turn on ge position display
   ACALL DELAY
   CJNE R6,#14H,NEXT
   MOV R6,#00H
   DEC R7
   CJNE  R7,#0FFH,NEXT
   SJMP MAIN
INTT0:MOV TL0,#0B0H ;Interrupt service routine
   MOV TH0, #3CH
   INC R6
   RARELY
DELAY:MOV R5,#02H ; Delay subroutine
 LOOP:MOV R4,#02H
   DJNZ R4,$
   DJNZ R5,LOOP
   RIGHT
TABLE:DB 0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,90H
   END
Keywords:MCU Reference address:60S countdown assembly language for single chip microcomputer

Previous article:From software simulation to hardware circuit
Next article:10-minute countdown program for single-chip microcomputer (with pause)

Recommended ReadingLatest update time:2024-11-16 20:47

MCU signal pulse width measurement program + Proteus simulation diagram
The reference textbook was modified a bit, and a display program was added. The digital tube can only display 4 bits, and the maximum pulse width can theoretically display 9999us. Interested students can expand it, add digital tubes, improve the algorithm, calculate the average value multiple times, etc. The simulatio
[Microcontroller]
MCU signal pulse width measurement program + Proteus simulation diagram
51 microcontroller control stepper motor hardware connection part
1. Summary: This case explains the hardware connection part of the stepper motor controlled by the 51 microcontroller. Later, we will explain the microcontroller program, S-curve acceleration and deceleration method, host computer and other related content. 2. Functional schematic diagram: 2.1, 51 microcontroller: ①
[Microcontroller]
51 microcontroller control stepper motor hardware connection part
Single chip microcomputer multiplication circuit
The microcontroller multiplication circuit can feed back different X and Y inputs, or use a simple single-ended ground input. The connection of the input determines the polarity of the output.
[Power Management]
Single chip microcomputer multiplication circuit
Operation of 16-bit INT data in 8-bit microcontroller
There are no 16-bit operation instructions in 8-bit microcontrollers. All int data must be operated separately by two bytes. The method used is different, the generated code is different, and of course the efficiency is also different. Operating on 16-bit numbers through pointers can produce efficient code.       Fo
[Microcontroller]
51 MCU-Function Encapsulation
1. Clean code Generally, the reading of single-chip microcomputer programs starts with the main function. The program writing method in the previous lecture is not concise in the main function, which affects the efficiency of reading the code. Sometimes we only need to know what a statement means, so we encapsulate th
[Microcontroller]
51 MCU-Function Encapsulation
AVR single chip passive infrared alarm experiment
The alarm consists of an infrared transmitter, receiver, buzzer and LED indicator. Under normal circumstances, the green LED flashes constantly, indicating that the monitored area is normal. Once someone breaks into the monitored area, the green LED goes out, the red LED flashes quickly, and the buzzer sounds an ala
[Microcontroller]
AVR single chip passive infrared alarm experiment
Course Design of Single Chip Microcomputer 00 to 99 Stopwatch
This is the MCU stopwatch course design I made last month. This course design is to realize a stopwatch from 00 to 99 seconds, and it has start and reset functions. It took a week. The attachment contains the MCU source program of the stopwatch, the proteus simulation circuit diagram and the course design document. I
[Microcontroller]
Course Design of Single Chip Microcomputer 00 to 99 Stopwatch
Analysis of the driving capability and pull-up resistor of 51 series MCU IO pins
When the microcontroller outputs a low level, external devices are allowed to input current into the microcontroller pins. This current is called "injection current" and the external circuit is called "injection current load". When the microcontroller outputs a high level, external devices are allowed to pull curren
[Microcontroller]
Analysis of the driving capability and pull-up resistor of 51 series MCU IO pins
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号