A crystal-free CAN device calibration system and method

By designing a crystal-free calibration system in CAN equipment and using the main control module and storage module to adjust the tuning value of the RC oscillator, the problem of poor accuracy of the RC oscillator is solved, the internal generation of high-precision clock signals is realized, and the equipment costs are reduced. cost and avoid adverse effects on the CAN bus.

CN116016019BActive Publication Date: 2024-09-27SHANGHAI AISINOCHIP ELECTRONICS TECH
View PDF 14 Cites 0 Cited by

Patent Information

Application Number
CN202211638528.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-19
Publication Date
2024-09-27
Estimated Expiration
2042-12-19

AI Technical Summary

Technical Problem

Due to the poor accuracy of the RC oscillator in existing CAN equipment, an additional high-precision and high-cost crystal oscillator needs to be added, resulting in increased material costs.

Method used

Design a crystal-free CAN device calibration system that uses the main control module, storage module and RC oscillator to calibrate the clock signal output by the RC oscillator in real time by reading and adjusting the RC tuning value to ensure that its accuracy meets the CAN transceiver module requirements, avoiding the use of additional crystal oscillators.

Benefits of technology

It effectively reduces the cost of the overall equipment, reduces the adverse impact on the CAN bus system, and realizes the internal generation of high-precision clock signals, avoiding additional crystal oscillator costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116016019B
    Figure CN116016019B
Patent Text Reader

Abstract

The present invention discloses a crystal-free CAN device calibration system, comprising a main control module, a storage module, a CAN transceiver module and an RC oscillator; the main control module is respectively connected to the storage module and the RC oscillator signal, and is used to receive the RC tuning value from the storage module and send it to the RC oscillator to control the RC oscillator; the RC oscillator is also connected to the storage module and the CAN transceiver module signal, and is used to receive the RC tuning value and provide a clock signal to the main control module, the storage module and the CAN transceiver module, so as to serve as the clock source of the main control module, the storage module and the CAN transceiver module respectively; the storage module is used to store the RC tuning value. The present invention effectively reduces the cost of the overall equipment. At present, the price of a high-precision crystal oscillator is comparable to that of a chip with a CAN transceiver, and the internal RC oscillator is a module integrated inside the chip, which basically does not increase additional costs, thereby reducing costs well. Secondly, this method has no adverse effects on the CAN bus system to be connected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of CAN bus equipment, and in particular relates to a crystal-free CAN equipment calibration system and method. Background Art

[0002] CAN (Controller Area Network) is a communication bus with good real-time performance, high reliability, strong flexibility and simple structure. It is widely used in industrial automation, ships, medical equipment, automobiles and other fields.

[0003] The CAN2.0A / B specification is currently widely used. In the CAN2.0A / B technical guidance standard, there is a chapter specifically discussing the requirements of CAN devices for crystal oscillator accuracy, requiring that the accuracy of the oscillator that provides the clock to the CAN device must be higher than this requirement, otherwise communication failure will occur, and in severe cases, the entire CAN bus may be paralyzed.

[0004] Existing chips generally come with RC oscillators, which have the characteristic of poor precision. When the chip leaves the factory, the RC will be calibrated to a relatively accurate frequency point, but there is still a certain error from the absolutely ideal frequency point. After the chip goes through processes such as packaging and welding, the frequency point recorded when the chip leaves the factory will also shift. Therefore, general CAN devices need to add an additional crystal oscillator as the source of their clock. Crystal oscillators have the characteristic of high precision, but the price of crystal oscillators is sometimes more expensive than the chip with CAN function itself, and the material cost increases significantly. Summary of the invention

[0005] The technical purpose of the present invention is to provide a crystal-free CAN device calibration system and method to solve the problem of high cost in the prior art.

[0006] To solve the above problems, the technical solution of the present invention is:

[0007] A crystal-free CAN device calibration system, comprising:

[0008] Main control module, storage module, CAN transceiver module and RC oscillator;

[0009] The main control module is respectively connected with the storage module and the RC oscillator signal, and is used to receive the RC tuning value from the storage module and send it to the RC oscillator to control the RC oscillator;

