(6) Compilation to realize digital display

(6) Compilation to realize digital display

1. Whether the decoder is used or not

Insert picture description here
The upper part uses the decoder, the lower part does not use the decoder
1) The code of the decoder is not used:
P2, 0, P2.1 are the plus button, and the minus button
LED sequentially stores the digital display pattern.
Insert picture description here
Insert picture description here
2) Use digital tube
Insert picture description here
Insert picture description here

2. Two-digit digital tube static drive

Insert picture description here
Insert picture description here

Insert picture description here
Put the tens place of the decimal number to A and the ones place to B through DIV, and then output the digital tube patterns in the TABLE.

3. Dynamic display of digital tube

Insert picture description here

Insert picture description here
P1.0 to P1.3 connect the chip select signal, P1.4 to P1.7 connect the decoder.
Chip select signal function: For example, when the first digit displays 8, all 4 digits are 8 at this time, and the first 8 is controlled by the chip select signal to display.
Program: (take output 8051 as an example)
Insert picture description here

4. The two-digit digital tube starts from 0 and increases to 99

Insert picture description here

Insert picture description here

Insert picture description here
Insert picture description here

5. Use 74138 chip select to display 8 bits

Insert picture description here
Insert picture description here
Insert picture description here
Codes 1 to 8 are similar. . .
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_44026026/article/details/110201697