Hetai MCU digital tube display control program

Publisher:532829319hmkLatest update time:2015-05-12 Source: 51hei Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
;4-digit common cathode digital tube displays 0123
;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  
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.
Reference address:Hetai MCU digital tube display control program

Previous article:Hetai MCU external interrupt program
Next article:Design and control of intelligent car based on photoelectric sensor

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号