Remote control with baud rate switching function and method for switching baud rate with remote control
The target baud rate can be directly determined by the remote control triggered by local buttons, which solves the baud rate matching problem in the vehicle electronic control system and realizes high real-time and deterministic baud rate switching that can be switched instantly by pressing a button, making it suitable for high reliability scenarios.
Patent Information
- Application Number
- CN202611365415.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-03
- Publication Date
- 2026-11-17
AI Technical Summary
In existing automotive electronic control systems, the baud rate matching problem leads to low development efficiency and inflexible field operations. Furthermore, existing solutions rely on bus messages or external tools and cannot independently complete switching without communication, thus failing to meet the security and deterministic requirements of automotive-grade networks.
Design a remote control that can be triggered by local buttons, directly determine the target baud rate based on a pre-stored mapping relationship, and achieve baud rate switching that can be switched instantly by pressing a button. It does not rely on diagnostic commands or CAN bus message detection, and uses a microprocessor unit to determine valid trigger events and reinitialize communication parameters.
It achieves non-intrusive, high real-time and deterministic baud rate switching, and is suitable for industrial remote control, construction machinery and vehicle control scenarios, reducing the time cost and communication risks of on-site operations.
Smart Images

Figure CN123123066A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vehicle network communication technology, and more specifically, to a remote control with baud rate switching function and a method for switching baud rates with the remote control. Background Technology
[0002] In automotive electronic control systems, the CAN bus, with its high reliability and real-time performance, has become the core communication backbone for data exchange between electronic control units (ECUs) such as electronically controlled air suspension (ECAS) and engine control. However, in practical engineering applications, different OEMs, different vehicle models, and even different calibration tools often use different communication baud rates such as 125 kbps, 250 kbps, and 500 kbps. This leads to baud rate matching problems for ECUs in various stages, including vehicle debugging, production line cross-flow flashing, and after-sales maintenance and diagnosis, which seriously restricts development efficiency and flexibility of on-site operations.
[0003] Currently, there are various baud rate adaptive or switching technology solutions in the industry, which can be summarized into the following categories according to their implementation principles: A passive method for estimating bus baud rate by monitoring bus messages. This type of scheme infers the current bus baud rate by detecting the Start of Frame (SOF) edge, bit timing, or statistical error count. This method relies on the existence of valid CAN message communication on the bus and cannot perform baud rate identification in networks where the bus is idle or only a single node is powered on.
[0004] One method involves actively sending test frames and detecting acknowledgments (ACK) responses. This approach involves nodes actively sending test frames at different baud rates and determining baud rate compatibility by detecting successful transmission and receiving ACK responses from other nodes. However, this proactive sending behavior can introduce erroneous frames, interfering with normal network communication, and poses security risks in multi-master networks competing for the bus.
[0005] Hardware detection schemes based on bit-time measurement. These schemes infer the baud rate by directly measuring the bit-time width corresponding to the dominant and recessive levels on the bus. However, this approach places high demands on the accuracy of the microprocessor unit's timers and the sampling rate, significantly increasing hardware cost and engineering implementation complexity.
[0006] This approach involves issuing switching commands via diagnostic protocols. It utilizes Unified Diagnostic Services (UDS) or the original equipment manufacturer's (OEM) proprietary diagnostic services, with external diagnostic tools sending switching commands to the ECU to rewrite baud rate-related parameters. However, this initial communication must be established at a known and correct baud rate, and it relies entirely on external diagnostic equipment, making it impossible to complete the switching independently without diagnostic tools or pre-established communication.
[0007] The aforementioned existing technical solutions generally suffer from the following common defects: Most solutions rely on existing effective communication on the bus and cannot work in bus idle or single-node networks. Some active detection solutions are intrusive to normal network communication and do not meet the security requirements of automotive-grade networks; Although the hardware solution based on bit time measurement does not rely on protocol decoding, it has excessively high requirements for the performance of the microprocessor unit and is not economical. The diagnostic command switching scheme relies on external tools and the initial communication must be based on the correct baud rate; it cannot be operated independently.
[0008] It is evident that existing technologies generally have inherent limitations, such as relying on existing bus messages or diagnostic tools, and lack a switching method that is independent of network conditions, requires no external device support, and can be flexibly intervened by field personnel.
[0009] Furthermore, existing adaptive solutions are sensitive to environmental factors such as network load and frame period, and their recognition time is uncertain. They lack a deterministic worst-case time limit, making it difficult to meet the stringent security and deterministic requirements of automotive-grade networks. In actual engineering and production processes, typical scenarios such as vehicle model changeover debugging (different vehicles have different baud rates), production line flashing / calibration (different stages require different baud rates), and after-sales maintenance and diagnosis (requiring ECU initialization in a bus-less environment at a specific baud rate) cannot meet the prerequisite of existing bus having effective communication, making the existing technology unsuitable for application.
[0010] Therefore, there is an urgent need for a baud rate switching solution that is easy to operate, highly deterministic, non-intrusive, and does not rely on network status or external tools, so as to effectively reduce the time cost and communication risk of on-site operations and improve the efficiency and reliability of the entire chain of vehicle system development, production and maintenance.
[0011] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of the present invention, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0012] To address the problems in the prior art, the present invention aims to provide a remote control with baud rate switching function and a method for switching baud rates with the remote control. The remote control is triggered by local buttons and directly determines the target baud rate based on a pre-stored mapping relationship, realizing instant switching, high real-time performance and anti-interference baud rate switching, without relying on diagnostic commands, CAN bus message detection or automatic baud rate identification.
[0013] A first aspect of the present invention provides a remote control with baud rate switching function, comprising: The local input unit is used to receive user input. A storage unit is used to store the mapping relationship between at least one trigger event and baud rate, as well as the bit timing parameters corresponding to each baud rate; The control unit is used for CAN communication according to the set baud rate; The microprocessor unit is connected to the local input unit, the storage unit, and the control unit, respectively, and is configured to perform the following operations: Receive the input signal from the local input unit and determine whether there is a valid triggering event that meets the preset conditions; When the valid triggering event exists, the target baud rate corresponding to the valid triggering event is determined according to the mapping relationship; Control the control unit to exit the operating mode corresponding to the current baud rate; Read the bit timing parameters corresponding to the target baud rate from the storage unit and write the bit timing parameters into the configuration register of the control unit to reinitialize the control unit; The control unit, after being re-initialized, enters the operating mode at the target baud rate to communicate according to the target baud rate.
[0014] According to a first aspect of the present invention, the local input unit is a key matrix circuit or multiple GPIO input interfaces, and each operation key on the remote control housing is electrically connected to the corresponding row and column lines of the key matrix circuit or the corresponding pin of the GPIO input interface through conductive contacts. When the operation key is pressed, the level state of the corresponding pin is changed. The microprocessor unit receives input signals from the key matrix circuit or the plurality of GPIO input interfaces to obtain the valid trigger event; The effective triggering events include one or any combination of combination key events, sequential key events, and continuous press events.
[0015] According to a first aspect of the invention, the microprocessor unit is further configured to: Perform debouncing processing on the received key input; Based on the duration of the key input, the combination of pressed keys, or the triggering order of each key, determine whether the key input meets the preset conditions for a valid triggering event. The valid triggering events include combination key events, continuous press events, and sequential key events. The preset conditions for each event type are as follows: When the effective triggering event is a combination key event, the preset condition is: the pressed key combination matches the preset combination, and the duration of the combination key state reaches the preset time threshold. When the effective triggering event is a continuous press event, the preset condition is: the continuous press time of a single button reaches a preset time threshold. When the effective triggering event is a sequential key press event, the preset condition is: the triggering order of each key is consistent with the preset order; The microprocessor unit confirms that the valid triggering event is established only when all preset conditions corresponding to the event type matching the key input are met.
[0016] According to a first aspect of the present invention, the remote control with baud rate switching function further includes: A feedback output unit, connected to the microprocessor unit, is used to output a feedback signal representing the current baud rate information to the user after the control unit successfully communicates at the target baud rate. The feedback output unit includes at least one of a background light, a status indicator light, and a buzzer, and the feedback signal includes one or a combination of light color change, indicator light flashing mode, and buzzer prompt sound. The microprocessor unit is further configured to: after the control unit successfully communicates at the target baud rate, control the feedback output unit to output a preset feedback mode corresponding to the target baud rate, with different baud rates corresponding to different feedback modes.
[0017] According to a first aspect of the invention, the storage unit includes a non-volatile memory, and the microprocessor unit is further configured to: After the control unit successfully communicates at the target baud rate, the target baud rate is saved as the default baud rate to the non-volatile memory. When the remote control is powered on again, the microprocessor unit directly reads the default baud rate from the non-volatile memory and initializes the control unit based on the bit timing parameters corresponding to the default baud rate.
[0018] According to a first aspect of the invention, the microprocessor unit is further configured to: When the control unit fails to communicate at the target baud rate, it automatically controls the control unit to fall back to the preset default baud rate or the effective baud rate of the most recent successful communication. The communication failure includes: not receiving a valid CAN response frame within a predetermined timeout period, or the received response frame containing an error flag.
[0019] A second aspect of the present invention provides a method for switching baud rates using a remote control, the method comprising the following steps: Receive local input and determine whether there is a valid trigger event that meets preset conditions; If a valid triggering event exists, the target baud rate corresponding to the valid triggering event is determined according to the pre-stored mapping relationship between triggering events and target baud rates. Exit the working mode corresponding to the current baud rate; Read the bit timing parameters corresponding to the target baud rate, and perform a re-initialization operation using the bit timing parameters; Enter the operating mode at the target baud rate to communicate at the target baud rate.
[0020] According to a second aspect of the present invention, the local input is key input, and the determination of whether a valid triggering event satisfying a preset condition includes: Perform debouncing processing on the received key input; Based on the duration of the key input, the combination of pressed keys, or the triggering order of each key, determine whether the key input meets the preset conditions for a valid triggering event. The valid triggering events include combination key events, continuous press events, and sequential key events. The preset conditions for each event type are as follows: When the effective triggering event is a combination key event, the preset condition is: the pressed key combination matches the preset combination, and the duration of the combination key state reaches the preset time threshold. When the effective triggering event is a continuous press event, the preset condition is: the continuous press time of a single button reaches a preset time threshold. When the effective triggering event is a sequential key press event, the preset condition is: the triggering order of each key is consistent with the preset order; The valid triggering event is confirmed only when all preset conditions corresponding to the event type matching the key input are met.
[0021] According to a second aspect of the invention, before exiting the operating mode corresponding to the current baud rate, the method further includes: Determine whether the target baud rate is the same as the current baud rate; When the target baud rate is the same as the current baud rate, maintain the working mode corresponding to the current baud rate; When the target baud rate is different from the current baud rate, the operation of exiting the working mode corresponding to the current baud rate is executed, as well as reading the bit timing parameters corresponding to the target baud rate and performing a re-initialization operation using the bit timing parameters is performed.
[0022] According to a second aspect of the present invention, the method for switching baud rates using a remote control further includes at least one of the following steps: After successfully communicating at the target baud rate, a feedback signal representing the current baud rate information is output. The feedback signal includes one or a combination of light color change, indicator flashing mode, and buzzer tone. After successfully communicating at the target baud rate, the target baud rate is saved as the default baud rate to non-volatile memory so that it can be directly used as the default initialization parameter on the next power-on. When communication fails at the target baud rate, the system falls back to the preset default baud rate or the effective baud rate of the most recent successful communication. The communication failure includes not receiving a valid CAN response frame within a predetermined timeout period or receiving a response frame containing an error flag.
[0023] The remote controller and its switching method with baud rate switching function of the present invention are triggered entirely by local operation buttons. The target baud rate is directly determined based on the pre-stored trigger event and baud rate mapping relationship, without relying on diagnostic commands, CAN bus message detection or automatic baud rate identification, thus avoiding bus interference and protocol compatibility issues. It achieves deterministic switching and high real-time performance, and is suitable for high reliability scenarios such as industrial remote control, engineering machinery and vehicle control. Attached Figure Description
[0024] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings.
[0025] Figure 1 This is a schematic diagram of the module structure of a remote control according to an embodiment of the present invention; Figure 2 This is a flowchart of a method for switching baud rates using a remote control according to an embodiment of the present invention. Detailed Implementation
[0026] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that the invention will be thorough and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the invention, and should not be construed as limiting the invention. The same reference numerals in the drawings denote the same or similar structures, and therefore repeated descriptions of them will be omitted.
[0027] In the description of this invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, features defined as "first" and "second" may explicitly or implicitly include one or more features. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0028] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection, an electrical connection, or a connection that allows communication between them; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0029] The following disclosure provides numerous different embodiments or examples for implementing various structures of the invention. To simplify the disclosure, specific examples of components and settings are described below. These are merely examples and are not intended to limit the invention. Furthermore, reference numerals and / or letters may be repeated in different examples; such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or settings discussed. In addition, examples of various specific processes and materials are provided in this invention, but those skilled in the art will recognize the application of other processes and / or the use of other materials.
[0030] The following description, in conjunction with the accompanying drawings and specific embodiments, further illustrates the present invention's remote control with baud rate switching function and the method for switching baud rates with the remote control. It should be understood that the specific embodiments are not intended to limit the scope of protection of the present invention.
[0031] This invention provides a remote control with baud rate switching function. Figure 1This is a schematic diagram of the module structure of a remote control according to an embodiment of the present invention. The remote control has a housing, on which multiple operation buttons for users to press are provided, such as directional keys, confirmation keys, and function keys A / B / C / D. The remote control includes a local input unit M10, a storage unit M20, a control unit M30, and a microprocessor unit M40 disposed within the housing. The microprocessor unit M40 is electrically connected to and communicates with the local input unit M10, the storage unit M20, and the control unit M30.
[0032] The operation buttons can be physical buttons or touch buttons. There is a physical / electrical connection or signal coupling between the local input unit M10 and the operation buttons. Specifically, when the operation buttons are physical buttons, each physical button has a conductive contact at its bottom. The local input unit M10 is a button detection circuit, such as a button matrix circuit or multiple GPIO interface circuits. When a button is pressed, the conductive contact makes electrical contact with the corresponding pin of the local input unit M10, thereby converting the user's pressing action into a change in level signal. When the operation buttons are touch buttons, the touch buttons are virtual buttons set on the remote control display screen. The local input unit M10 includes a touch sensing interface circuit. When the virtual button is touched by the user, a touch signal is generated, which is processed by the touch sensing interface circuit and transmitted to the microprocessor unit M40. Thus, the local input unit M10 is used to receive the user's pressing input to physical buttons or touch input to touch buttons, and convert the pressing input or touch input into an electrical signal.
[0033] Storage unit M20 stores the mapping relationship between at least one trigger event and baud rate, as well as the bit timing parameters corresponding to each baud rate. These bit timing parameters include, but are not limited to, synchronization jump width, sampling point position, and baud rate prescaler value. Control unit M30 is a CAN controller that supports the CAN protocol and is used for CAN bus communication according to the set baud rate.
[0034] The microprocessor unit M40 is the core computing and control component of the remote control, integrating or connecting to the storage unit M20 and control unit M30. The microprocessor unit M40 is configured to execute subsequent baud rate switching logic. Its switching process does not rely on diagnostic commands, CAN bus message detection, automatic baud rate identification, or multi-candidate baud rate polling or bit time measurement. Instead, it directly determines the target baud rate based entirely on local trigger events and pre-stored mapping relationships, avoiding uncertainties caused by bus interference, protocol compatibility, or identification timeouts.
[0035] In one embodiment, the local input unit M10 is a key matrix circuit, including multiple input interfaces, each connected to a key switch. The microprocessor unit M40 is configured to acquire key input signals by scanning the GPIO interface level state or by row and column scanning, and to determine whether there is a valid trigger event that meets preset conditions.
[0036] Specifically, the microprocessor unit M40 can scan the level status of each input pin in the local input unit M10 through polling, or respond to level changes in real time through interrupts. For physical button inputs, the microprocessor unit M40 performs debouncing processing on the received button inputs, that is, after detecting a level change, it delays for 10ms to 50ms and reads the level status again. If the two readings are consistent, it is confirmed as a valid button action. For virtual button inputs, the microprocessor unit M40 uses multiple sampling to obtain consistent values to achieve debouncing.
[0037] Based on this, the microprocessor unit M40 determines whether the key input constitutes a valid trigger event based on the duration of the key input, the combination of pressed keys, or the triggering order of each key. Valid trigger events include, but are not limited to, the following types: Combination key event: Pressing two or more preset keys simultaneously, such as "key A + key B", and the duration of this combination state reaches a preset time threshold (e.g., ≥2 seconds).
[0038] Sequential key events: Press multiple keys in a preset order, such as pressing "key C" first, then "key D", and the triggering order of each key is exactly the same as the preset order.
[0039] Continuous press event: The continuous press time of a single button reaches a preset time threshold (e.g., ≥3 seconds).
[0040] For each event type, the storage unit M20 pre-stores corresponding preset conditions (key combination, sequence, time threshold, etc.). The microprocessor unit M40 only confirms a valid trigger event when all preset conditions corresponding to the event type matching the key input are met; otherwise, it ignores the input and does not perform baud rate switching.
[0041] In one embodiment, the microprocessor unit M40 is configured to determine the target baud rate corresponding to the valid triggering event based on the mapping relationship when a valid triggering event exists.
[0042] Specifically, after confirming a valid trigger event, the microprocessor unit M40 accesses the storage unit M20 and searches for the target baud rate corresponding to the current trigger event in a pre-stored trigger event-to-baud rate mapping table. For example, this mapping can be set as follows: pressing the "A+B" key for 2 seconds corresponds to 500kbps, pressing the "C+D" key for 2 seconds corresponds to 125kbps, pressing the "A→B→C" key sequence corresponds to 1Mbps, and pressing and holding the "D" key for 3 seconds corresponds to 250kbps. This mapping is pre-set in the storage unit M20 when the remote control is manufactured.
[0043] In another embodiment, the microprocessor unit M40 is further configured to: determine whether the target baud rate is the same as the current baud rate after determining the target baud rate and before performing the switching operation.
[0044] Specifically, the microprocessor unit M40 acquires the current baud rate information and compares it with the target baud rate. When the target baud rate is the same as the current baud rate, the microprocessor unit M40 determines that no baud rate switching operation is needed. In this case, it maintains the current operating mode and does not perform subsequent operations such as exiting the operating mode corresponding to the current baud rate, reading bit timing parameters from the storage unit and writing them to the control unit's configuration register to reinitialize the control unit, or controlling the reinitialized control unit to enter the operating mode at the target baud rate. This consistency judgment function avoids invalid resets caused by repeatedly triggering the same baud rate switching event, reduces unnecessary restarts of the control unit M30, and improves the system's response efficiency and stability.
[0045] The microprocessor unit M40 is also configured to control the control unit M30 to exit the operating mode corresponding to the current baud rate after determining that the target baud rate is different from the current baud rate.
[0046] Specifically, the microprocessor unit M40 first disables all transmission requests from the control unit M30. If a CAN frame is currently being transmitted, it waits for the frame to complete or times out and abandons the transmission. Subsequently, the microprocessor unit M40 disables relevant interrupts for the control unit M30, including but not limited to transmission completion interrupts, receive interrupts, and error interrupts, to prevent interrupt nesting or accidental triggering during the handover process. The microprocessor unit M40 can also clear the transmit and receive buffers of the control unit M30 and clear the status flags related to the current baud rate, including the error counter value and the protocol state machine state. Finally, the microprocessor unit M40 sets the control unit M30 to initialization mode, removing it from normal communication mode and preparing it for subsequent parameter configuration.
[0047] In a preferred embodiment, the operations of disabling relevant interrupts, clearing status information, and setting to initialization mode are performed under the critical section protection of the microprocessor unit M40. That is, during the execution of the above operations, the microprocessor unit M40 prohibits all other interrupt responses that may interrupt the process, thereby ensuring the atomicity and consistency of the exit operation and avoiding incomplete configuration or abnormal status caused by other interrupts during parameter configuration.
[0048] The microprocessor unit M40 is also configured to read the bit timing parameters corresponding to the target baud rate from the storage unit M20 and write the bit timing parameters into the configuration register of the control unit M30 to reinitialize the control unit M30.
[0049] After the control unit M30 is in initialization mode, the microprocessor unit M40 reads the bit timing parameters corresponding to the target baud rate from the storage unit M20. These parameters together determine the bit time length and sampling point position on the CAN bus, which is a key configuration for the CAN controller to work correctly at the target baud rate.
[0050] Microprocessor unit M40 writes these bit timing parameters into the configuration register of control unit M30. After the parameters are written, microprocessor unit M40 performs a software reset or hardware reset on control unit M30, causing control unit M30 to re-initialize with the new bit timing parameters. The initialization process includes reconfiguring the CAN operating mode, re-enabling interrupts, and resetting the error counter.
[0051] The microprocessor unit M40 is also configured to control the re-initialized control unit M30 to enter the operating mode at the target baud rate, so as to communicate at the target baud rate.
[0052] Specifically, after re-initialization, the microprocessor unit M40 clears the initialization mode flag of the control unit M30, causing it to exit the initialization state and enter the normal transmit / receive mode. At this time, the control unit M30 has been configured according to the target baud rate and begins communication on the CAN bus at the target baud rate.
[0053] In a preferred embodiment, after entering the target baud rate operating mode, the microprocessor unit M40 sends a preset verification frame through the control unit M30, such as a diagnostic request frame containing the remote control ID and the current baud rate encoding, to verify whether the communication is normal. If a valid CAN response frame is received within a predetermined timeout period, the communication is considered successful; otherwise, a subsequent fallback mechanism is triggered.
[0054] In one embodiment, the remote controller further includes a feedback output unit M50 connected to the microprocessor unit M40. The feedback output unit M50 includes at least one of a backlight, a status indicator light, and a buzzer. The feedback signal includes one or a combination of a light color change, an indicator light flashing pattern, and a buzzer tone.
[0055] In this embodiment, the microprocessor unit M40 is further configured to control the feedback output unit M50 to output a preset feedback mode corresponding to the target baud rate after the control unit M30 successfully communicates at the target baud rate. Different baud rates correspond to different feedback modes. For example, 125kbps corresponds to a blue background light remaining constantly on for 2 seconds, 250kbps corresponds to a green background light flashing rapidly 3 times, 500kbps corresponds to a red background light flashing slowly 2 times, and 1Mbps corresponds to a buzzer emitting two short tones. Through different feedback modes, the user can intuitively perceive the current baud rate status without the need for additional equipment.
[0056] In an embodiment where the microprocessor unit M40 is further configured to have the function of determining whether the target baud rate is the same as the current baud rate, the microprocessor unit M40 is further configured to: when the target baud rate is the same as the current baud rate, the control feedback output unit M50 outputs a prompt signal indicating "currently at the target baud rate". This prompt signal is different from the feedback mode corresponding to any of the above baud rates, so that the user can distinguish between the two different situations of "successful switching" and "already at the target baud rate".
[0057] The microprocessor unit M40 is also configured to automatically control the control unit M30 to fall back to a preset default baud rate or the effective baud rate of the most recent successful communication when communication by the control unit M30 fails at the target baud rate. Communication failure includes: failure to receive a valid CAN response frame within a predetermined timeout period, or the received response frame containing an error flag, etc.
[0058] Storage unit M20 may include non-volatile memory, such as EEPROM or Flash-simulated EEPROM. Microprocessor unit M40 is configured to save the target baud rate as the default baud rate to the non-volatile memory after control unit M30 successfully communicates at the target baud rate. This allows microprocessor unit M40 to directly read the default baud rate from the non-volatile memory and initialize control unit M30 based on the corresponding bit timing parameters when the remote control is powered on again, without requiring the user to re-trigger the switching event. If there is no valid value in the non-volatile memory or the read data fails verification, the factory-preset default baud rate is used for initialization.
[0059] This invention provides a method for switching baud rates using a remote control. Figure 2This is a flowchart of a method for switching baud rates using a remote control according to an embodiment of the present invention. Specifically, the method includes the following steps: Step S1: Receive local input and determine whether there is a valid trigger event that meets the preset conditions.
[0060] The microprocessor unit M40 receives user input signals collected by the local input unit M10 in real time or periodically. In one embodiment, the microprocessor unit M40 scans the level state of each row and column line of the key matrix by polling, or detects the level change of each input pin by GPIO interrupt; in another embodiment, the microprocessor unit M40 reads the touch coordinate information reported by the touch sensing interface circuit.
[0061] When a key press or touch operation is detected, the microprocessor unit M40 further determines whether the current key input meets the preset conditions for a valid trigger event based on the duration of the key input, the combination of pressed keys, or the triggering order of each key. Of course, when a key press or touch operation is detected, the microprocessor unit M40 can perform debouncing processing on the received input signal, which will not be elaborated here.
[0062] In real-world scenarios, the types of events that can be effectively triggered include the following: Combination key event: The microprocessor unit M40 determines whether the currently pressed key combination matches the preset combination and whether the duration of the combination key state reaches the preset time threshold. Continuous press event: The microprocessor unit M40 determines whether the continuous press time of a single button has reached a preset time threshold; Sequential key events: The microprocessor unit M40 determines whether the triggering order of each key is consistent with the preset order.
[0063] The microprocessor unit M40 confirms a valid trigger event only when all preset conditions corresponding to the event type matching the current key input are met; otherwise, it ignores the input and continues to wait for the next valid input without triggering the subsequent baud rate switching process.
[0064] After determining in step S1 that a valid trigger event exists, step S2 is executed: based on the pre-stored mapping relationship between trigger events and target baud rates, the target baud rate corresponding to the valid trigger event is determined.
[0065] Once a valid trigger event is confirmed, the microprocessor unit M40 accesses the storage unit M20 and searches for the target baud rate corresponding to the current trigger event in the pre-stored mapping table.
[0066] It should be noted that the determination of the target baud rate in step S2 is based entirely on the direct matching of the local trigger event and the pre-stored mapping relationship. It does not rely on any diagnostic command input, the message detection or response results on the CAN bus, polling multiple candidate baud rates, or an automatic baud rate identification algorithm based on bit time measurement. This design ensures the immediacy and determinism of baud rate switching, avoiding uncertainties caused by bus interference, protocol compatibility, or identification timeouts.
[0067] After determining the target baud rate, execute step S3: Exit the working mode corresponding to the current baud rate.
[0068] In some embodiments, the method of the present invention, after step S2 and before step S3, further includes a sub-step S2a: determining whether the target baud rate is the same as the current baud rate.
[0069] Specifically, sub-step S2a includes: the microprocessor unit M40 acquiring the current baud rate information and comparing the target baud rate determined in step S2 with the current baud rate.
[0070] If the comparison result shows that the target baud rate is the same as the current baud rate, it is determined that no baud rate switching operation is needed. In this case, the microprocessor unit M40 directly maintains the operating mode corresponding to the current baud rate and does not perform subsequent exit, reinitialization, or entry operations. Optionally, the microprocessor unit M40 can control the feedback output unit M50 to output a prompt signal indicating "current baud rate is the target" to the user, informing the user that the current baud rate is the target value and avoiding confusion caused by repeated operations.
[0071] If the comparison result shows that the target baud rate is different from the current baud rate, the microprocessor unit M40 continues to execute subsequent steps S3 to S5 to complete the baud rate switching process. This consistency judgment step effectively avoids invalid resets caused by repeatedly triggering the same baud rate switching event, reduces unnecessary restarts of the control unit M30, and improves the system's response efficiency and stability.
[0072] After confirming that the target baud rate is different from the current baud rate, the microprocessor unit M40 controls the control unit M30 to stop communicating at the current baud rate and exit the working mode corresponding to the current baud rate.
[0073] After step S3, proceed to step S4: read the bit timing parameters corresponding to the target baud rate and use these bit timing parameters to perform a re-initialization operation.
[0074] Specifically, the microprocessor unit M40 reads the bit timing parameters corresponding to the target baud rate from the storage unit M20 and writes these bit timing parameters into the configuration register of the control unit M30 via direct mapping from the bus or register. After the parameters are written, the microprocessor unit M40 performs a software reset or hardware reset on the control unit M30, causing the control unit M30 to re-initialize with the new bit timing parameters. The initialization process includes reconfiguring the CAN operating mode, re-enabling interrupts, and resetting the error counter.
[0075] Finally, execute step S5: Enter the working mode at the target baud rate to perform CAN communication according to the target baud rate.
[0076] In a preferred embodiment, after entering the target baud rate operating mode, the microprocessor unit M40 can send a preset verification frame through the control unit M30 to verify whether the communication is normal. If a valid CAN response frame is received within a predetermined timeout period (e.g., 100ms), the communication is considered successful; otherwise, a subsequent fallback mechanism is triggered.
[0077] In another preferred embodiment, the method for switching baud rates using the remote control of the present invention further includes a feedback output step. After the control unit M30 successfully communicates at the target baud rate, the microprocessor unit M40 controls the feedback output unit M50 to output a feedback signal representing the current baud rate information to the user. The feedback output unit M50 may be at least one of a backlight, a status indicator light, or a buzzer, and the feedback signal includes one or a combination of light color changes, indicator light flashing patterns, and buzzer sounds.
[0078] In yet another preferred embodiment, the method for switching baud rates with the remote control of the present invention further includes a default baud rate saving step. After the control unit M30 successfully communicates at the target baud rate, the microprocessor unit M40 saves the target baud rate as the default baud rate to the non-volatile memory in the storage unit M20.
[0079] In another preferred embodiment, the method for switching baud rates in the remote control further includes a communication failure fallback step. When the control unit M30 communicates at the target baud rate, if no valid CAN response frame is received within a predetermined timeout period, or if the received response frame contains an error flag, the microprocessor unit M40 determines that the communication has failed. After determining that the communication has failed, the microprocessor unit M40 automatically controls the control unit M30 to fall back to a preset default baud rate or the valid baud rate of the most recent successful communication, and re-executes the above steps S3 to S5 to ensure that the remote control can still maintain basic communication capabilities with other nodes on the CAN bus.
[0080] In summary, the remote control baud rate switching method of the present invention determines the target baud rate without relying on any CAN bus information. This method is particularly suitable for application scenarios such as industrial remote control, construction machinery remote control, and vehicle auxiliary control, which have high requirements for real-time performance and reliability.
[0081] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
[0082] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of the present invention, and all such modifications and substitutions should be considered within the scope of protection of the present invention.
Claims
1. A remote control with baud rate switching function, characterized in that, include: The local input unit is used to receive user input. A storage unit is used to store the mapping relationship between at least one trigger event and baud rate, as well as the bit timing parameters corresponding to each baud rate; The control unit is used for CAN communication according to the set baud rate; The microprocessor unit is connected to the local input unit, the storage unit, and the control unit, respectively, and is configured to perform the following operations: Receive the input signal from the local input unit and determine whether there is a valid triggering event that meets the preset conditions; When the valid triggering event exists, the target baud rate corresponding to the valid triggering event is determined according to the mapping relationship; Control the control unit to exit the operating mode corresponding to the current baud rate; Read the bit timing parameters corresponding to the target baud rate from the storage unit and write the bit timing parameters into the configuration register of the control unit to reinitialize the control unit; The control unit, after being re-initialized, enters the operating mode at the target baud rate to communicate according to the target baud rate.
2. The remote control with baud rate switching function according to claim 1, characterized in that, The local input unit is a button matrix circuit or multiple GPIO input interfaces. Each operation button on the remote control housing is electrically connected to the corresponding row and column lines of the button matrix circuit or the corresponding pin of the GPIO input interface through conductive contacts. When the operation button is pressed, the level state of the corresponding pin is changed. The microprocessor unit receives input signals from the key matrix circuit or the plurality of GPIO input interfaces to obtain the valid trigger event; The effective triggering events include one or any combination of combination key events, sequential key events, and continuous press events.
3. The remote control with baud rate switching function according to claim 2, characterized in that, The microprocessor unit is further configured to: Perform debouncing on the received key input; Based on the duration of the key input, the combination of pressed keys, or the triggering order of each key, determine whether the key input meets the preset conditions for a valid triggering event. The valid triggering events include combination key events, continuous press events, and sequential key events. The preset conditions for each event type are as follows: When the effective triggering event is a combination key event, the preset condition is: the pressed key combination matches the preset combination, and the duration of the combination key state reaches the preset time threshold. When the effective triggering event is a continuous press event, the preset condition is: the continuous press time of a single button reaches a preset time threshold. When the effective triggering event is a sequential key press event, the preset condition is: the triggering order of each key is consistent with the preset order; The microprocessor unit confirms that the valid triggering event is established only when all preset conditions corresponding to the event type matching the key input are met.
4. The remote control with baud rate switching function according to claim 1, characterized in that, Also includes: A feedback output unit, connected to the microprocessor unit, is used to output a feedback signal representing the current baud rate information to the user after the control unit successfully communicates at the target baud rate. The feedback output unit includes at least one of a background light, a status indicator light, and a buzzer, and the feedback signal includes one or a combination of light color change, indicator light flashing mode, and buzzer prompt sound. The microprocessor unit is further configured to: after the control unit successfully communicates at the target baud rate, control the feedback output unit to output a preset feedback mode corresponding to the target baud rate, with different baud rates corresponding to different feedback modes.
5. The remote control with baud rate switching function according to claim 1, characterized in that, The storage unit includes non-volatile memory, and the microprocessor unit is further configured to: After the control unit successfully communicates at the target baud rate, the target baud rate is saved as the default baud rate to the non-volatile memory. When the remote control is powered on again, the microprocessor unit directly reads the default baud rate from the non-volatile memory and initializes the control unit based on the bit timing parameters corresponding to the default baud rate.
6. The remote control with baud rate switching function according to claim 1, characterized in that, The microprocessor unit is further configured to: When the control unit fails to communicate at the target baud rate, it automatically controls the control unit to fall back to the preset default baud rate or the effective baud rate of the most recent successful communication. The communication failure includes: not receiving a valid CAN response frame within a predetermined timeout period, or the received response frame containing an error flag.
7. A method for switching baud rates using a remote control, characterized in that, The method includes the following steps: Receive local input and determine whether there is a valid trigger event that meets preset conditions; If a valid triggering event exists, the target baud rate corresponding to the valid triggering event is determined according to the pre-stored mapping relationship between triggering events and target baud rates. Exit the working mode corresponding to the current baud rate; Read the bit timing parameters corresponding to the target baud rate, and perform a re-initialization operation using the bit timing parameters; Enter the operating mode at the target baud rate to communicate at the target baud rate.
8. The method for switching baud rates with a remote control according to claim 7, characterized in that, The local input is key input, and the determination of whether there is a valid trigger event that meets preset conditions includes: Perform debouncing on the received key input; Based on the duration of the key input, the combination of pressed keys, or the triggering order of each key, determine whether the key input meets the preset conditions for a valid triggering event. The valid triggering events include combination key events, continuous press events, and sequential key events. The preset conditions for each event type are as follows: When the effective triggering event is a combination key event, the preset condition is: the pressed key combination matches the preset combination, and the duration of the combination key state reaches the preset time threshold. When the effective triggering event is a continuous press event, the preset condition is: the continuous press time of a single button reaches a preset time threshold. When the effective triggering event is a sequential key press event, the preset condition is: the triggering order of each key is consistent with the preset order; The valid triggering event is confirmed only when all preset conditions corresponding to the event type matching the key input are met.
9. The method for switching baud rates with a remote control according to claim 7, characterized in that, Before exiting the operating mode corresponding to the current baud rate, the following is also included: Determine whether the target baud rate is the same as the current baud rate; When the target baud rate is the same as the current baud rate, maintain the working mode corresponding to the current baud rate; When the target baud rate is different from the current baud rate, the operation of exiting the working mode corresponding to the current baud rate is executed, as well as reading the bit timing parameters corresponding to the target baud rate and performing a re-initialization operation using the bit timing parameters is performed.
10. The method for switching baud rates with a remote control according to claim 7, characterized in that, It also includes at least one of the following steps: After successfully communicating at the target baud rate, a feedback signal representing the current baud rate information is output. The feedback signal includes one or a combination of light color change, indicator flashing mode, and buzzer tone. After successfully communicating at the target baud rate, the target baud rate is saved as the default baud rate to non-volatile memory so that it can be directly used as the default initialization parameter on the next power-on. When communication fails at the target baud rate, the system falls back to the preset default baud rate or the effective baud rate of the most recent successful communication. The communication failure includes not receiving a valid CAN response frame within a predetermined timeout period or receiving a response frame containing an error flag.
