A data conversion circuit and method between an external bus and an OSP bus
By designing a data conversion circuit between the external bus and the OSP bus, and using the MCU side conversion module and the node side conversion module to realize protocol conversion, the problems of high MCU processing capabilities and increased cost in the prior art are solved, and efficient and low-cost data conversion effect is achieved.
Patent Information
- Application Number
- CN202510107493.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-23
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2045-01-23
AI Technical Summary
The prior art requires high MCU processing capability and additional costs when implementing data conversion between the OSP bus and the external bus, and there are problems such as limiting MCU selection and increasing application costs.
A data conversion circuit between an external bus and an OSP bus is designed, including an MCU-side conversion module and a node-side conversion module. The conversion of the external bus to the OSP protocol is realized through the processor module, an on-chip bus, an external bus controller and an OSP controller. Only a set of OSP ports are required to complete the data conversion and transmission.
It realizes efficient data conversion between external bus and OSP bus, supports multiple bus protocols, reduces the processing capability requirements and application costs of MCUs, and reduces the limitations on MCU selection.
Smart Images

Figure CN119537284B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of OSP data transmission, in particular to a data conversion circuit and method between an external bus and an OSP bus. Background Art
[0002] OSP (Open System Protocl) is an open, unlicensed communication technology used to connect different RGB LEDs, sensors and microcontrollers.
[0003] refer to Figure 1 The OSP protocol stipulates that each node provides two sets of identical I / O ports, each set contains two SIOx_P and SIOx_N pins (where x is 1 or 2). Figure 1 The figure shows two internal pin connection diagrams. The left one is a symmetrical connection, which is generally used in the LVDS mode of the OSP protocol; the right one is a cross connection, which is used in the CAN mode of the OSP protocol.
[0004] Currently, OSP protocol is commonly used in Smart LED (intelligent light emitting diode) applications, which generally include two PCB boards, the main control board and the LED board, which are connected via the CAN bus. Two common applications are as follows:
[0005] refer to Figure 2 The first is that the main control MCU on the main control board is connected to the CAN bus through TX (transmit) and RX (receive) lines. The signals on TX and RX are Manchester encoded signals that meet the definition of the OSP physical layer protocol. The MCU needs to implement Manchester decoding (2.4M rate) through software, which consumes a lot of resources and computing power. This puts higher requirements on the selection of MCU, and requires an MCU with more powerful processing capabilities.
[0006] refer to Figure 3 The second method is to add a smart LED node with an OSP controller to the main control board and communicate with the MCU through this node. However, in actual applications, because the smart LED with the OSP controller is located on the main control board PCB, it needs to be covered with shading material to achieve the use scenario of no light in the application. This technical solution requires an additional smart LED chip with an OSP controller and external shading material, which increases the cost in the application.
[0007] Therefore, the existing technology can no longer meet the needs of people at this stage, and it is urgent to improve the existing technology. Summary of the invention
[0008] The object of the present invention is to provide a data conversion circuit and method between an external bus and an OSP bus to solve the problems raised in the above background technology.
[0009] On the one hand, the present invention provides the following technical solution: a data conversion circuit between an external bus and an OSP bus, comprising: an MCU-side conversion module and a node-side conversion module; wherein,
[0010] The MCU-side conversion module includes: a processor module, an on-chip bus, an external bus controller and an OSP controller;
[0011] The processor module is connected to the external bus controller and the OSP controller via the on-chip bus. The processor module reads data from the external bus controller and the OSP controller via the on-chip bus, and realizes conversion from the external bus to the OSP protocol after data processing.
[0012] The external bus controller is connected to the on-chip bus through the bus interface, and one end of the external bus controller is connected to the external bus; the OSP controller is connected to the on-chip bus through the bus interface, and the OSP controller is provided with a group of OSP ports to communicate with the downstream OSP node through the OSP bus; the MCU-end conversion module is arranged in the main control circuit board, and the OSP controller is provided with only one group of OSP ports to realize data conversion and transmission between the external bus and the OSP bus;
[0013] The node-end conversion module comprises: a UART controller, a protocol conversion module and an OSP controller;
[0014] The UART controller is connected to the MCU-end conversion module via an external bus transceiver, and the UART controller converts the external bus into the UART protocol; the UART controller is connected to the OSP controller via a protocol conversion module, and the protocol conversion module is used to implement UART-OSP protocol conversion; the node-end conversion module is arranged at the first node in the LED circuit board, and the external bus protocol is received or sent at the first node, and the OSP protocol conversion is completed.
[0015] On the other hand, the invention also provides the following technical solution: a method for data conversion between an external bus and an OSP bus, the specific steps comprising:
[0016] S100: external bus converts OSP bus data output; the steps include:
[0017] S101: Enable the external bus controller receiving function to receive the external bus control byte and the control byte in the OSP frame:
[0018] S102: Parse the control byte in the OSP frame to obtain the payload byte length in the control byte;
[0019] S103: receiving the data byte and the check code byte in the OSP frame, determining whether the data byte length is consistent with the payload byte length in the OSP frame control byte, and whether the check code byte is correct;
[0020] S104: If all conditions are met, all received bytes are stored in the FIFO of the OSP controller, and the bytes include the control byte, data byte, and checksum byte in the OSP frame;
[0021] S105: Send OSP bus data via OSP controller;
[0022] S200: OSP bus converts external bus data output; the steps include:
[0023] S201: Parse the command in the OSP protocol and determine whether the command contains a response frame;
[0024] If a response frame is included, the OSP controller receiving function is enabled to receive the control byte in the OSP frame;
[0025] S202: Parse the control bytes in the OSP frame and obtain the payload byte length until all data bytes and check code bytes in the OSP frame are received;
[0026] S203: Determine whether the received data byte length is consistent with the payload byte length of the control byte in the OSP frame, and whether the check code byte is correct;
[0027] S204: If all the conditions are met, all bytes are received, including the control byte, data byte and checksum byte in the OSP frame, and the received bytes are written into the FIFO of the external bus controller;
[0028] S205: Sending external bus data via the external bus controller.
[0029] The present invention has the following beneficial effects:
[0030] The present invention can realize data conversion and transmission between an external bus and an OSP bus by setting an MCU-side conversion module in a main control circuit board and an OSP controller having only one set of OSP ports;
[0031] The present invention sets the node end conversion module at the first node in the LED circuit board, completes receiving or sending the external bus protocol at the first node, and completes the OSP protocol conversion;
[0032] The present invention can support data conversion between multiple external buses and OSP buses, including: SPI bus, CAN bus, FlexRay bus (a vehicle-mounted technology bus) and Ethernet bus, etc. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It is a schematic diagram of the I / O port structure of each node in the OSP protocol;
[0034] Figure 2 It is a schematic diagram of the first structure of the application of the intelligent light emitting diode described in the background technology;
[0035] Figure 3 It is a schematic diagram of the second structure of the smart light emitting diode application described in the background technology;
[0036] Figure 4 This is a schematic diagram of the structure of the MCU-side conversion module of the present invention;
[0037] Figure 5 Another structural diagram of the MCU-side conversion module of the present invention;
[0038] Figure 6 This is a schematic diagram of a node-side conversion module of the present invention;
[0039] Figure 7 This is a schematic diagram of the structure of an application embodiment of a node-side conversion module of the present invention;
[0040] Figure 8 It is a schematic diagram of the OSP protocol frame structure of the present invention. DETAILED DESCRIPTION
[0041] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in the field of the present invention without creative work are within the scope of protection of the present invention.
[0042] On the one hand, the present invention provides the following technical solution: a data conversion circuit between an external bus and an OSP bus, comprising: an MCU-side conversion module and a node-side conversion module; wherein:
[0043] refer to Figure 4The MCU-side conversion module includes: a processor module, an on-chip bus, an external bus controller and an OSP controller. The processor module is connected to the external bus controller and the OSP controller through the on-chip bus. The processor module reads data in the external bus controller and the OSP controller through the on-chip bus, and realizes the conversion between the external bus and the OSP protocol after data processing. In this embodiment, the data processing includes extracting control words, data, and check bits from the external bus, and converting them into control words, data, and check bits of the OSP protocol, thereby realizing the conversion between the external bus and the OSP protocol.
[0044] The external bus controller includes: LIN bus controller, CAN bus controller, FlexRay bus controller, SPI bus controller and Ethernet bus controller, etc., and the external bus controller is connected to the on-chip bus through the bus interface, and one end of the external bus controller is connected to the external bus, for example, the LIN bus controller is connected to the external LIN bus, and the CAN bus controller is connected to the external CAN bus, etc.
[0045] The first OSP controller of the MCU-side conversion module is provided with a group of OSP ports: SIO_N and SIO_P, and the OSP ports communicate with the downstream OSP nodes through the OSP bus; wherein SIO_P is used to send data to the downstream OSP node, and SIO_N is used to receive data sent by the downstream OSP node; and the first OSP controller is also connected to the on-chip bus through the bus interface. In this embodiment, the OSP controller of the prior art solution is provided with two groups of OSP ports connected to the OSP bus, wherein one group of OSP ports communicates with the upstream OSP node, and the other group of OSP ports communicates with the downstream OSP node, while the MCU-side conversion module of this embodiment is provided in the main control circuit board, and the first OSP controller does not need to be provided with an OSP port to communicate with the upstream node, but only needs to be provided with a group of OSP ports to communicate with the downstream OSP node through the OSP bus.
[0046] refer to Figure 4 As an optional implementation of the present invention, in this embodiment, the process of the host sending a data packet to the downstream node is as follows:
[0047] In this embodiment, the external bus controller receives data sent by the host through the external bus and stores it in its own data cache FIFO. The processor module reads data from the data cache FIFO of the external bus controller through the internal bus, and after processing by the processor module, sends the data to the data cache FIFO of the OSP controller through the internal bus. Finally, the first OSP controller sends the data to the downstream node through the OSP bus via the OSP port.
[0048] refer to Figure 4As another optional implementation of the present invention, in this embodiment, the process of sending a data packet from a downstream node to a host is as follows:
[0049] In this embodiment, after the first OSP controller receives data sent by the downstream node through the OSP bus through the OSP port, it stores it in its own data cache FIFO. The processor module reads the data from the data cache FIFO of the first OSP controller through the on-chip bus. After processing by the processor module, the data is sent to the data cache FIFO of the external bus controller through the on-chip bus. Finally, the external bus controller sends the data to the host through the external bus.
[0050] It can be seen from the above two embodiments that no matter a data packet is sent from the host to a downstream node or from a downstream node to the host, during the entire transmission process, the first OSP controller only needs to have a set of OSP ports to realize data conversion and transmission between the external bus and the OSP bus.
[0051] refer to Figure 5 The present invention also provides another optional implementation mode, which integrates the external bus controller and the first OSP controller into a bridge controller, and the bridge controller is connected to the on-chip bus through the bus interface; in this embodiment, if the external bus used is a CAN bus, which has a relatively high frequency, the CAN bus controller and the first OSP controller are integrated into a bridge controller, which is smaller in size and more convenient to use.
[0052] refer to Figure 1 , Figure 2 and Figure 7 In this embodiment, the intelligent LED node and microcontroller of the OSP controller are replaced by the MCU-side conversion module, and the MCU-side conversion module has no special requirements on the performance of the processor in the processor module, which greatly saves costs.
[0053] refer to Figure 6 , a node-end conversion module, including: a UART controller, a protocol conversion module and a second OSP controller, wherein the node-end conversion module is arranged at the first node in the LED circuit board, and is used to realize receiving or sending an external bus protocol at the first node, and complete OSP protocol conversion; the UART controller is connected to the MCU-end conversion module via an external bus transceiver, the UART controller converts the external bus into a UART protocol, and the UART controller is connected to the second OSP controller via the protocol conversion module, and the protocol conversion module is used to realize UART-OSP protocol conversion;
[0054] refer to Figure 7In this embodiment, taking the intelligent LED application with OSP controller mentioned in the background technology as an example, the intelligent LED application with OSP controller generally requires two PCB boards, namely the main control circuit board and the LED circuit board. The two PCB boards are connected through the CAN bus, so the node-end conversion module is set at the first node in the LED board circuit, and the protocol conversion from CAN bus to OSP is realized at the first node in the LED board. First, the UART controller realizes the CAN-UART protocol conversion, and then the protocol conversion module realizes the UART-OSP protocol conversion. In this way, the conversion from CAN bus to OSP protocol is realized at the first node in the LED board circuit. In this embodiment, because the MCU end realizes the conversion from other buses to OSP, there is no need to add an additional intelligent LED node with OSP controller and external shading material on the main control board.
[0055] On the other hand, the present invention also provides the following technical solution: a method for data conversion between an external bus and an OSP bus, the specific steps comprising:
[0056] S100: external bus conversion OSP bus data output;
[0057] S200: OSP bus converts external bus data output;
[0058] The step S100 includes:
[0059] S101: Enable the external bus controller receiving function to receive the external bus control byte and the control byte in the OSP frame:
[0060] In this embodiment, the external bus control byte is received first and then the control byte in the OSP frame is received. Figure 8 The external bus of this embodiment is the SPI bus, so the SPI bus control byte is received first, and then the control byte in the OSP frame is received; the control bytes in the OSP frame: byte M-1, byte M-2, byte M-3 are used to parse the preamble, address, payload byte length, and command.
[0061] S102: Parse the control byte in the OSP frame and obtain the payload byte length in the control byte.
[0062] S103: Receive the data byte and check code byte in the OSP frame, determine whether the length of the data byte is consistent with the payload byte length in the OSP frame control byte, and whether the check code byte is correct.
[0063] refer to Figure 8 In this embodiment, byte M-4 to byte 1 are data bytes used to parse the payload data; byte 0 is the check code byte used to parse the cyclic redundancy check code.
[0064] S104: If all conditions are met, all received bytes (control bytes, data bytes, checksum bytes in the OSP frame) are stored in the FIFO of the OSP controller;
[0065] S105: Send OSP bus data via OSP controller;
[0066] The step S200 includes:
[0067] S201: Parse the command in the OSP protocol and determine whether the command contains a response frame;
[0068] If a response frame is included, the OSP controller receiving function is enabled to receive the control byte in the OSP frame;
[0069] S202: Parse the control bytes in the OSP frame and obtain the payload byte length until all data bytes and check code bytes in the OSP frame are received;
[0070] S203: Determine whether the received data byte length is consistent with the payload byte length of the control byte in the OSP frame, and whether the check code byte is correct;
[0071] S204: If all conditions are met, all received bytes are written into the FIFO of the external bus controller, including the control byte, data byte and checksum byte in the OSP frame;
[0072] S205: Sending external bus data via the external bus controller.
[0073] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0074] Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments, or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A data conversion circuit between an external bus and an OSP bus, characterized in that: include: MCU-side conversion module and node-side conversion module; wherein, The MCU-side conversion module includes: a processor module, an on-chip bus, an external bus controller and a first OSP controller; The processor module is connected to the external bus controller and the first OSP controller via the on-chip bus, the processor module reads data in the external bus controller and the first OSP controller via the on-chip bus, and realizes conversion between the external bus and the OSP protocol after data processing; The external bus controller is connected to the on-chip bus via a bus interface, and one end of the external bus controller is connected to the external bus; The first OSP controller is connected to the on-chip bus via a bus interface, and the first OSP controller is provided with a group of OSP ports for communicating with downstream OSP nodes via the OSP bus; The MCU-side conversion module is arranged in the main control circuit board, and the first OSP controller realizes data conversion and transmission between the external bus and the OSP bus by only setting one group of OSP ports; The node-end conversion module comprises: a UART controller, a protocol conversion module and a second OSP controller; The UART controller is connected to the MCU-side conversion module via an external bus transceiver, and the UART controller is used to convert the external bus into a UART protocol; The UART controller is connected to the second OSP controller via a protocol conversion module, and the protocol conversion module is used to implement UART-OSP protocol conversion; The node end conversion module is arranged at the first node in the LED circuit board, completes receiving or sending the external bus protocol at the first node, and completes OSP protocol conversion.
2. The data conversion circuit between the external bus and the OSP bus according to claim 1, characterized in that: The external bus controllers include: LIN bus controller, CAN bus controller, FlexRay bus controller, SPI bus controller and Ethernet bus controller.
3. The data conversion circuit between the external bus and the OSP bus according to claim 1, characterized in that: The OSP port includes two pins: SIO_N and SIO_P, and the OSP port communicates with the downstream OSP node through the OSP bus; wherein SIO_P is used to send data to the downstream OSP node, and SIO_N is used to receive data sent by the downstream OSP node.
4. The data conversion circuit between the external bus and the OSP bus according to claim 1, characterized in that: When data is sent from the external bus to the OSP bus, the external bus controller receives the data sent by the upstream host through the external bus and stores it in its own data cache FIFO; and, The processor module reads the stored data from the data cache FIFO of the external bus controller through the on-chip bus, and after the data is processed by the processor module, sends the data to the data cache FIFO of the first OSP controller through the on-chip bus; and, The first OSP controller sends the data to the downstream node through the OSP bus via the OSP port.
5. The data conversion circuit between the external bus and the OSP bus according to claim 1, characterized in that: When data is sent from the OSP bus to the external bus, the first OSP controller receives the data sent by the downstream node through the OSP bus through the OSP port and stores it in its own data cache FIFO; and, The processor module reads the stored data from the data cache FIFO of the first OSP controller through the on-chip bus, and after the data is processed by the processor module, sends the data to the data cache FIFO of the external bus controller through the on-chip bus; and, The external bus controller sends data to the host via the external bus.
6. The data conversion circuit between the external bus and the OSP bus according to claim 1, characterized in that: The external bus controller and the first OSP controller are integrated into a bridge controller, and the bridge controller is connected to the on-chip bus through a bus interface.
7. The data conversion circuit between the external bus and the OSP bus according to claim 1, characterized in that: The MCU-side conversion module replaces the intelligent LED node and the microcontroller of the first OSP controller, and the MCU-side conversion module does not limit the performance of the processor in the processor module.
8. A method for data conversion between an external bus and an OSP bus based on the data conversion circuit between an external bus and an OSP bus according to any one of claims 1 to 7, characterized in that: The specific steps include: S100: external bus conversion OSP bus data output; S200: OSP bus converts external bus data output; in, The step S100 includes: S101: Enable the external bus controller receiving function to receive the external bus control byte and the control byte in the OSP frame: S102: Parse the control byte in the OSP frame to obtain the payload byte length in the control byte; S103: Receive the data byte and the check code byte in the OSP frame, determine whether the data byte length is consistent with the payload byte length in the OSP frame control byte, and whether the check code byte is correct; S104: If all conditions are met, the control byte, data byte and checksum byte in the OSP frame are received, and the received bytes are stored in the FIFO of the OSP controller; S105: Send OSP bus data via OSP controller; The step S200 includes: S201: Parse the command in the OSP protocol and determine whether the command contains a response frame; If a response frame is included, the OSP controller receiving function is enabled to receive the control byte in the OSP frame; S202: Parse the control bytes in the OSP frame and obtain the payload byte length until all data bytes and check code bytes in the OSP frame are received; S203: Determine whether the received data byte length is consistent with the payload byte length of the control byte in the OSP frame, and whether the check code byte is correct; S204: If all conditions are met, the control byte, data byte and checksum byte in the OSP frame are received, and the received bytes are written into the FIFO of the external bus controller; S205: Sending external bus data via the external bus controller.
9. The method for data conversion between an external bus and an OSP bus according to claim 8, characterized in that: The external bus controller first receives the external bus control byte and then receives the control byte in the OSP frame.
10. The method for data conversion between an external bus and an OSP bus according to claim 8, characterized in that: The check code byte is used to parse the cyclic redundancy check code and determine whether the check code byte in step S103 is correct; The data byte is used to parse the effective payload data and determine whether the data byte length in step S103 is consistent with the payload byte length in the OSP frame control byte.
Citation Information
Patent Citations
Function extension device, system on chip, method and product
CN118760647A