WO2022041421A1 - Adaptive data decoding circuit and led unit circuit - Google Patents

Adaptive data decoding circuit and led unit circuit Download PDF

Info

Publication number
WO2022041421A1
WO2022041421A1 PCT/CN2020/122135 CN2020122135W WO2022041421A1 WO 2022041421 A1 WO2022041421 A1 WO 2022041421A1 CN 2020122135 W CN2020122135 W CN 2020122135W WO 2022041421 A1 WO2022041421 A1 WO 2022041421A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
circuit
code
decoding
signal
Prior art date
Application number
PCT/CN2020/122135
Other languages
French (fr)
Chinese (zh)
Inventor
周兴安
Original Assignee
无锡德芯微电子有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 无锡德芯微电子有限公司 filed Critical 无锡德芯微电子有限公司
Publication of WO2022041421A1 publication Critical patent/WO2022041421A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H05ELECTRIC TECHNIQUES NOT OTHERWISE PROVIDED FOR
    • H05BELECTRIC HEATING; ELECTRIC LIGHT SOURCES NOT OTHERWISE PROVIDED FOR; CIRCUIT ARRANGEMENTS FOR ELECTRIC LIGHT SOURCES, IN GENERAL
    • H05B45/00Circuit arrangements for operating light-emitting diodes [LED]
    • H05B45/30Driver circuits

