;4-digit common cathode digital tube displays 0123
Here is a Holtek MCU digital tube program for your reference: http://www.51hei.com/mcu/1349.html , with both the circuit diagram and the program.
Reference address:Hetai MCU digital tube display control program
;Digital tube segment code connection method A-PD0, B-PD1....G-PD6, H-PD7
;Digital tube bit code connection method OM0-PC0...COM4-PC3
;Purpose:
;1. Look up the table
;2. Indirect addressing
include HT66F50.inc
ORG0000H
JMPA1
ORG0020H
Q1:
DC03FH; 0
DC006H; 1
DC05BH; 2
DC04FH; 3
DC066H; 4
DC06DH; 5
DC07DH; 6
DC007H; 7
DC07FH; 8
DC06FH; 9
DC077H; A
DC07CH; B
DC039H; C
DC05EH;D
DC079H; E
DC071H; F
A1:
MOVA,0;Display content
MOV[8AH],A; the first digital tube segment code display content register
MOVA,1;Display content
MOV[8BH],A; The second digital tube segment code display content register
MOVA,2;Display content
MOV[8CH],A; The third digital tube segment code displays the content register
MOVA,3;Display content
MOV[8DH],A; The fourth digital tube display content register
MOVA,08H; select data according to CP1C register setting requirements
MOVCP1C,A; Set the PC port to be the I/0 port instead of the interrupt port
CLRPCC; Set the PC port as the output port
CLRPDC; Set the PD port as output port
MOVA,1; Set the initial display bit code to display the first bit
MOV[80H],A; bit code register
MOVA,8AH; set the corresponding first bit segment code register
MOVMP0,A; indirect register pointer
A2:
CLRPC; Clear PC (clear screen)
MOVA,Q1; data table address
CLR TBHP; clear the high bit of the data table address, otherwise an error will occur
CLR TBHP; clear the high bit of the data table address, otherwise an error will occur
ADDA, IAR0; Use the indirect register to find the address of the data table where the segment code to be displayed is located
MOVTBLP,A; table pointer register TBLP
TABRDPD; Look up the table and store the data in the PD port register
MOVA,[80H]; bit code register
MOVPC,A; store the bit code register value to the PC port register
; The segment code and bit code are both available, so the digital tube is lit
INCMP0; indirect register pointer plus 1 points to the next segment code register
RL[80H]; Left shift code register controls the next digital tube
SNZ[80H].5; Determine whether the 4 digital tubes are controlled
JMPA2; No return to continue
MOVA,1; if yes, reinitialize register data
MOV[80H],A;
MOVA,8AH;
MOVMP0,A;
JMPA1;
END
Here is a Holtek MCU digital tube program for your reference: http://www.51hei.com/mcu/1349.html , with both the circuit diagram and the program.
Previous article:Hetai MCU external interrupt program
Next article:Design and control of intelligent car based on photoelectric sensor
Recommended Content
Latest Microcontroller Articles
He Limin Column
Microcontroller and Embedded Systems Bible
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
MoreSelected Circuit Diagrams
MorePopular Articles
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
MoreDaily News
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
Guess you like
- National College Student Electronic Design Competition Open Source Flight Control Data Album: APM Learning Materials
- Annual review: 2019 TI training course highlights, good reviews and gifts!
- Which development environment do I use for C8051F58x/F59x?
- C2000 CLA FAQ: Accessing Peripherals
- TI MSP430F55xx ultra-low-power MCUs enable smarter connectivity
- Design of small signal precision rectifier circuit
- EEWORLD University ---- Computer Architecture (Huazhong University of Science and Technology)
- Innovative application of capacitive touch buttons in the elevator industry
- The role of inductance
- EEWORLD University ---- Motor Control