CAN communication board based on C167 single chip microcomputer and its implementation method

By designing a CAN communication board based on C167 microcontroller, the high load and real-time requirements of traditional transportation control systems in data communication are solved, and more efficient and reliable CAN communication is achieved, reducing the burden on the main controller and enhancing electrical safety.

CN119758830APending Publication Date: 2025-04-04SHANGHAI METRO IT CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411924623.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

Traditional transportation control systems face high loads, high real-time requirements in data communication and are susceptible to electromagnetic interference, resulting in a decline in communication quality and excessive burden on the main processor.

Method used

A CAN communication board based on C167 microcontroller was designed. By independently designing the CAN communication module, the isolation power supply and protection circuit are added, electrical isolation and data buffering are realized, and the work burden of the main controller is reduced.

Benefits of technology

It improves the reliability and efficiency of CAN communication, reduces the busyness of the main controller of the train control unit, enhances electrical safety, and provides convenient debugging and status indication functions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119758830A_ABST
    Figure CN119758830A_ABST
Patent Text Reader

Abstract

The present invention provides a CAN communication board based on C167 single-chip microcomputer and its implementation method, including: a main controller module, a data buffer module, a board encoding module, a CAN driver module, a status indication module, a debugging interface module, and an output interface module. The host computer signal realizes real-time data interaction with the main controller module through the data buffer module; the main controller module realizes CAN data transmission and reception through the CAN driver module; the debugging interface is used for debugging and program updating of the main controller module; the board encoding module is used for identifying the version of the CAN communication board; and the status indication module is used for indicating the working status of the CAN communication board. The CAN communication board based on C167 single-chip microcomputer provided by the present invention caters to the current environment, provides an optional solution for updating and replacing communication boards of the same specifications that have been used at home and abroad, and has a simple structure and low cost compared with imported products.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of CAN communication, and in particular to a CAN communication board based on a C167 single-chip microcomputer and an implementation method thereof. Background Art

[0002] CAN bus is an industrial control system. The control circuits of many cars use CAN bus. The buses used in subway vehicles include WTB bus, MVB bus, CAN bus, etc. CAN bus is widely used in subway vehicle communication subnetworks due to its high reliability and good error detection capabilities. For example, in multimedia passenger information systems, shielded door control systems, air conditioning control units and other occasions that use multi-node communication, CAN communication is being used more and more widely.

[0003] With the continuous growth of modern transportation demand, transportation control systems have put forward higher and higher requirements for the stability and reliability of communication modules. Traditional transportation control systems face the following problems in data communication: First, the vehicle control unit needs to process a large amount of real-time communication data of different components on the train when working. There are many communication nodes and a large amount of data. The traditional integrated design requires the main processor to consume a lot of time to handle communication tasks; the present invention independently designs the CAN communication module, simplifies the hardware and software design of the vehicle control unit, and improves the efficiency of the vehicle control unit in accessing different electronic control components on the network; second, the transportation control system, especially the rail transit train, has large electromagnetic interference and the train cable length is large and has many nodes, which reduces the communication quality and has high real-time requirements; the present invention adds an isolated power supply and a protection circuit in the CAN drive circuit design to improve the reliability of the communication circuit, which is an effective protection for both the CAN communication board and the train control unit.

[0004] Patent document CN221862867U (application number: 202323273918.7) discloses a CAN communication circuit, including: a main control chip; a CAN chip, the CAN chip including a communication circuit and a transceiver, the communication circuit is communicatively connected to the main control chip through a communication isolation circuit; a first power supply circuit, electrically connected to the main control chip, the first power supply circuit including a first power supply module; a second power supply circuit, electrically connected to the CAN chip, including a second power supply module and a third power supply module, the third power supply module is electrically connected to the first power supply module through a power isolation circuit; when the CAN chip is in a sleep state, the second power supply module stops supplying power, the first power supply module supplies power to the third power supply module, and the third power supply module supplies power to the transceiver, so that the transceiver maintains a working state and detects a specific wake-up frame. Summary of the invention

[0005] In view of the defects in the prior art, the object of the present invention is to provide a CAN communication board based on a C167 single-chip microcomputer and an implementation method thereof.

[0006] A CAN communication board based on a C167 single-chip microcomputer provided by the present invention comprises: a main controller module, a data cache module, a board encoding module, a CAN driver module, a status indication module, a debugging interface module and an output interface module;

[0007] One end of the data buffer module is connected to the main controller module, and the other end is connected to the host computer;

[0008] The board encoding module is connected to the host computer;

