Very practical really! Serial LED shows circuit is designed

  • Time:
  • Click:95
  • source:KAPLOWITZ CNC Machining
In sheet piece in engine system design, because LED indication means is had use convenient, price cheap wait for an advantage and get applied extensively. When using collateral indication means, paragraph of code of indication circuit and accuse a code to want to take up odd the more opening line of a machine, although can be used 8155 wait for interface chip to undertake expanding, but buccal line utilization rate still inferior, cannot satisfy the requirement of large control system. Use serial indication means to need to take up only 2 to 3 buccal lines, managing sheet piece the I/O line with much chance, and use effect is very good. This task uses 74HC595A to realize many LED serial show. 74HC595 chip 1. Interior of 74HC595A of 74HC595A job principle contains 8 shift register and 8 D Suo Cunqi, internal composition sees plan institute is shown. 74HC595 of construction of 74HC595A in-house logic and digital canal join serial shift register receives exterior input to string together a data, can undertake serial data is outputted on one hand, offer 8 collateral data-in to Suo Cunqi at the same time, have asynchronous restoration function; 8 Suo Cunqi but 3 condition are outputted and linage is occupied. This chip has the clock signal that serial input, collateral output becomes independent twice. 74HC595A logistic function notes: U: Changeless; N: Data refresh; Z: Tall block. 2. The graph below applied circuit design is 12 LED monitor to use circuit. If use common LED,collateral indication means wants patulous sheet piece machine interface, circuit complex, cost is high. This system uses 3 74HC595A chip to realize LED of travel of 12 bit string to show control. When using, below the control of serial clock, but monitor accuse code and paragraph accuse a code to chase input of bit string travel to come in 3 chip, use a lock to put signal to realize collateral output next, finish 12 count code to show newer. Use this to show means takes up only odd a machine 3 buccal lines, great and managing sheet piece resource of machine opening line. Use serial data to input, indication speed is relative slower, when be being used actually, show the effect is stable, reliable, satisfy design requirement completely. 12 LED are serial indication application circuit is initiative a set accusing a code be in charge of to show the first digit is piled up (in all cathode) , see next tables group accuse a code. Every show, need is changed accuse a code to issue in order to show, next watches reflected a metabolic condition that accuses a code. R6, R7 uses 1 area register at depositing processing accuse a code. 12 LED monitor accuse a code to form sketch map 3.

This program uses means of indication process work monitor of time means control works. 12 monitor use dynamic scanning to show, every monitor indication time is about 1.

67ms, by timer T0 control. T0 time time shows to generation interrupt, enter show interrupt a program to show below one digit is occupied. This kind of indication means can improve the work efficiency of CPU, but the refresh speed of accurate control monitor. 4.

Interrupt indication subprogram to use a staff one program, ordinal on canal of 12 digit code show 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1ORG 0000HDSDATE BIT P1.

0; serial data inputs DSCLK BIT P1.

1; DSLUCK BIT P1 of serial shift clock.

2; Collateral lock puts clock DISBUF EQU 51H; Indication buffer head location DS20 EQU 34H; 20ms time register (12 indication tally) LJMP MAIN; turns main program ORG 000BHLJMP TIMINT; Turn time show interrupt subprogram MAIN: MOV SP, #70H; MOV 51H of buy vertebra stack pointer, #00H; Beforehand buy shows buffer MOV 52H, #01HMOV 53H, #02HMOV 54H, #03HMOV 55H, #04HMOV 56H, #05HMOV 57H, #06HMOV 58H, #07HMOV 59H, #08HMOV 5AH, #09HMOV 5BH, #00HMOV 5CH, #01HMOV 08H, #DISBUF; 1 area R0 points to indication buffer head location MOV 0EH, #07H; Buy is initiative accuse a code (1 area R6) MOV 0FH, #0FFH; Buy is initiative accuse a code (1 area R7) MOV TMOD, #01H; Buy T0 is 1.

67ms timer MOV TL0, #00HMOV TH0, #0FAHMOV DS20, #12; Buy shows digit tally SETB TR0; The T0SETB EA that start; Interrupt SETB ET0; Open T0 to interrupt HERE: SJMP HERETIMINT: PUSH PSW; Time show interrupt a subprogram, condition word enters inn MOV PSW, #08H; Replacement condition word, choose PUSH ACC of register of 1 division job; Accumulator enters inn PUSH B; B register takes pen CLR TR0; Stop T0 time MOV TH0, #0FAH; Replacement 1.

MOV TL0 of 67ms time initial value, #00HSETB TR0; Time MOV R5 of the T0 that start, 0FH; Accuse a code to send R4, R5MOV R4, 0EHLCALL DIS1; Call show one digit piles up pipe program SETB C; Form show below one an apposition accusing a code at the MOV A in 1 area R6, R7, r6SETB ACC.

4RRC AMOV R6, AMOV A, r7RRC AMOV R7, ADJNZ DS20, LOOP1; 12 showed deny, not was over exit, if show replacement MOV DS20, #12; Replacement shows tally MOV R0, #DISBUF; Replacement shows buffer finger MOV R7, #0FFH; Replacement is initiative a MOV R6 accusing a code, #07HLOOP1: POP B; Restore spot POP ACCPOP PSWRETI; Interrupt return DIS1: MOV DPTR, #TAB; Show one digit piles up pipe program, point to paragraph of stopwatch MOV A, @R0; Take wait for INC R0 of indication character data; MOVC A of modification buffer finger, @A+DPTR; Check a watch to take indication character paragraph code MOV R3, a; Will paragraph code and combination accusing a code becomes MOV R1 of 20 effective and serial codes, #0CH; The MOV A in R3 of park of 20 effective and serial codes, R4, R5, @R1SWAP AMOV @R1, AMOV A, r3XCHD A, @R1MOV A, @R1SWAP AMOV @R1, AMOV A, r3SWAP AMOV R3, AMOV R1, #20; Buy is serial output tally DIS0: MOV A, r3; Serial shift of R3, R4, R5, output by R5 perch. RRC AMOV R3, AMOV A, r4RRC AMOV R4, AMOV A, r5RRC AMOV R5, AMOV DSDATE, c; The most exalted send to 595 chip serial input carries SETB DSCLK; Produce 595 chip NOPCLR DSCLK of serial input signal; Serial input lock puts DJNZ R1, DIS0; 20 2 output that enter a code are over deny, not was over continue SETB DSLUCK; Produce 595 chip collateral output signal, character begins to show NOPCLR DSLUCK; Output character data puts RETTAB by 595 chip lock: DB 3FH, 06H, 5BH; Show paragraph of stopwatch DB 4FH, 66H, 6DHDB 7DH, 07H, 7FHDB 6FH, 00H, 40HEND CNC Milling CNC Machining