74hc164 drive control 8 digital tube program

74hc164 drive control 8 digital tube program

tenco 2019-04-25

Equipment overview 74HC164

8-bit string in and out of the shift register

74HC16474HC164 and 74HCT164 are high-speed silicon gate CMOS devices, which are compatible with the pins of low-power schottl (LSTTL) devices.74HC164 and 74HCT164 are 8-bit edge-triggered shift registers that input data serially and then output in parallel.Data is input serially through one of two input terminals (DSA or DSB);Either input can be used as a high level enable to control the data input of the other input.The two input terminals may be connected together, or the unused input terminal may be connected to a high level, and must not be suspended.

Each time the clock (CP) changes from low to high, the data is moved one bit to the right and input to Q0. Q0 is the logic of the two data input terminals (DSA and DSB) and it will maintain a length of establishment time before the rising clock edge.

A low level on the primary reset (MR) input will invalidate all other inputs and simultaneously unsynchronously clear the registers, forcing all outputs to be low.


Digital tube

A nixie tube, also called a glow tube, is an electronic device that displays Numbers and other information.The glass tube contains an anode made of wire mesh and a plurality of cathodes.Most of the cathode of digital tube are in digital shape.The tube is filled with a low pressure gas, usually mostly neon with some mercury and/or argon.When a cathode is charged, the digital tube emits a colour light, depending on the gas inside, usually orange or green.

Digital tube also known as LED digital tube, different industries of digital tube call is not the same, in fact, are the same product.

According to the connection mode of led unit, it can be divided into common anode digital tube and common cathode digital tube.Total Yang digital tube is all leds of anode together form the anode (COM) of the digital tube, the application of total Yang digital tube should be public extremely COM from + 5 v, when a particular field of light emitting diode cathode for low electricity at ordinary times, the corresponding field will light up, when a cathode for high electric fields, the corresponding field is not bright.Total Yin digital tube is all leds cathode together form the cathode (COM) of the digital tube, digital tube, a total of Yin in the application should be public ground very COM received GND, when a field anode for high power leds, the corresponding field is light, when a particular field of anode for low electricity at ordinary times, the corresponding field is not bright.

Eight 74HC164 control eight digital tube procedures


ORG0000H

JMPMAIN

ORG0013H

AJMPBreak_2

MAIN:;The main program

MOVSP, # 60 h;Set stack pointer

MOVTCON, 04 h

MOVIE, 84 h

MOVSCON, # 00 h;Set serial port to 0 mode, synchronous shift register, baud rate Fosc/ 12,0: single machine to single machine, reception control forbidden

START:;

JNBP3.2, DISPLAY_09

CALLDISPLAY_0;Call the display subroutine

CALLDELAY;Call the delay subroutine

DISPLAY_0:;Display subroutine

MOVR7, # 2

MOVR6, # 2

MOVR5, # 2

L0:

MOVA, # 0;Send the first ten - digit LED digital channel selection code

MOVDPTR, # TABLE;Ten digit LED digital tube segment selection table address to data register pointer DPTR

MOVCA, @ A + DPTR;Select the 10-digit counter COUNT2, and send the second LED digital tube to A

MOVSBUF, A;Send a select ten - digit counter COUNT2, the second LED digital tube selection code

L0_1:

JBCTI L0_2;Send control bit TI=1, jump to DATA1 after sending, and clear TI to 0

JMPL0_1;Send control bit TI=0, jump to LOOPD0 before completion of sending and continue to detect TI bit

L0_2:

DJNZR7, L0

MOVR7, # 2

MOVA, # 0;Send the first ten - digit LED digital channel selection code

MOVDPTR, # TABLE_1;Ten digit LED digital tube segment selection table address to data register pointer DPTR

MOVCA, @ A + DPTR;Select the 10-digit counter COUNT2, and send the second LED digital tube to A

MOVSBUF, A;Send a select ten - digit counter COUNT2, the second LED digital tube selection code

L0_3:

JBCTI L0_4;Send control bit TI=1, jump to DATA1 after sending, and clear TI to 0

JMPL0_3;Send control bit TI=0, jump to LOOPD0 before completion of sending and continue to detect TI bit

L0_4: DJNZR6, L0

L0_5:

MOVA, # 0;Send the first ten - digit LED digital channel selection code

MOVDPTR, # TABLE;Ten digit LED digital tube segment selection table address to data register pointer DPTR

MOVCA, @ A + DPTR;Select the 10-digit counter COUNT2, and send the second LED digital tube to A

MOVSBUF, A;Send a select ten - digit counter COUNT2, the second LED digital tube selection code

L0_6:

