A proprietary CAN bus frame synchronization structure and its underlying ambient lighting flow control system
Through the private CAN bus frame synchronization structure and frame synchronization level generator, the problems of low transmission efficiency and difficulty in frame synchronization head resolution in the traditional CAN/CAN FD protocol are solved, efficient ambient lighting flow control is achieved, and MCU computing overhead is reduced. It also supports efficient UART format private protocol transmission.
Patent Information
- Application Number
- CN202211375459.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-04
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2042-11-04
AI Technical Summary
The traditional CAN/CAN FD communication protocol has the problem of low transmission efficiency in vehicle ambient lighting control, especially in data transmission in large-scale lighting effect scenarios, which leads to wasted CPU computing power on the receiver and difficulty in parsing the frame synchronization head.
The private CAN bus frame synchronization structure is adopted, and a private CAN network is formed through the UARTonCAN method. The frame synchronization level generator and BUS ERROR error interrupt function are used to omit the synchronization head data to realize the DMA batch data reception at the receiving end.
It improves efficient and accurate control of ambient lighting flow, reduces MCU computing overhead, supports efficient UART format private protocol transmission, and forms a private lighting control domain.
Smart Images

Figure CN115694773B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vehicle-mounted LED lighting effect control, and in particular to a private CAN bus frame synchronization structure and an ambient light flow control system constructed therewith. Background Art
[0002] Car ambient lighting has become an indispensable part of car interiors. Traditional ambient lighting control uses the CAN / CAN FD communication protocol, which not only requires the selection of ICs with integrated CAN / CAN FD functions; at the same time, due to the reliability considerations of the CAN / CAN FD standard data protocol, it contains more verification information, resulting in low transmission efficiency, which is not conducive to data transmission of large-scale lighting effect scenes.
[0003] The CAN / CAN FD communication protocol for lighting control not only requires the selection of ICs with integrated CAN / CAN FD functions; at the same time, due to reliability considerations of the CAN / CAN FD standard data protocol, it contains more verification information, resulting in low transmission efficiency, which is not conducive to data transmission for large-scale lighting effect scenes.
[0004] In view of the characteristics of the prior art, the inventor proposes a solution of utilizing the physical layer of CAN / CAN FD and transmitting in a private protocol in UART format to form a private control domain for lighting, that is, using UARTonCAN to form a private CAN network.
[0005] However, based on the difference between UART and standard CAN: the former is a "stream data network" while the latter is a "packet data network". Therefore, before sending "stream data" each time, the former needs to send "frame synchronization" data first, so that the receiving end and the sending end can start data transmission after the status is consistent. The latter has its own hardware mechanism to ensure the synchronization of each frame header to form a data packet, and does not need to send "frame synchronization" data additionally.
[0006] For a private CAN bus such as UARTonCAN, if the standard UART "stream data" transmission method is used, a synchronization header data needs to be constructed at the head of each frame of data. When the receiving end decodes, feature analysis must be performed byte by byte. In this way, DMA cannot be used for efficient batch data reception. When a higher transmission rate is required, this traditional method will cause a great waste of CPU computing power on the receiving end.
[0007] However, due to the "streaming data" characteristics of UART itself, the receiving end does not have a standard hardware mechanism to detect the frame synchronization header signal. Therefore, only by solving the "frame synchronization" problem before the "streaming data network" transmission can the private CAN bus achieve efficient and accurate control of the ambient light flow. Summary of the invention
[0008] The purpose of the present invention is to provide a private CAN bus frame synchronization structure and an ambient light flow control system constructed by the structure, and to achieve frame synchronization between the receiving end and the transmitting end for a private CAN bus such as UARTonCAN, thereby utilizing the physical layer of CAN / CAN FD to realize private protocol transmission in UART format, and to form a private control domain for lighting, that is, to form a technical solution of a private CAN network using the UARTonCAN method.
[0009] If you want to implement this technical solution, you need to find a solution that uses the detection function of some UART itself to detect the frame synchronization header from the physical hardware layer, so that the synchronization header data can be omitted from the communication data, and the receiving end can directly use the DMA method to efficiently receive batch data.
[0010] In order to achieve the above object, the present invention adopts the following technical solution: a private CAN bus frame synchronization structure, including a CAN sending unit and a CAN receiving unit connected via a bus, the key of which is that the CAN sending unit and the CAN receiving unit form a private CAN network in a UARTonCAN manner, and "stream data" is sent between the two:
[0011] A frame synchronization level generator is also configured in the CAN network between the CAN sending unit and the CAN receiving unit. The frame synchronization level generator is used to send a long-term level to the CAN receiving unit. The CAN receiving unit has a BUSERROR error interrupt function of the UART.
[0012] Before the UART sends data each time, the CAN sending unit uses the IO operation to generate a pull-down level to pull down the data line, and keeps it long enough as a frame synchronization header signal, and then starts to send normal data frame content.
[0013] In coordination with this, the CAN receiving unit turns on the BUS ERROR interrupt function of the UART: Due to the UART standard, the signal line must maintain a high level in the IDLE state, and once it enters a low level, it means that the data begins to be transmitted. A transmission process can only contain 13 bits of data at most, and then the signal line must return to a high level state. If the bus is still at a low level after exceeding this time limit, a BUS ERROR error will occur. Using this mechanism, each time the CAN receiving unit receives a long low level, it will enter a BUS ERROR interrupt due to an error. In this interrupt function, frame reset synchronization is performed to synchronize the receiving end with the transmitting end, and then the normal UART data receiving process in DMA mode can be entered.
[0014] The long-period level is a low level whose duration is greater than 13-bit baud rate time.
[0015] Furthermore, the use of an external frame synchronization level generator has the disadvantage of high cost, and the external frame synchronization level generator must also be synchronized with the CAN sending unit clock, so it is more economical and reasonable to use a built-in frame synchronization level generator. The frame synchronization level generator is solidified in the CAN sending unit.
[0016] The structure is simple. Every time a frame of data is sent, the frame synchronization level generator dynamically reconfigures the IO mode of the UART.
[0017] Furthermore, the RXD transmitting end of the CAN transmitting unit is connected to the TX receiving end of the CAN receiving unit, and the TXD transmitting end of the CAN transmitting unit is connected to the RX receiving end of the CAN receiving unit;
[0018] The output end of the frame synchronization level generator is connected to the TXD transmitting end, thereby saving the communication interface of the CAN transmitting unit.
[0019] Furthermore, the RXD transmitting end of the CAN transmitting unit is connected to the TX receiving end of the CAN receiving unit, and a two-choice MUX module is connected between the TXD transmitting end of the CAN transmitting unit and the RX receiving end of the CAN receiving unit;
[0020] The CAN sending unit is also provided with a frame synchronization terminal GPIO2;
[0021] The TXD transmitting end is connected to the first input end of the two-choice MUX module, the frame synchronization end GPIO2 is connected to the first input end of the two-choice MUX module, and the output end of the two-choice MUX module is connected to the RX receiving end of the CAN receiving unit.
[0022] The frame synchronization header low level is generated by GPIO2, and through the cooperation of the external two-choice MUX module, after the low level is generated, the output of the two-choice MUX module is immediately switched to the GPIO2 low level and passed to the CAN receiving unit. After completing the synchronization header, the output of the two-choice MUX module is switched back to TXD to continue sending data.
[0023] This solution reduces the MCU computing overhead ratio and direct drive is small.
[0024] Furthermore, the RXD transmitting end of the CAN transmitting unit is connected to the TX receiving end of the CAN receiving unit, and a two-choice MUX module and a monostable trigger are connected between the TXD transmitting end of the CAN transmitting unit and the RX receiving end of the CAN receiving unit;
[0025] The CAN sending unit is also provided with a frame synchronization terminal GPIO2;
[0026] The TXD transmitting end is connected to the first input end of the two-choice MUX module, the frame synchronization end GPIO2 is connected to the first input end of the two-choice MUX module, the output end of the two-choice MUX module is connected to the input end of the monostable trigger, and the output end of the monostable trigger is connected to the RX receiving end of the CAN receiving unit.
[0027] The frame synchronization header low-level trigger signal is generated by GPIO2, and through the cooperation of the two-choice MUX module, after the low level is generated, the output of the two-choice MUX module is immediately switched to the GPIO2 low level, which is passed to the monostable trigger. The monostable trigger generates a low level of >13bit length through hardware delay, which can be fine-tuned by its RC parameters and output to the CAN receiving unit. After the monostable trigger outputs a low level and returns to a steady state, its output rising edge triggers an interrupt through GPIO1, guiding the CAN sending unit logic to continue sending data from TXD.
[0028] This solution does not require a dynamic configuration mode and does not consume additional timer resources. GPIO2 only needs to generate a falling edge signal once, and no timing is required, with minimal MCU calculation overhead.
[0029] However, a small amount of additional hardware circuits are required to cooperate with this function
[0030] An ambient light flow control system includes a main control MCU, the main control MCU is connected to at least one CAN receiving unit with the same structure via a bus, the CAN receiving unit is connected to a CAN transceiver, the CAN transceiver is connected to a light node controller, the light node controller drives an LED light strip, and the connection relationship between each CAN receiving unit, CAN transceiver, light node controller and LED light strip is consistent. The key is:
[0031] The master MCU acts as a CAN sending unit, and the CAN receiving unit forms a private CAN network in UARTonCAN mode, and "stream data" is sent between the two:
[0032] A frame synchronization level generator is also configured in the CAN network between the main control MCU and the CAN receiving unit, and the frame synchronization level generator is used to send a long-term level to the CAN receiving unit.
[0033] With the help of the detection function of UART itself, the frame synchronization header is detected from the physical hardware layer, so that the synchronization header data can be omitted from the communication data, and the receiving end can directly use the DMA method to receive batch data efficiently. The technical effect of using the physical layer of CAN / CAN FD and transmitting in the private protocol of UART format is achieved to form a private control domain for lighting, which effectively supports the solution of forming a private CAN network using the UARTonCAN method.
[0034] Furthermore, the long-period level is a low level with a duration greater than 13-bit baud rate time.
[0035] Furthermore, the frame synchronization level generator is solidified in the CAN sending unit;
[0036] The RXD transmitting end of the CAN transmitting unit is connected to the TX receiving end of the CAN receiving unit, and the TXD transmitting end of the CAN transmitting unit is connected to the RX receiving end of the CAN receiving unit;
[0037] The output end of the frame synchronization level generator is connected to the TXD transmitting end.
[0038] Alternatively, the RXD transmitting end of the CAN transmitting unit is connected to the TX receiving end of the CAN receiving unit, and a two-choice MUX module is connected between the TXD transmitting end of the CAN transmitting unit and the RX receiving end of the CAN receiving unit;
[0039] The CAN sending unit is also provided with a frame synchronization terminal GPIO2;
[0040] The TXD transmitting end is connected to the first input end of the two-choice MUX module, the frame synchronization end GPIO2 is connected to the first input end of the two-choice MUX module, and the output end of the two-choice MUX module is connected to the RX receiving end of the CAN receiving unit;
[0041] Alternatively, the RXD transmitting end of the CAN transmitting unit is connected to the TX receiving end of the CAN receiving unit, and a two-choice MUX module and a monostable trigger are connected between the TXD transmitting end of the CAN transmitting unit and the RX receiving end of the CAN receiving unit;
[0042] The CAN sending unit is also provided with a frame synchronization terminal GPIO2;
[0043] The TXD transmitting end is connected to the first input end of the two-choice MUX module, the frame synchronization end GPIO2 is connected to the first input end of the two-choice MUX module, the output end of the two-choice MUX module is connected to the input end of the monostable trigger, and the output end of the monostable trigger is connected to the RX receiving end of the CAN receiving unit.
[0044] Significant effect: The present invention provides a private CAN bus frame synchronization structure and an ambient light flow control system constructed thereon. The UART detects the frame synchronization header from the physical hardware layer by using its own detection function, thereby eliminating the synchronization header data from the communication data, and the receiving end can directly use the DMA method to efficiently receive batch data. The physical layer of CAN / CAN FD is used to transmit the private protocol in the UART format, forming a private control domain for lighting, and effectively supporting the solution of forming a private CAN network using the UARTonCAN method. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 This is a connection diagram of Example 1;
[0046] Figure 2 is a connection diagram of Example 2;
[0047] Figure 3 This is a connection diagram of Example 3;
[0048] Figure 4 This is the circuit diagram of the main control MCU;
[0049] Figure 5 The circuit diagram of the CAN receiving unit assembly;
[0050] Figure 6 This is the circuit diagram of the CAN transceiver;
[0051] Figure 7 This is the circuit diagram of the lamp node controller. DETAILED DESCRIPTION
[0052] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0053] Embodiment 1, a private CAN bus frame synchronization structure, includes a CAN sending unit and a CAN receiving unit connected via a bus, the key of which is that the CAN sending unit and the CAN receiving unit form a private CAN network in a UARTonCAN manner, and "stream data" is sent between the two:
[0054] The CAN network between the CAN transmitting unit and the CAN receiving unit is also equipped with a frame synchronization level generator, which is used to send a long-term level to the CAN receiving unit. The CAN receiving unit has a BUSERROR error interrupt function of UART. In the error interrupt function, frame reset and transceiver synchronization are performed, and then the subsequent frame data is received normally.
[0055] The long-period level is a low level whose duration is greater than 13-bit baud rate time.
[0056] Depending on the settings of the CAN receiving unit, the long-term level may be of any duration, such as 15-bit baud rate time, 20-bit baud rate time, or a long-term high level, pulse level, etc.
[0057] The frame synchronization level generator is embedded in the CAN sending unit.
[0058] Furthermore, the RXD transmitting end of the CAN transmitting unit is connected to the TX receiving end of the CAN receiving unit, and the TXD transmitting end of the CAN transmitting unit is connected to the RX receiving end of the CAN receiving unit;
[0059] The output end of the frame synchronization level generator is connected to the TXD transmitting end.
[0060] Embodiment 2 is a first scheme of externally placing a frame synchronization level generator, wherein the RXD transmitting end of the CAN transmitting unit is connected to the TX receiving end of the CAN receiving unit, and a two-choice MUX module is connected between the TXD transmitting end of the CAN transmitting unit and the RX receiving end of the CAN receiving unit;
[0061] The CAN sending unit is also provided with a frame synchronization terminal GPIO2;
[0062] The TXD transmitting end is connected to the first input end of the two-choice MUX module, the frame synchronization end GPIO2 is connected to the first input end of the two-choice MUX module, and the output end of the two-choice MUX module is connected to the RX receiving end of the CAN receiving unit.
[0063] Embodiment 3 is a second scheme of externally placing a frame synchronization level generator, wherein the RXD transmitting end of the CAN transmitting unit is connected to the TX receiving end of the CAN receiving unit, and a two-choice MUX module and a monostable trigger are connected between the TXD transmitting end of the CAN transmitting unit and the RX receiving end of the CAN receiving unit;
[0064] The CAN sending unit is also provided with a frame synchronization terminal GPIO2;
[0065] The TXD transmitting end is connected to the first input end of the two-choice MUX module, the frame synchronization end GPIO2 is connected to the first input end of the two-choice MUX module, the output end of the two-choice MUX module is connected to the input end of the monostable trigger, and the output end of the monostable trigger is connected to the RX receiving end of the CAN receiving unit.
[0066] The ambient light flow control system based on the private CAN bus frame synchronization structure has a main control MCU as a CAN sending unit, and the main control MCU is connected to at least three CAN receiving units via the bus.
[0067] like Figure 4 ,5 As shown in Figures 6 and 7, the three UART ports TX0-TX2 and RX0-RX2 of the main control MCU are connected to the three CAN receiving units respectively, and the data are sent to the three private CAN buses through the CAN0_H-CAN2_H and CAN0_L-CAN2_L of the three CAN receiving units respectively.
[0068] The first CAN receiving unit is connected to the CAN transceiver U6 via the CAN0_H terminal and the CAN0_L terminal, and the CAN transceiver U6 is connected to the light node controller via the TX terminal and the RX terminal, and the light node controller drives the LED light strip.
[0069] The light node controller connected to the private CAN bus receives the data through a CAN transceiver U6 and transmits it to the TX and RX pins of the light node controller, thus realizing the control of the light flow of the light strip.
[0070] The master MCU acts as a CAN sending unit, and the CAN receiving unit forms a private CAN network in UARTonCAN mode, and "stream data" is sent between the two:
[0071] A frame synchronization level generator is also configured in the CAN network between the main control MCU and the CAN receiving unit, and the frame synchronization level generator is used to send a long-term level to the CAN receiving unit.
[0072] The long-period level is a low level whose duration is greater than 13-bit baud rate time.
[0073] The frame synchronization level generator is solidified in the CAN sending unit;
[0074] The RXD transmitting end of the CAN transmitting unit is connected to the TX receiving end of the CAN receiving unit, and the TXD transmitting end of the CAN transmitting unit is connected to the RX receiving end of the CAN receiving unit;
[0075] The output end of the frame synchronization level generator is connected to the TXD transmitting end.
[0076] Alternatively, the RXD transmitting end of the CAN transmitting unit is connected to the TX receiving end of the CAN receiving unit, and a two-choice MUX module is connected between the TXD transmitting end of the CAN transmitting unit and the RX receiving end of the CAN receiving unit;
[0077] The CAN sending unit is also provided with a frame synchronization terminal GPIO2;
[0078] The TXD transmitting end is connected to the first input end of the two-choice MUX module, the frame synchronization end GPIO2 is connected to the first input end of the two-choice MUX module, and the output end of the two-choice MUX module is connected to the RX receiving end of the CAN receiving unit;
[0079] Alternatively, the RXD transmitting end of the CAN transmitting unit is connected to the TX receiving end of the CAN receiving unit, and a two-choice MUX module and a monostable trigger are connected between the TXD transmitting end of the CAN transmitting unit and the RX receiving end of the CAN receiving unit;
[0080] The CAN sending unit is also provided with a frame synchronization terminal GPIO2;
[0081] The TXD transmitting end is connected to the first input end of the two-choice MUX module, the frame synchronization end GPIO2 is connected to the first input end of the two-choice MUX module, the output end of the two-choice MUX module is connected to the input end of the monostable trigger, and the output end of the monostable trigger is connected to the RX receiving end of the CAN receiving unit.
[0082] Finally, it should be noted that the above examples are only specific implementation examples of the present invention. Of course, those skilled in the art can make changes and modifications to the present invention. If these modifications and variations fall within the scope of the claims of the present invention and their equivalent technologies, they should be considered to be within the scope of protection of the present invention.
Claims
1. A private CAN bus frame synchronization structure, comprising a CAN sending unit and a CAN receiving unit connected via a bus, characterized in that: The CAN sending unit and the CAN receiving unit form a private CAN network in UARTonCAN mode, and "stream data" is sent between the two: A frame synchronization level generator is also configured in the CAN network between the CAN sending unit and the CAN receiving unit, and the frame synchronization level generator is used to send a long-term level to the CAN receiving unit, and the CAN receiving unit has a BUS ERROR error interrupt function of the UART; The long-term level is a low level whose duration is greater than 13-bit baud rate time; The CAN receiving unit turns on the BUS ERROR interrupt function of UART: According to the UART standard, the signal line maintains a high level in the IDLE state, and data transmission starts when it enters a low level. A transmission process can only contain 13 bits of data at most, and then the signal line returns to a high level state. If the bus is still at a low level after exceeding the time limit, a BUS ERROR error will be generated. Each time the CAN receiving unit receives a long low level, it will detect an error and enter a BUS ERROR interrupt. In this interrupt function, frame reset synchronization is performed to keep the receiving end synchronized with the sending end, and then enter the normal UART data receiving process in DMA mode; The RXD transmitting end of the CAN transmitting unit is connected to the TX receiving end of the CAN receiving unit, and a two-choice MUX module is connected between the TXD transmitting end of the CAN transmitting unit and the RX receiving end of the CAN receiving unit; The CAN sending unit is also provided with a frame synchronization terminal GPIO2; The TXD transmitting end is connected to the first input end of the two-choice MUX module, the frame synchronization end GPIO2 is connected to the first input end of the two-choice MUX module, and the output end of the two-choice MUX module is connected to the RX receiving end of the CAN receiving unit.
2. The private CAN bus frame synchronization structure according to claim 1, characterized in that: The frame synchronization level generator is embedded in the CAN sending unit.
3. The private CAN bus frame synchronization structure according to claim 2, characterized in that: The RXD transmitting end of the CAN transmitting unit is connected to the TX receiving end of the CAN receiving unit, and the TXD transmitting end of the CAN transmitting unit is connected to the RX receiving end of the CAN receiving unit; The output end of the frame synchronization level generator is connected to the TXD transmitting end.
4. The private CAN bus frame synchronization structure according to claim 1, characterized in that: The RXD transmitting end of the CAN transmitting unit is connected to the TX receiving end of the CAN receiving unit, and a two-choice MUX module and a monostable trigger are connected between the TXD transmitting end of the CAN transmitting unit and the RX receiving end of the CAN receiving unit; The CAN sending unit is also provided with a frame synchronization terminal GPIO2; The TXD transmitting end is connected to the first input end of the two-choice MUX module, the frame synchronization end GPIO2 is connected to the first input end of the two-choice MUX module, the output end of the two-choice MUX module is connected to the input end of the monostable trigger, and the output end of the monostable trigger is connected to the RX receiving end of the CAN receiving unit.
5. An ambient light flow control system, comprising a main control MCU, the main control MCU is connected to at least one CAN receiving unit with the same structure via a bus, the CAN receiving unit is connected to a CAN transceiver, the CAN transceiver is connected to a light node controller, the light node controller drives an LED light strip, the connection relationship between each CAN receiving unit, the CAN transceiver, the light node controller and the LED light strip is consistent, and is characterized in that: The master MCU acts as a CAN sending unit, and the CAN receiving unit forms a private CAN network in UARTonCAN mode, and "stream data" is sent between the two: A frame synchronization level generator is also configured in the CAN network between the main control MCU and the CAN receiving unit, and the frame synchronization level generator is used to send a long-term level to the CAN receiving unit; The long-term level is a low level whose duration is greater than 13-bit baud rate time; Alternatively, the RXD transmitting end of the CAN transmitting unit is connected to the TX receiving end of the CAN receiving unit, and a two-choice MUX module is connected between the TXD transmitting end of the CAN transmitting unit and the RX receiving end of the CAN receiving unit; The CAN sending unit is also provided with a frame synchronization terminal GPIO2; The TXD transmitting end is connected to the first input end of the two-choice MUX module, the frame synchronization end GPIO2 is connected to the first input end of the two-choice MUX module, and the output end of the two-choice MUX module is connected to the RX receiving end of the CAN receiving unit; Alternatively, the RXD transmitting end of the CAN transmitting unit is connected to the TX receiving end of the CAN receiving unit, and a two-choice MUX module and a monostable trigger are connected between the TXD transmitting end of the CAN transmitting unit and the RX receiving end of the CAN receiving unit; The CAN sending unit is also provided with a frame synchronization terminal GPIO2; The TXD transmitting end is connected to the first input end of the two-choice MUX module, the frame synchronization end GPIO2 is connected to the first input end of the two-choice MUX module, the output end of the two-choice MUX module is connected to the input end of the monostable trigger, and the output end of the monostable trigger is connected to the RX receiving end of the CAN receiving unit.
6. The ambient light flow control system according to claim 5, characterized in that: The frame synchronization level generator is solidified in the CAN sending unit; The RXD transmitting end of the CAN transmitting unit is connected to the TX receiving end of the CAN receiving unit, and the TXD transmitting end of the CAN transmitting unit is connected to the RX receiving end of the CAN receiving unit; The output end of the frame synchronization level generator is connected to the TXD transmitting end.
Citation Information
Patent Citations
Device and method for reading out NERR bit, and synchronizing data frame in testing faulttolerant CAN network in low speed
CN101094108A
Controller for protocol conversion between multipath UART bus and CAN bus
CN102202058A
Synchronization system and synchronization method for modular multilevel pulse width modulation
CN109391250A
Load data interface device for satellite communication
CN110474674A
CAN data frame synchronization structure and atmosphere lamp light flow frame synchronization control system
CN219181725U