[0009] One end of the CAN driver module is connected to the main controller module, and the other end is connected to one end of the output interface module; the other end of the output interface module is connected to the CAN communication bus;

[0010] The status indication module is connected to the main controller module.

[0011] Preferably, the main controller module is used to control the coordinated work of the data cache module, the board encoding module, the CAN driver module, the status indication module, the debugging interface module and the output interface module;

[0012] The data buffer module is used to realize the data exchange between the host computer control signal and the CAN communication board;

[0013] The board encoding module is used to enable the host computer to identify the model version of the CAN communication board;

[0014] The CAN driver module is used to convert the level signal of the main controller into the level signal required by the CAN bus and realize electrical isolation;

[0015] The debugging interface module is used to realize online debugging of the overall function of the CAN communication board and update the firmware version;

[0016] The output interface module is used to connect the CAN communication board to an external CAN communication bus and provide matching resistance;

[0017] The status indication module is used to display the working status of the CAN communication board.

[0018] Preferably, the main controller module comprises: a main control chip, a program memory ROM and a data memory RAM; wherein the main control chip is a C167 single chip microcomputer.

[0019] Preferably, the data buffer module is implemented using a dual-port RAM, the data bus and address bus of the left port of the dual-port RAM are connected to the host computer control signal; the data bus and address bus of the right port of the dual-port RAM are connected to the main control chip in the main controller module.

[0020] Preferably, the CAN driving module comprises: an optocoupler isolation circuit, a CAN differential driving circuit and a DC / DC isolation power supply;

[0021] The CAN signal pin of the main control chip is connected to the CAN differential drive circuit after being optically isolated by the optical coupling isolation circuit; the output signal of the CAN differential drive circuit is connected to the output interface module;

[0022] The DC / DC isolated power supply is used to provide isolated power for the CAN driver module.

[0023] Preferably, the board encoding module is implemented using 8-bit binary encoding and is directly connected to the host computer control signal;

[0024] The board coding module is used to indicate the software and hardware versions of the CAN communication board; after the host computer identifies the correct board coding, it uses the corresponding driver to call the CAN communication board to work normally.

[0025] Preferably, the status indication module comprises three groups of LED indicator lights; the three groups of LED indicator lights are connected to the main controller module; the main control chip in the main controller module is used to control the LED indicator lights, and the current working status is indicated by the LED indicator lights.

[0026] Preferably, the debugging interface module includes an RS232 level conversion chip, a debugging interface socket and a debugging shorting terminal;

[0027] When the debugging short-circuit terminal is valid, the host computer can update the CAN communication board firmware program through the debugging interface socket; when the debugging short-circuit terminal is invalid, the main controller module can output debugging information through the RS232 level conversion chip for user use.

[0028] Preferably, the output interface module includes a 120-ohm matching resistor and a shorting cap, the matching resistor is connected in parallel to the CAN communication differential signal line, and whether to short-circuit the shorting cap to enable the matching resistor is determined according to actual conditions.

[0029] According to a method for implementing a CAN communication board based on a C167 single chip microcomputer provided by the present invention, the following steps are implemented based on the CAN communication board based on the C167 single chip microcomputer described above:

[0030] Step S1: The main controller module reads the data of the data buffer module in real time and performs corresponding operations according to the read data;

[0031] Step S2: The main controller module packages the data to be sent in sequence, converts the level through the CAN driver module, and finally sends it to the CAN bus to complete the sending process;

[0032] Step S3: The main controller module receives the valid data returned by the CAN bus in real time, and writes it into the data buffer module according to the protocol format agreed with the host computer for use by the host computer.

[0033] Compared with the prior art, the present invention has the following beneficial effects:

[0034] 1. The CAN communication board based on the C167 single-chip microcomputer caters to the current environment and provides an optional replacement solution for communication boards of the same specifications that have been used at home and abroad. Independent research and development replaces the purchase of imported finished products, and can provide timely and reliable technical support and professional after-sales service, which not only reduces costs and improves efficiency, but also provides better services;

[0035] 2. The CAN communication board of the present invention has the functions of dual-port data buffering, autonomous sending and receiving of CAN data packets, etc., which greatly reduces the workload of the main controller of the train control unit on the basis of realizing CAN communication;

[0036] 3. The CAN drive circuit of the present invention adopts an independent DC / DC power supply and optical coupling isolation, which can improve the electrical safety of the train control unit;

[0037] 4. The CAN communication board of the present invention is equipped with matching resistors, and users can choose whether to enable it according to the usage scenario;

[0038] 5. The CAN communication board of the present invention is equipped with a debugging interface module and a status indication module, which is convenient for developers and end users to use;

