Using the MCU serial port to expand 16 LEDs

Publisher:BlissfulSunriseLatest update time:2017-10-14 Source: eefocusKeywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Title: Use the serial port of a single-chip microcomputer to expand 16 light-emitting diodes. Draw a circuit diagram and write a program to make the 16 light-emitting diodes emit light in different sequences (the time interval between light-emitting diodes is 1s).

Answer: 

MOV SCON,#00H


CLR P1.1


MOV R7,#16


MOV A,#10000000B 

LOOP: MOV SBUF,A 

              JNB TI,$


              ACALL DELAY1S


              R A


              DJNZ R7,LOOP 

              RET



Picture 1


Keywords:MCU Reference address:Using the MCU serial port to expand 16 LEDs

Previous article:Write a microcontroller program to initialize the serial port and read the data from the receive buffer
Next article:Write a data transmission program for single-chip serial communication

Recommended ReadingLatest update time:2024-11-16 15:56

MCU counter function experiment program
1. Experimental requirements The internal timer counter of 8031 ​​works in counter mode and mode 1, and counts the P3.4 (T0) pin. Use T1 of 8031 ​​as a timer, interrupt once every 50ms, and see how many pulses come every 0.50ms in T0, and display their values ​​on the 74LS273 driver LED light as binary numbers, and
[Microcontroller]
MCU counter function experiment program
Hidden Errors in Using ACC in the for Loop on MCU
I recently wrote a few programs, one was to use a 51 microcontroller to read the voltage value of an analog-to-digital sensor adc0832, and the other was to read the time value of a ds1302. The result was that the reading was always 0. I debugged it for nearly a week, and modified a sentence that I thought could not be
[Microcontroller]
RTOS-AVRX application of AVR microcontroller
Introduction   With the development of technology, the design and application of embedded systems have had a great impact on people's lives and will gradually change people's future lifestyles. Developing applications on a specific operating system allows developers to ignore many underlying hardware details, making
[Microcontroller]
Application of CRC error checking method in serial communication between PC and 8031 ​​microcontroller
With the increasing power of data acquisition systems and the popularity of microcomputers, industrial control applications using microcomputers for data communication are becoming more and more widespread in modern industry. Especially in large-scale high-precision data acquisition systems, data analysis and calcul
[Microcontroller]
Application of CRC error checking method in serial communication between PC and 8031 ​​microcontroller
51 MCU serial communication ---- self-study notes
1. Serial communication 1.1. The basis of computer communication Computer communication: It is the combination of computer technology and communication technology to complete the information exchange between computers and external devices or between computers. It can be divided into two categories: parallel communicat
[Microcontroller]
51 MCU serial communication ---- self-study notes
Programmable filter based on single chip microcomputer and FPGA design
  With single-chip microcomputer and programmable logic device (FPGA) as the control core, a programmable filter is designed to realize the functions of small signal programmable amplification, programmable adjustment of filter cutoff frequency and amplitude-frequency characteristic test. The amplification module is re
[Microcontroller]
Programmable filter based on single chip microcomputer and FPGA design
Teach you the difference between DSP and MCU
This article briefly introduces the difference between DSP and MCU . 1. Different memory structures The microcontroller uses a von Neumann memory structure, in which there is only one memory space connected to the processor core through a set of buses (an address bus and a data bus). Most DSPs use the Harvard stru
[Analog Electronics]
The rise of Renesas MCU in recent years
Friends who often read my official WeChat public account articles should have noticed that I have shared a lot about Renesas MCU this year. Again, you will find that Renesas Electronics has developed rapidly in recent years, with a large number of online and offline activities, and new MCU products cons
[Automotive Electronics]
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号