Summary of the invention
Complicated to each paths of LEDs gray-scale Control realization of full-color LED display screen for overcoming prior art, the sequential control confusion causes the technological deficiency of display frame distortion, the invention provides a kind of all-colour LED array gray scale control method and circuit.
All-colour LED array gray regulating circuit, comprise some LED gray regulating circuits, described LED gray regulating circuit comprises at least one programmable current source group, it is characterized in that: described LED gray regulating circuit comprises input end of clock mouth, output terminal of clock mouth and is connected the clock buffer module of above-mentioned port; Described programmable current source group comprises the first programmable current source, the second programmable current source and the 3rd programmable current source, described LED gray regulating circuit also comprises gradation data input port, gradation data output port and grey level decoding module, described grey level decoding module is connected with gradation data input port, gradation data output port and the programmable current source of being connected, and can make the duty cycle switch of programmable current source to set.
Concrete, each LED gray regulating circuit is connected signal by the gradation data input port and is connected with the gradation data output port, the gradation data output port of arbitrary LED gray regulating circuit and gradation data input port 23 connections of LED gray regulating circuit of being connected.
Concrete, described clock buffer module also is connected with described grey level decoding module controls, the output terminal of clock mouth of arbitrary LED gray regulating circuit be connected the input end of clock mouth connection of LED gray regulating circuit.
Concrete, described clock buffer circuit comprises clock input stage, electric capacity (13), level sensitive circuit (6), pull-up circuit (8), pull-down circuit (9), clock output stage and logic control circuit (11), the output terminal of clock input stage and the input end of level sensitive circuit are connected in the A point, the A point also is connected with electric capacity (13), reaches the output terminal of pull-up circuit (8) and pull-down circuit (9), another termination of electric capacity (13) is DC level fixedly, described level sensitive circuit (6) detects the A point voltage, and output detection signal is to the clock output stage; Described logic control circuit (11) is connected with clock input stage, pull-up circuit and pull-down circuit, and control pull-up circuit and pull-down circuit are opened at high level time and the low level time of clock respectively.
Further, described clock input stage and clock output stage are realized that by a rest-set flip-flop clock signal is from the R end input of rest-set flip-flop, and Q holds output; The QN end is connected with the A point, and the S end is connected with the output terminal of level sensitive circuit.
Further, the relative input clock time-delay of the output clock of described clock buffer module is 250-350 nanosecond.
Concrete, described grey level decoding module comprises shift register group and gray scale output module group, described shift register group comprises the shift register of M series connection;
Described gray scale output module group comprises the first gray scale output module, the second gray scale output module and the 3rd gray scale output module, each gray scale output module is comprised of N input and counting circuit and the clock division circuits that is in series by N d type flip flop, and the data output end of depositing of the Enable Pin of a described N d type flip flop and N described shift register connects one to one; The output terminal of a described N d type flip flop is connected with N input end of counting circuit one by one with the N input, described N input and the output terminal of counting circuit and the described gray scale control circuit control linkage of described programmable current source;
Wherein M, N are positive integer and M=3N, and the data output end of depositing of each shift register only connects a d type flip flop 2.
Further, the 1st of described shift register group the data output end of depositing to N, N+1 to 2N, 2N+1 to a M shift register is connected with the Enable Pin of N d type flip flop in the first, second, and third gray scale load module respectively.
Preferably, described N=8, M=24.
All-colour LED array gray scale control method, based on all-colour LED array gray regulating circuit as mentioned above, comprise the step of regulating data from gradation data input port input gray level, described gray scale is regulated the gradation data that comprises M byte that data comprise that some head and the tail connect, each gradation data carries out gray scale definition to a programmable current source group in the described all-colour LED array gray regulating circuit, and the 1st to N, N+1 to 2N, 2N+1 to a M byte define respectively the duty cycle of switching of first, second, and third programmable current source; Define method is:
Wherein G is duty cycle of switching, and i is the sequence number of each byte in N the byte, and i is greater than 0 and less than the positive integer of N, Di is the binary value of i byte of gradation data, value 0 or 1.
Adopt all-colour LED array gray scale control method of the present invention and circuit, adjusting has realized unified control operation to redgreenblue LED lamp gray scale, realized the synchronism of redgreenblue LED lamp combination display pixel color from hardware, overcome the reportedly display distortion that causes of transmission delay difference of each lamp grey, for full-color LED lamp display frame control provides easily hardware condition.
Embodiment
Below in conjunction with accompanying drawing, the specific embodiment of the present invention is described in further detail.
All-colour LED array gray regulating circuit, comprise some LED gray regulating circuits, described LED gray regulating circuit comprises at least one programmable current source group, it is characterized in that: described LED gray regulating circuit comprises input end of clock mouth 21, output terminal of clock mouth 22 and is connected the clock buffer module of above-mentioned port; Described programmable current source group comprises the first programmable current source, the second programmable current source and the 3rd programmable current source, described LED gray regulating circuit also comprises gradation data input port 23, gradation data output port 24 and grey level decoding module, described grey level decoding module is connected with gradation data input port, gradation data output port and the programmable current source of being connected, and can make the duty cycle switch of programmable current source to set.Each LED gray regulating circuit can share same external power supply and ground, also can share a peripheral hardware clock.
As shown in Figure 7, provide the internal frame diagram of a kind of embodiment of LED gray regulating circuit of the present invention, INPUT CONTROL is input control module among the figure, and OSC is oscillator module, and the constant frequency clock is provided; BAND GAP REFERENCE is the reference voltage module, and a stable reference dc voltage is provided; GRAY SCALE DATA LATCH (gradation data latch) and GRAYSCALE DATA REGISTER (gradation data register) consist of the grey level decoding module gradation data are decoded; PWM COUNTER is the PWM counter module, PWM COMPARATOR is the PWM comparer, and the two gradation data with the output of gradation data decoder module is converted into the PWM square wave of certain dutycycle, controls three programmable current source IS-1, IS-2, the duty cycle of switching of IS-3.DATA ﹠amp; CLOCK RECONSTRUCT is data and clock buffer module, and gradation data and clock signal are outputed to next LED gray regulating circuit by gradation data output port 24 and output terminal of clock mouth 22.
Each programmable current source group comprises three programmable current sources, in use respectively with red LED lamp (red-light LED or cover the white light LEDs of Red lightscreening plate, blue green is identical therewith, below repeat no more), blue led lamp, green LED lamp connect, and the electric current of this string LED is flow through in control, by the brightness of setting Current Control LED lamp, thereby realize the control of redgreenblue GTG, combination realizes different colors.The gradation data input port receives the gradation data of extraneous input, through sending signal to programmable current source after the grey level decoding module to regulate the electric current of LED lamp.The grey level decoding module also outputs to subsequent conditioning circuit with the gradation data that receives by the gradation data output port and uses.The gray scale of redgreenblue LED lamp is regulated by same circuit control operation, synchronously convenient in sequential, has overcome the reportedly display distortion that causes of transmission delay difference of each lamp grey.
Described each programmable current source can adopt duplicate circuit structure, and the LED lamp color that the different only representatives of name connect among the present invention is different.Programmable current source can adopt the structure such as Fig. 3, comprise operational amplifier 14, adjust pipe 15, resistance 16, the positive input termination electric current of operational amplifier 14 is regulated reference voltage 17, negative input end with adjust pipe 15 source class and be connected an end with resistance and be connected, resistance other end ground connection, operational amplifier 14 output terminals are connected with adjustment pipe 15 grids, make resistance 16 pressure drops equal electric current and regulate reference voltage, then resistor current equals magnitude of voltage that electric current regulates reference voltage divided by resistance, LED lamp 18 with adjust pipe and resistance and connect LED lamp 18 electric currents are equated with resistor current.Size of current when normally opening by the magnitude of voltage setting programmable current source of setting resistance value or electric current adjusting reference voltage.
The periodic switch of programmable current source can be accomplished in several ways, take above-mentioned embodiment as example, can connect a drop-down N pipe at adjustment pipe 15 grids, the source class ground connection of drop-down N pipe is leaked level and is connected with the adjustment tube grid, input one-period switching signal on the grid of drop-down N pipe, periodically open this drop-down N pipe, grid voltage is periodically dragged down, and realize to adjust the periodic switch of pipe, thereby reaches and adjust the purpose of LED lamp 18 periodic switchs that pipe connects.Obviously the drop-down NPN pipe that also can use adopts similar connected mode well known in the art to realize.
Preferably, each LED gray regulating circuit is connected successively signal by gradation data input port 23 and is connected with the gradation data output port, the gradation data output port 24 of arbitrary LED gray regulating circuit and gradation data input port 23 connections of LED gray regulating circuit of being connected.Obviously, the gradation data input port of first LED gray regulating circuit is as the gradation data input end of described all-colour LED array gray regulating circuit, be connected with external system controller, the gradation data output port of end LED gray regulating circuit can be unsettled.Gray scale is regulated data and is inputted from first LED gray regulating circuit, successively to follow-up whole LED gray regulating circuit input data, digital circuit to the definition gradation data of peripheral hardware only needs an output terminal, can reach the purpose of whole LED gray regulating circuits being carried out the gradation data input.
Each LED gray regulating circuit can adopt clock, and read-write operates to data, preferably, all-colour LED array gray regulating circuit of the present invention can use a clock that each LED gray regulating circuit is operated, the LED gray regulating circuit comprises input end of clock mouth 21, output terminal of clock mouth 22 and is connected the clock buffer module of above-mentioned port, described clock buffer module also is connected with described grey level decoding module controls, the output terminal of clock mouth 22 of arbitrary LED gray regulating circuit be connected the input end of clock mouth 21 of LED gray regulating circuit and connect.The clock buffer module is carried out driving force to the clock signal of input and is strengthened, and avoids the long signal attenuation that causes of clock transfer distance.
The clock buffer module can adopt the realizations such as multistage phase inverter series connection, RC time-delay, the present invention provides a kind of embodiment: described clock buffer circuit comprises clock input stage, electric capacity 13, level sensitive circuit 6, pull-up circuit 8, pull-down circuit 9, clock output stage and logic control circuit 11, the input end of the output terminal of clock input stage and level sensitive circuit 6 is connected in the A point, the A point also is connected with electric capacity 13, reaches the output terminal of pull-up circuit 8 and pull-down circuit 9, another termination of electric capacity is DC level fixedly, preferably can ground connection; 6 pairs of A point voltages of described level sensitive circuit detect, and output detection signal is to the clock output stage; Described logic control circuit 11 and clock input stage, pull-up circuit 8 are connected with pull-down circuit and are connected, and control pull-up circuit and pull-down circuit are opened at high level time and the low level time of clock respectively.
Clock signal is from 7 inputs of input end of clock mouth, after rising edge clock signal passes through the clock input stage, pull-up circuit 8 is started working, this moment, pull-down circuit 9 was closed, 8 pairs of electric capacity 13 of pull-up circuit charge, when charging to the detection level that is higher than level sensitive circuit, the level sensitive circuit output signal uprises from low, and the duration of charging is the time-delay between rising edge clock signal and the level sensitive circuit output signal rising edge.In the high level stage of clock signal, capacitance voltage is pulled up to supply voltage by pull-up circuit.When clock signal negative edge passes through the clock input stage, pull-down circuit work, pull-up circuit is closed simultaneously, electric capacity is discharged, when being discharged to the detection level that is lower than level sensitive circuit, the level sensitive circuit output signal is the time-delay between clock signal negative edge and the level sensitive circuit output signal negative edge discharge time from high step-down.Here suppose that the time-delay of level sensitive circuit can ignore, in fact, usually the time-delay of level sensitive circuit is compared quite little with the capacitor charge and discharge time-delay, and because the time-delay of level sensitive circuit is difficult to accurate control, the design focal point of the length of therefore delaying time is the accuracy of detection of capacitor charge and discharge time and level sensitive circuit.
The foregoing circuit structure adopts when the rising of clock or negative edge and begins capacitor charge and discharge, and capacitor charging or energizing signal again when discharging into the detection level of level sensitive circuit cause the time-delay on signal output edge.
As shown in Figure 2, provide some embodiments that can combinatorial optimization, draw with pull-down circuit on for example and can adopt current source to realize, current source is realized matching each other in design easily, and pull-up current and pull-down current are all equated under various conditions.And with prior art, the constant temperature current source realizes easily, the charging and discharging electric current is not varied with temperature and changes.Relatively RC time-delay, current source discharge and recharge the time-delay drift that time-delay has avoided the electrical resistance process deviation to bring.
Level sensitive circuit is a comparator circuit preferably, and the comparer anode connects a detection reference voltage 12, for example DC level about 1.2V.Detection reference voltage is chosen near half of supply voltage usually, makes on the one hand comparer in this reference voltage better performances during input voltage as a comparison, and the voltage drop when electric capacity 13 discharges and recharges simultaneously on the electric capacity is roughly the same, is convenient to the charging and discharging currents setting.
From designing succinct consideration, level sensitive circuit also can adopt simple logic gate, phase inverter for example, and as detecting voltage, but the counter-rotating level of phase inverter is larger with multiple factor bias such as technological temperatures with the counter-rotating level of phase inverter.
Clock input stage and clock output stage can be realized that by a rest-set flip-flop clock signal is from the R end input of rest-set flip-flop, and the Q end goes clock signal output terminal 10 to connect output; The QN end is connected with the A point, and the S end is connected with the output terminal of level sensitive circuit.This implementation is simple and reliable, only two with the door can realize.
Clock track lengths during from system applies and certain design margin consider that the relative input clock time-delay of the output clock of described clock buffer module was preferably for 300 nanoseconds, also can accept in the 250-350 nano-seconds.The realization of above-mentioned time-delay detects the size of level by setting electric capacity and level sensitive circuit, consider the time-delay of other circuit, and those skilled in that art reach designing requirement easily.
To grey level decoding module of the present invention, the invention provides a kind of embodiment, described grey level decoding module comprises shift register group and gray scale output module group, described shift register group comprises the shift register 1 of M series connection, the input end 5 input gray level data of the first shift register wherein, last bit shift register output terminal output gray level data; The input end 5 of the first shift register can directly be connected with the gradation data input port, also can insert in the centre buffer stage circuit, end bit shift register output terminal can directly be connected with the gradation data output port, also can insert in the centre buffer stage circuit.
The present invention also provides a kind of clock detection circuit, as shown in Figure 6, by three phase inverters, three two input nand gates, one two input rejection gate and an impact damper form, annexation is unique as shown in Figure 6 determines that those skilled in the art can undoubtedly determine annexation between each unique gate level circuit from Fig. 6, repeat no more here.Clock acquisition input end 25 receive clock signals, clock acquisition input end output detection signal, the time-delay T1 of detection signal and clock signal is mainly provided by impact damper.Clock acquisition trigger end input trigger pip.Described clock detection circuit provides following function: when clock is surveyed trigger end input trigger pip, output to 26 behind the signal lag T1 to 25 terminations receipts.To the grey level decoding module, because initial as reading and writing data of the edge that must utilize clock, after the external clock signal arrived, time-delay T1 began to carry out reading and writing data again.
Described gray scale output module group comprises the first gray scale output module, the second gray scale output module and the 3rd gray scale output module, each gray scale output module is comprised of N input and counting circuit and the clock division circuits that is in series by N d type flip flop, and the data output end of depositing of the Enable Pin of a described N d type flip flop and N described shift register connects one to one; The output terminal of a described N d type flip flop is connected with N input end of counting circuit one by one with the N input, described N input and the output terminal of counting circuit and the described gray scale control circuit control linkage of described programmable current source;
Wherein M, N are positive integer and M=3N, and the data output end of depositing of each shift register only connects a d type flip flop.
Clock signal is from input end 4 inputs of first d type flip flop, d type flip flop is connected into the Clock dividers connected mode in mode well known in the art, the clock frequency that is first d type flip flop output is identical with input clock frequency, second d type flip flop output clock frequency equals 1/2nd of input clock frequency, and all the other by that analogy.Accordingly, the high duty ratio time in each d type flip flop output clock frequency monocycle doubles successively.The N input is processed clock signal input and the corresponding d type flip flop of each d type flip flop with counting circuit from the aggregation of data that shift register reads.Export the dutycycle square wave relevant with the data that read with above-mentioned clock signal, the dutycycle of this square wave signal is the duty cycle of switching of programmable current source.
All-colour LED screen display color is take the 16.7M look as main flow, and each monochrome (being one of redgreenblue) LED lamp needs 8 gradation datas definition, take monochromatic LED lamp input 8 bit data definition GTG be N=8 as example, gray-scale Control displaying principle of the present invention is:
Consisting of a complete pixel needs three groups of gradation datas of redgreenblue LED, when the gradation data H1 of monochromatic LED lamp figure place is 8, and the gradation data H3 figure place M=3N=24 of each pixel.Gradation data H3 is input to the shift register group of grey level decoding module, store into successively 24 shift registers of series connection from the first beginning of H3, after pixel grey scale data H3 storage is complete, the first to the 3rd gray scale output module totally 24 d type flip flops according to predefined data address corresponding relation, reading out data from 24 shift registers, 8 d type flip flops of each gray scale output module are exported the gradation data that reads the gray scale definition of each monochromatic LED lamp by 8 inputs and counting circuit, gray scale combination by three monochromatic LED lamps reaches demonstration 2
8* 2
8* 2
8The pixel gray level degree display effect of=16.7M look.
Preferably, be convenient design and input gray level data, described shift register group the 1st to N, the data output end of depositing of N+1 to 2N, 2N+1 to a M shift register is connected with the Enable Pin of N d type flip flop in the first, second, and third gray scale load module respectively.
The data output end of depositing that is the top n shift register of the Enable Pin of N d type flip flop in described the first gray scale output module and described shift register group connects one to one, the data output end of depositing of middle N shift register of the Enable Pin of N d type flip flop and described shift register group connects one to one in the second gray scale output module, and the data output end of depositing of rear N shift register of the Enable Pin of N d type flip flop and described shift register group connects one to one in the 3rd gray scale output module.For example during N=8, in 24 series connection d type flip flops, continuous 8 d type flip flops with the first gray scale output module in front are connected, and continuous 8 d type flip flops with the first gray scale output module in centre are connected, and continuous 8 d type flip flops with the 3rd gray scale output module are connected at last.
Adopt N bit data definition monochromatic LED lamp shade of gray that various implementation methods are arranged, the following all-colour LED array gray scale control method of the concrete employing of the present invention: regulate data from gradation data input port input gray level, described gray scale is regulated the gradation data that comprises M byte that data comprise that some head and the tail connect, each gradation data carries out gray scale definition to a programmable current source group in the described all-colour LED array gray regulating circuit, and the 1st to N, N+1 to 2N, 2N+1 to a M byte define respectively the duty cycle of switching of first, second, and third programmable current source; Define method is:
Wherein G is duty cycle of switching, and i is the sequence number of each byte in N the byte, and i is the nonnegative integer less than N, and Di is the binary value of i byte, value 0 or 1.
Be the gray scale that the top n byte defines the first programmable current source, a middle N byte defines the gray scale of the second programmable current source, and a rear N byte defines the gray scale of the 3rd programmable current source.
Still take N=8 as example, for example input pixel grey scale definition data H3 and be (1,001 0,110 1,110 0,001 1,011 0011), define front 8 of above-mentioned H3, in 8 and rear 8 define respectively first, second, the dutycycle of the 3rd programmable current source, and the first, the second, the 3rd programmable current source is corresponding red respectively, green, blueness, the define method above utilizing:
The demonstration dutycycle of the first programmable current source is:
The demonstration dutycycle that in like manner can get the second programmable current source and the 3rd programmable current source is respectively 52.7% and 80.1%.
When the DC current of programmable current source all is set as 100 MAHs, then the pixel effects of Human Perception is 41 milliamperes of red brightness, 52.7 milliamperes of green brightness, the color displays effect that blue brightness is 80.1 milliamperes.Change each bit digital of data H3, can realize the full-color demonstration of 16.7M.
Obviously during or lower-order color displays higher when needs, as long as relate to corresponding circuits number or the port of N and M parameter-definition among corresponding increase or minimizing the present invention.
To the all-colour LED array, the corresponding gradation data of each pixel, the demonstration of one frame picture needs several gradation datas that each pixel is carried out the gray scale definition, among the present invention, gradation data is from the gradation data input port input of the first LED gray regulating circuit, with aforesaid N=8, M=24 is example, and suppose that each LED gray regulating circuit only has a programmable current source group, the first LED gray regulating circuit reads front 24 bit data, follow-up data is from the output of gradation data output port, and inferior position LED gray regulating circuit reads time 24 bit data, the like.Show the field at the all-colour LED array, current mode is that corresponding LED lamp is closed before reading data not.
Each gray regulating circuit reads 24 bit data successively, and discharges temporarily and receive new data and can realize by clock, Enable Pin or the data receiver enable signal etc. of writing corresponding software program control gray regulating circuit at the next frame picture behind the reading data.
For example as shown in Figure 4, the part that gradation data SDA is cut apart by vertical dotted line is the data of a pixel of definition, comprises the red R 7-R0 that is arranged in order, green G7-G0, blue B7-B0 is totally 24 gray scale definition data, and EN1 is the enable signal of the first LED gray regulating circuit, and high level is effective.When the SDA1 data were inputted, EN1 was effective, and front 24 are input in the gray regulating circuit, within each cycle of clock signal clk, read in successively, front 24 finish after, EN1 upset is low level, the LED gray regulating circuit enable signal EN2 upset of inferior position is for effectively, inferior 24 bit data are read in time position LED gray regulating circuit, the like, SDA1 wherein, SDA2, SDA3 represents the first place successively, and this and the 3rd LED gray regulating circuit are regulated data in the gray scale that the gradation data input port receives.
Adopt all-colour LED array gray scale control method of the present invention and circuit, adjusting has realized unified control operation to redgreenblue LED lamp gray scale, realized the synchronism of redgreenblue LED lamp combination display pixel color from hardware, overcome the reportedly display distortion that causes of transmission delay difference of each lamp grey, for full-color LED lamp display frame control provides easily hardware condition.Among the present invention each circuit is provided preferred implementation, and proposed a kind of dutycycle define method to realize 16.7M look or other figure place color displays.
The software module that the method that the disclosed embodiments are described among the present invention or the step of algorithm can directly use hardware, processor to carry out, perhaps the combination of the two is implemented.Software module can place the storage medium of any other form known in random access memory (RAM), internal memory, ROM (read-only memory) (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or the technical field.
Previously described is each preferred embodiment of the present invention; preferred implementation in each preferred embodiment is if not obviously contradictory or take a certain preferred implementation as prerequisite; each preferred implementation arbitrarily stack combinations is used; design parameter among described embodiment and the embodiment only is the invention proof procedure for clear statement inventor; be not to limit scope of patent protection of the present invention; scope of patent protection of the present invention still is as the criterion with its claims; the equivalent structure that every utilization instructions of the present invention and accompanying drawing content are done changes, and in like manner all should be included in protection scope of the present invention.