74ls164 made of C51 program

Publisher:冰山火影1977Latest update time:2012-08-22 Source: 51heiKeywords:74ls164 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

c51 74hc164--165--595c51

The 51 single-chip microcomputer drives the 74ls164 marquee. The advantage is that only two ports are used to achieve it. The circuit is shown in the figure below:
Click to browse the next page

#include
#include 
#define uint unsigned int
#define uchar unsigned char
sbit dat=P2^6;
sbit clk=P2^7;
uchar ii;
uchar code seg7code[]=
{0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80,0x00,0xff}; //0-9,-, all destroyed
void sendbyte(uchar seg)
{
 uchar num,c;
 num=seg7code[seg];
 for(c=0;c<8;c++)
 {
 dat=num&0x80;
 num=_crol_(num,1);
 clk=0;
 clk=1;
 }
}
void delayms(int ms)
{
 uchar mi,mj;
 for(;ms>0;ms--)
  for(mi=6;mi>0;mi--)
   for(mj=82;mj>0;mj--);
}
void main()
{
 for(ii=0;ii<10;ii++)
 {
 sendbyte(ii);
 delayms(200);
 }
}
Keywords:74ls164 Reference address:74ls164 made of C51 program

Previous article:MCU drives ds18b20 four-way temperature patrol detection program
Next article:Using C language to realize key-controlled colored light system

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

Development and Application of AT89S51 Single Chip Microcomputer Experimental System
At present, the application of single-chip microcomputers has penetrated into various fields, and the development of single-chip microcomputer technology has also changed with each passing day. As an application-oriented discipline with strong practicality, single-chip microcomputer research and development and teachin
[Microcontroller]
Development and Application of AT89S51 Single Chip Microcomputer Experimental System
Using 74LS164 to expand C8051F's serial port output to parallel port output
System functions Use 74LS164 to expand the AVR's serial port output to parallel port output. hardware design Schematic diagram of the control circuit of the serial output expansion chip 74LS164 parallel output software design The following part is copied from TXT and copied to the web page. There are many spac
[Microcontroller]
Using 74LS164 to expand C8051F's serial port output to parallel port output
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号