Like the 74LS164, the 74HC595 is also a shift register that goes in and out.
They are often found in microcontroller systems to extend the parallel output interface.
I have seen some data, the serial signal sent to the 74HC595, basically using a bit of the parallel interface of the microcontroller, simulating the timing of the SPI, output.
In this way, flexibility is its advantage, and low speed is its disadvantage.
If you use the serial port mode 0 of the 51 MCU, you can get higher speed and more concise programming methods.
In the general single-chip teaching material, when talking about the serial port mode 0, the method of expanding the parallel port with 164 is given. But for the rising star of 595, there is very little introduction.
In fact, the functions of the 595 and 164 are the same, except that there is an additional "update output" control pin.
Below, we will introduce the method of using four 74HC595 to expand the four 8-bit interfaces and drive the digital display.
The circuit is as follows:
Note: The current limiting resistor is omitted from the circuit diagram. In actual production, a resistor of about 1K can be connected in series for each segment.
This display circuit is a static display method, and it is not necessary to frequently call the display subroutine, which is very convenient to use.
This display circuit only draws four 595s. In fact, it can follow the structure of the current circuit and continue to cascade. Of course, too many cascades will cause the signal to be unstable, so add the driver circuit.
This display circuit is actually a "display one line" drive circuit on the LED dot matrix screen. If you have a 16-line decoding circuit, you can drive the 16&TImes;32 dot matrix screen.
The procedure for driving the digital tube with the 74HC595 is as follows.
Use 4 595 parallel output to drive 4 digital displays.
;======================================================
ORG 0000H
SJMP START
;------------------------------------------------- ----------------
START:
MOV SCON, #0 ; Set serial port mode 0
MOV 30H, #1 ; Write number in display buffer: 8031
MOV 31H, #3
MOV 32H, #0
MOV 33H, #8
CALL TXD_595 ; display
LJMP $ ; other programs can be executed here, without having to call the display program often
;------------------------------------------------- ----------------
; The serial port is sent to the subroutine of 595.
;------------------------------------------------- ----------------
TXD_595:
MOV R0, #30H ; display buffer first address
TXD_B:
MOV A, @R0 ; data to be displayed
ADD A, #(TAB - $ - 3)
MOVC A, @A+PC ; find seven-segment code
MOV SBUF, A; serial output 8 digits
INC R0
JNB TI, $ ; wait for output to complete
CLR TI; soon, 8us (@12MHz) can output 8 digits
CJNE R0, #34H, TXD_B ; output a total of 4 bytes
CLR P3.2; Let 595 update display
SETB P3.2; with 164, these two lines are free
RET
TAB:
DB 0C0H, 0F9H, 0A4H, 0B0H, 99H, 92H, 82H, 0F8H; common anode 0-7 display code
DB 80H, 90H, 88H, 83H, 0C6H, 0A1H, 86H, 8EH; common anode 8-F display code
You can look for top sell Tablet Case here.Our factory is located in Guangzhou, China's "leather capital", which will be more affordable in terms of the price of goods.
We employ the most creative designers and tech brilliant engineers to make the best cases. We believe our high-quality products with competitive prices will satisfy your needs.
The productive process :
Make the Products Mould –Cutting the fabric –Do the half products – Finish products – Cleaning –QC- Package – Shippment .
For Tablet Case,High quality Tablet Case,hot selling Tablet Case,best Tablet Cases
Ysure Leather case 24/7 Support : 86 13430343455 , https://www.ysurecase.com