Analysis of the effect of 8 segments of single-chip digital tube

The digital tube consists of 8 segments, which can be directly controlled as 8 individual LED lights labeled a, b, c, d, e, f, g, and dp. As shown in Figure 5-3, when only the b and c segments are lit, while all other segments remain off, the digital tube displays the number 1. In this case, the value of P0 is 0b11111001, which is equivalent to 0xF9 in hexadecimal. To observe this effect, we can write a simple program to control the display. #include sbit ADDR0 = P1^0; sbit ADDR1 = P1^1; sbit ADDR2 = P1^2; sbit ADDR3 = P1^3; sbit ENLED = P1^4; void main() { ENLED = 0; // Enable U3, select the first digital tube DS1 ADDR3 = 1; ADDR2 = 0; ADDR1 = 0; ADDR0 = 0; P0 = 0xF9; // Light up segments b and c to display the number 1 while(1); // Infinite loop to keep the display on } After compiling and downloading this program to the microcontroller, you should see the number 1 displayed on the rightmost digital tube. By changing the value of P0, we can display different numbers on the digital tube. Each number corresponds to a specific pattern of the 8 segments, and this mapping is known as the digital tube's truth table. For example, if we want to display the number 2, we need to set P0 to 0x86 (binary 10000110), which lights up segments a, b, g, e, and d. Similarly, for each digit from 0 to 9, there is a corresponding hexadecimal value that controls the correct segments. By referring to the truth table provided in Table 5-7, we can determine the appropriate value for P0 to display any desired digit. Note that the truth table does not include the decimal point (dp) segment. If you want to display a decimal point, you would need to set the dp segment accordingly by adjusting the value of P0. In conclusion, understanding how to control the digital tube using the P0 port and its corresponding truth table is essential for displaying numbers on the device. This knowledge allows us to create more complex programs that can show various digits and even characters, depending on the configuration of the segments.

Bare Copper Wire

About Bare Copper Wire

Good conductivity; Strong anticorrosion; Long service life; Lowest price; Easy installation

Bare Copper Wire is used as flexible connector in electric transmission and distribution appliance(such as volt transformer, electric

stove),electronic equipment and thyristor. Underground Electrical Wire also could be used for grounding wire in electric working.

Also, it can be manufactured accordingto customer's drawings and demands.

Bare Copper Wire

1. Professional Operation Experience
2. The Sizes All Can Be Customised
3. Sample For Your Reference Available
4. Low MOQ, Low Price
5. Safe Packing & Prompt Delivery
6. Quality Guaranted: ISO9001:2008, All Kinds of Test

Bare Copper Wire,Bare Copper Wire Solid,Copper Wire Bare Copper Wire,Pure Copper Wire Bare Copper

HENAN HUAYANG ELECTRICAL TECHNOLOGY GROUP CO.,LTD , https://www.huaonwire.com

Posted on