Definitions

  • the present invention relates to the technical field of LED circuits, in particular to an adaptive data decoding circuit and an LED unit circuit including the adaptive data decoding circuit.
  • LED has been widely used in decoration, lighting, advertising, stage lighting and many other fields.
  • LEDs require a dedicated integrated circuit to drive and control, that is, an LED drive circuit.
  • an LED unit the combination of the LED and its corresponding driving circuit is referred to as an LED unit.
  • multiple LED units are generally connected in parallel or in series to form a larger LED project.
  • it is necessary to send corresponding data to each LED unit through the controller.
  • the general practice is to set an address for each LED unit, and each LED unit receives the corresponding data from the main controller according to its own address.
  • the main controller sends data according to the agreed data format, and the LED unit can receive the corresponding data according to its own address.
  • the data transmission rate is generally agreed upon in product design, which is the fixed data transmission rate.
  • the advantage of the fixed data transmission rate is that the data decoding at the receiving end of the LED unit is simple, but the disadvantages of the fixed data transmission rate are also obvious, mainly in the following points:
  • the second is the decoding problem of the LED unit, because the data transmission rate is fixed, which requires the LED unit to decode the data at this fixed rate.
  • a fixed frequency clock inside the LED unit for decoding and receiving. Data, but this internal clock frequency is related to application conditions, such as voltage changes, temperature changes, etc., which will cause the internal clock of the LED unit to change.
  • process deviation will also lead to clock frequency deviation. Due to the deviation of the clock frequency, the probability of failure of the LED unit to decode the data from the main controller is greatly increased. Therefore, in order to ensure the smooth decoding of the LED unit, the product design and production process requirements are higher.
  • the fixed data transmission rate is difficult to meet different applications. For example, sometimes there are fewer LED units in the project, but the customer needs a relatively high data transmission rate to improve the refresh rate. In this case, the fixed data transmission rate rate cannot be achieved.
  • the invention provides an adaptive data decoding circuit and an LED unit circuit including the adaptive data decoding circuit, which solves the problem in the related art that the decoding must be performed at a fixed rate when the data transmission rate is fixed, and the process and production requirements are relatively high. question.
  • an adaptive data decoding circuit which includes: a signal edge detection processing circuit, a reset code detection circuit, a reference code decoding circuit and a data packet decoding circuit, the signal edge detection processing circuit Both the output end of the reference code decoding circuit and the output end of the reset code detection circuit are connected to the input end of the reference code decoding circuit, and the output end of the reference code decoding circuit is connected to the data packet decoding circuit;
  • the signal edge detection processing circuit is used to detect the rising edge or falling edge of the data code in each frame of data, and can output a flag signal when the rising edge or falling edge of the data code is detected, wherein each frame of data includes sequential A connected reset code, a reference code and a data packet, the data packet includes a plurality of data codes, the length of the reference code is N times the length of a data code in the data packet, and N is a natural number greater than 1;
  • the reset code detection circuit is configured to generate a reset signal after recognizing the reset code in each frame of data
  • the reference code decoding circuit is configured to decode the reference code in each frame of data according to the flag signal and the reset signal to obtain a reference code decoding result
  • the data code decoding circuit is configured to generate a decoding rate of the data packet according to the decoding result of the reference code, and decode the data packet according to the decoding rate of the data code.
  • the adaptive data decoding circuit includes a first clock signal, and both the input terminal of the signal edge detection processing circuit and the input terminal of the reference code decoding circuit are input with the first clock signal.
  • the adaptive data decoding circuit includes a counter circuit and a data comparator circuit
  • the output terminal of the reference code decoding circuit is connected to the first input terminal of the data comparator circuit
  • the output terminal of the counter circuit is connected to the first input terminal of the data comparator circuit.
  • the second input end of the data comparator circuit, the output end of the data comparator circuit is connected to the data packet decoding circuit
  • the counter circuit is used to input the enable signal and the first clock signal, and output the counter result, so
  • the data comparator circuit is used for generating a second clock signal according to the result of the counter and the decoding result of the reference code, and the second clock signal is used for inputting to the data packet decoding circuit.
  • the adaptive data decoding circuit includes an RS flip-flop, the R terminal of the RS flip-flop is connected to the second clock signal, the S terminal of the RS flip-flop is connected to the flag signal, and the RS flip-flop is connected to the second clock signal.
  • the output terminal Q of the counter circuit is connected to the enable signal terminal of the counter circuit, and the RS flip-flop is used for outputting the enable signal according to the flag signal and the second clock signal.
  • the adaptive data decoding circuit includes a D flip-flop, the D terminal of the D flip-flop is connected to the output terminal of the data comparator circuit, and the clock signal terminal of the D flip-flop is connected to the first clock signal , the output terminal Q of the D flip-flop outputs a second clock signal.
  • the length of the reference code is 8 times the length of a data code in the data packet.
  • an LED unit circuit which includes: a controller and a plurality of LED units, each LED unit is communicatively connected to the controller, and each LED unit includes the aforementioned
  • the controller can send multiple frames of data to each LED unit, and the adaptive data decoding circuit in each LED unit can decode each frame of data received according to the corresponding decoding rate .
  • each LED unit is connected with the controller through a data line.
  • each LED unit and the controller are connected in communication with the controller through a power line carrier.
  • the length of the reference code can be customized, and the length of the reference code is equal to the length of a data code in the data packet.
  • Scale setting when the LED unit receives data, it first decodes the reference code, and the decoding rate of the data packet can be determined according to the length of the reference code. Again subject to the impact of the transmission rate.
  • FIG. 1 is a specific embodiment of the LED unit circuit provided by the present invention.
  • FIG. 2 is another specific embodiment of the LED unit circuit provided by the present invention.
  • FIG. 3 is a structural block diagram of an adaptive data decoding circuit provided by the present invention.
  • FIG. 4 is a schematic diagram of a frame data structure provided by the present invention.
  • FIG. 5 is a schematic diagram of a reset code, a reference code and a data waveform in a data packet in a frame of data provided by the present invention.
  • FIG. 6 is a schematic diagram of a specific circuit structure of an adaptive data decoding circuit provided by the present invention.
  • FIG. 7 is a timing diagram of the decoding waveforms of the data 1 code and the data 0 code provided by the present invention.
  • FIG. 8 is a schematic diagram of one frame of data in a specific implementation manner provided by the present invention.
  • FIG. 9 is a circuit schematic diagram of a reference code decoding circuit provided by the present invention.
  • FIG. 10 is a circuit schematic diagram of a signal edge detection processing circuit provided by the present invention.
  • an LED unit circuit provided by an embodiment of the present invention, as shown in FIG. 1 and FIG. 2 , includes a controller and a plurality of LED units, each Each LED unit is connected in communication with the controller, and each LED unit includes an adaptive data decoding circuit, the controller can send multiple frames of data to each LED unit, and the adaptive data decoding in each LED unit decodes The circuits can decode each frame of data received according to the corresponding decoding rate.
  • the adaptive data decoding circuit provided by the embodiment of the present invention can be set as required within a certain range, so that each LED unit can successfully and accurately complete data decoding without decoding at a fixed rate.
  • each LED unit is connected with the controller through a data line.
  • each LED unit and the controller are connected in communication with the controller through a power line carrier.
  • each LED unit and the controller can realize data transmission through the power line carrier.
  • controller may include an MCU, etc., which may be selected as required, which is not limited here.
  • all LED units connected to the main controller can receive all data at the same time, and each LED unit decodes the data sent by the main controller and receives its own data according to its own address.
  • the master controller sends data in units of frames.
  • the adaptive data decoding circuit that enables adaptive rate decoding for each LED unit will be described in detail below.
  • FIG. 3 is a structural block diagram of an adaptive data decoding circuit provided according to an embodiment of the present invention. As shown in FIG. 3 , it includes: a signal edge detection processing circuit 100, a reset code detection circuit 200, a reference code decoding circuit 300, and a data packet decoding circuit 400.
  • the output end of the signal edge detection processing circuit 100 and the output end of the reset code detection circuit 200 are both connected to the input end of the reference code decoding circuit 300, and the output end of the reference code decoding circuit 300 is connected to the reference code decoding circuit 300.
  • the data packet decoding circuit 400 is connected;
  • the signal edge detection processing circuit 100 is used to detect the rising edge or falling edge of the data code in each frame of data, and can output a flag signal when the rising edge or falling edge of the data code is detected, wherein each frame of data includes: A reset code, a reference code and a data packet connected in sequence, the data packet includes a plurality of data codes, the length of the reference code is N times the length of a data code in the data packet, and N is a natural number greater than 1 ;
  • the reset code detection circuit 200 is configured to generate a reset signal after identifying the reset code in each frame of data
  • the reference code decoding circuit 300 is configured to decode the reference code in each frame of data according to the flag signal and the reset signal to obtain a reference code decoding result;
  • the data code decoding circuit 400 is configured to generate a decoding rate of the data packet according to the decoding result of the reference code, and decode the data packet according to the decoding rate of the data code.
  • a frame of data in the embodiment of the present invention specifically refers to that a frame of data starts with a reset code, followed by a reference code, and then followed by a data packet.
  • a schematic diagram of a frame of data timing waveform is shown in Figure 4.
  • the data frame structure of the adaptive data decoding circuit Compared with the data frame structure that uses a fixed frequency to transmit data, the data frame structure of the adaptive data decoding circuit provided by the present invention adds a reference code, and the length of the data code at the sending end can be randomly selected within a certain range.
  • the LED unit with the data code length has a wider application range and is more adaptable to the application environment. Because the sender can freely change the length of the data code within the required range, in actual engineering, the sending rate can be changed as needed to obtain better results. For example, the rate of sending data can be increased to increase the display frame rate of the LED unit. It is also possible to reduce the sending rate so that it works properly with a particularly large number of points.
  • the decoding of the data is done by judging the signal level change and the duration of the high and low levels.
  • the falling edge of the signal is used as the start of all data codes, and the next falling edge is the end of the current data code and the beginning of the next data code, thus connecting all the data codes.
  • the data frames are connected by reset codes.
  • all data codes are started according to the falling edge, and the rising edge can also be used as the start of the data code, as long as the LED unit design specification corresponds to the data specification sent by the main controller.
  • the above-mentioned so-called data code is a general term for the reference code and each bit of data in the data packet.
  • Each component of one frame of data is described in detail below. Here, it is introduced according to the falling edge of the signal as the start of the data code.
  • Reset code which defines the data signal as the reset code if the data signal continues to be at a high level for more than a certain length.
  • the reset code has two functions. The first function is to determine the start of sending a new frame of data. For the LED unit circuit, when the reset code is detected, it must be ready to receive new data, that is, start the reference code and data packets at any time. The second function is to make the data of the previous frame take effect, that is to say, when the LED unit circuit decodes the data packet and receives its own data packet, it is only temporarily stored, and will not be stored until the next reset code. Load data into its working register for use.
  • Reference code it is defined that the first data code after the reset code is the reference code.
  • the role of the reference code is to determine the data transfer rate.
  • the length of the reference code code is N times the length of one data code in the data packet.
  • Data packet the sum of all data codes after the definition reference code is a data packet.
  • Both the reference code and the data packet start with the falling edge of the data signal, and the low level lasts for a certain period of time and then changes to a high level and ends for a specified time.
  • the schematic diagram of reset code, reference code and data packet waveform is shown in Figure 5, TD is the high level time length of data 1 code, and the high and low level lengths of all patterns are defined with reference to TD .
  • the length T reset of the reset code can be defined as several hundreds of microseconds to several milliseconds.
  • T D is specifically set according to the actual situation, but it must meet the following requirements, that is, whether it is a reference code or a data code, the length of the high level time cannot be longer than the reset code.
  • TD represents the high level time length of data 1 code
  • the high and low level lengths of all code patterns are defined with reference to TD .
  • the length of the reference code is N times the length of a data code in the data packet, usually N ⁇ 2.
  • the sender When the sender sends data, it can be sent in units of frames.
  • the reset code, reference code and data codes in all data packets in one frame of data can be sent continuously. If necessary, a certain high-level idle time can be added between codes, but it is necessary to ensure this high-level The idle time cannot be greater than T reset , otherwise it may be mistaken as a reset code by the circuit.
  • the idle time between frames can be connected with a high level, and there is no time requirement.
  • the so-called data transmission means that under the agreed specifications, the sender sends data as required, and the receiver interprets the input data. decode and get the correct data.
  • the so-called receiving end refers to the LED unit in the present invention.
  • the process of accurately obtaining its own data from the data sent by the LED unit from the sender is called adaptive decoding, and the circuit that completes the adaptive decoding work is called the adaptive decoding circuit.
  • the schematic diagram of the adaptive decoding circuit is as follows: Figure 6 shows.
  • the LED unit circuit also includes other module circuits, which are not described here, and the present invention only introduces the adaptive decoding circuit.
  • DI represents the data signal
  • CK1 is the clock signal of the LED unit circuit
  • DO is the data obtained after the decoding circuit completes the decoding work, generally 8 bits or multi-bit data processed for the convenience of subsequent circuits
  • 1 represents logic High level
  • 0 represents logic low level.
  • the signal edge detection processing circuit 100 is responsible for detecting the falling edge of the DI signal, and the circuit outputs a flag signal DIPL for use by other module circuits at the falling edge of the DI signal, and the DIPL signal is a positive pulse.
  • the adaptive data decoding circuit includes a first clock signal CK1, and both the input terminal of the signal edge detection processing circuit 100 and the input terminal of the reference code decoding circuit 300 are input with the first clock signal CK1 .
  • the reset code detection circuit 200 After the reset code detection circuit 200 successfully detects the reset code, a reset signal reset is generated, and the reset signal is a positive pulse.
  • the reference code decoding circuit 300 After receiving the reset signal, the reference code decoding circuit 300 first sets the output ED signal to 0, and then prepares to calculate the length of the reference code. The interval between the first two falling edges of DI after the reset signal is the length of the reference code. A clock signal CK1 is counted to calculate the length of the reference code. After the reference code decoding circuit calculates the length of the reference code, it divides the length value by 2N and saves it as Q, and outputs it from its output Q in real time for use by other related circuits, and sets the output signal ED to 1 for use by other circuits. So far, the reference code decoding is completed, and the reference code decoding circuit stops working until the next reset signal to work again according to the above process.
  • the adaptive data decoding circuit includes a counter circuit 500 and a data comparator circuit 600 , and the output terminal of the reference code decoding circuit 300 is connected to the first input terminal of the data comparator circuit 600 .
  • the output end of the counter circuit 500 is connected to the second input end of the data comparator circuit 600
  • the output end of the data comparator circuit 600 is connected to the data packet decoding circuit 400
  • the counter circuit 500 is used for input
  • the data comparator circuit 600 is configured to generate a second clock signal CK2 according to the counter result and the reference code decoding result
  • the second clock signal CK2 is used for input to the packet decoding circuit 400 .
  • the adaptive data decoding circuit includes an RS flip-flop 700, the R terminal of the RS flip-flop 700 is connected to the second clock signal, and the S terminal of the RS flip-flop 700 is connected to the second clock signal.
  • the output terminal Q of the RS flip-flop 700 is connected to the enable signal terminal of the counter circuit, and the RS flip-flop 700 is configured to output the enable signal according to the flag signal and the second clock signal. energy signal.
  • the adaptive data decoding circuit includes a D flip-flop 800, the D terminal of the D flip-flop 800 is connected to the output terminal of the data comparator circuit 600, and the D flip-flop 800
  • the clock signal terminal of the D flip-flop 800 is connected to the first clock signal, and the output terminal Q of the D flip-flop 800 outputs the second clock signal CK2.
  • the ED signal is set to 1, and other related circuits start the data packet decoding work when the ED signal is equal to 1.
  • the flag signal DIPL from the signal edge detection processing circuit 100 indicates the beginning of the data code, and the flag signal DIPL makes the output end Q of the RS flip-flop 700 output 1, and the output end Q of the RS flip-flop 700 is connected with the input end EN of the counter circuit 500 , when the input terminal EN of the counter circuit 500 becomes 1, its internal counter starts to work, that is, counts with the clock CK1, and outputs the result Q of the counter in real time.
  • the input terminal A and the input terminal B of the data comparator circuit 600 are connected to the output Q of the reference code decoding circuit 300 and the output Q of the counter circuit 500, respectively.
  • the output terminal Y of the data comparator circuit 600 outputs 1.
  • the input terminal D of the D flip-flop 800 is connected to the output terminal Y of the data comparator circuit 600.
  • the output terminal Q of the D flip-flop 800 outputs 1 under the action of the clock CK.
  • the output terminal Q of the D flip-flop 800 outputs the second clock signal CK2.
  • the second clock signal CK2 is connected to the input port R of the RS flip-flop 700 and is also connected to the clock terminal CK of the data decoding circuit 400 .
  • the second clock signal CK2 becomes 1
  • the output terminal Q of the RS flip-flop 700 is set to 0, thus the counter circuit 500 stops working, and at the same time its output Q is set to 0, so that the output Y of the data comparator circuit 600 changes accordingly. is 0, and finally the second clock signal CK2 becomes 0 again.
  • the length of a data code in the data packet is TL
  • the length of the reference code is N* TL .
  • a second clock signal CK2 will be generated at 1/ 2TL time point. If the high and low level lengths of the data 1 code and the data 0 code are reasonably defined, and the data DI is stored with the second clock signal CK2 as the clock, the data 1 code and the data 0 code can obtain the corresponding values 1 and 0 respectively. . In this way, the decoding of the one-bit data code is completed.
  • All data in the data packet is decoded in sequence according to the above method, and other related circuits of the LED unit obtain their own data according to their own address according to the specific definition of the data packet in the data frame.
  • the automatic code provided by the embodiment of the present invention is used.
  • the LED unit can correctly identify the data 1 code and the data 0 code.
  • Different TL lengths represent different data transmission rates. That is to say, the rate at which the controller sends data does not need to be fixed to a certain value, but to be set within a certain range, and the LED unit can decode and obtain the data correctly.
  • the N value is appropriately selected according to the specific application, and the range of the data code length TL is estimated, and the adaptive data transmission can be realized by designing a hardware circuit that satisfies the N value and the TL range.
  • the LED unit described in the embodiment of the present invention has four outputs. Each output is controlled by 8 bits of data to control its output duty cycle.
  • the main controller sends data, each LED unit decodes according to its own address and obtains its own data, and the data transmission between the main controller and each LED unit adopts the adaptive data decoding circuit provided by the embodiment of the present invention.
  • Each LED unit decodes its own data from the data sent by the main controller according to its own address.
  • the LED unit first converts the data loaded on the power supply line (VDD) into a standard digital signal DI. This part of the work is completed by a special circuit, which will not be described in detail here.
  • the so-called data in the following description refers to DI.
  • the definition of the data frame in the embodiment of the present invention is shown in FIG. 8 .
  • the high level that lasts for more than 120us is the time unit: microseconds. The same below) is the reset code.
  • the length of the reference code is 8 times the length of a data code in the data packet.
  • the multiple N 8 of the length of the reference code and the length of a data code.
  • a data code length TL ranges from 3 to 30us.
  • the high and low level lengths of the data code meet the requirements shown in Figure 5 and Table 1.
  • the data packet includes command byte CMD and data D0 ⁇ Dn. All LED unit circuits will receive the command byte CMD; data D0 ⁇ Dn are the LED unit circuits corresponding to addresses 0 ⁇ n used to control the data output by the 4 channels, and the LED unit circuit receives the corresponding data according to its own address.
  • the principle of adaptive data decoding in the embodiment of the present invention is shown in FIG. 6 .
  • the frequency of the first clock signal CK1 used in the decoding circuit is designed to be 10 MHz, and its period is 0.1 us.
  • the reference code is up to 240us, so the counter used to detect the length of the reference code in the reference code decoding circuit 300 is designed to be 12 bits to meet the requirements.
  • the result of the 12-bit counter divided by 2N is the reference code decoding circuit.
  • the range that the counter circuit 500 needs to be able to measure in actual work is half of the data code, that is, 1.5us to 15us.
  • the data comparator circuit 600 may also be designed to be 8 bits.
  • the signal edge detection and processing circuit 100 works in real time, and generates a signal DIPL when the DI signal falls on the falling edge for use by other circuits, as shown in FIG. 7 .
  • FIG. 10 it is a circuit schematic diagram of a specific implementation of the signal edge detection processing circuit 100 , which is specifically composed of three D flip-flops, a NOT gate, an AND gate, and a NOR gate. It should be understood that the circuit structure shown in FIG. 10 is only an example, and the signal edge detection processing circuit 100 in the embodiment of the present invention is not limited to the structure of FIG. 10 .
  • the reset code detection circuit 200 generates a reset signal reset after recognizing the reset code.
  • the reference code is after the reset.
  • the reset causes the reference code decoding circuit 300 to enter the working state, firstly, the output ED is set to 0, and then the DIPL signal is set to 0. Under the action, the reference code length calculation is completed and the final output result Q is obtained, and the output signal ED is set to 1 at the same time.
  • the specific work flow is as follows.
  • the first DIPL signal after the reset signal represents the start of the reference code. At this time, the internal counter of the reference code decoding circuit starts to work, that is, counting with CK1 as the clock. When the next DIPL signal appears, it represents the end of the reference code.
  • the circuit does the following two tasks, the first is to suspend the counter work, divide the result by 16 and store it in the output register Q and output it in real time; the second is to set the circuit output signal ED to 1.
  • the decoding of the reference code ends here, and the above working process is repeated again when the next frame of data arrives.
  • the data code decoding process is as follows: when the ED signal is 1, all data code decoding related circuits start to work, the data code starts at the falling edge of DI, and the DIPL signal is generated.
  • the DIPL signal sets the output Q of the RS flip-flop 700 to 1.
  • the counter When the input terminal EN of the circuit 500 receives the output Q of the RS flip-flop 700 and becomes 1, it starts to work, that is, counts with the clock signal CK as the clock, and the counter result Q is output in real time.
  • the output Y of the data comparator circuit 600 becomes 1, and the output Y of the data comparator circuit 600 is connected to the input terminal D of the D flip-flop 800.
  • the D flip-flop 800 detects that the input D becomes 1, in the first Its output Q becomes 1 under the action of the clock signal CK1.
  • the output terminal Q of the D flip-flop 800 drives the second clock signal CK2.
  • the second clock signal CK2 changes to 1, it acts on the RS flip-flop 700 and makes its output Q change to 0.
  • the EN terminal of the counter circuit 500 changes to 0, its output Q changes to 0.
  • the second clock signal CK2 After passing through the data comparator circuit After 600 and the D flip-flop 800 act, the second clock signal CK2 becomes 0 again under the action of the first clock signal CK1. As a result of the above process, the second clock signal CK2 is generated at half the length of the data code, and its timing waveform is shown in FIG. 7 .
  • the data decoding circuit 400 uses the second clock signal CK2 as a clock to store the DI data and output it to the DO signal for use by other module circuits. So far, the decoding of the one-bit data code is completed.
  • FIG. 9 it is a circuit schematic diagram of the reference code decoding circuit 300 in the embodiment of the present invention, and is specifically composed of three RS flip-flops, a NAND gate, an OR gate and a counter 310, wherein the upper 8 bits Q[11: 4] represents the output Q of the reference code decoding circuit 300 .
  • the LED unit circuit will sequentially decode all data codes as described above.
  • Other module circuits of the LED unit use the second clock signal CK2 and the DO data signal to use the data in groups of 8.
  • the first 8 bits of a frame of data are the command byte CMD, and all LED units receive the CMD byte. Afterwards, it receives its own data according to the CMD requirements and the current LED unit circuit address and stores it for backup. When the next reset code flag signal is reset, the received data is acted on the output module, so as to complete the task of the main controller sending data to control the four outputs of each LED unit circuit.
  • the LED unit circuit Both instructions and data can be decoded normally.
  • the adaptive data decoding circuit and LED unit circuit provided by the present invention can accept the data code length of the transmitting end to be randomly selected within a certain range. Compared with the LED unit that can only accept a fixed data code length, the application range is wider. The application environment is more adaptable. Because the sender can freely change the length of the data code within the required range, in actual engineering, the sending rate can be changed as needed to obtain better results. For example, the rate of sending data can be increased to increase the display frame rate of the LED unit. It is also possible to reduce the sending rate so that it works properly with a particularly large number of points.