[0010] The RC oscillator is also connected to the storage module and the CAN transceiver module signals, and is used to receive the RC tuning value and provide a clock signal to the main control module, the storage module and the CAN transceiver module, so as to serve as the clock source of the main control module, the storage module and the CAN transceiver module respectively;

[0011] The storage module is used to store RC tuning values.

[0012] Preferably, the main control module is also connected to the CAN transceiver module signal. The main control module is used to send a judgment instruction to the CAN transceiver module and receive a feedback signal. Based on the feedback signal, it is judged whether the clock signal output by the RC oscillator meets the clock accuracy requirement of the CAN transceiver module; if not, the RC tuning value is changed to change the clock signal output by the RC oscillator, and the judgment is made again until it is judged to be compliant.

[0013] Specifically, the main control module is a CPU module, and the storage module is a non-volatile memory, wherein the non-volatile memory is the EFLASH of the CPU module.

[0014] Further preferably, the storage module is also used to store the execution instructions of the main control module; the storage module is also used to store and replace the changed RC tuning value.

[0015] A crystal-free CAN device calibration method is applied to the above-mentioned crystal-free CAN device calibration system, comprising the following steps:

[0016] S1: Read the RC tuning value from the storage module and write it into the RC oscillator;

[0017] S2: Initialize the CAN transceiver module and output the corresponding clock signal based on the RC tuning value;

[0018] S3: Receive the clock signal and use the clock signal as the clock source of the CAN transceiver module.

[0019] Further preferably, the method further comprises step S4:

[0020] S4: Send a request to the CAN transceiver module. If an ACK signal is fed back from the CAN transceiver module, it is determined that the clock signal output by the RC oscillator meets the accuracy requirement of the CAN transceiver module. If an ACK signal is not fed back, the RC tuning value is increased or decreased, and steps S2 to S4 are repeated.

[0021] Further preferably, the method further comprises step S5:

[0022] S5: Writing the RC adjustment value when the ACK signal is received into the storage module as the adjustment value used for the next power-on.

[0023] Due to the adoption of the above technical solution, the present invention has the following advantages and positive effects compared with the prior art:

[0024] The present invention provides a crystal-free CAN device calibration system and method, which effectively reduces the cost of the overall device compared to the prior art. The current price of a high-precision crystal oscillator is comparable to the price of a chip with a CAN transceiver, and the internal RC oscillator is a module integrated inside the chip, which basically does not increase additional costs, thereby greatly reducing costs. Secondly, this method has no adverse effects on the CAN bus system to be connected. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the following detailed description of the preferred embodiment.The drawings are only for the purpose of illustrating the preferred embodiments and are not to be construed as limiting the invention.

[0026] Figure 1 A framework diagram of a crystal-free CAN device calibration system of the present invention;

[0027] Figure 2 The present invention is a flow chart of a crystal-free CAN device calibration system. DETAILED DESCRIPTION

[0028] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the specific implementation methods of the present invention will be described below with reference to the accompanying drawings. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings and other implementation methods can be obtained based on these drawings without creative work.

[0029] In order to simplify the drawings, only the parts related to the present invention are schematically shown in each figure, and they do not represent the actual structure of the product. In addition, in order to simplify the drawings and facilitate understanding, in some figures, only one of the parts with the same structure or function is schematically drawn or marked. In this article, "one" not only means "only one", but also means "more than one".

[0030] The following is a further detailed description of a crystal-free CAN device calibration system and method proposed by the present invention in conjunction with the accompanying drawings and specific embodiments. The advantages and features of the present invention will become more apparent from the following description and claims.

[0031] Example

[0032] See also Figure 1 This embodiment provides a crystal-free CAN device calibration system. In this embodiment, the system includes a main control module, a storage module, a CAN transceiver module and an RC oscillator.

[0033] The main control module is a CPU module that is mainly used to execute the entire control process. It is connected to the storage module, RC oscillator, CAN transceiver module, etc. It can realize functions such as reading the storage module, adjusting the internal RC oscillator calibration value, initializing the CAN transceiver module, controlling the CAN transceiver module to send and receive data, and writing the RC calibration value after calibration to the storage module.

[0034] The storage module mainly stores the execution code of the CPU module and the RC adjustment value of the internal RC oscillator. In this embodiment, the storage module is a non-volatile memory, which uses the EFLASH inside the chip.