JBCTI L0_7;Send control bit TI=1, jump to DATA1 after sending, and clear TI to 0

JMPL0_6;Send control bit TI=0, jump to LOOPD0 before completion of sending and continue to detect TI bit

L0_7:

DJNZR5, L0_5

RET

DISPLAY_09:

MOVCOUNT1, # 0;The one digit counter is zero

MOVCOUNT2, # 0;The ten-digit counter COUNT2 is set to 2

MOVCOUNT3, # 0;The hundred digit counter is eight

MOVCOUNT4, # 0;The hundred digit counter is eight

MOVCOUNT5, # 0;The hundred digit counter is eight

MOVCOUNT6, # 0;The hundred digit counter is eight

MOVCOUNT7, # 0;The hundred digit counter is eight

MOVCOUNT8, # 0;The hundred digit counter is eight

START_09:

CALLDISPLAY;Call the display subroutine

CALLDELAY;Call the delay subroutine

W1:

INCCOUNT1;The one digit counter COUNT1 plus 1

MOVA, COUNT1

CJNEA, #10, START_09;Check whether the single digit changes 10 times. If not, jump to START at the beginning of the program

W10:

INCCOUNT2;The ten-digit counter COUNT2 plus 1

MOVCOUNT1, # 0;The one digit counter is zero

MOVA COUNT2;

CJNEA, #6, START_09;Detects if the single digit has changed 10 times. If not, jumps to the beginning of the program

W100:

INCCOUNT3;The hundred - digit counter COUNT3 plus 1

MOVCOUNT2, # 0;The ten-digit COUNT2 counter is zero

MOVCOUNT1, # 0;The one digit counter is zero

MOVA, COUNT3;

CJNEA, #1, START_09;Detects if the single digit has changed 10 times. If not, jumps to the beginning of the program

W1000:

INCCOUNT4;The thousand-digit counter COUNT4 plus 1

MOVCOUNT3, # 0;The hundred digit counter is 0

MOVCOUNT2, # 0;The ten-digit COUNT2 counter is zero

MOVCOUNT1, # 0;The one digit counter is zero

MOVA COUNT4;

CJNEA, #10, START_09;Detects if the single digit has changed 10 times. If not, jumps to the beginning of the program

W10000:

INCCOUNT5;COUNT5 plus 1

MOVCOUNT4, # 0;The COUNT4 is 0

MOVCOUNT3, # 0;The hundred digit counter is 0

MOVCOUNT2, # 0;The ten-digit COUNT2 counter is zero

MOVCOUNT1, # 0;The one digit counter is zero

MOVA COUNT5;

CJNEA, #6, START_09;Detects if the single digit has changed 10 times. If not, jumps to the beginning of the program

W100000:

INCCOUNT6;COUNT6 plus 1

MOVCOUNT5, # 0;The COUNT5 number is 0

MOVCOUNT4, # 0;The COUNT4 is 0

MOVCOUNT3, # 0;The hundred digit counter is 0

MOVCOUNT2, # 0;The ten-digit COUNT2 counter is zero

MOVCOUNT1, # 0;The one digit counter is zero

MOVA COUNT6;

CJNEA, #1, START_09;Detects if the single digit has changed 10 times. If not, jumps to the beginning of the program

W1000000:

INCCOUNT7;The million number counter COUNT7 plus 1

MOVCOUNT6, # 0;The COUNT6 is 0

MOVCOUNT4, # 0;The COUNT4 is 0

MOVCOUNT3, # 0;The hundred digit counter is 0

MOVCOUNT2, # 0;The ten-digit COUNT2 counter is zero

MOVCOUNT1, # 0;The one digit counter is zero

MOVA COUNT7;

CJNEA, #10, START_09;Detects if the single digit has changed 10 times. If not, jumps to the beginning of the program

W10000000:

INCCOUNT8;COUNT7 plus one

MOVCOUNT7, # 0;COUNT7 plus 1

MOVCOUNT6, # 0;The COUNT6 is 0

MOVCOUNT4, # 0;The COUNT4 is 0

MOVCOUNT3, # 0;The hundred digit counter is 0

MOVCOUNT2, # 0;The ten-digit COUNT2 counter is zero

MOVCOUNT1, # 0;The one digit counter is zero

MOVA COUNT8;

CJNEA, #10, L1;Detect if the single digit changes 10 times, and if not, jump to AJMPW0 at the beginning of the program

L1: AJMPSTART

W0:

MOVCOUNT1, # 0;The one digit counter is zero

MOVCOUNT2, # 0;The ten-digit COUNT2 counter is zero

MOVCOUNT3, # 0;The hundred digit counter is 0

TENCO TECH