8051 MCU serial port expansion LED display interface and application

Publisher:温柔浪漫Latest update time:2015-03-20 Source: diangon Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
In the 8051 single-chip microcomputer application system, the serial interface can be used to expand the parallel I/O port (assuming that the serial port works in the shift register, mode 0 state). The serial shift output connected to the output shift register 74LS164 can expand an 8-bit parallel output port to connect an LED digital tube for static display.
     As shown in the figure. There are 6 common anode LED digital tubes, programmed to display 200304.

 C51 software design:
     # include //preprocessing
     # include
     unsigned char code ledcode[11]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x88}; //font encoding
     unsigned char code buf[6]={0x2,0x00,0x00,0x03,0x00,0x04}; //200304
     void main(void) //main function
     {
     unsigned char idata i,k;
     SCON=0x00; //serial port initialization
     ES=0;
     EA=0; //disable interrupt
     for(i=0;i<6;i++)
     {
     TI=0;
     k=buf[i];
     k=ledcode[k];
     SBUF=k;
     while(TI==0);
     }
     while(1);
     }
Reference address:8051 MCU serial port expansion LED display interface and application

Previous article:Four Misunderstandings of Learning 51 Single Chip Microcomputer
Next article:8051 MCU serial port expansion matrix keyboard interface and application

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号