Microcontroller CAN Bus Auto Speed Detection
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional CAN bus initialization methods are time-consuming and prone to failure due to unknown operating frequencies and variable bit lengths, especially when synchronizing with an already established CAN bus system.
Innovation Solution
A microcontroller-based method that measures period times between CAN signal edges, sorts and filters these values to determine a valid frequency, and iteratively adjusts the CAN module initialization until a correct frequency is found, using a combination of hardware components like timers and capture modules, and potentially a state machine for automation.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If trial and error method is used to determine correct operating frequency, then frequency determination is achieved, but setup time becomes very long
Solution Approach 1:
The system performs preliminary measurement of CAN signal period times during the initialization phase before full operation begins. By capturing and analyzing the actual signal timing characteristics early on, the system can determine the correct operating frequency without requiring lengthy trial and error procedures later.
Solution Approach 2:
The patent replaces the mechanical trial-and-error adjustment process with an automated electronic measurement and calculation system. The microcontroller measures period times, sorts them, calculates frequency values, and automatically selects the correct frequency, eliminating the need for manual or iterative testing.
2Ease of manufacture
If conventional initialization methods are used, then CAN module can be initialized, but reliability is reduced due to unknown operating frequencies and variable bit lengths
Solution Approach 1:
The system continuously monitors the CAN signal and uses feedback from the measured period times to adjust and verify the initialized frequency. By comparing the measured actual frequency against the initialized frequency and making corrections as needed, the system ensures reliable synchronization even when operating conditions vary.
Solution Approach 2:
The patent dynamically determines the operating frequency parameter by measuring actual signal characteristics rather than relying on predetermined values. The system changes the initialization parameters based on real-time measurement of period times, ensuring the CAN module is configured correctly for the actual operating conditions.
3Productivity
If auto-speed detect system is implemented, then setup time is reduced, but device complexity increases
Solution Approach 1:
The microcontroller's timer and capture module are designed to serve multiple functions: measuring CAN signal period times during initialization, monitoring signal integrity during operation, and potentially debugging purposes. This multi-functionality reduces the need for separate dedicated hardware components.
Solution Approach 2:
The system uses the microcontroller's existing timer and capture module capabilities to perform the frequency detection and initialization tasks. Rather than requiring external specialized equipment, the microcontroller itself performs the measurement and calculation functions, making the system self-sufficient.
Data Source
Figure 1
Figure 2~3
Figure 4
AI summary
In a method for initializing a Controller Area Network (CAN) module in a microcontroller, the following steps may be provided: measuring the period times between a plurality of falling or rising edges of a CAN signal; sorting the period times; determining difference values between adjacent period times of the sorted period times; sorting the difference values; selecting a first difference value from the sorted difference values and determining a first frequency from the first difference value; initializing the CAN module using the selected frequency; receiving a CAN signal frame; determining whether an error occurred; if an error occurred selecting a next frequency and repeating initializing the CAN module until a valid CAN frequency has been found.