Landscapes

  • Optical Communication System (AREA)
  • Dc Digital Transmission (AREA)

Abstract

An adaptive data decoding circuit and an LED unit circuit. The adaptive data decoding circuit comprises: a signal edge detection processing circuit (100), a reset code detection circuit (200), a reference code decoding circuit (300) and a data packet decoding circuit (400), wherein the signal edge detection processing circuit (100) is used for outputting a mark signal upon detection of a rising edge or a falling edge of a data code, each frame of data comprises a reset code, a reference code and a data packet which are sequentially connected, the data packet comprises a plurality of data codes, the length of the reference code is N times of the length of one data code in the data packet, and N is a natural number greater than 1; the reset code detection circuit (200) is used for generating a reset signal; the reference code decoding circuit (300) is used for decoding the reference code in each frame of data, so as to obtain a reference code decoding result; and the data packet decoding circuit (400) is used for decoding the data packet. The adaptive data decoding circuit and the LED unit circuit can implement adaptive data decoding.

Description

一种自适应数据解码电路及LED单元电路An adaptive data decoding circuit and LED unit circuit 技术领域technical field
本发明涉及LED电路技术领域,尤其涉及一种自适应数据解码电路及包括该自适应数据解码电路的LED单元电路。The present invention relates to the technical field of LED circuits, in particular to an adaptive data decoding circuit and an LED unit circuit including the adaptive data decoding circuit.
背景技术Background technique
目前LED已大量应用在装饰、照明、广告、舞台灯光等很多领域。一般情况下,LED都需要专门的集成电路来驱动控制,即LED驱动电路。在以下的描述中,把LED和其相应的驱动电路的组合称之为LED单元。在实际应用中,一般是将多个LED单元并联或者串联组成一个更大的LED工程。为了让每个LED单元能按照要求工作,需要通过控制器给每个LED单元发送对应数据。在并联应用工程中,一般做法是给每个LED单元设定地址,各个LED单元根据自己的地址接收从主控器发来的对应数据。At present, LED has been widely used in decoration, lighting, advertising, stage lighting and many other fields. In general, LEDs require a dedicated integrated circuit to drive and control, that is, an LED drive circuit. In the following description, the combination of the LED and its corresponding driving circuit is referred to as an LED unit. In practical applications, multiple LED units are generally connected in parallel or in series to form a larger LED project. In order to make each LED unit work as required, it is necessary to send corresponding data to each LED unit through the controller. In parallel application engineering, the general practice is to set an address for each LED unit, and each LED unit receives the corresponding data from the main controller according to its own address.
主控器按照约定的数据格式发送数据,LED单元可根据自己的地址收到对应数据。数据发送速率一般都是产品设计时约定好的,这就是固定数据发送速率。固定数据发送速率的优点在于LED单元接收端数据解码简单,但是固定数据发送速率的缺点也比较明显,主要有以下几点:The main controller sends data according to the agreed data format, and the LED unit can receive the corresponding data according to its own address. The data transmission rate is generally agreed upon in product design, which is the fixed data transmission rate. The advantage of the fixed data transmission rate is that the data decoding at the receiving end of the LED unit is simple, but the disadvantages of the fixed data transmission rate are also obvious, mainly in the following points:
第一,多个LED单元连接组成一个系统,如果在将这些LED单元连接时出现了比较长的连接线,或者同一系统中使用了比较多的LED单元时,对于主控制器的驱动输出端口来说,负载比较大,其发送到各个LED单元的数据失真比较大,最终导致LED单元解码失败的概率增加,严重的情况下无法正常工作。First, multiple LED units are connected to form a system. If there is a relatively long connection line when connecting these LED units, or when more LED units are used in the same system, the drive output port of the main controller will be used. It is said that the larger the load, the larger the distortion of the data sent to each LED unit, which eventually leads to an increase in the probability of the LED unit decoding failure, and in severe cases it cannot work normally.
第二,是LED单元解码问题,因为数据发送速率是固定的,这就要求LED单元对数据的解码必须按照这个固定的速率来进行,一般LED单元内部有一个固定频率的时钟来用于解码接收数据,但是这个内部时钟频率跟应用条件有关,比如电压变化,温度变化等等,都会导致LED单元内部时钟发生变化。另外在集成电路加工环节,工艺偏差也会导致时钟频率偏差。由于时钟频率偏差导致LED单元对来自主控制器的数据解码失败概率大增,因此,为了保证LED单元能顺利解码,对产品设计和生产工艺要求更高。The second is the decoding problem of the LED unit, because the data transmission rate is fixed, which requires the LED unit to decode the data at this fixed rate. Generally, there is a fixed frequency clock inside the LED unit for decoding and receiving. Data, but this internal clock frequency is related to application conditions, such as voltage changes, temperature changes, etc., which will cause the internal clock of the LED unit to change. In addition, in the process of integrated circuit processing, process deviation will also lead to clock frequency deviation. Due to the deviation of the clock frequency, the probability of failure of the LED unit to decode the data from the main controller is greatly increased. Therefore, in order to ensure the smooth decoding of the LED unit, the product design and production process requirements are higher.
另外,在实际应用时,固定数据发送速率比较难满足不同应用场合,比如,有时工程中LED单元较少,但客户需要比较高的数据发送速率来提高刷新率,这种情况下,固定数据发送速率无法实现。In addition, in practical applications, the fixed data transmission rate is difficult to meet different applications. For example, sometimes there are fewer LED units in the project, but the customer needs a relatively high data transmission rate to improve the refresh rate. In this case, the fixed data transmission rate rate cannot be achieved.
发明内容SUMMARY OF THE INVENTION
本发明提供了一种自适应数据解码电路及包括该自适应数据解码电路的LED单元电路,解决相关技术中存在的数据发送速率固定时解码必须按照固定速率进行导致的工艺以及生产要求较高的问题。The invention provides an adaptive data decoding circuit and an LED unit circuit including the adaptive data decoding circuit, which solves the problem in the related art that the decoding must be performed at a fixed rate when the data transmission rate is fixed, and the process and production requirements are relatively high. question.
作为本发明的第一个方面,提供一种自适应数据解码电路,其中,包括:信号边沿检测处理电路、复位码检测电路、参考码解码电路和数据包解码电路,所述信号边沿检测处理电路的输出端以及所述复位码检测电路的输出端均连接 所述参考码解码电路的输入端,所述参考码解码电路的输出端和所述数据包解码电路连接;As a first aspect of the present invention, an adaptive data decoding circuit is provided, which includes: a signal edge detection processing circuit, a reset code detection circuit, a reference code decoding circuit and a data packet decoding circuit, the signal edge detection processing circuit Both the output end of the reference code decoding circuit and the output end of the reset code detection circuit are connected to the input end of the reference code decoding circuit, and the output end of the reference code decoding circuit is connected to the data packet decoding circuit;
所述信号边沿检测处理电路用于检测每一帧数据中数据码的上升沿或者下降沿,并能够在检测到数据码的上升沿或者下降沿时输出标志信号,其中每一帧数据均包括依次连接的复位码、参考码和数据包,所述数据包包括多个数据码,所述参考码的长度为所述数据包中一个数据码的长度的N倍,且N为大于1的自然数;The signal edge detection processing circuit is used to detect the rising edge or falling edge of the data code in each frame of data, and can output a flag signal when the rising edge or falling edge of the data code is detected, wherein each frame of data includes sequential A connected reset code, a reference code and a data packet, the data packet includes a plurality of data codes, the length of the reference code is N times the length of a data code in the data packet, and N is a natural number greater than 1;
所述复位码检测电路用于在识别到所述每一帧数据中的复位码后产生复位信号;The reset code detection circuit is configured to generate a reset signal after recognizing the reset code in each frame of data;
所述参考码解码电路用于根据所述标志信号和所述复位信号对所述每一帧数据中的参考码进行解码,得到参考码解码结果;The reference code decoding circuit is configured to decode the reference code in each frame of data according to the flag signal and the reset signal to obtain a reference code decoding result;
数据码解码电路用于根据所述参考码解码结果生成数据包的解码速率,并根据所述数据码的解码速率对所述数据包进行解码。The data code decoding circuit is configured to generate a decoding rate of the data packet according to the decoding result of the reference code, and decode the data packet according to the decoding rate of the data code.
进一步地,所述自适应数据解码电路包括第一时钟信号,所述信号边沿检测处理电路的输入端和所述参考码解码电路的输入端均输入所述第一时钟信号。Further, the adaptive data decoding circuit includes a first clock signal, and both the input terminal of the signal edge detection processing circuit and the input terminal of the reference code decoding circuit are input with the first clock signal.
进一步地,所述自适应数据解码电路包括计数器电路和数据比较器电路,所述参考码解码电路的输出端连接所述数据比较器电路的第一输入端,所述计数器电路的输出端连接所述数据比较器电路的第二输入端,所述数据比较器电路的输出端连接所述数据包解码电路,所述计数器电路用于输入使能信号与第一时钟信号,并输出计数器结果,所述数据比较器电路用于根据所述计数器结果与所述参考码解码结果生成第二时钟信号,所述第二时钟信号用于输入至所述数据包解码电路。Further, the adaptive data decoding circuit includes a counter circuit and a data comparator circuit, the output terminal of the reference code decoding circuit is connected to the first input terminal of the data comparator circuit, and the output terminal of the counter circuit is connected to the first input terminal of the data comparator circuit. The second input end of the data comparator circuit, the output end of the data comparator circuit is connected to the data packet decoding circuit, the counter circuit is used to input the enable signal and the first clock signal, and output the counter result, so The data comparator circuit is used for generating a second clock signal according to the result of the counter and the decoding result of the reference code, and the second clock signal is used for inputting to the data packet decoding circuit.
进一步地,所述自适应数据解码电路包括RS触发器,所述RS触发器的R端连接所述第二时钟信号,所述RS触发器的S端连接所述标志信号,所述RS触发器的输出端Q连接所述计数器电路的使能信号端,所述RS触发器用于根据所述标志信号和所述第二时钟信号输出所述使能信号。Further, the adaptive data decoding circuit includes an RS flip-flop, the R terminal of the RS flip-flop is connected to the second clock signal, the S terminal of the RS flip-flop is connected to the flag signal, and the RS flip-flop is connected to the second clock signal. The output terminal Q of the counter circuit is connected to the enable signal terminal of the counter circuit, and the RS flip-flop is used for outputting the enable signal according to the flag signal and the second clock signal.
进一步地,所述自适应数据解码电路包括D触发器,所述D触发器的D端连接所述数据比较器电路的输出端,所述D触发器的时钟信号端连接所述第一时钟信号,所述D触发器的输出端Q输出第二时钟信号。Further, the adaptive data decoding circuit includes a D flip-flop, the D terminal of the D flip-flop is connected to the output terminal of the data comparator circuit, and the clock signal terminal of the D flip-flop is connected to the first clock signal , the output terminal Q of the D flip-flop outputs a second clock signal.
进一步地,所述参考码的长度为所述数据包中一个数据码的长度的8倍。Further, the length of the reference code is 8 times the length of a data code in the data packet.
作为本发明的另一个方面,提供一种LED单元电路,其中,包括:控制器和多个LED单元,每个LED单元均与所述控制器通信连接,且每个LED单元均包括前文所述的自适应数据解码电路,所述控制器能够向每个LED单元发送多帧数据,每个LED单元中的自适应数据解码电路均能够对收到的每一帧数据按照对应的解码速率进行解码。As another aspect of the present invention, an LED unit circuit is provided, which includes: a controller and a plurality of LED units, each LED unit is communicatively connected to the controller, and each LED unit includes the aforementioned The controller can send multiple frames of data to each LED unit, and the adaptive data decoding circuit in each LED unit can decode each frame of data received according to the corresponding decoding rate .
进一步地,每个LED单元与所述控制器均通过数据线连接。Further, each LED unit is connected with the controller through a data line.
进一步地,每个LED单元与所述控制器均通过电源线载波进行通信连接。Further, each LED unit and the controller are connected in communication with the controller through a power line carrier.
本发明实施例提供的自适应数据解码电路,由于在每帧数据中均设置了参 考码,而参考码的长度是可以自定义的,且参考码的长度与数据包中一个数据码的长度成比例设置,当LED单元接收到数据时,首先解码参考码,根据参考码的长度可以确定数据包的解码速率,这样可以为数据包按照相应速率解码提前准备,从而可以实现自适应数据解码,不再受制于传输速率的影响。In the adaptive data decoding circuit provided by the embodiment of the present invention, since a reference code is set in each frame of data, the length of the reference code can be customized, and the length of the reference code is equal to the length of a data code in the data packet. Scale setting, when the LED unit receives data, it first decodes the reference code, and the decoding rate of the data packet can be determined according to the length of the reference code. Again subject to the impact of the transmission rate.
附图说明Description of drawings
附图是用来提供对本发明的进一步理解,并且构成说明书的一部分,与下面的具体实施方式一起用于解释本发明,但并不构成对本发明的限制。The accompanying drawings are used to provide a further understanding of the present invention, and constitute a part of the specification, and together with the following specific embodiments, are used to explain the present invention, but do not constitute a limitation to the present invention.
图1为本发明提供的LED单元电路的一种具体地实施方式。FIG. 1 is a specific embodiment of the LED unit circuit provided by the present invention.
图2为本发明提供的LED单元电路的另一种具体地实施方式。FIG. 2 is another specific embodiment of the LED unit circuit provided by the present invention.
图3为本发明提供的自适应数据解码电路的结构框图。FIG. 3 is a structural block diagram of an adaptive data decoding circuit provided by the present invention.
图4为本发明提供的一帧数据结构示意图。FIG. 4 is a schematic diagram of a frame data structure provided by the present invention.
图5为本发明提供的一帧数据中复位码、参考码和数据包中的数据波形示意图。FIG. 5 is a schematic diagram of a reset code, a reference code and a data waveform in a data packet in a frame of data provided by the present invention.
图6为本发明提供的自适应数据解码电路的具体电路结构示意图。FIG. 6 is a schematic diagram of a specific circuit structure of an adaptive data decoding circuit provided by the present invention.
图7为本发明提供的数据1码和数据0码的解码波形时序图。FIG. 7 is a timing diagram of the decoding waveforms of the data 1 code and the data 0 code provided by the present invention.
图8为本发明提供的一种具体实施方式中一帧数据的示意图。FIG. 8 is a schematic diagram of one frame of data in a specific implementation manner provided by the present invention.
图9为本发明提供的参考码解码电路的电路原理图。FIG. 9 is a circuit schematic diagram of a reference code decoding circuit provided by the present invention.
图10为本发明提供的信号边沿检测处理电路的电路原理图。FIG. 10 is a circuit schematic diagram of a signal edge detection processing circuit provided by the present invention.
具体实施方式detailed description
需要说明的是,在不冲突的情况下,本发明中的实施例及实施例中的特征可以相互结合。下面将参考附图并结合实施例来详细说明本发明。It should be noted that the embodiments of the present invention and the features of the embodiments may be combined with each other under the condition of no conflict. The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
为了使本领域技术人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only Embodiments of some, but not all, of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包括,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "first", "second" and the like in the description and claims of the present invention and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific sequence or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances for the embodiments of the invention described herein. Furthermore, the terms "comprising" and "having", and any variations thereof, are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those expressly listed Rather, those steps or units may include other steps or units not expressly listed or inherent to these processes, methods, products or devices.
为了解决现有技术中存在的LED单元必须按照固定速率进行解码的问题,本发明实施例提供的一种LED单元电路,如图1和图2所示,包括控制器和多个LED单元,每个LED单元均与所述控制器通信连接,且每个LED单元均包括自适应数据解码电路,所述控制器能够向每个LED单元发送多帧数据,每个LED单元中的自适应数据解码电路均能够对收到的每一帧数据按照对应的解码速率进行解码。In order to solve the problem that the LED units in the prior art must be decoded at a fixed rate, an LED unit circuit provided by an embodiment of the present invention, as shown in FIG. 1 and FIG. 2 , includes a controller and a plurality of LED units, each Each LED unit is connected in communication with the controller, and each LED unit includes an adaptive data decoding circuit, the controller can send multiple frames of data to each LED unit, and the adaptive data decoding in each LED unit decodes The circuits can decode each frame of data received according to the corresponding decoding rate.
应当理解的是,本发明实施例提供的自适应数据解码电路能够在一定范围内根据需要进行设定,可以使得每个LED单元都能够顺利准确完成数据解码,无需按照固定速率进行解码。It should be understood that the adaptive data decoding circuit provided by the embodiment of the present invention can be set as required within a certain range, so that each LED unit can successfully and accurately complete data decoding without decoding at a fixed rate.
如图1所示,每个LED单元与所述控制器均通过数据线连接。As shown in FIG. 1 , each LED unit is connected with the controller through a data line.
如图2所示,每个LED单元与所述控制器均通过电源线载波进行通信连接。As shown in FIG. 2 , each LED unit and the controller are connected in communication with the controller through a power line carrier.
可以理解的是,每个LED单元与所述控制器可以通过电源线载波来实现数据传输。It can be understood that, each LED unit and the controller can realize data transmission through the power line carrier.
应当理解的是,所述控制器可以包括MCU等,具体可以根据需要进行选择,此处不做限定。It should be understood that the controller may include an MCU, etc., which may be selected as required, which is not limited here.
需要说明的是,所有连接在主控制器上的LED单元都能同时接收到所有的数据,各个LED单元分别对主控制器发来的数据进行解码并根据自己的地址收取属于自己的数据。主控制器以帧为单位发送数据。It should be noted that all LED units connected to the main controller can receive all data at the same time, and each LED unit decodes the data sent by the main controller and receives its own data according to its own address. The master controller sends data in units of frames.
下面详细说明能够使得每个LED单元进行自适应速率解码的自适应数据解码电路。The adaptive data decoding circuit that enables adaptive rate decoding for each LED unit will be described in detail below.
图3是根据本发明实施例提供的自适应数据解码电路的结构框图,如图3所示,包括:信号边沿检测处理电路100、复位码检测电路200、参考码解码电路300和数据包解码电路400,所述信号边沿检测处理电路100的输出端以及所述复位码检测电路200的输出端均连接所述参考码解码电路300的输入端,所述参考码解码电路300的输出端和所述数据包解码电路400连接;FIG. 3 is a structural block diagram of an adaptive data decoding circuit provided according to an embodiment of the present invention. As shown in FIG. 3 , it includes: a signal edge detection processing circuit 100, a reset code detection circuit 200, a reference code decoding circuit 300, and a data packet decoding circuit 400. The output end of the signal edge detection processing circuit 100 and the output end of the reset code detection circuit 200 are both connected to the input end of the reference code decoding circuit 300, and the output end of the reference code decoding circuit 300 is connected to the reference code decoding circuit 300. The data packet decoding circuit 400 is connected;
所述信号边沿检测处理电路100用于检测每一帧数据中数据码的上升沿或者下降沿,并能够在检测到数据码的上升沿或者下降沿时输出标志信号,其中每一帧数据均包括依次连接的复位码、参考码和数据包,所述数据包包括多个数据码,所述参考码的长度为所述数据包中一个数据码的长度的N倍,且N为大于1的自然数;The signal edge detection processing circuit 100 is used to detect the rising edge or falling edge of the data code in each frame of data, and can output a flag signal when the rising edge or falling edge of the data code is detected, wherein each frame of data includes: A reset code, a reference code and a data packet connected in sequence, the data packet includes a plurality of data codes, the length of the reference code is N times the length of a data code in the data packet, and N is a natural number greater than 1 ;
所述复位码检测电路200用于在识别到所述每一帧数据中的复位码后产生复位信号;The reset code detection circuit 200 is configured to generate a reset signal after identifying the reset code in each frame of data;
所述参考码解码电路300用于根据所述标志信号和所述复位信号对所述每一帧数据中的参考码进行解码,得到参考码解码结果;The reference code decoding circuit 300 is configured to decode the reference code in each frame of data according to the flag signal and the reset signal to obtain a reference code decoding result;
数据码解码电路400用于根据所述参考码解码结果生成数据包的解码速率,并根据所述数据码的解码速率对所述数据包进行解码。The data code decoding circuit 400 is configured to generate a decoding rate of the data packet according to the decoding result of the reference code, and decode the data packet according to the decoding rate of the data code.
需要说明的是,本发明实施例中的一帧数据具体指,一帧数据以复位码开头,之后是参考码,之后是数据包。一帧数据时序波形示意图如图4所示。It should be noted that, a frame of data in the embodiment of the present invention specifically refers to that a frame of data starts with a reset code, followed by a reference code, and then followed by a data packet. A schematic diagram of a frame of data timing waveform is shown in Figure 4.
相对于采用固定频率传输数据的数据帧结构,本发明提供的自适应数据解码电路的数据帧结构增加了参考码,可以接受发送端数据码长度在一定范围内随意选取,相对于只能接受固定数据码长度的LED单元,应用范围更广,对应用环境适应性更强。因为发送端可以在要求范围内随意改变数据码长度,所以,在实际工程中,可根据需要改变发送速率以获得更优秀的效果,例如,可以提高发送数据的速率以提高LED单元显示帧频,也可以降低发送速率以使点数特别多的情况下能正常工作。Compared with the data frame structure that uses a fixed frequency to transmit data, the data frame structure of the adaptive data decoding circuit provided by the present invention adds a reference code, and the length of the data code at the sending end can be randomly selected within a certain range. The LED unit with the data code length has a wider application range and is more adaptable to the application environment. Because the sender can freely change the length of the data code within the required range, in actual engineering, the sending rate can be changed as needed to obtain better results. For example, the rate of sending data can be increased to increase the display frame rate of the LED unit. It is also possible to reduce the sending rate so that it works properly with a particularly large number of points.
因为是单线传输数据,所以数据的解码是通过判断信号电平变化和高、低电平时长来完成的。将信号的下降沿作为所有数据码的开始,之后一个下降沿是当前一位数据码的结束,同时也是下一位数据码的开始,如此将所有的数据码连接起来。数据帧与帧之间通过复位码连接。这里是按下降沿开始所有数据码的,也可以使用上升沿作为数据码的开始,只要LED单元设计规范和主控器发送数据规范相对应即可。上述所谓数据码是参考码和数据包中每一位数据的统称。Because the data is transmitted over a single wire, the decoding of the data is done by judging the signal level change and the duration of the high and low levels. The falling edge of the signal is used as the start of all data codes, and the next falling edge is the end of the current data code and the beginning of the next data code, thus connecting all the data codes. The data frames are connected by reset codes. Here, all data codes are started according to the falling edge, and the rising edge can also be used as the start of the data code, as long as the LED unit design specification corresponds to the data specification sent by the main controller. The above-mentioned so-called data code is a general term for the reference code and each bit of data in the data packet.
下面详细描述一帧数据的各组成部分。这里按照信号下降沿作为数据码开始来介绍。Each component of one frame of data is described in detail below. Here, it is introduced according to the falling edge of the signal as the start of the data code.
复位码,定义数据信号持续高电平超过一定长度为复位码。复位码有两个作用,第一个作用是确定一帧新数据开始发送,对于LED单元电路来说,检测到复位码时,要做好接收新数据的准备,即随时开始参考码和数据包的解码工作;第二个作用是将上一帧数据生效,也就是说,LED单元电路在解码数据包并收到属于自己的数据包时,只是暂时存下来,要等到下一个复位码时才将数据加载到其工作寄存器使用。Reset code, which defines the data signal as the reset code if the data signal continues to be at a high level for more than a certain length. The reset code has two functions. The first function is to determine the start of sending a new frame of data. For the LED unit circuit, when the reset code is detected, it must be ready to receive new data, that is, start the reference code and data packets at any time. The second function is to make the data of the previous frame take effect, that is to say, when the LED unit circuit decodes the data packet and receives its own data packet, it is only temporarily stored, and will not be stored until the next reset code. Load data into its working register for use.
参考码,定义复位码之后的第一个数据码是参考码。参考码的作用是确定数据传输速率。参考码码的长度是数据包中一个数据码的长度的N倍。Reference code, it is defined that the first data code after the reset code is the reference code. The role of the reference code is to determine the data transfer rate. The length of the reference code code is N times the length of one data code in the data packet.
数据包,定义参考码之后的所有数据码总合是数据包。数据码有两种:数据1码和数据0码。Data packet, the sum of all data codes after the definition reference code is a data packet. There are two kinds of data codes: data 1 code and data 0 code.
参考码和数据包都是以数据信号下降沿开始,按规定持续一定长时间低电平后变为高电平并保持规定时间结束。复位码、参考码和数据包波形示意图如图5,T D是数据1码高电平时间长度,所有码型高、低电平长度都参考T D来定义。一般情况下,复位码的长度T reset可定义为几百微秒到几毫秒。T D根据实际情况具体设定,但要满足以下要求,即不管是参考码或者是数据码,其中的高电平时间长度不能大于复位码。 Both the reference code and the data packet start with the falling edge of the data signal, and the low level lasts for a certain period of time and then changes to a high level and ends for a specified time. The schematic diagram of reset code, reference code and data packet waveform is shown in Figure 5, TD is the high level time length of data 1 code, and the high and low level lengths of all patterns are defined with reference to TD . In general, the length T reset of the reset code can be defined as several hundreds of microseconds to several milliseconds. T D is specifically set according to the actual situation, but it must meet the following requirements, that is, whether it is a reference code or a data code, the length of the high level time cannot be longer than the reset code.
表1 一帧数据中复位码、参考码和数据包的定义表Table 1 Definition of reset code, reference code and data packet in one frame of data
Figure PCTCN2020122135-appb-000001
Figure PCTCN2020122135-appb-000001
需要说明的是,T D表示数据1码高电平时间长度,所有码型高、低电平长度都参考T D来定义。参考码的长度是数据包中一个数据码的长度的N倍,通常 N≥2。 It should be noted that TD represents the high level time length of data 1 code, and the high and low level lengths of all code patterns are defined with reference to TD . The length of the reference code is N times the length of a data code in the data packet, usually N≥2.
发送端在发送数据时,以帧为单位发送即可。一帧数据中的复位码、参考码和所有数据包中的数据码连续发出即可,如有需要,可以在码与码之间增加一定的高电平空闲时间,但是要确保这个高电平空闲时间不能大于T reset,否则有可能被电路误认为是复位码。帧与帧之间的空闲时间用高电平连接即可,没有时间要求。 When the sender sends data, it can be sent in units of frames. The reset code, reference code and data codes in all data packets in one frame of data can be sent continuously. If necessary, a certain high-level idle time can be added between codes, but it is necessary to ensure this high-level The idle time cannot be greater than T reset , otherwise it may be mistaken as a reset code by the circuit. The idle time between frames can be connected with a high level, and there is no time requirement.
确定了一帧数据结构后,下面描述数据传输至自适应数据解码电路进行解码的具体实现过程,所谓数据传输,是指在约定的规范下,发送端按照要求发送数据,接收端对输入的数据解码并得到正确的数据。所谓接收端在本发明中指的是LED单元。把LED单元从发送端发来的数据中准确的获得属于自己的数据的过程称之为自适应解码,把完成自适应解码工作的电路称之为自适应解码电路,自适应解码电路原理示意图如图6示。LED单元电路除了自适应解码电路,还包括其他模块电路,这里不予描述,本发明只介绍自适应解码电路。After determining the data structure of a frame, the following describes the specific implementation process of data transmission to the adaptive data decoding circuit for decoding. The so-called data transmission means that under the agreed specifications, the sender sends data as required, and the receiver interprets the input data. decode and get the correct data. The so-called receiving end refers to the LED unit in the present invention. The process of accurately obtaining its own data from the data sent by the LED unit from the sender is called adaptive decoding, and the circuit that completes the adaptive decoding work is called the adaptive decoding circuit. The schematic diagram of the adaptive decoding circuit is as follows: Figure 6 shows. In addition to the adaptive decoding circuit, the LED unit circuit also includes other module circuits, which are not described here, and the present invention only introduces the adaptive decoding circuit.
以下的描述中,DI代表数据信号;CK1是LED单元电路的时钟信号;DO是解码电路完成解码工作后得到的数据,一般是8位或者处理为方便后续电路使用的多位数据;1代表逻辑高电平,0代表逻辑低电平。In the following description, DI represents the data signal; CK1 is the clock signal of the LED unit circuit; DO is the data obtained after the decoding circuit completes the decoding work, generally 8 bits or multi-bit data processed for the convenience of subsequent circuits; 1 represents logic High level, 0 represents logic low level.
信号边沿检测处理电路100负责检测DI信号的下降沿,该电路会在DI下降沿时输出标志信号DIPL供其他模块电路使用,DIPL信号是一个正脉冲。The signal edge detection processing circuit 100 is responsible for detecting the falling edge of the DI signal, and the circuit outputs a flag signal DIPL for use by other module circuits at the falling edge of the DI signal, and the DIPL signal is a positive pulse.
应当理解的是,所述自适应数据解码电路包括第一时钟信号CK1,所述信号边沿检测处理电路100的输入端和所述参考码解码电路300的输入端均输入所述第一时钟信号CK1。It should be understood that the adaptive data decoding circuit includes a first clock signal CK1, and both the input terminal of the signal edge detection processing circuit 100 and the input terminal of the reference code decoding circuit 300 are input with the first clock signal CK1 .
复位码检测电路200成功检测到复位码后,产生复位信号reset,reset信号是一个正脉冲。参考码解码电路300收到reset信号后,首先将输出ED信号置为0,然后准备计算参考码的长度,在reset信号之后的DI的前两次下降沿间隔时间就是参考码长度,这里通过第一时钟信号CK1计数的方式来计算参考码长度的。参考码解码电路计算好参考码长度后,将此长度值除以2N后保存为Q,并实时从其输出端Q输出为其他相关电路使用,同时将输出信号ED置1以备其他电路使用。至此,参考码解码完成,参考码解码电路停止工作,直到下次reset信号来再次按上述流程工作。After the reset code detection circuit 200 successfully detects the reset code, a reset signal reset is generated, and the reset signal is a positive pulse. After receiving the reset signal, the reference code decoding circuit 300 first sets the output ED signal to 0, and then prepares to calculate the length of the reference code. The interval between the first two falling edges of DI after the reset signal is the length of the reference code. A clock signal CK1 is counted to calculate the length of the reference code. After the reference code decoding circuit calculates the length of the reference code, it divides the length value by 2N and saves it as Q, and outputs it from its output Q in real time for use by other related circuits, and sets the output signal ED to 1 for use by other circuits. So far, the reference code decoding is completed, and the reference code decoding circuit stops working until the next reset signal to work again according to the above process.
具体地,如图6所示,所述自适应数据解码电路包括计数器电路500和数据比较器电路600,所述参考码解码电路300的输出端连接所述数据比较器电路600的第一输入端,所述计数器电路500的输出端连接所述数据比较器电路600的第二输入端,所述数据比较器电路600的输出端连接所述数据包解码电路400,所述计数器电路500用于输入使能信号与第一时钟信号,并输出计数器结果,所述数据比较器电路600用于根据所述计数器结果与所述参考码解码结果生成第二时钟信号CK2,所述第二时钟信号CK2用于输入至所述数据包解码电路400。Specifically, as shown in FIG. 6 , the adaptive data decoding circuit includes a counter circuit 500 and a data comparator circuit 600 , and the output terminal of the reference code decoding circuit 300 is connected to the first input terminal of the data comparator circuit 600 . , the output end of the counter circuit 500 is connected to the second input end of the data comparator circuit 600, the output end of the data comparator circuit 600 is connected to the data packet decoding circuit 400, and the counter circuit 500 is used for input The enable signal and the first clock signal, and output the counter result, the data comparator circuit 600 is configured to generate a second clock signal CK2 according to the counter result and the reference code decoding result, and the second clock signal CK2 is used for input to the packet decoding circuit 400 .
进一步具体地,如图6所示,所述自适应数据解码电路包括RS触发器700,所述RS触发器700的R端连接所述第二时钟信号,所述RS触发器700的S端 连接所述标志信号,所述RS触发器700的输出端Q连接所述计数器电路的使能信号端,所述RS触发器700用于根据所述标志信号和所述第二时钟信号输出所述使能信号。Further specifically, as shown in FIG. 6 , the adaptive data decoding circuit includes an RS flip-flop 700, the R terminal of the RS flip-flop 700 is connected to the second clock signal, and the S terminal of the RS flip-flop 700 is connected to the second clock signal. For the flag signal, the output terminal Q of the RS flip-flop 700 is connected to the enable signal terminal of the counter circuit, and the RS flip-flop 700 is configured to output the enable signal according to the flag signal and the second clock signal. energy signal.
进一步具体地,如图6所示,所述自适应数据解码电路包括D触发器800,所述D触发器800的D端连接所述数据比较器电路600的输出端,所述D触发器800的时钟信号端连接所述第一时钟信号,所述D触发器800的输出端Q输出第二时钟信号CK2。Further specifically, as shown in FIG. 6 , the adaptive data decoding circuit includes a D flip-flop 800, the D terminal of the D flip-flop 800 is connected to the output terminal of the data comparator circuit 600, and the D flip-flop 800 The clock signal terminal of the D flip-flop 800 is connected to the first clock signal, and the output terminal Q of the D flip-flop 800 outputs the second clock signal CK2.
具体地,参考码解码完成后ED信号被置1,其他各相关电路在ED信号等于1时开始数据包解码工作。来自信号边沿检测处理电路100的标志信号DIPL表示数据码的开始,标志信号DIPL使得RS触发器700的输出端Q输出1,RS触发器700的输出端Q与计数器电路500的输入端EN相连接,当计数器电路500的输入端EN变为1时,其内部计数器开始工作,即以时钟CK1计数,并实时将计数器的结果Q输出。数据比较器电路600的输入端A和输入端B分别与参考码解码电路300的输出Q和计数器电路500的输出Q连接。当数据比较器电路600的输入A和输入B相等时,其输出端Y输出1。D触发器800的输入端D与数据比较器电路600的输出端Y连接,在D触发器800的输入端D变为1时,在其时钟CK作用下,其输出端Q输出1。D触发器800的输出端Q输出第二时钟信号CK2。第二时钟信号CK2与RS触发器700的输入端口R连接,同时还连接数据解码电路400的时钟端CK。当第二时钟信号CK2变为1时,RS触发器700输出端Q被置为0,这样计数器电路500停止工作,同时其输出Q被置为0,从而数据比较器电路600输出Y随之变为0,最后第二时钟信号CK2再次变为0。Specifically, after the decoding of the reference code is completed, the ED signal is set to 1, and other related circuits start the data packet decoding work when the ED signal is equal to 1. The flag signal DIPL from the signal edge detection processing circuit 100 indicates the beginning of the data code, and the flag signal DIPL makes the output end Q of the RS flip-flop 700 output 1, and the output end Q of the RS flip-flop 700 is connected with the input end EN of the counter circuit 500 , when the input terminal EN of the counter circuit 500 becomes 1, its internal counter starts to work, that is, counts with the clock CK1, and outputs the result Q of the counter in real time. The input terminal A and the input terminal B of the data comparator circuit 600 are connected to the output Q of the reference code decoding circuit 300 and the output Q of the counter circuit 500, respectively. When the input A and the input B of the data comparator circuit 600 are equal, the output terminal Y of the data comparator circuit 600 outputs 1. The input terminal D of the D flip-flop 800 is connected to the output terminal Y of the data comparator circuit 600. When the input terminal D of the D flip-flop 800 becomes 1, the output terminal Q of the D flip-flop 800 outputs 1 under the action of the clock CK. The output terminal Q of the D flip-flop 800 outputs the second clock signal CK2. The second clock signal CK2 is connected to the input port R of the RS flip-flop 700 and is also connected to the clock terminal CK of the data decoding circuit 400 . When the second clock signal CK2 becomes 1, the output terminal Q of the RS flip-flop 700 is set to 0, thus the counter circuit 500 stops working, and at the same time its output Q is set to 0, so that the output Y of the data comparator circuit 600 changes accordingly. is 0, and finally the second clock signal CK2 becomes 0 again.
从上面描述的相关电路工作过程可以看出,从DI下降沿开始到一定时间点产生一个脉冲信号CK2。具体时序波形参考图7。It can be seen from the working process of the related circuit described above that a pulse signal CK2 is generated from the falling edge of DI to a certain time point. Refer to Figure 7 for specific timing waveforms.
假设数据包中的一个数据码的长度是T L,则参考码的长度是N*T L,每个数据码经过上述电路处理后,会在1/2T L时间点产生第二时钟信号CK2。如果合理定义数据1码和数据0码的高、低电平长度,并以第二时钟信号CK2为时钟将数据DI存储下来,那么数据1码和数据0码就能分别得到对应值1和0。这样就完成了一位数据码的解码工作。 Assuming that the length of a data code in the data packet is TL , the length of the reference code is N* TL . After each data code is processed by the above circuit, a second clock signal CK2 will be generated at 1/ 2TL time point. If the high and low level lengths of the data 1 code and the data 0 code are reasonably defined, and the data DI is stored with the second clock signal CK2 as the clock, the data 1 code and the data 0 code can obtain the corresponding values 1 and 0 respectively. . In this way, the decoding of the one-bit data code is completed.
数据包中所有数据都按上述方法依次完成解码工作,LED单元其他相关电路按照数据帧中关于数据包的具体定义,并根据自身地址获得属于自己的数据。All data in the data packet is decoded in sequence according to the above method, and other related circuits of the LED unit obtain their own data according to their own address according to the specific definition of the data packet in the data frame.
从上述数据解码过程可以看出,在一定范围内,不管数据码长度T L是多少,只要满足参考码的长度是数据包中一个数据码长度N倍的关系,采用本发明实施例提供的自适应数据解码电路,LED单元都能正确辨识数据1码和数据0码。T L长度不同,代表了数据传输速率不同。也就是说,控制器发送数据的速率不需要固定为某一个值,而是在一定范围内设定一个,LED单元都能正确解码并获得数据。 It can be seen from the above data decoding process that, within a certain range, no matter what the length of the data code TL is, as long as the relationship that the length of the reference code is N times the length of a data code in the data packet is satisfied, the automatic code provided by the embodiment of the present invention is used. Adapted to the data decoding circuit, the LED unit can correctly identify the data 1 code and the data 0 code. Different TL lengths represent different data transmission rates. That is to say, the rate at which the controller sends data does not need to be fixed to a certain value, but to be set within a certain range, and the LED unit can decode and obtain the data correctly.
在实际产品设计时,根据具体应用,适当选取N值,并预估数据码长度TL的范围,设计好满足N值和TL范围的硬件电路即可实现自适应数据传输。In actual product design, the N value is appropriately selected according to the specific application, and the range of the data code length TL is estimated, and the adaptive data transmission can be realized by designing a hardware circuit that satisfies the N value and the TL range.
本发明实施例所述的LED单元有4路输出。每路输出由8位数据控制其输出占空比。由主控制器发送数据,各LED单元根据自身地址解码并获得属于自己的数据,主控制器与各LED单元之间的数据传输正是采用本发明实施例提供的自适应数据解码电路。The LED unit described in the embodiment of the present invention has four outputs. Each output is controlled by 8 bits of data to control its output duty cycle. The main controller sends data, each LED unit decodes according to its own address and obtains its own data, and the data transmission between the main controller and each LED unit adopts the adaptive data decoding circuit provided by the embodiment of the present invention.
多个LED单元并联使用,硬件连接如图1和图2示,各LED单元根据自己的地址从主控器发送的数据中解码属于自己的数据。LED单元首先把加载在电源线(VDD)上的数据转换为标准的数字信号DI,这部分工作由专门的电路来完成,此处不再详述。以下描述中所谓数据都是指的DI。Multiple LED units are used in parallel, and the hardware connection is shown in Figure 1 and Figure 2. Each LED unit decodes its own data from the data sent by the main controller according to its own address. The LED unit first converts the data loaded on the power supply line (VDD) into a standard digital signal DI. This part of the work is completed by a special circuit, which will not be described in detail here. The so-called data in the following description refers to DI.
下面以一个具体实施例对本发明提供的自适应数据解码电路的工作过程进行详细描述。The working process of the adaptive data decoding circuit provided by the present invention will be described in detail below with a specific embodiment.
本发明实施例数据帧定义如图8示。The definition of the data frame in the embodiment of the present invention is shown in FIG. 8 .
持续时间超过120us(us是时间单位:微秒。下同)的高电平为复位码。The high level that lasts for more than 120us (us is the time unit: microseconds. The same below) is the reset code.
优选地,在本发明实施例中,所述参考码的长度为所述数据包中一个数据码的长度的8倍。Preferably, in this embodiment of the present invention, the length of the reference code is 8 times the length of a data code in the data packet.
参考码长度与一个数据码长度的倍数N=8。The multiple N=8 of the length of the reference code and the length of a data code.
一个数据码长度TL范围是3~30us。数据码高、低电平长度满足图5以及表1所示要求。A data code length TL ranges from 3 to 30us. The high and low level lengths of the data code meet the requirements shown in Figure 5 and Table 1.
数据包包括指令字节CMD和数据D0~Dn。所有LED单元电路都会收到指令字节CMD;数据D0~Dn是对应地址0~n的LED单元电路用于控制4路输出的数据,LED单元电路根据自己地址收取对应数据。The data packet includes command byte CMD and data D0~Dn. All LED unit circuits will receive the command byte CMD; data D0~Dn are the LED unit circuits corresponding to addresses 0~n used to control the data output by the 4 channels, and the LED unit circuit receives the corresponding data according to its own address.
本发明实施例自适应数据解码原理如图6示,用于解码电路的第一时钟信号CK1频率设计为10MHz,其周期是0.1us。根据数据帧定义知道,参考码最长240us,所以参考码解码电路300中用于检测参考码长度的计数器设计为12位即可满足要求,该12位计数器结果除以2N即是参考码解码电路的输出Q,因为N=8,所以Q是该12位计数器除以16得到的,因此Q是一个8位数据。计数器电路500在实际工作中需要能够计量的范围是数据码的一半,即1.5us~15us,这里设计为8位计数器,最大可计量范围是0.1us*256=25.6us,完全满足本实施例的要求。数据比较器电路600因此也设计为8位即可。The principle of adaptive data decoding in the embodiment of the present invention is shown in FIG. 6 . The frequency of the first clock signal CK1 used in the decoding circuit is designed to be 10 MHz, and its period is 0.1 us. According to the definition of the data frame, the reference code is up to 240us, so the counter used to detect the length of the reference code in the reference code decoding circuit 300 is designed to be 12 bits to meet the requirements. The result of the 12-bit counter divided by 2N is the reference code decoding circuit. The output Q, because N=8, so Q is obtained by dividing the 12-bit counter by 16, so Q is an 8-bit data. The range that the counter circuit 500 needs to be able to measure in actual work is half of the data code, that is, 1.5us to 15us. Here, it is designed as an 8-bit counter, and the maximum measurable range is 0.1us*256=25.6us, which fully satisfies the requirements of this embodiment. Require. Therefore, the data comparator circuit 600 may also be designed to be 8 bits.
信号边沿检测处理电路100实时工作,在DI信号下降沿时产生信号DIPL供其他电路使用,如图7示。The signal edge detection and processing circuit 100 works in real time, and generates a signal DIPL when the DI signal falls on the falling edge for use by other circuits, as shown in FIG. 7 .
需要说明的是,如图10所示,为所述信号边沿检测处理电路100的一种具体实施方式的电路原理图,具体由三个D触发器、非门、与门以及或非门组成。应当理解的是,图10所示的电路结构仅为示例,本发明实施例中的所述信号边沿检测处理电路100并不限于图10的结构。It should be noted that, as shown in FIG. 10 , it is a circuit schematic diagram of a specific implementation of the signal edge detection processing circuit 100 , which is specifically composed of three D flip-flops, a NOT gate, an AND gate, and a NOR gate. It should be understood that the circuit structure shown in FIG. 10 is only an example, and the signal edge detection processing circuit 100 in the embodiment of the present invention is not limited to the structure of FIG. 10 .
复位码检测电路200识别到复位码后产生复位信号reset,根据数据帧定义知道,复位之后是参考码,reset使参考码解码电路300进入工作状态,首先将输出ED设置为0,之后在DIPL信号作用下,完成参考码长度计算并得到最终输出结果Q,同时将输出信号ED设置为1。具体工作流程如下,reset信号后的首个DIPL信号代表参考码开始,此时参考码解码电路内部计数器开始工作,即 以CK1为时钟进行计数,当下一个DIPL信号出现时,代表参考码结束,此时电路要做以下两个工作,第一是暂停计数器工作,将其结果除以16后存储到输出寄存器Q并实时输出;第二是将电路输出信号ED设置为1。参考码解码到此结束,等下一帧数据来时再次重复上述工作过程。The reset code detection circuit 200 generates a reset signal reset after recognizing the reset code. According to the data frame definition, it is known that the reference code is after the reset. The reset causes the reference code decoding circuit 300 to enter the working state, firstly, the output ED is set to 0, and then the DIPL signal is set to 0. Under the action, the reference code length calculation is completed and the final output result Q is obtained, and the output signal ED is set to 1 at the same time. The specific work flow is as follows. The first DIPL signal after the reset signal represents the start of the reference code. At this time, the internal counter of the reference code decoding circuit starts to work, that is, counting with CK1 as the clock. When the next DIPL signal appears, it represents the end of the reference code. When the circuit does the following two tasks, the first is to suspend the counter work, divide the result by 16 and store it in the output register Q and output it in real time; the second is to set the circuit output signal ED to 1. The decoding of the reference code ends here, and the above working process is repeated again when the next frame of data arrives.
参考码解码完成后,将进行数据码解码工作。数据码解码过程如下:当ED信号是1时,所有数据码解码相关电路开始工作,数据码开始于DI下降沿,有DIPL信号产生,DIPL信号将RS触发器700输出Q置为1,当计数器电路500输入端EN接收到RS触发器700的输出Q变为1时,启动工作,即以其时钟信号CK为时钟进行计数,计数器结果Q实时输出,当其计数结果Q与参考码解码电路300输出Q相等时,数据比较器电路600输出Y变为1,数据比较器电路600输出Y与D触发器800输入端D连接,当D触发器800检测到输入D变为1时,在第一时钟信号CK1作用下使其输出Q变为1。D触发器800输出端Q驱动第二时钟信号CK2。当第二时钟信号CK2变1后,作用于RS触发器700并使其输出Q变0,计数器电路500的EN端变为0时,会使其输出Q变为0,在经过数据比较器电路600和D触发器800作用后,第二时钟信号CK2在第一时钟信号CK1作用下再次变为0。上述过程的结果是在数据码长度二分之一处产生第二时钟信号CK2,其时序波形如图7示。数据解码电路400以第二时钟信号CK2为时钟将DI数据存储并输出到DO信号以为其他模块电路使用,至此一位数据码解码完成。After the decoding of the reference code is completed, the decoding of the data code will be performed. The data code decoding process is as follows: when the ED signal is 1, all data code decoding related circuits start to work, the data code starts at the falling edge of DI, and the DIPL signal is generated. The DIPL signal sets the output Q of the RS flip-flop 700 to 1. When the counter When the input terminal EN of the circuit 500 receives the output Q of the RS flip-flop 700 and becomes 1, it starts to work, that is, counts with the clock signal CK as the clock, and the counter result Q is output in real time. When the count result Q and the reference code decoding circuit 300 When the output Q is equal, the output Y of the data comparator circuit 600 becomes 1, and the output Y of the data comparator circuit 600 is connected to the input terminal D of the D flip-flop 800. When the D flip-flop 800 detects that the input D becomes 1, in the first Its output Q becomes 1 under the action of the clock signal CK1. The output terminal Q of the D flip-flop 800 drives the second clock signal CK2. When the second clock signal CK2 changes to 1, it acts on the RS flip-flop 700 and makes its output Q change to 0. When the EN terminal of the counter circuit 500 changes to 0, its output Q changes to 0. After passing through the data comparator circuit After 600 and the D flip-flop 800 act, the second clock signal CK2 becomes 0 again under the action of the first clock signal CK1. As a result of the above process, the second clock signal CK2 is generated at half the length of the data code, and its timing waveform is shown in FIG. 7 . The data decoding circuit 400 uses the second clock signal CK2 as a clock to store the DI data and output it to the DO signal for use by other module circuits. So far, the decoding of the one-bit data code is completed.
如图9所示,为本发明实施例中的参考码解码电路300的电路原理图,具体由三个RS触发器、与非门、或门以及计数器310组成,其中高8位Q[11:4]表示参考码解码电路300的输出Q。As shown in Figure 9, it is a circuit schematic diagram of the reference code decoding circuit 300 in the embodiment of the present invention, and is specifically composed of three RS flip-flops, a NAND gate, an OR gate and a counter 310, wherein the upper 8 bits Q[11: 4] represents the output Q of the reference code decoding circuit 300 .
需要说明的是,关于复位码检测电路200、数据包解码电路400、计数器电路500以及数据比较器电路600的具体实施电路原理图为本领域技术人员所熟知,此处不再赘述。It should be noted that the specific implementation circuit diagrams of the reset code detection circuit 200 , the data packet decoding circuit 400 , the counter circuit 500 and the data comparator circuit 600 are well known to those skilled in the art and will not be repeated here.
LED单元电路将按上述方式依次解码所有数据码。The LED unit circuit will sequentially decode all data codes as described above.
LED单元的其他模块电路使用第二时钟信号CK2以及DO数据信号,将数据按照8位一组进行使用,一帧数据中首8位是指令字节CMD,所有LED单元都收到CMD字节。之后根据CMD要求和当前LED单元电路地址接收属于自己的数据并存储备用。在下一个复位码标志信号reset时,将收到的数据作用于输出模块,从而完成主控制器发送数据控制各LED单元电路4路输出的任务。Other module circuits of the LED unit use the second clock signal CK2 and the DO data signal to use the data in groups of 8. The first 8 bits of a frame of data are the command byte CMD, and all LED units receive the CMD byte. Afterwards, it receives its own data according to the CMD requirements and the current LED unit circuit address and stores it for backup. When the next reset code flag signal is reset, the received data is acted on the output module, so as to complete the task of the main controller sending data to control the four outputs of each LED unit circuit.
从实施例关于自适应解码的过程来看,主控制器发出的一帧数据,只要满足复位码大于120us、数据码长度3us~30us、参考码长度是数据码的8倍的要求,LED单元电路都可以正常解码获得指令和数据。From the perspective of the adaptive decoding process in the embodiment, as long as a frame of data sent by the main controller meets the requirements that the reset code is greater than 120us, the length of the data code is 3us to 30us, and the length of the reference code is 8 times that of the data code, the LED unit circuit Both instructions and data can be decoded normally.
综上,本发明提供的自适应数据解码电路及LED单元电路,可以接受发送端数据码长度在一定范围内随意选取,相对于只能接受固定数据码长度的LED单元,应用范围更广,对应用环境适应性更强。因为发送端可以在要求范围内随意改变数据码长度,所以,在实际工程中,可根据需要改变发送速率以获得更优秀的效果,例如,可以提高发送数据的速率以提高LED单元显示帧频,也 可以降低发送速率以使点数特别多的情况下能正常工作。To sum up, the adaptive data decoding circuit and LED unit circuit provided by the present invention can accept the data code length of the transmitting end to be randomly selected within a certain range. Compared with the LED unit that can only accept a fixed data code length, the application range is wider. The application environment is more adaptable. Because the sender can freely change the length of the data code within the required range, in actual engineering, the sending rate can be changed as needed to obtain better results. For example, the rate of sending data can be increased to increase the display frame rate of the LED unit. It is also possible to reduce the sending rate so that it works properly with a particularly large number of points.
可以理解的是,以上实施方式仅仅是为了说明本发明的原理而采用的示例性实施方式,然而本发明并不局限于此。对于本领域内的普通技术人员而言,在不脱离本发明的精神和实质的情况下,可以做出各种变型和改进,这些变型和改进也视为本发明的保护范围。It can be understood that the above embodiments are only exemplary embodiments adopted to illustrate the principle of the present invention, but the present invention is not limited thereto. For those skilled in the art, without departing from the spirit and essence of the present invention, various modifications and improvements can be made, and these modifications and improvements are also regarded as the protection scope of the present invention.

