A method and device for setting a lamp chip without controller upgrade
The method enables controllers to support new chip types in landscape lighting systems by constructing configuration frames based on chip-specific protocols, improving system expandability and maintenance efficiency without requiring software updates.
Patent Information
- Application Number
- CN202411278497.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2044-09-12
AI Technical Summary
In the prior art, the parameter configuration protocol of lamp chips is constantly changing, resulting in frequent upgrades of controllers and inability to be compatible with new chips, resulting in reduced storage resources and difficulty in maintaining equipment.
By building protocol formats and data content, the controller querys the write-in format library and database according to the type of the lamp chip, generates configuration frames and sends them in cascading or parallel modes, supporting new lamp chip types without modifying the controller's internal programs.
It realizes that the new lamp chip type is supported without changing the controller program, improves the system's scalability and maintenance efficiency, simplifies the configuration process, and enhances the system's flexibility.
Smart Images

Figure CN119336726B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of lamp chip control, and particularly to a method and device for setting a lamp chip without upgrading a controller. Background Art
[0002] In the floodlighting landscape lighting industry, LED driver chips controlled in parallel by DMX512 are widely used, and certain parameters need to be configured for them through a controller. In response to market demands, the number of parameters to be configured is increasing during the continuous upgrading of the chips, and the data protocols are constantly changing and not downward compatible. The traditional approach is that whenever a new chip is launched, the controller needs to upgrade the program according to its configuration protocol to support the configuration of the chip. The drawback of this approach is that whenever a new chip is launched, R & D personnel need to be invested to upgrade the controller program, and continuously increasing the chip support program will continuously reduce the program storage resources of the device, and it will be impossible to upgrade after reaching a certain level. Summary of the Invention
[0003] Embodiments of the present invention provide a method and device for setting a lamp chip without upgrading a controller. The controller sends a configuration frame to the lamp chip in a cascaded or parallel manner, so that the system can support new types of lamp chips without modifying the internal program of the controller, improving the scalability and maintenance efficiency of the system.
[0004] To achieve the above object, a first aspect of the embodiments of the present application provides a method for setting a lamp chip without upgrading a controller, including:
[0005] According to the type of the lamp chip, obtain a write parameter format feature description from a write parameter format library and construct a protocol format; the write parameter format library includes the timing of the lamp chip;
[0006] According to the type of the lamp chip, obtain a data field description from a write parameter database and determine the data content; the write parameter database includes the instruction code, parameter code, and value range of the parameter code of the lamp chip;
[0007] Construct a lamp chip configuration frame according to the protocol format and the data content;
[0008] The controller sends the lamp chip configuration frame to the lamp chip in a cascaded manner or a parallel manner.
[0009] In a possible implementation manner of the first aspect, the obtaining a write parameter format feature description from a write parameter format library and constructing a protocol format according to the type of the lamp chip specifically includes:
[0010] If there is a code interval between the instruction code and the parameter code of the lamp chip and they need to be uniformly written by the bus, construct the first type of single-frame protocol format as the protocol format; the first type of single-frame protocol format includes a reset code, a start code, an instruction code, and a parameter code, and there are code intervals between the reset code, the start code, the instruction code, and the parameter code.
[0011] In a possible implementation manner of the first aspect, the constructing the protocol format by obtaining the write parameter format feature description from the write parameter format library according to the type of the lamp chip specifically includes:
[0012] If there is no code interval between the instruction code and the parameter code of the lamp chip and they do not need to be uniformly written by the bus, construct the second type of single-frame protocol format as the protocol format; the second type of single-frame protocol format includes a reset code, a start code, and several combined codes, and there are code intervals between the reset code, the start code, and the combined codes. The combined code includes adjacent instruction codes and parameter codes, and one combined code corresponds to one lamp chip.
[0013] In a possible implementation manner of the first aspect, the constructing the protocol format by obtaining the write parameter format feature description from the write parameter format library according to the type of the lamp chip specifically includes:
[0014] If the lamp chip needs to input several DMX data frames in combination, construct a multi-frame protocol format; the multi-frame protocol format includes a reset code, a start code, and an instruction code, or the multi-frame protocol format includes a reset code, a start code, and a parameter code; the number of bytes of the instruction code or the parameter code has a lower limit and an upper limit.
[0015] In a possible implementation manner of the first aspect, when constructing the protocol format, construct the protocol format with several of the characteristic values such as the number of frame groups, the group interval, the idle waiting at the end of the frame group, the reset code at the end of the frame group, the frame type, the number of frames, the frame interval, the frame size, the duration of the reset code, the start code, the code interval, the segment interval, and the data type.
[0016] In a possible implementation manner of the first aspect, the number of frame groups is the number of configured frame groups in one configuration; the group interval is the interval duration between groups; the idle at the end of the frame group includes a code value and a time parameter; the reset code at the end of the frame group includes a code value and a time parameter; the frame type is the DMX512 category value; the number of frames is the number of frames included in each group; the frame interval is the interval duration between frames in the same group; the frame size is a variable value following the length of the data field or a fixed value of the number of data bytes; the duration of the reset code is the time parameter when the reset code maintains a low level; the start code is fixed to 0; the code interval is the idle duration between two different codes; the segment interval is the interval between the instruction code and the parameter code during cascaded writing of codes; the data type is the representation value of the instruction code and the data code.
[0017] In a possible implementation of the first aspect, when the DMX512 class value is 0, it indicates that the baud rate of this frame is 250K, the data is low-order first, including 1 start bit, 8 data bits, and 2 stop bits;
[0018] When the DMX512 class value is 1, it indicates that the baud rate of this frame is 250K, the data is high-order first, including 1 start bit, 8 data bits, and 2 stop bits.
[0019] In a possible implementation of the first aspect, when the characterization value is 0, it indicates that the instruction code and the data code are separated; when the characterization value is 1, the instruction code and the data code are combined; when the characterization value is 2, it indicates that the instruction code and the data code do not need to be distinguished.
[0020] In a possible implementation of the first aspect, the determination of the data content specifically includes:
[0021] Determine the data content using several of the fields such as frame number, instruction code, parameter code, and number of chips according to the data field description;
[0022] The frame number is used to identify the frame to which the three fields of instruction code, parameter code, and number of chips belong; the instruction code is a set of instruction codes arranged in sequence, and this field is not used when the data type is 2; the parameter code is a set of parameter codes arranged in sequence, and this field is only filled when the data type is 2; the number of chips is the number of chips during cascaded parameter writing, and is fixed at 1 during parallel parameter writing.
[0023] The second aspect of the embodiments of the present application provides a device for setting a lamp chip without controller upgrade, including:
[0024] A construction format module, configured to obtain a write parameter format feature description from a write parameter format library according to the type of the lamp chip, and construct a protocol format; the write parameter format library includes the timing of the lamp chip;
[0025] A construction data module, configured to obtain a data field description from a write parameter database according to the type of the lamp chip, and determine the data content; the write parameter database includes the instruction code, parameter code, and value range of the parameter code of the lamp chip;
[0026] A configuration frame module, configured to construct a lamp chip configuration frame according to the protocol format and the data content;
[0027] A sending module, configured to send the lamp chip configuration frame to the lamp chip by the controller in a cascaded manner or a parallel manner.
[0028] Compared with the prior art, a method and device for setting a lamp chip without controller upgrade provided by an embodiment of the present invention queries a writing parameter format library according to the type of the lamp chip. The writing parameter format library stores the timing information of the lamp chip. Based on this information, the controller can determine how to construct the communication protocol format; obtain the data field description for the lamp chip from the writing parameter database. The writing parameter database contains the instruction code, parameter code, and the valid value range of the parameter code of a specific lamp chip, which helps to determine the actual data content. After determining the information of the protocol format and data content, the controller can construct a lamp chip configuration frame. The lamp chip configuration frame contains all the configuration information required by the lamp chip, and this information is organized according to the previously determined protocol format and data content.
[0029] The controller sends the configuration frame to the lamp chip in a cascaded or parallel manner. This method enables the system to support new types of lamp chips without modifying the internal program of the controller, improving the scalability and maintenance efficiency of the system. The present invention not only simplifies the configuration process of the lamp chip but also enhances the flexibility of the system, making the system more easily adaptable to new types of lamp chips that may appear in the future. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 is a schematic flowchart of a method for setting a lamp chip without controller upgrade provided by an embodiment of the present invention;
[0031] Figure 2 is a schematic diagram of the configuration process of a first type of single-frame protocol format provided by an embodiment of the present invention;
[0032] Figure 3 is a schematic diagram of the configuration process of a second type of single-frame protocol format provided by an embodiment of the present invention;
[0033] Figure 4 is a schematic diagram of the configuration process of a multi-frame protocol format provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0034] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0035] To solve the above problems, please refer to Figure 1 , an embodiment of the present invention provides a method for setting a lamp chip without controller upgrade, including:
[0036] S10. Obtain the parameter writing format feature description from the parameter writing format library according to the type of the lamp chip, and construct a protocol format; the parameter writing format library includes the timing sequence of the lamp chip.
[0037] S11. Obtain the data field description from the parameter writing database according to the type of the lamp chip, and determine the data content; the parameter writing database includes the instruction code, parameter code, and the value range of the parameter code of the lamp chip.
[0038] S12. Construct a lamp chip configuration frame according to the protocol format and the data content.
[0039] S13. The controller sends the lamp chip configuration frame to the lamp chip in a cascaded manner or a parallel manner.
[0040] In S10, the parameter writing format library will be queried according to the type of the lamp chip. The parameter writing format feature description for this lamp chip is obtained from the parameter writing format library. The parameter writing database stores the timing information of the lamp chip. Based on this information, the host computer of the controller can determine how to construct the communication protocol format. Then, in S11, the host computer will query the parameter writing database according to the type of the lamp chip. The parameter writing database contains the instruction code (Command Code), parameter code (Parameter Code), and the valid value range of the parameter code of a specific lamp chip, and then determines the actual data content. After having the information of the protocol format and the data content, the controller can construct the lamp chip configuration frame. The configuration frame contains all the configuration information required by the lamp chip, and these information are organized according to the format determined previously. Finally, the controller sends the configuration frame to the lamp chip in a cascaded or parallel manner. This method enables the system to support new types of lamp chips without modifying the internal program of the controller, improving the scalability and maintenance efficiency of the system.
[0041] The above method splits the parameter configuration protocol of the mainstream LED driver chip into two parts: constructing the protocol format and determining the data content. The instruction packet can be encapsulated in the host computer through the abstracted and parameterized format feature description and data field description, and transmitted to the controller through an SD card or a communication interface. The controller sends the level and data sequence to the lamp chip according to the data field description, and most of the parameter settings of the newly added lamp chips can be realized without updating the running program of the controller.
[0042] The host computer can have an interactive interface to select the lamp chip and its corresponding parameter values, and add new parameters; the host computer can have a set of chip parameter writing databases, and generally need to upgrade the parameter writing database for newly added lamp chips; the host computer can have a set of chip parameter writing format libraries. When adding a new lamp chip, if there is no compatibility in the format library, the parameter writing format library needs to be upgraded. Encapsulate the instruction packet (including the parameter writing format and data content) and transmit it to the control, and the new transmission method needs to be upgraded.
[0043] It should be noted that the write parameter format library is saved in text, with one text file for each format. It is compiled by technicians according to the chip data provided in accordance with the method of constructing the protocol format in S10. The text contains the protocol formats (usually also called timings) for various chip configurations. When a certain chip needs to be configured, first find the corresponding format feature description from the library and pass this description to the controller. The controller constructs the protocol format according to the description content. Generally, multiple chips of one manufacturer share a set of formats, and the manufacturer's protocol is finalized and basically no longer changed. When a new chip is launched and its configuration protocol format is not compatible with the existing formats in the current inventory, an update is required, that is, a new set of format feature descriptions is added.
[0044] The write parameter database is saved in text, with one text file corresponding to one chip. It is compiled by technicians according to the chip data provided in a predefined manner. The text contains the instruction codes, parameter codes, and the value ranges of each parameter code included in various chips, which can be used for the software interface to display the chip parameter options. After the user selects them, data abstraction descriptions are performed in the software background and then passed to the controller. The controller fills the data (including instructions and parameter values) into the corresponding protocol format according to the description content and sends it to the lamp chip. Generally, a set of parameters needs to be independently constructed for one chip. When a new chip is launched, corresponding data content needs to be added to the library.
[0045] The lamp chip configuration frame consists of one or more frames similar to DMX512. The frame format includes:
[0046] Idle level: The bus level when there is no data transmission, generally high level.
[0047] Reset code: Generally a low level for a certain duration, and the duration may vary for different chips.
[0048] Start code: Generally a one-byte serial port data with a fixed value of 0 (1 start bit + 8 data bits + 2 stop bits).
[0049] Instruction code: Used to identify what kind of parameter is written, generally variable multiple-byte serial port data (1 start bit + 8 data bits + 2 stop bits).
[0050] Parameter code: A set of parameter values, generally variable multiple-byte serial port data (1 start bit + 8 data bits + 2 stop bits).
[0051] Exemplarily, please refer to Figure 2 , obtaining the write parameter format feature description from the write parameter format library according to the type of the lamp chip and constructing the protocol format, specifically including:
[0052] If there is a code interval between the instruction code and the parameter code of the lamp chip and they need to be uniformly written by the bus, a first type of single-frame protocol format is constructed as the protocol format; the first type of single-frame protocol format includes a reset code, a start code, an instruction code, and a parameter code, and there are code intervals between the reset code, the start code, the instruction code, and the parameter code.
[0053] When there is a code interval between the instruction code (Command Code) and the parameter code (Parameter Code) of the lamp chip and these codes need to be uniformly written through the bus, the controller needs to construct a first type of single-frame protocol format. The design of this format is to ensure the correctness and consistency of data transmission.
[0054] Among them, the reset code is a signal used to initialize the communication link and ensure that the receiving end is in the receiving state. It marks the start of a frame of data and maintains a certain interval from other codes; the start code follows the reset code and is used to clearly inform the receiving party that a frame of data is about to start. In this protocol, the start code is fixed at 0, which means it always remains unchanged and is convenient for identifying the start of the frame; the instruction code specifies the operation command to be executed by the lamp chip. It is located after the start code and also has a code interval from the start code; the parameter code is the parameter value passed to the lamp chip to adjust its working state. The parameter code follows the instruction code and there is also a code interval between them.
[0055] The code interval refers to the time or space interval between the reset code, the start code, the instruction code, and the parameter code. The existence of these intervals is to ensure that each code is not confused and the receiving end can correctly distinguish each code.
[0056] Because it needs to be uniformly written through the bus, this means that all codes - the reset code, the start code, the instruction code, and the parameter code - must be sent as a whole to ensure that the lamp chip can receive the complete command at one time.
[0057] In this way, the controller can dynamically generate configuration frames suitable for different types of lamp chips without changing its own program, thereby realizing the flexible configuration and management of the lamp chips. This method improves the scalability and maintainability of the system and reduces the workload of frequently updating the controller program due to supporting new chips.
[0058] Exemplarily, please refer to Figure 3 , obtaining the write parameter format feature description from the write parameter format library according to the type of the lamp chip, and constructing the protocol format, specifically including:
[0059] If there is no code interval between the instruction code and the parameter code of the lamp chip and they do not need to be uniformly written by the bus, a second - type single - frame protocol format is constructed as the protocol format; the second - type single - frame protocol format includes a reset code, a start code, and several combined codes. There are code intervals between the reset code, the start code, and the combined codes. The combined code includes adjacent instruction code and parameter code, and one combined code corresponds to one lamp chip.
[0060] When there is no code interval between the instruction code (Command Code) and the parameter code (Parameter Code) of the lamp chip and these codes do not need to be uniformly written through the bus, the controller needs to construct a second - type single - frame protocol format. This format is designed to accommodate lamp chips that can write instruction codes and parameter codes independently.
[0061] In the second - type single - frame protocol format, the reset code is used to initialize the communication link and ensure that the receiving end is in the receiving state. It marks the start of a frame of data and has a certain interval from other codes; the start code follows the reset code immediately and is used to clearly inform the receiving party that a frame of data is about to start. In this protocol, the start code is fixed as 0; the combined code is a unit composed of adjacent instruction code and parameter code. Each combined code corresponds to one lamp chip, which means that each lamp chip can receive its exclusive instructions and parameters through such a combined code.
[0062] Although there is no code interval between the instruction code and the parameter code, there are still code intervals between the reset code, the start code, and the combined codes. These intervals are to ensure the clear definition of each code and prevent data confusion. Since they do not need to be uniformly written through the bus, it means that each lamp chip can receive its instruction code and parameter code independently, that is, each lamp chip can process its own combined code.
[0063] According to the requirements of the lamp chip, the instruction code and the parameter code are combined into a combined code. Each combined code represents the complete information required by one lamp chip.
[0064] When constructing the second - type single - frame protocol format, ensure that there are appropriate code intervals between the reset code, the start code, and each combined code to ensure the accuracy of data transmission. The controller sends the constructed configuration frame to the lamp chip in a cascaded or parallel manner. In the cascaded mode, each lamp chip receives its respective configuration frame in sequence; in the parallel mode, all lamp chips receive the configuration frame simultaneously.
[0065] In the above - mentioned way, the controller can dynamically generate configuration frames suitable for different types of lamp chips without changing its own program, thus realizing the flexible configuration and management of lamp chips. This method improves the scalability and maintainability of the system and reduces the workload of frequently updating the controller program due to supporting new chips.
[0066] Exemplarily, according to the type of the lamp chip, obtain the write parameter format feature description from the write parameter format library and construct the protocol format. Specifically, it includes:
[0067] If the lamp chip requires the combined input of several DMX data frames, construct a multi-frame protocol format; the multi-frame protocol format includes a reset code, a start code, and an instruction code, or the multi-frame protocol format includes a reset code, a start code, and a parameter code; the number of bytes of the instruction code or the parameter code has a lower limit and an upper limit.
[0068] When the lamp chip needs to be configured through the combined input of multiple DMX data frames, the controller needs to construct a multi-frame protocol format. The design of this format is applicable to lamp chips that need to complete the configuration task through a series of consecutive data frames.
[0069] In the multi-frame protocol format, the reset code is used to initialize the communication link and ensure that the receiving end is in the receiving state. It marks the start of a frame of data and maintains a certain interval from other codes; the start code follows the reset code immediately and is used to clearly inform the receiving party that a frame of data is about to start. In this protocol, the start code is fixed at 0; if the lamp chip needs to be guided by an instruction code for operation, the multi-frame protocol format will include an instruction code; if the lamp chip needs to adjust its behavior through a parameter code, the multi-frame protocol format will include a parameter code.
[0070] Exemplarily, please refer to Figure 4 , the following embodiment is a transmission example of sending two groups of multi-frame protocol formats when the multi-frame protocol format corresponding to the lamp chip is 2 fields (set 2 channels / dual color):
[0071] The first frame of the first group: There are 3 channels of data, and the data content is: 0x00, 0x00, 0x00;
[0072] The second frame of the first group: There are 3 channels of data, and the data content is: 0x00, 0x00, 0x00;
[0073] The third frame of the first group: There are 3 channels of data, and the data content is: 0x0E, 0x01, 0x00;
[0074] The fourth frame of the first group: There are 3 channels of data, and the data content is: 0x0D, 0x01, 0x00;
[0075] After each frame is sent, wait for 5 ms before sending the next frame. After the fourth frame of the first group of data is sent, wait for 5 ms, and then send a reset of 100 us.
[0076] After waiting for 1 s, send the following second group of configuration commands:
[0077] The first frame of the second group: There is data in 3 channels, and the data content is: 0x00, 0x00, 0x00;
[0078] The second frame of the second group: There is data in 3 channels, and the data content is: 0x00, 0x00, 0x00;
[0079] The third frame of the second group: There is data in 3 channels, and the data content is: 0x26, 0x01, 0x00;
[0080] The fourth frame of the second group: There is data in 3 channels, and the data content is: 0x25, 0x01, 0x00;
[0081] After each frame is sent, wait for 5 ms before sending the next frame. After the data of the fourth frame in the second group is sent, wait for 5 ms, and then send a reset of 100 us.
[0082] Wait for 2 seconds to complete the 2-field function setting.
[0083] The number of bytes of the instruction code or parameter code has a lower limit and an upper limit. This means that the length of each code has a certain limit and cannot exceed the specified range. The lamp chip needs to complete the configuration through the combination of multiple DMX data frames, which means that a single frame may not be sufficient to convey all the necessary configuration information.
[0084] By constructing a multi-frame protocol format, the controller can dynamically generate configuration frames suitable for different types of lamp chips without changing its own program. This method improves the scalability and maintainability of the system, reduces the workload of frequently updating the controller program due to supporting new chips. In addition, this method also ensures that even in the case where multiple frames are required to complete the configuration, the lamp chips can be effectively managed and configured.
[0085] Exemplarily, when constructing the protocol format, several of the characteristic values such as the number of frame groups, group interval, frame group end idle wait, frame group end reset code, frame type, number of frames, frame interval, frame size, reset code duration, start code, code interval, segment interval, and data type are used to construct the protocol format.
[0086] Suppose it is necessary to construct a multi-frame protocol format to configure a lamp chip, which needs to be completed through two DMX data frames, one of which contains the instruction code and the other contains the parameter code. The following is an example of the construction process:
[0087] Determine the number of frame groups: Suppose two frame groups are required to complete the configuration.
[0088] Set the group interval: The interval between groups is 1 millisecond.
[0089] Set the frame group end idle wait: The end idle wait time is 2 milliseconds.
[0090] Set the frame group end reset code: The reset code is at a low level for a duration of 3 milliseconds.
[0091] Select the frame type: The DMX512 class value is 0, indicating a baud rate of 250K and the data is low-order first.
[0092] Set the number of frames: Each frame group contains 2 frames.
[0093] Set the frame interval: The frame interval is 0.5 milliseconds.
[0094] Set the frame size: The data length of each frame is 16 bytes.
[0095] Set the reset code duration: The reset code duration is 1 millisecond.
[0096] Set the start code: The start code is fixed at 0.
[0097] Set the code interval: The code interval is 0.2 milliseconds.
[0098] Set the segment interval: The segment interval is 0.3 milliseconds.
[0099] Set the data type: The instruction code and the data code are separated (representation value is 0).
[0100] In this way, the controller can construct a flexible and efficient multi-frame protocol format to ensure that the lamp chip can accurately receive the required configuration information and perform corresponding operations based on this information.
[0101] Exemplarily, the number of frame groups is the number of configuration frame groups included in one configuration; the group interval is the interval duration between groups; the frame group end idle includes a code value and time parameters; the frame group end reset code includes a code value and time parameters; the frame type is the DMX512 class value; the number of frames is the number of frames included in each group; the frame interval is the interval duration between frames in the same group; the frame size is a variable value following the data field length or a fixed value of the number of data bytes; the reset code duration is the duration parameter when the reset code maintains a low level; the start code is fixed at 0; the code interval is the idle duration between two different codes; the segment interval is the interval between the instruction code and the parameter code during cascaded code writing; the data type is the representation value of the instruction code and the data code.
[0102] Exemplarily, when the DMX512 class value is 0, it indicates that the baud rate of this frame is 250K, the data is low-order first, including 1 start bit, 8 data bits, and 2 stop bits;
[0103] When the DMX512 class value is 1, it indicates that the baud rate of this frame is 250K, the data is high-order first, including 1 start bit, 8 data bits, and 2 stop bits.
[0104] Exemplarily, when the characterization value is 0, it indicates that the instruction code and the data code are separated; when the characterization value is 1, the instruction code and the data code are combined; when the characterization value is 2, it means that the instruction code and the data code do not need to be distinguished.
[0105] In summary, the construction format can be described by the characteristic values in Table 1.
[0106] Table 1 Characteristic Value Table of Construction Format
[0107]
[0108]
[0109] Exemplarily, the determination of the data content specifically includes:
[0110] Determine the data content using several fields among the frame sequence number, instruction code, parameter code, and number of chips according to the description of the write parameter format characteristics;
[0111] The frame sequence number is used to identify the frame to which the instruction code, parameter code, and number of chips belong; the instruction code is a set of instruction codes arranged in sequence, and this field is not used when the data type is 2; the parameter code is a set of parameter codes arranged in sequence, and only this field is filled when the data type is 2; the number of chips is the number of cascaded lamp chips during cascaded write parameter, and it is fixed to 1 during parallel write parameter.
[0112] The data content that needs to be determined includes:
[0113] Frame Sequence Number: Used to identify the frame to which the instruction code, parameter code, and number of chips belong. This is to ensure the uniqueness of each frame in the sequence and help the receiving end correctly parse each frame.
[0114] Command Code: A set of instruction codes arranged in sequence. If the data type is 2 (instruction code and data code do not need to be distinguished), this field is not used.
[0115] Parameter Code: A set of parameter codes arranged in sequence. If the data type is 2, only the parameter code field is used.
[0116] Number of Chips: In the cascaded write mode, the number of chips refers to the total number of cascaded lamp chips; in the parallel write mode, the number of chips is fixed to 1, indicating that all lamp chips receive the same configuration frame simultaneously.
[0117] Through the above steps, the controller can determine the specific data content based on the type of the lamp chip and the description of the writing parameter format characteristics required, so as to construct the correct configuration frame. This method not only improves the flexibility of configuration, but also ensures that the lamp chip can correctly receive the required configuration information.
[0118] In summary, the determination of the data content can be described by the fields shown in Table 2.
[0119] Table 2 Field description table for determining data content
[0120]
[0121] Take the parallel writing of the current file for the UCS512K series chips (the current levels of 7 channels are 1, 2, 3, 4, 5, 6, and 7) as an example:
[0122] Description of the writing parameter format characteristics:
[0123] Groups = 1
[0124] Group Interval = 0
[0125] GroupEndWait = 0
[0126] GroupEndReset = 0
[0127] FrameType = 1
[0128] FrameQty = 1
[0129] Frame Interval = 0
[0130] ResetCode = 2500000 / / Duration of the reset low level: 2.5 seconds
[0131] StartCode = 0
[0132] Code Interval = 176
[0133] Seg Interval = 176
[0134] DataType = 1
[0135] Description of the data field:
[0136] FrameNum = 1
[0137] InsCode = 170, 15, 52, 49, 172, 144
[0138] ParamCode = 1,130,3,132,5,134,7
[0139] Chip Qty = 1
[0140] Take the example of "setting the current of 4 channels of the GS8526 chip to a maximum of 26.5 mA (this chip only supports parallel writing)":
[0141] Feature description of the writing parameter format:
[0142] Groups = 1 / / One group of frames
[0143] Group Interval = 0 / / No group interval. GroupEndWait = 5000 / / 5 ms idle level after the group. GroupEndReset = 100 / / 100 us reset after the group. FrameType = 0 / / Standard DMX512
[0144] Frame Qty = 4 / / Each group has 4 frames of data. Frame Interval = 10000 / / Frame interval 10 ms. ResetCode = 88 / / Duration of the reset low level 88 us. StartCode = 0 / / Reset code is 0. Code Interval = 8 / / Code interval 8 us. Seg Interval = 0 / / No segment interval. Data Type = 2 / / There is no obvious distinction between the instruction code and the data code. Data field description:
[0145] FrameNum = 1
[0146] ParamCode = 0,0,0
[0147] Chip Qty = 1
[0148] FrameNum = 2
[0149] ParamCode = 0,0,0
[0150] Chip Qty = 1
[0151] FrameNum = 3
[0152] ParamCode = 6,255,255. Chip Qty = 1
[0153] FrameNum = 4
[0154] ParamCode = 2,255,255
[0155] Chip Qty = 1
[0156] Compared with the prior art, a method for setting a lamp chip without controller upgrade provided by an embodiment of the present invention queries a write parameter format library according to the type of the lamp chip. The write parameter format library stores the timing information of the lamp chip. Based on this information, the controller can determine how to construct the communication protocol format; obtain the write parameter format feature description for the lamp chip from the write parameter database. The write parameter database contains the instruction code, parameter code, and the valid value range of the parameter code of a specific lamp chip, which helps to determine the actual data content. After determining the information of the protocol format and the data content, the controller can construct a lamp chip configuration frame. The lamp chip configuration frame contains all the configuration information required by the lamp chip, and this information is organized according to the previously determined protocol format and data content.
[0157] The controller sends the configuration frame to the lamp chip in a cascaded or parallel manner. This method enables the system to support new types of lamp chips without modifying the internal program of the controller, improving the scalability and maintenance efficiency of the system. The present invention not only simplifies the configuration process of the lamp chip but also enhances the flexibility of the system, enabling the system to more easily adapt to new types of lamp chips that may appear in the future.
[0158] An embodiment of the present application provides a device for setting a lamp chip without controller upgrade, including: a format construction module, a data construction module, a configuration frame module, and a sending module.
[0159] The format construction module is used to obtain the write parameter format feature description from the write parameter format library according to the type of the lamp chip and construct the protocol format; the write parameter format library includes the timing of the lamp chip.
[0160] The data construction module is used to obtain the data field description from the write parameter database according to the type of the lamp chip and determine the data content; the write parameter database includes the instruction code, parameter code, and the value range of the parameter code of the lamp chip.
[0161] The configuration frame module is used to construct a lamp chip configuration frame according to the protocol format and the data content;
[0162] The sending module is used to send the lamp chip configuration frame from the controller to the lamp chip in a cascaded manner or a parallel manner.
[0163] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the above-described system can refer to the corresponding process in the foregoing method embodiment and will not be elaborated here.
[0164] Compared with the prior art, a lamp chip setting device with controller free of upgrade provided by an embodiment of the present invention queries a writing parameter format library according to the type of the lamp chip. The writing parameter format library stores the timing information of the lamp chip. Based on this information, the controller can determine how to construct the communication protocol format; obtain the data field description for the lamp chip from the writing parameter database. The writing parameter database contains the instruction code, parameter code and the valid value range of the parameter code of a specific lamp chip, which helps to determine the actual data content. After determining the information of the protocol format and data content, the controller can construct a lamp chip configuration frame. The lamp chip configuration frame contains all the configuration information required by the lamp chip, and this information is organized according to the protocol format and data content determined above.
[0165] The controller sends the configuration frame to the lamp chip in a cascaded or parallel manner. This way enables the system to support new types of lamp chips without modifying the internal program of the controller, improving the scalability and maintenance efficiency of the system. The present invention not only simplifies the configuration process of the lamp chip, but also enhances the flexibility of the system, making the system more easily adaptable to new types of lamp chips that may appear in the future.
[0166] An embodiment of the present application provides a computer-readable storage medium, which includes a stored computer program. When the computer program runs, it controls the device where the computer-readable storage medium is located to execute a method for setting a lamp chip with a controller free of upgrade as described above.
[0167] The computer device may be a computing device such as a smart phone, a tablet computer, a desktop computer and a cloud server. The computer device may include but is not limited to a processor and a memory. Those skilled in the art can understand that the figure is only an example of the computer device, and does not constitute a limitation on the computer device. It may include more or fewer components than shown in the figure, or combine some components, or different components. For example, it may also include input and output devices, network access devices, etc.
[0168] The so-called processor may be a Central Processing Unit (CPU), and the processor may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0169] In some embodiments, the memory may be an internal storage unit of the computer device, such as the hard disk or memory of the computer device. In other embodiments, the memory may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc., equipped on the computer device. Further, the memory may also include both the internal storage unit and the external storage device of the computer device. The memory is used to store an operating system, application programs, a BootLoader, data, and other programs, such as the program code of the computer program. The memory may also be used to temporarily store data that has been output or is to be output.
[0170] The embodiments of the present application provide a computer program product. When the computer program product runs on a computer device, it enables the computer device to execute the steps in the above-mentioned method embodiments.
[0171] In several embodiments provided by the present application, it can be understood that each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the module, the program segment, or the part of code includes one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved.
[0172] When the above-mentioned functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device to execute all or part of the steps of the methods described in various embodiments of this application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.
[0173] The above is the preferred embodiment of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements are also regarded as the protection scope of the present invention.
Claims
1. A method for setting a lamp chip without controller upgrade, characterized in that Including: According to the type of the lighting chip, obtain the writing parameter format feature description from the writing parameter format library and construct the protocol format, specifically including: If there is a code interval between the instruction code and the parameter code of the lighting chip and it needs to be uniformly written by the bus, construct the first type of single-frame protocol format as the protocol format; the first type of single-frame protocol format includes a reset code, a start code, an instruction code, and a parameter code, and there are code intervals between the reset code, the start code, the instruction code, and the parameter code; If there is no such code interval between the instruction code and the parameter code of the lighting chip and it does not need to be uniformly written by the bus, construct the second type of single-frame protocol format as the protocol format; the second type of single-frame protocol format includes a reset code, a start code, and several combined codes, and there are code intervals between the reset code, the start code, and the combined codes. The combined code includes adjacent instruction code and parameter code, and one combined code corresponds to one lighting chip; If the lighting chip needs to be input by combining several DMX data frames, construct a multi-frame protocol format; the multi-frame protocol format includes a reset code, a start code, and an instruction code, or the multi-frame protocol format includes a reset code, a start code, and a parameter code; the number of bytes of the instruction code or the parameter code has a lower limit and an upper limit; The writing parameter format library includes the timing of the lighting chip; According to the type of the lighting chip, obtain the data field description from the writing parameter database and determine the data content; the writing parameter database includes the instruction code, the parameter code, and the value range of the parameter code of the lighting chip; According to the protocol format and the data content, construct a lighting chip configuration frame; In a cascaded or parallel manner, the controller sends the lighting chip configuration frame to the lighting chip.
2. The method for setting a lamp chip without controller upgrade according to claim 1, wherein, When constructing the protocol format, construct the protocol format with several of the characteristic values such as the number of frame groups, the group interval, the idle waiting at the end of the frame group, the reset code at the end of the frame group, the frame type, the number of frames, the frame interval, the frame size, the duration of the reset code, the start code, the code interval, the segment interval, and the data type.
3. The method for setting a lamp chip without controller upgrade according to claim 2, wherein The number of frame groups is the number of configuration frame groups included in one configuration; the group interval is the interval duration between groups; the frame group end idle includes a code value and a time parameter; the frame group end reset code includes a code value and a time parameter; the frame type is the DMX512 category value; the number of frames is the number of frames included in each group; the frame interval is the interval duration between frames in the same group; the frame size is a variable value following the data field length or a fixed value of the number of data bytes; the duration of the reset code is the duration parameter when the reset code maintains a low level; the start code is fixed at 0; the code interval is the idle duration between two different codes; the segment interval is the interval between the instruction code and the parameter code when writing codes in cascade; the data type is the representation value of the instruction code and the data code.
4. The method for setting a lamp chip without controller upgrade according to claim 3, characterized in that, When the DMX512 category value is 0, it means that the baud rate of this frame is 250K, the data is low-order first, and it includes 1 start bit, 8 data bits, and 2 stop bits; When the DMX512 category value is 1, it means that the baud rate of this frame is 250K, the data is high-order first, and it includes 1 start bit, 8 data bits, and 2 stop bits.
5. The method for setting a lamp chip without controller upgrade according to claim 3, characterized in that, When the representation value is 0, it indicates that the instruction code and the data code are separated; when the representation value is 1, the instruction code and the data code are combined; when the representation value is 2, it means that the instruction code and the data code do not need to be distinguished.
6. The method for setting a lamp chip without controller upgrade according to claim 1, characterized in that The determination of the data content specifically includes: According to the description of the data field, several fields among the frame sequence number, instruction code, parameter code, and the number of chips are used to determine the data content; The frame sequence number is used to identify the frame to which the three fields of the instruction code, parameter code, and the number of chips belong; the instruction code is a set of instruction codes arranged in sequence, and this field is not used when the data type is 2; the parameter code is a set of parameter codes arranged in sequence, and only this field is filled when the data type is 2; the number of chips is the number of chips during cascaded parameter writing, and it is fixed at 1 during parallel parameter writing.
7. A lighting chip setting device with controller free of upgrade, characterized in that It includes: Construct a format module, which is used to obtain the description of the writing parameter format characteristics from the writing parameter format library according to the type of the lamp chip and construct a protocol format. Specifically, it includes: if there is a code interval between the instruction code and the parameter code of the lamp chip and they need to be uniformly written by the bus, construct the first type of single-frame protocol format as the protocol format; the first type of single-frame protocol format includes a reset code, a start code, an instruction code, and a parameter code, and there are code intervals between the reset code, the start code, the instruction code, and the parameter code; if there is no such code interval between the instruction code and the parameter code of the lamp chip and they do not need to be uniformly written by the bus, construct the second type of single-frame protocol format as the protocol format; the second type of single-frame protocol format includes a reset code, a start code, and several combined codes, and there are code intervals between the reset code, the start code, and the combined codes, and the combined code includes adjacent instruction codes and parameter codes, and one combined code corresponds to one lamp chip; if the lamp chip requires the combined input of several DMX data frames, construct a multi-frame protocol format; the multi-frame protocol format includes a reset code, a start code, and an instruction code, or the multi-frame protocol format includes a reset code, a start code, and a parameter code; the number of bytes of the instruction code or the parameter code has a lower limit and an upper limit; the writing parameter format library includes the timing of the lamp chip; Construct a data module, which is used to obtain the description of the data field from the writing parameter database according to the type of the lamp chip and determine the data content; the writing parameter database includes the instruction code, parameter code, and the value range of the parameter code of the lamp chip; Configure a frame module, which is used to construct a lamp chip configuration frame according to the protocol format and the data content; A sending module, which is used to send the lamp chip configuration frame to the lamp chip by the controller in a cascaded or parallel manner.
Citation Information
Patent Citations
Logic design structure of general chip adopting microprocessor architecture and method thereof
CN101625706A
General data analysis platform and method for communication data stream
CN109981599A