[0039] 6. Since the information exchange between different functional components between vehicles is handled by the CAN communication board, the main controller of the train control unit can spend more time on important functions such as complex control algorithm calculations and monitoring of the working status of each node; the train control unit can access the data of different functional components between vehicles as easily and quickly as accessing local data. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:

[0041] Figure 1 This is a structural diagram of the CAN communication board based on the C167 microcontroller. DETAILED DESCRIPTION

[0042] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several changes and improvements can also be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.

[0043] Example 1

[0044] According to a CAN communication board based on a C167 single-chip microcomputer provided by the present invention, Figure 1 As shown, it includes: a main controller module, a data buffer module, a board encoding module, a CAN driver module, a status indication module, a debugging interface module and an output interface module;

[0045] The main controller module is connected to the debugging interface module, the data buffer module, the CAN driver module, and the status indication module at the same time; the data buffer module is connected to the host computer signal at one end, and is connected to the main controller module at the other end; the board encoding module is connected to the host computer signal; the CAN driver module is connected to the main controller module at one end, and is connected to the output interface module at the other end; the output interface module is connected to the CAN driver module at one end, and is connected to the external CAN communication bus at the other end; the status indication module is connected to the main controller module.

[0046] The main controller module is the core control unit of the CAN communication board, which controls the coordinated work of other modules;

[0047] The data buffer module is used for data exchange between the host computer control signal and the CAN communication board;

[0048] The board encoding module is used by the host computer to identify the model version of the CAN communication board;

[0049] The CAN driver module is used to convert the level signal of the controller into the level signal required by the CAN bus and realize electrical isolation;

[0050] The debugging interface module is used for online debugging of the overall function of the CAN communication board and firmware version update;

[0051] The output interface module is used to connect the CAN communication board to an external CAN communication bus and provide matching resistance;

[0052] The status indication module is used to display the working status of the CAN communication board.

[0053] The main controller module includes a main control chip, a program memory ROM, and a data memory RAM, which constitute the basic structure of the main controller module. The main control chip is realized by purchasing a C167 single-chip microcomputer.

[0054] The data buffer module is implemented by a dual-port RAM, the data bus and address bus of the left port of the dual-port RAM are connected to the host computer control signal, and the data bus and address bus of the right port of the dual-port RAM are connected to the main control chip in the main controller module.

[0055] The CAN drive module includes an optocoupler isolation circuit, a CAN differential drive circuit, and a DC / DC isolation power supply. The CAN signal pin of the main control chip is connected to the CAN differential drive circuit after optocoupler isolation, and the output signal of the CAN differential drive circuit is connected to the output interface module;

[0056] The board coding module is implemented with 8-bit binary coding and is directly connected to the host computer control signal. The board coding is used to indicate the software and hardware version of the CAN communication board. After the host computer recognizes the correct board coding, it uses the corresponding driver to call the CAN communication board to work normally;

[0057] The status indication module includes three groups of LED indicator lights, which are directly connected to the main controller module; the main control chip controls the LEDs to turn on, off, and flash quickly to indicate the current working status.

[0058] The debugging interface module includes an RS232 level conversion chip, a debugging interface socket, and a debugging short-circuit terminal. When the debugging short-circuit terminal is valid, the host computer can update the CAN communication board firmware program through the debugging interface socket; when the debugging short-circuit terminal is invalid, the main controller module can output debugging information through the RS232 level conversion chip for user use.

[0059] The output interface module is connected to the CAN driver module at one end and to the external CAN communication bus at the other end; the interface module contains a 120-ohm matching resistor and a shorting cap, and the matching resistor is connected in parallel to the CAN communication differential signal line. The user decides whether to short-circuit the shorting cap to enable the matching resistor according to actual conditions.

[0060] According to the present invention, a method for implementing a CAN communication board based on a C167 single-chip microcomputer comprises:

[0061] The main controller module reads the data in the dual-port data buffer module in real time and translates what operations the host computer needs the CAN communication board to perform, such as: what length of data to send to what address. The main controller module packs the data to be sent in sequence, converts the level through the CAN driver module, and finally sends it to the CAN bus to complete the sending process. The main controller module also needs to receive the valid data returned by the CAN bus in real time, and writes the valid data into the dual-port buffer module according to the protocol format agreed with the host computer for use by the host computer. The debugging interface is used during product production testing and later program upgrade and maintenance, and the status indication module indicates the working status of the communication board.