Claims (9)

  1. 一种自适应数据解码电路,其特征在于,包括:信号边沿检测处理电路、复位码检测电路、参考码解码电路和数据包解码电路,所述信号边沿检测处理电路的输出端以及所述复位码检测电路的输出端均连接所述参考码解码电路的输入端,所述参考码解码电路的输出端和所述数据包解码电路连接;An adaptive data decoding circuit, characterized in that it comprises: a signal edge detection processing circuit, a reset code detection circuit, a reference code decoding circuit and a data packet decoding circuit, an output end of the signal edge detection processing circuit and the reset code The output ends of the detection circuit are all connected to the input end of the reference code decoding circuit, and the output end of the reference code decoding circuit is connected to the data packet decoding circuit;
    所述信号边沿检测处理电路用于检测每一帧数据中数据码的上升沿或者下降沿,并能够在检测到数据码的上升沿或者下降沿时输出标志信号,其中每一帧数据均包括依次连接的复位码、参考码和数据包,所述数据包包括多个数据码,所述参考码的长度为所述数据包中一个数据码的长度的N倍,且N为大于1的自然数;The signal edge detection processing circuit is used to detect the rising edge or falling edge of the data code in each frame of data, and can output a flag signal when the rising edge or falling edge of the data code is detected, wherein each frame of data includes sequential A connected reset code, a reference code and a data packet, the data packet includes a plurality of data codes, the length of the reference code is N times the length of a data code in the data packet, and N is a natural number greater than 1;
    所述复位码检测电路用于在识别到所述每一帧数据中的复位码后产生复位信号;The reset code detection circuit is configured to generate a reset signal after recognizing the reset code in each frame of data;
    所述参考码解码电路用于根据所述标志信号和所述复位信号对所述每一帧数据中的参考码进行解码,得到参考码解码结果;The reference code decoding circuit is configured to decode the reference code in each frame of data according to the flag signal and the reset signal to obtain a reference code decoding result;
    数据码解码电路用于根据所述参考码解码结果生成数据包的解码速率,并根据所述数据码的解码速率对所述数据包进行解码。The data code decoding circuit is configured to generate a decoding rate of the data packet according to the decoding result of the reference code, and decode the data packet according to the decoding rate of the data code.
  2. 根据权利要求1所述的自适应数据解码电路,其特征在于,所述自适应数据解码电路包括第一时钟信号,所述信号边沿检测处理电路的输入端和所述参考码解码电路的输入端均输入所述第一时钟信号。The adaptive data decoding circuit according to claim 1, wherein the adaptive data decoding circuit comprises a first clock signal, an input terminal of the signal edge detection processing circuit and an input terminal of the reference code decoding circuit Both input the first clock signal.
  3. 根据权利要求2所述的自适应数据解码电路,其特征在于,所述自适应数据解码电路包括计数器电路和数据比较器电路,所述参考码解码电路的输出端连接所述数据比较器电路的第一输入端,所述计数器电路的输出端连接所述数据比较器电路的第二输入端,所述数据比较器电路的输出端连接所述数据包解码电路,所述计数器电路用于输入使能信号与第一时钟信号,并输出计数器结果,所述数据比较器电路用于根据所述计数器结果与所述参考码解码结果生成第二时钟信号,所述第二时钟信号用于输入至所述数据包解码电路。The adaptive data decoding circuit according to claim 2, wherein the adaptive data decoding circuit comprises a counter circuit and a data comparator circuit, and an output end of the reference code decoding circuit is connected to an output terminal of the data comparator circuit. The first input terminal, the output terminal of the counter circuit is connected to the second input terminal of the data comparator circuit, the output terminal of the data comparator circuit is connected to the data packet decoding circuit, and the counter circuit is used for inputting The power signal and the first clock signal, and output the counter result, the data comparator circuit is used for generating a second clock signal according to the counter result and the reference code decoding result, and the second clock signal is used for input to the Describe the packet decoding circuit.
  4. 根据权利要求3所述的自适应数据解码电路,其特征在于,所述自适应数据解码电路包括RS触发器,所述RS触发器的R端连接所述第二时钟信号,所述RS触发器的S端连接所述标志信号,所述RS触发器的输出端Q连接所述计数器电路的使能信号端,所述RS触发器用于根据所述标志信号和所述第二时钟信号输出所述使能信号。The adaptive data decoding circuit according to claim 3, wherein the adaptive data decoding circuit comprises an RS flip-flop, the R terminal of the RS flip-flop is connected to the second clock signal, and the RS flip-flop is connected to the second clock signal. The S end is connected to the flag signal, the output end Q of the RS flip-flop is connected to the enable signal end of the counter circuit, and the RS flip-flop is used to output the signal according to the flag signal and the second clock signal. enable signal.
  5. 根据权利要求3所述的自适应数据解码电路,其特征在于,所述自适应数据解码电路包括D触发器,所述D触发器的D端连接所述数据比较器电路的输出端,所述D触发器的时钟信号端连接所述第一时钟信号,所述D触发器的输出端Q输出第二时钟信号。The adaptive data decoding circuit according to claim 3, wherein the adaptive data decoding circuit comprises a D flip-flop, the D terminal of the D flip-flop is connected to the output terminal of the data comparator circuit, and the The clock signal terminal of the D flip-flop is connected to the first clock signal, and the output terminal Q of the D flip-flop outputs the second clock signal.
  6. 根据权利要求1所述的自适应数据解码电路,其特征在于,所述参考码的长度为所述数据包中一个数据码的长度的8倍。The adaptive data decoding circuit according to claim 1, wherein the length of the reference code is 8 times the length of a data code in the data packet.
  7. 一种LED单元电路,其特征在于,包括:控制器和多个LED单元,每 个LED单元均与所述控制器通信连接,且每个LED单元均包括权利要求1至6中任意一项所述的自适应数据解码电路,所述控制器能够向每个LED单元发送多帧数据,每个LED单元中的自适应数据解码电路均能够对收到的每一帧数据按照对应的解码速率进行解码。An LED unit circuit, characterized in that it includes: a controller and a plurality of LED units, each LED unit is connected to the controller in communication, and each LED unit includes any one of claims 1 to 6. The adaptive data decoding circuit described above, the controller can send multiple frames of data to each LED unit, and the adaptive data decoding circuit in each LED unit can decode each frame of data received according to the corresponding decoding rate. decoding.
  8. 根据权利要求7所述的LED单元电路,其特征在于,每个LED单元与所述控制器均通过数据线连接。The LED unit circuit according to claim 7, wherein each LED unit is connected to the controller through a data line.
  9. 根据权利要求7所述的LED单元电路,其特征在于,每个LED单元与所述控制器均通过电源线载波进行通信连接。The LED unit circuit according to claim 7, wherein each LED unit and the controller are communicatively connected through a power line carrier.
