Design of single chip microcomputer in dynamic digital display circuit

Publisher:beta13Latest update time:2014-01-20 Source: dqjsw Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  1. Experimental tasks

  As shown in the figure, the P0 port is connected to the character code pen segment of the dynamic digital tube, the P2 port is connected to the digit selection end of the dynamic digital tube, and P1.7 is connected to a switch. When the switch is connected to a high level, "12345" is displayed; when the switch is connected to a low level, "HELLO" is displayed.

  2. Circuit diagram

Circuit Schematic

  3. Hardware connections on the system board

  (1. Connect P0.0/AD0-P0.7/AD7 in the "MCU System" area to ports a-h in the "Dynamic Digital Display" area using an 8-core cable;

  (2. Connect P2.0/A8-P2.7/A15 in the "MCU System" area to the S1-S8 ports in the "Dynamic Digital Display" area using an 8-core cable;

  (3. Connect the P1.7 port in the "MCU System" area to the SP1 port in the "Standalone Keyboard" area with a wire;

  4. Programming content

  (1. Dynamic scanning method

  The dynamic interface uses a method in which each digital tube is displayed in turn in a cycle. When the frequency of the cyclic display is high, the flickering display phenomenon cannot be seen by utilizing the retention characteristics of the human eye. This display requires one interface to complete the output of the glyph code (glyph selection) and another interface to complete the lighting of each digital tube in turn (digit selection).

  (2. When performing digital display, 8 display buffers should be opened for the display unit, and each display buffer is loaded with different display data.

  (3. For the displayed glyph code data, we use the table lookup method to complete it.

  5. Flowchart

Block Diagram

  6. Assembly source program

  ORG 00H

  START: JB P1.7,DIR1

  MOV DPTR,#TABLE1

  SJMP DIR

  DIR1: MOV DPTR,#TABLE2

  DIR: MOV R0,#00H

  MOV R1,#01H

  NEXT: MOV A,R0

  MOVC A,@A+DPTR

  MOV P0,A

  MOV A,R1

  MOV P2,A

  LCALL DAY

  INC R0

  RL A

  MOV R1,A

  CJNE R1,#0DFH,NEXT

  SJMP START

  DAY: MOV R6,#4

  D1: MOV R7,#248

  DJNZ R7,$[page]

  DJNZ R6,D1

  RET

  TABLE1: DB 06H,5BH,4FH,66H,6DH

  TABLE2: DB 78H,79H,38H,38H,3FH

  END

  7. C language source program

  #include

  unsigned char code table1[]={0x06,0x5b,0x4f,0x66,0x6d};

  unsigned char code table2[]={0x78,0x79,0x38,0x38,0x3f};

  unsigned char i;

  unsigned char a,b;

  unsigned char temp;

  void main(void)

  {

  while(1)

  {

  temp=0xfe;

  for(i=0;i<5;i++)

  {

  if(P1_7==1)

  {

  P0=table1[i];

  }

  else

  {

  P0=table2[i];

  }

  P2=temp;

  a=temp<<(i+1);

  b=temp>>(7-i);

  temp=a|b;

  for(a=4;a>0;a--)

  for(b=248;b>0;b--);

  }

  }

Reference address:Design of single chip microcomputer in dynamic digital display circuit

Previous article:Design of Programmable Logic Device and Single Chip Microcomputer in Dual Controller
Next article:How to learn MCU programming

Recommended ReadingLatest update time:2024-11-16 19:54

C51 dynamic display method of digital tube
Code: #include reg52.h #define uchar unsigned char #define uint unsigned int sbit dula=P2^6; sbit wela=P2^7; uchar num,dunum,wenum; uchar code table_du ={ 0x3f,0x06,0x5b,0x4f,0x66,0x6d, 0x7d,0x07,0x7f,0x6f,0x77,0x7c, 0x39,0x5e,0x79,0x71}; //Digital tube segment selection code uchar code table_we ={ 0xfe,0xfd,0xfb
[Microcontroller]
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号