Microcontroller Learning Notes 2---Debugging Digital Tube Circuit

Publisher:数据旅人Latest update time:2021-07-20 Source: eefocusKeywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

In the previous section, we explained why we wanted to do such a project, and we proposed requirements, and based on the specific requirements analysis, we converted them into hardware design and drew a specific schematic diagram. However, there are still many issues that have not been explained clearly, such as the pin determination of the digital tube. Which 8 of the 12 pins are the segment code of the digital tube? Which 4 are the bit code of the digital tube? We didn't know this when we just bought it, and we still need to measure it. This requires the use of a multimeter. Set the multimeter to the diode position. The diode has unidirectional conductivity. We know that the digital tube is composed of 8 small lights. If we buy a common anode digital tube, it is as shown in the following figure:

If we connect the red probe of the multimeter to any one of the 12 pins, and the black probe to any one of the remaining 11 pins, if the small light is on, it means that the pin of the red probe is the bit code of the digital tube, and we have four digital tubes, so there are 4 bit codes, which can be found by lighting the small light. After finding the bit code, write it down, and then we start to find the segment code of the digital tube one by one. The segment code of the digital tube is arranged in the order shown in the figure below:

The anodes of each small lamp are connected together, so it is called a common anode digital tube. DB0-DB7 are the cathodes of the 8 small lamps respectively. Has anyone noticed that there is no DB7? DB7 is a decimal point, which is generally not added in the schematic diagram.


Now that we have figured out the pin definition, we need to look at the data sheets of the relevant components and start drawing the package. Generally, the components need to be purchased and measured with a vernier caliper. Many components have data sheets provided by the manufacturer, which have package dimensions. We just need to draw one according to the data sheets. There are also some common packages.


Drawing components requires drawing software. Many people used 99SE in the past. I used this old software when I was in school. Many old engineers still use it. I am used to using AD13, which is more powerful. Of course, the installation file is relatively large and the computer requirements are relatively high. In fact, it is a tool. The one that suits you is good. Since this document mainly focuses on the study of single-chip microcomputers, as for the production of schematics and PCBs, as well as schematic packaging, PCB packaging, wiring, etc., a separate post will be opened in the future. This is not something that can be learned with a simple introduction, so this process is omitted here. If you need it, you can search for relevant tutorials to learn. Okay, the drawn PCB is shown in the figure below: DRC online check, after confirming that there are no errors, we can send it to the PCB manufacturer to make a sample. Post a PCB3D photo. If you want to make one, you can refer to the component layout diagram and component shape we provide, draw one by yourself, and practice.

It takes about 3-7 days to get the drawn PCB for proofing.

After getting the PCB, we start soldering. Of course, we don’t solder all the components, but test whether the PCB is defective or the packaging position of the components is correct. Because we haven’t programmed yet, if we find any problems in the process, we should correct them in time to avoid similar problems next time. We try to solder the LQFP32 microcontroller, which requires caution. Then solder the digital tube, current limiting resistor, voltage stabilizing chip components, etc. At this time, we can write a test program, which is downloaded through the reserved serial port. The function of the program is to light up all the digital tubes.


The difference between microcontroller and general programming is that microcontroller belongs to hardware programming. We know that LED0-LED3 are connected to P3.3, P3.4, P3.6, and P3.7 pins respectively, and DB0-DB7 are connected to P2 port.


OK, now that we know the hardware, we can use the KEIL4 compiler software to program in C language. Let's write a simple program to test that all digital tubes are fully lit: We use KEIL4 to create a new project and name it LED. How to create a new KEIL4 project and download and debug it is the content of the next post. Let's ignore it for now. The written program is as follows:


After compiling the program and downloading it to the target board, we can see that all the digital tubes are lit up. The actual hardware effect is as follows:

Although it achieved our intended purpose, this program is still imperfect.

Okay, this is the end of this post. In the next post, we will talk about how to create a new KEIL project and the steps to download and compile it.

Keywords:MCU Reference address:Microcontroller Learning Notes 2---Debugging Digital Tube Circuit

Previous article:51 Single Chip Microcomputer (I)—— Introduction to 51 Single Chip Microcomputer
Next article:Microcontroller Learning Notes 10 Using thermistors to collect temperature

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号