PCT/CN2020/122135 2020-08-28 2020-10-20 Adaptive data decoding circuit and led unit circuit WO2022041421A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010888140.2 2020-08-28
CN202010888140.2A CN111970792A (en) 2020-08-28 2020-08-28 Self-adaptive data decoding circuit and LED unit circuit

Publications (1)

Publication Number Publication Date
WO2022041421A1 true WO2022041421A1 (en) 2022-03-03

Family

ID=73399903

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/122135 WO2022041421A1 (en) 2020-08-28 2020-10-20 Adaptive data decoding circuit and led unit circuit

Country Status (2)

Country Link
CN (1) CN111970792A (en)
WO (1) WO2022041421A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1355631A (en) * 2000-11-29 2002-06-26 深圳市中兴通讯股份有限公司 Circuit and method for frame location search and code stream conversion
US20100125455A1 (en) * 2004-03-31 2010-05-20 Microsoft Corporation Audio encoding and decoding with intra frames and adaptive forward error correction
CN102932103A (en) * 2012-10-22 2013-02-13 武汉烽火富华电气有限责任公司 Data transmission rate self-adaptive receiving method based on digital substation
CN107896400A (en) * 2017-12-12 2018-04-10 无锡德芯微电子有限公司 Utilize the LED drive circuit and data transmission method of power line transmission data
US20180324439A1 (en) * 2017-05-08 2018-11-08 Mediatek Inc. Method and apparatus for adaptive video encoding

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1355631A (en) * 2000-11-29 2002-06-26 深圳市中兴通讯股份有限公司 Circuit and method for frame location search and code stream conversion
US20100125455A1 (en) * 2004-03-31 2010-05-20 Microsoft Corporation Audio encoding and decoding with intra frames and adaptive forward error correction
CN102932103A (en) * 2012-10-22 2013-02-13 武汉烽火富华电气有限责任公司 Data transmission rate self-adaptive receiving method based on digital substation
US20180324439A1 (en) * 2017-05-08 2018-11-08 Mediatek Inc. Method and apparatus for adaptive video encoding
CN107896400A (en) * 2017-12-12 2018-04-10 无锡德芯微电子有限公司 Utilize the LED drive circuit and data transmission method of power line transmission data

