Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Application of 74HC13838 Decoder in single Chip Microcomputer

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

When we design the single-chip microcomputer circuit, the number of IO ports of the single-chip microcomputer is unlimited, and sometimes it can not meet our design requirements. For example, our STC89C52 has a total of 32 IO ports, but in order to master more devices, we have to use some core digital chips. This kind of digital chip uses complex output logic to master the input logic, such as 74HC138. Figure 3-15 is a use of 74HC138 on our truth diagram.

Figure 3-15 74HC138 use reason diagram

Judging from this name, the 38 decoder translates three output forms into eight input forms. As you can see from figure 3-15, the 74HC138 has a total of six output pins, but the four, five, and six pins are the enable pins. Enable pins are the same as the OE pins we talked about 74HC245 before. if these three pins do not meet the regular output request, Y0 to Y7 will always be high no matter what the level shape of your output 1, 2, 3 pin is. So if we want to make this 74HC138 normal task, ENLED who output status must output low level, ADDR3 status must output high level, these two positions are to enable master port. I wonder if anyone can remember that the program in our second lesson has these two sentences: ENLED = 0placeADDR3 = 1; that is, to master and enable this 74HC138.

Most of this kind of logic chips have enable pins, which can meet the request, so it is necessary to study and master the logic. With regard to the pins of digital devices, if a pin is output, there are two forms: 0 and 1. About the two pin output time, there will be 00, 01, 10, 11 these four forms, then about the three output time, will show 8 forms, everyone can see the following truth table-figure 3-16, where the output is the order of A2, A1, A0, the input is the order of Y0, Y1.Y7.

Figure 3-16 74HC138 truth table

As can be seen from figure 3-16, in any output form, as long as one input pin is low, most of the other pins are high. In the following circuit, we have seen that the master switch Q16 base of 8 LED lights is LEDS6, that is, when Y6 inputs a low level, it can keep the transistor Q16. From the result of the desire input on the right, we can deduce that the output form of our A2, A1, A0 should be 110, as shown in figure 3-17.

Figure 3-17 all circuit diagrams of LED lights

So let's go through the process of lighting LED lights again. First of all, let's take a look at 74HC138. We want LEDS6 to turn on the transistor Q16 at low level, so ENLED = 0 / ADDR3 = 1; make sure that 74HC138 is enabled. Then ADDR2 = 1; ADDR1 = 1; ADDR0 = 0; so it is guaranteed that the transistor Q16 is old-fashioned and the 5V power supply is added to the LED.

And the left side of the 74HC245 is mastered through the P0 port, we make the P0.0 pin equal to 0, that is, DB_0 equals 0, and the right DB0 equals to DB_0, which is also 0, so in this row of 8 small LED lights, as long as there is a pressure difference between the rightmost small light and 5V, there will be a current difference, and there will be a smooth current flow through our LED2.

We can see on the left side of the 74HC245 that it is directly connected to the P0 port, but where is the ADDR0 ~ ADDR3 connection of the 74HC138? Take a look at figure 3-18.

Figure 3-18 shows the selection jumper for decoding and stepper motors

The jumper is a device that everyone will often come into contact with in the future. it is a row of two or three needles that lean together, and then the two adjacent needles can be connected with a device called a jumper cap. Its influence is the influence of the wire, and we can complete the switching of the connecting wire through the jumper cap. As shown in figure 3-19.

Figure 3-19 jumper diagram

As can be seen from the figure, the jumper cap itself can occupy the position of two stitches, and now the needles on the right and both ends are connected together. This is accomplished by connecting P1.0 and ADDR0 in figure 3-18, P1.1 and ADDR1, P1.2 and ADDR2, P1.3 and ADDR3. In this way, we can have a thorough understanding of the procedure of our second lesson.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report