[0062] This embodiment greatly reduces the workload of the main controller of the train control unit on the basis of realizing CAN communication. The train control unit can access the data of different functional components between vehicles as conveniently and quickly as accessing local data. The independent DC / DC unit and isolation optical coupler in the CAN drive module improve the electrical safety of the train control unit.

[0063] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essence of the present invention. In the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other arbitrarily.

Claims

1. A CAN communication board based on C167 single chip microcomputer, characterized in that: include: Main controller module, data cache module, board encoding module, CAN driver module, status indication module, debugging interface module and output interface module; One end of the data buffer module is connected to the main controller module, and the other end is connected to the host computer; The board encoding module is connected to the host computer; One end of the CAN driver module is connected to the main controller module, and the other end is connected to one end of the output interface module; the other end of the output interface module is connected to the CAN communication bus; The status indication module is connected to the main controller module.

2. The CAN communication board based on the C167 single chip microcomputer according to claim 1 is characterized in that: The main controller module is used to control the coordinated work of the data cache module, the board encoding module, the CAN driver module, the status indication module, the debugging interface module and the output interface module; The data buffer module is used to realize the data exchange between the host computer control signal and the CAN communication board; The board encoding module is used to enable the host computer to identify the model version of the CAN communication board; The CAN driver module is used to convert the level signal of the main controller into the level signal required by the CAN bus and realize electrical isolation; The debugging interface module is used to realize online debugging of the overall function of the CAN communication board and update the firmware version; The output interface module is used to connect the CAN communication board to an external CAN communication bus and provide matching resistance; The status indication module is used to display the working status of the CAN communication board.

3. The CAN communication board based on C167 single chip microcomputer according to claim 1 is characterized in that: The main controller module includes: a main control chip, a program memory ROM and a data memory RAM; wherein the main control chip is a C167 single chip microcomputer.

4. The CAN communication board based on C167 single chip microcomputer according to claim 2 is characterized in that: The data buffer module is implemented using a dual-port RAM, the data bus and address bus of the left port of the dual-port RAM are connected to the host computer control signal; the data bus and address bus of the right port of the dual-port RAM are connected to the main control chip in the main controller module.

5. The CAN communication board based on C167 single chip microcomputer according to claim 1 is characterized in that: The CAN drive module includes: an optocoupler isolation circuit, a CAN differential drive circuit and a DC / DC isolation power supply; The CAN signal pin of the main control chip is connected to the CAN differential drive circuit after being optically isolated by the optical coupling isolation circuit; the output signal of the CAN differential drive circuit is connected to the output interface module; The DC / DC isolated power supply is used to provide isolated power for the CAN driver module.

6. The CAN communication board based on C167 single chip microcomputer according to claim 1 is characterized in that: The board encoding module is implemented using 8-bit binary encoding and is directly connected to the host computer control signal; The board coding module is used to indicate the software and hardware versions of the CAN communication board; after the host computer identifies the correct board coding, it uses the corresponding driver to call the CAN communication board to work normally.

7. The CAN communication board based on C167 single chip microcomputer according to claim 1 is characterized in that: The status indication module comprises three groups of LED indicator lights; the three groups of LED indicator lights are connected to the main controller module; the main control chip in the main controller module is used to control the LED indicator lights, and the current working status is indicated by the LED indicator lights.

8. The CAN communication board based on C167 single chip microcomputer according to claim 1 is characterized in that: The debugging interface module includes an RS232 level conversion chip, a debugging interface socket and a debugging shorting terminal; When the debugging short-circuit terminal is valid, the host computer can update the CAN communication board firmware program through the debugging interface socket; When the debugging short-circuit terminal is invalid, the main controller module can output debugging information through the RS232 level conversion chip for user use.

9. The CAN communication board based on C167 single chip microcomputer according to claim 1, characterized in that: The output interface module includes a 120-ohm matching resistor and a shorting cap. The matching resistor is connected in parallel to the CAN communication differential signal line. It is determined whether to short-circuit the shorting cap to enable the matching resistor according to actual conditions.

10. A method for implementing a CAN communication board based on a C167 single-chip microcomputer, characterized in that: The CAN communication board based on the C167 single-chip microcomputer according to any one of claims 1 to 9 implements the following steps: Step S1: The main controller module reads the data of the data buffer module in real time and performs corresponding operations according to the read data; Step S2: The main controller module packages the data to be sent in sequence, converts the level through the CAN driver module, and finally sends it to the CAN bus to complete the sending process; Step S3: The main controller module receives the valid data returned by the CAN bus in real time, and writes it into the data buffer module according to the protocol format agreed with the host computer for use by the host computer.

Citation Information

Patent Citations

  • CAN communication circuit

    CN221862867U