AVR MCU-Digital Tube 2 (Dynamic Scanning)

Publisher:Xiaohan521Latest update time:2015-07-13 Source: 51hei Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
The static scanning of digital tubes was mentioned above, but in most cases, it is dynamic scanning. The characteristic of dynamic display is that the segment selection lines of all digital tubes are connected in parallel, and the bit selection line controls which digital tube is effective. In this way, there is no need to equip each digital tube with a latch, which greatly simplifies the hardware circuit. The selected digital tube adopts dynamic scanning display. The so-called dynamic scanning display is to send the font code and the corresponding bit selection to each digital tube in turn, and use the afterglow of the light-emitting tube and the visual retention of the human eye to make people feel as if each digital tube is displaying at the same time. The brightness of dynamic display is worse than that of static display, so when selecting the current limiting resistor, it should be slightly smaller than that in the static display circuit.

 The schematic diagram of this program:


 

Source program:

/*
 * shumaguan1.c
 *
 * Created: 2011-6-24 20:45:16
 *  Author: ZYIN
 */

#include
char temp;
int i,h,num,k;

unsigned char led0[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
       0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,
       0x7F,0x6F,0x77,0x7C,0x39,0x5E,0x79,0x71,
       0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};

void delay(void)
{
 unsigned int j;
 j=1000;
 while(j--);
}

int main(void)
{
 DDRF=0xff;
 PORTF=0b00000110;
 DDRA=0xff;
 DDRC=0xff;
    while(1)
    {
   
  for(k=0;k<45;k++)
  {
   temp=0b00000001;
   for(i=0;i<8;i++)
   {
    num=i+h;
    PORTA=temp;
    PORTC=~led0[num];
    delay(); 
    temp<<=1;
   }
   }
  h++;
  if(h==24)
  h=0;
   }
}

Effect picture:

 

 
 
Reference address:AVR MCU-Digital Tube 2 (Dynamic Scanning)

Previous article:AVR microcontroller + 12864 LCD animation display
Next article:AVR MCU-Flowing Light 2

Latest Microcontroller Articles
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号