Also Published As

Publication number Publication date
CN111970792A (en) 2020-11-20

Similar Documents

Publication Publication Date Title
CN110996461B (en) Single-wire LED data transmission display method and driving chip
US7457323B2 (en) Demultiplexer circuit
US20060153326A1 (en) Serial data communication apparatus and methods of using a single line
US20080123790A1 (en) Serial digital data communication interface
WO2022041421A1 (en) Adaptive data decoding circuit and led unit circuit
CN111262559B (en) Delay line circuit with correction function and correction method thereof
TW201320037A (en) Method for triggering source drivers
JP4353943B2 (en) Sequence control device
US9960853B2 (en) System and method for a differential pulse position modulation encoder and decoder
CN212367589U (en) Self-adaptive data decoding circuit and LED unit circuit
US4675545A (en) Wave shaping apparatus for eliminating pulse width distortion
US7020208B1 (en) Differential clock signals encoded with data
TWI810620B (en) Light-emitting diode driver and light-emitting diode driving device
US8774292B2 (en) Data transfer system, data transfer method, receiving circuit, and receiving method
CN113207209A (en) Data transmission method of single-wire cascade circuit and LED chip cascade system
US9054685B2 (en) Programmable bus signal hold time without system clock
US9479148B2 (en) Serial data signal edge detection
JP6232313B2 (en) Synchronous serial communication method and slave device
CN219554944U (en) Circuit for increasing signal pulse width
US20230087104A1 (en) Signal processing circuit and reception device
TWI678627B (en) Efficient single-line communication data transmission method and communication system using the same
KR20060107567A (en) Rate verification of an incoming serial alignment sequence
TWI670605B (en) Efficient single-line communication data transmission method and communication system using same
CN112996183B (en) LED control IC single-wire cascade data communication method
JP5383856B2 (en) Transmitter circuit

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20951089

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20951089

Country of ref document: EP

Kind code of ref document: A1