[0035] The RC oscillator is connected to the storage module (via the CPU module) and the CAN transceiver module. The RC oscillator receives the RC tuning value and provides a clock signal to the main control module and the CAN transceiver module, which serve as the clock source of the main control module and the CAN transceiver module respectively. The CAN transceiver module needs to be configured by the CPU to match the baud rate of the CAN bus to be connected.

[0036] The RC oscillator calibration value needs to meet certain requirements. The RC oscillator calibration accuracy must be high enough during the chip design phase, each calibration position must be relatively fine, and the adjustment percentage of each position must be less than the CAN bus's clock accuracy requirements. The RC oscillator can also modify its calibration value in real time through software.

[0037] Preferably, the main control module is also connected to the CAN transceiver module signal, and the CAN transceiver receives the CPU's instruction to send a data frame and returns the received data frame to the CPU for processing. Specifically, the main control module sends a judgment instruction to the CAN transceiver module and receives a feedback signal, and judges whether the clock signal output by the RC oscillator meets the clock accuracy requirements of the CAN transceiver module based on the feedback signal; if not, the RC tuning value is changed to change the clock signal output by the RC oscillator, and the judgment is repeated until it is judged to be in compliance. The RC tuning value after the judgment is in compliance will be written into the storage module and used after the present embodiment is powered on next time.

[0038] Specifically, the adjustable internal RC oscillator provides clocks for the CPU module, storage module, and CAN transceiver module. The target oscillation frequency of the RC oscillator is 48MHz. The actual oscillation frequency of the RC oscillator after adjustment when the chip leaves the factory is 47MHz. After the chip leaves the factory and undergoes operations such as welding, the actual frequency of the RC oscillator may further deviate slightly. Assume that the RC oscillation frequency of the chip after welding is 47.2Mhz. The adjustment value of each adjustment gear of the RC oscillator is 0.1Mhz, and the adjustment ratio of each gear is about 0.2%. The theoretical clock error that the CAN2.0A / B specification can tolerate is about 1.5%, and the maximum clock error that the actual CAN bus can tolerate is jointly determined by the CAN devices connected to it. Specifically, the CAN device with the smallest tolerance determines the tolerance of the entire CAN bus. In this example, it is assumed that the accuracy requirement of the CAN bus to be connected is 1%.

[0039] Therefore, in combination with the crystal-free CAN device calibration system mentioned in the above embodiment, a corresponding crystal-free CAN device calibration system method is proposed. Figure 2 , which can be divided into the following 5 steps

[0040] First, after the chip is powered on, the CPU module reads the previous RC calibration value from the internal EFLASH and writes it into the RC oscillator. This calibration value may be the calibration value when the chip leaves the factory, or it may be the calibration value written into the internal EFLASH after the last operation. Generally, the RC oscillator of the chip will be calibrated before leaving the factory, and the calibration value will be written into the storage module inside the chip, but there is still a certain error between the frequency point of the RC oscillator and the absolutely ideal frequency point. Therefore, at this time, the RC oscillator has not been calibrated in this embodiment, and the RC oscillator may run at a frequency of 40MHz.

[0041] Then, the CPU will configure the CAN transceiver module according to the baud rate of the CAN bus to be connected and initialize the CAN transceiver module. Then, it receives the clock signal and outputs the corresponding clock signal based on the RC adjustment value as the clock source of the CAN transceiver module. After the initial adjustment, the operating frequency of the RC oscillator may be 47.2MHz.

[0042] Next, the CPU module sends a command to the CAN transceiver module, requiring the CAN transceiver module to send a data frame to the CAN bus. If other devices on the CAN bus can correctly identify the data frame sent by this device, they will send an ACK signal to the CAN transceiver module, otherwise they will send an Error signal. The CPU module queries the CAN transceiver to see whether it receives an ACK signal or an Error signal. If an ACK signal is received, it means that the frequency of the RC oscillator at this time has met the accuracy requirements of the CAN bus to be connected, and jump to the next step. If an Error signal is received, it means that the frequency of the RC oscillator at this time does not meet the accuracy requirements of the CAN bus to be connected, and the RC oscillator needs to be adjusted. Specifically, the CPU module adds a gear to the current RC oscillator adjustment value. The adjustment value of each gear is 0.1MHz. The CPU writes the new adjustment value to the RC oscillator. At this time, the latest RC oscillator output frequency will increase by 0.1MHz. Then the CPU module sends a command to the CAN transceiver module again and repeats the above process.

