//This program function is: manual counter, when the button is pressed, the count is increased by one, and the LCD displays once (the result of the increase).
//Source program and proteus download address: http://proteus.5d6d.com/thread-9003-1-1.html
ORG 0000H
LJMP START
ORG 0030H
START: MOV DPTR,#TABLE ; Set the first address of the segment code
MOV R0,#00H ; Store the initial value of the count in R0
MOV P0,#3FH
MOV P2,#3FH ; When reset, the digital tube displays 0
S1: INC R0
CJNE R0,#100,S2
MOV R0,#00H
S2: JB P3.3,$ ; Wait for the button
LCALL DELAY ; Eliminate jitter delay
JB P3.3,S2
S3: MOV A,R0
MOV B,#10
DIV AB ; Separate the ones and tens of the count value
MOVC A,@A+DPTR
MOV P0,A
MOV A,B
MOVC A,@A+DPTR
MOV P2,A
JB P3.3,S1 ; Wait for the key to pick up
LJMP S3
DELAY: MOV R5,#20H ; Delay 10ms
D1: MOV R6,#250
DJNZ R6,$
DJNZ R5,D1
RET
TABLE: DB 3FH,06H,5BH,4FH,66H; 0-9 seven-segment code value
DB 6DH,7DH,07H,7FH,6FH
END
Previous article:Nested assembly method in C51
Next article:8*8 dot matrix display program (assembly)
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- AD17 There is a problem with copper laying on a four-layer board
- Static Timing Analysis Basics and Applications
- How to use Segger Embedded Studio to develop the HPM6750?
- 485 Point-to-Many Communication Problem
- The program of the microcontroller is lost, what's going on?
- EEWORLD University Hall----Audio Amplifier for Smart Speaker
- Qorvo Expands 1.8 GHz DOCSIS 4.0 Portfolio
- Gain Circuit Compensation
- [Hua Diao Experience] 01 Getting Started with Xingkong Board
- Discharge needle under the common mode inductor