[0043] Finally, after the adjustment is completed, the CPU module writes the current RC oscillator adjustment value into the internal EFLASH. In case it is still connected to the current CAN bus after the next power-on, there is no need to adjust the RC oscillator again. You can directly read the RC adjustment value to communicate normally with other devices on the CAN bus.

[0044] The embodiments of the present invention are described in detail above in conjunction with the accompanying drawings, but the present invention is not limited to the above embodiments. Even if various changes are made to the present invention, if these changes fall within the scope of the claims of the present invention and their equivalents, they still fall within the protection scope of the present invention.

Claims

1. A crystal-free CAN device calibration system, characterized in that: include Main control module, storage module, CAN transceiver module and RC oscillator; The main control module is respectively connected to the storage module and the RC oscillator signal, and is used to receive the RC tuning value from the storage module and send it to the RC oscillator to control the RC oscillator; The RC oscillator is also signal-connected to the storage module and the CAN transceiver module, and is used to receive the RC tuning value and provide a clock signal to the main control module, the storage module and the CAN transceiver module, so as to serve as the clock source of the main control module, the storage module and the CAN transceiver module respectively; The storage module is used to store RC tuning values; Among them, the main control module is also configured to send a request to the CAN transceiver module. If an ACK signal can be fed back from the CAN transceiver module, it is determined that the clock signal output by the RC oscillator meets the accuracy requirement of the CAN transceiver module; if the ACK signal cannot be fed back, the RC tuning value is increased or decreased, and the clock signal output by the RC oscillator is detected again to meet the accuracy requirement of the CAN transceiver module.

2. The crystal-free CAN device calibration system according to claim 1, characterized in that: The main control module is also connected to the CAN transceiver module signal. The main control module is used to send a judgment instruction to the CAN transceiver module and receive a feedback signal. Based on the feedback signal, it is judged whether the clock signal output by the RC oscillator meets the clock accuracy requirement of the CAN transceiver module; if not, the RC tuning value is changed to change the clock signal output by the RC oscillator, and the judgment is made again until it is judged to be compliant.

3. The crystal-free CAN device calibration system according to claim 1 or 2, characterized in that: The main control module is a CPU module, and the storage module is a non-volatile memory, wherein the non-volatile memory is the EFLASH of the CPU module.

4. The crystal-free CAN device calibration system according to claim 3, characterized in that: The storage module is also used to store the execution instructions of the main control module; the storage module is also used to store and replace the changed RC tuning value.

5. A crystal-free CAN device calibration method, applied to a crystal-free CAN device calibration system as claimed in any one of claims 1 to 4, characterized in that: The steps include: S1: Read the RC tuning value from the storage module and write it into the RC oscillator; S2: Initialize the CAN transceiver module and output the corresponding clock signal based on the RC tuning value; S3: Receive a clock signal, and use the clock signal as a clock source for the CAN transceiver module.

6. The crystal-free CAN device calibration method according to claim 5, characterized in that: The step S4 is also included: S4: Send a request to the CAN transceiver module. If an ACK signal can be fed back from the CAN transceiver module, it is determined that the clock signal output by the RC oscillator meets the accuracy requirement of the CAN transceiver module. If an ACK signal cannot be fed back, the RC tuning value is increased or decreased, and steps S2 to S4 are repeated.

7. The crystal-free CAN device calibration method according to claim 6, characterized in that: The step S5 is also included: S5: Writing the RC adjustment value when the ACK signal is received into the storage module as the adjustment value used for the next power-on.

Citation Information

Patent Citations

  • High-speed and low-power-consumption SD (Secure Digital) card

    CN102136082A

  • Easy-to-implement SOC built-in high-precision calibration system for RC oscillator

    CN106066661A

  • Apparatus for automatically calibrating clock of non-crystal oscillator and method thereof

    CN106201956A

  • RC oscillator calibration method, device, storage medium and processor

    CN108011633A

  • High-precision oscillator calibration system and rapid calibration method thereof

    CN111431526A