CAN communication board based on C167 single-chip microcomputer
By using a CAN communication board based on the C167 microcontroller and employing independent power supply and electrical isolation design, the problems of communication quality degradation and main processor burden in traditional transportation control systems have been solved, achieving efficient and reliable CAN communication and improving the stability and electrical safety of transportation systems.
Patent Information
- Application Number
- CN202423226501.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2034-12-25
AI Technical Summary
Traditional transportation control systems are burdened with processing large amounts of real-time communication data. The numerous communication nodes and significant electromagnetic interference lead to a decline in communication quality and difficulty in meeting real-time requirements. Furthermore, the existing CAN communication module design has not been effectively made independent, increasing the burden on the main processor.
A CAN communication board based on the C167 microcontroller was designed, including a main controller module, a data buffer module, a board encoding module, a CAN driver module, a status indicator module, a debug interface module, and an output interface module. It adopts optocoupler isolation circuit and DC/DC isolation power supply to achieve electrical isolation and independent power supply. Matching resistors and debug interfaces are configured to simplify hardware and software design.
It improves the reliability and efficiency of CAN communication, reduces the burden on the main controller of the train control unit, enhances electrical safety, provides flexible debugging and status indication functions, reduces costs and improves service quality.
Smart Images

Figure CN223650912U_ABST
Abstract
Description
Technical Field
[0001] This utility model relates to the field of CAN communication technology, specifically to a CAN communication board based on a C167 microcontroller. Background Technology
[0002] CAN bus is an industrial control system, and many automotive control circuits use CAN bus. Buses used in subway vehicles include WTB bus, MVB bus, and CAN bus. Due to its high reliability and good error detection capabilities, CAN bus is widely used in subway vehicle communication subnetworks, such as multimedia passenger information systems, platform screen door control systems, and air conditioning control units, where multi-node communication is used. The use of CAN communication is becoming increasingly widespread.
[0003] With the continuous growth of modern transportation demands, transportation control systems are placing increasingly higher requirements on the stability and reliability of communication modules. Traditional transportation control systems face the following problems in data communication: 1. Vehicle control units need to process a large amount of real-time communication data from different components on the train. With numerous communication nodes and large data volumes, traditional integrated designs consume a significant amount of time from the main processor to handle communication tasks. This invention designs the CAN communication module independently, simplifying the hardware and software design of the vehicle control unit and improving its efficiency in accessing different electronic control components on the network. 2. Transportation control systems, especially rail transit trains, experience significant electromagnetic interference and have long, numerous cable nodes, leading to decreased communication quality and high real-time requirements. This invention adds an isolation power supply and protection circuit to the CAN driver circuit design, improving the reliability of the communication circuit and providing 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, comprising: a main control chip; a CAN chip, the CAN chip including a communication circuit and a transceiver, the communication circuit being communicatively connected to the main control chip via 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 module; a second power supply circuit electrically connected to the CAN chip, including a second power module and a third power module, the third power module being electrically connected to the first power module via a power isolation circuit; when the CAN chip is in a sleep state, the second power module stops supplying power, the first power module supplies power to the third power module, and the third power module supplies power to the transceiver, so that the transceiver maintains its working state and detects a specific wake-up frame. Summary of the Invention
[0005] In view of the deficiencies in the existing technology, the purpose of this utility model is to provide a CAN communication board based on the C167 microcontroller.
[0006] According to the present invention, a CAN communication board based on a C167 microcontroller is provided, comprising: a main controller module, a data buffer module, a board encoding module, a CAN driver module, a status indicator module, a debug 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 operation of the data cache module, board encoding module, CAN driver module, status indication module, debug interface module and output interface module;
[0012] The data buffer module is used to realize the exchange of control signals from the host computer and data from the CAN communication board;
[0013] The board encoding module is used to enable the host computer to identify the model and 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 to achieve electrical isolation;
[0015] The debugging interface module is used to enable online debugging of the overall functions of the CAN communication board and firmware version updates;
[0016] The output interface module is used to connect the CAN communication board to an external CAN communication bus and provides a matching resistor;
[0017] The status indicator module is used to display the working status of the CAN communication board.
[0018] Preferably, 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 microcontroller.
[0019] Preferably, the data buffer module is implemented using a dual-port RAM, wherein the data bus and address bus of the left port of the dual-port RAM are connected to the control signals of the host computer; 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.
[0020] Preferably, the CAN driver module includes: an optocoupler isolation circuit, a CAN differential driver circuit, and a DC / DC isolated 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 optocoupler 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 to 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 represent 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 includes three sets of LED indicators; the three sets of LED indicators are connected to the main controller module; the main control chip in the main controller module controls the LED indicators, and the LED indicators indicate the current working status.
[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 shorting terminal is valid, the host computer can update the CAN communication board firmware program through the debugging interface socket; when the debugging shorting 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 jumper cap. The matching resistor is connected in parallel to the CAN communication differential signal line. The jumper cap is shorted to enable the matching resistor, depending on the actual situation.
[0029] Compared with the prior art, the present invention has the following beneficial effects:
[0030] 1. This utility model is a CAN communication board based on the C167 microcontroller. It caters to the current environment and provides an alternative solution for communication boards of the same specifications that have been used at home and abroad. It is independently developed instead of imported finished products. It can provide timely and reliable technical support and professional after-sales service, which not only reduces costs and improves efficiency, but also provides better service.
[0031] 2. The CAN communication board of this utility model has dual-port data buffering and autonomous CAN data packet sending and receiving functions. On the basis of realizing CAN communication, it greatly reduces the workload of the main controller of the train control unit.
[0032] 3. The CAN drive circuit of this utility model adopts an independent DC / DC power supply and optocoupler isolation, which can improve the electrical safety of the train control unit;
[0033] 4. The CAN communication board of this utility model is equipped with a matching resistor, which users can choose to enable or disable according to their usage scenarios;
[0034] 5. The CAN communication board of this utility model is equipped with a debugging interface module and a status indicator module, which is convenient for developers and end users. Attached Figure Description
[0035] Other features, objects, and advantages of this invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:
[0036] Figure 1 This is a schematic diagram of a CAN communication board based on the C167 microcontroller. Detailed Implementation
[0037] The present invention will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present invention, but do not limit the present invention in any way. It should be noted that those skilled in the art can make several changes and improvements without departing from the concept of the present invention. These all fall within the protection scope of the present invention.
[0038] Example 1
[0039] According to the present invention, a CAN communication board based on a C167 microcontroller is provided, such as... Figure 1 As shown, it includes: a main controller module, a data buffer module, a board encoding module, a CAN driver module, a status indicator module, a debug interface module, and an output interface module;
[0040] The main controller module is connected to the debugging interface module, the data buffer module, the CAN driver module, and the status indicator module. The data buffer module is connected to the host computer signal at one end and 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 to the output interface module at the other end. The output interface module is connected to the CAN driver module at one end and to an external CAN communication bus at the other end. The status indicator module is connected to the main controller module.
[0041] The main controller module is the core control unit of the CAN communication board, which controls the coordinated operation of other modules.
[0042] The data buffer module is used for exchanging control signals from the host computer and data from this CAN communication board.
[0043] The board encoding module is used by the host computer to identify the model and version of this CAN communication board;
[0044] The CAN driver module is used to convert the controller's level signals into the level signals required by the CAN bus and to achieve electrical isolation;
[0045] The debugging interface module is used for online debugging of the overall functions of the CAN communication board and firmware version updates.
[0046] The output interface module is used to connect this CAN communication board to an external CAN communication bus and provides a matching resistor;
[0047] The status indicator module is used to display the working status of the CAN communication board.
[0048] The main controller module includes a main control chip, a programmable memory (ROM), and a data memory (RAM), which together constitute the basic structure of the main controller module. The main control chip is implemented using a C167 microcontroller.
[0049] 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 control signals of the host computer, 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.
[0050] The CAN driver module includes an optocoupler isolation circuit, a CAN differential driver circuit, and a DC / DC isolated power supply. The CAN signal pins of the main control chip are connected to the CAN differential driver circuit after optocoupler isolation, and the output signal of the CAN differential driver circuit is connected to the output interface module.
[0051] The board encoding module uses 8-bit binary encoding and is directly connected to the host computer's control signals. The board encoding indicates the software and hardware version of the CAN communication board. After the host computer identifies the correct board encoding, it uses the corresponding driver to call the CAN communication board to work normally.
[0052] The status indicator module includes three sets of LED indicators, which are directly connected to the main controller module. The main control chip controls the LEDs to turn on, off, or flash rapidly to indicate the current working status.
[0053] The debugging interface module comprises an RS232 level conversion chip, a debugging interface socket, and debugging shorting terminals. When the debugging shorting terminals are active, the host computer can update the CAN communication board firmware program through the debugging interface socket; when the debugging shorting terminals are inactive, the main controller module can output debugging information through the RS232 level conversion chip for user use.
[0054] 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 jumper cap. The matching resistor is connected in parallel to the CAN communication differential signal line. The user can decide whether to short the jumper cap to enable the matching resistor according to the actual situation.
[0055] The present invention provides a method for implementing a CAN communication board based on a C167 microcontroller, comprising:
[0056] The main controller module reads data from the dual-port data buffer module in real time, interpreting the instructions from the host computer regarding the required operations for the CAN communication board, such as the address to which data of a certain length should be sent. The main controller module sequentially packages the data to be sent, performs level conversion via the CAN driver module, and finally sends it to the CAN bus to complete the transmission process. The main controller module also needs to receive valid data returned from the CAN bus in real time, write it into the dual-port buffer module according to the agreed-upon protocol format, and then provide it to the host computer. The debugging interface is used during product manufacturing testing and subsequent program upgrades and maintenance, while the status indicator module indicates the communication board's operating status.
[0057] This embodiment, based on CAN communication, significantly reduces the workload of the train control unit's main controller. The train control unit can access data from different functional components between vehicles as easily and quickly as accessing local data. The independent DC / DC unit and isolated optocoupler in the CAN driver module improve the electrical safety of the train control unit.
[0058] The specific embodiments of this utility model have been described above. It should be understood that this utility model is not limited to the specific embodiments described above, and those skilled in the art can make various changes or modifications within the scope of the claims, which do not affect the substantive content of this utility model. Unless otherwise specified, the embodiments and features described in this application can be arbitrarily combined with each other.
Claims
1. A CAN communication board based on a C167 microcontroller, characterized in that, include The main controller module, data buffer module, board encoding module, CAN driver module, status indicator module, debugging interface module, and output interface module are included. One end of the data caching 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 microcontroller according to claim 1, 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 microcontroller.
3. The CAN communication board based on the C167 microcontroller according to claim 1, characterized in that, The data cache 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 control signals of the host computer; 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.
4. The CAN communication board based on the C167 microcontroller according to claim 3, characterized in that, The CAN driver module includes: an optocoupler isolation circuit, a CAN differential driver circuit, and a DC / DC isolated 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 optocoupler isolation circuit; the output signal of the CAN differential drive circuit is connected to the output interface module.
5. The CAN communication board based on the C167 microcontroller according to claim 1, characterized in that, The board encoding module is connected to the host computer control signal.
6. The CAN communication board based on the C167 microcontroller according to claim 1, characterized in that, The status indicator module includes three sets of LED indicators; the three sets of LED indicators are connected to the main controller module.
7. The CAN communication board based on the C167 microcontroller according to claim 1, characterized in that, The debugging interface module includes an RS232 level conversion chip, a debugging interface socket, and a debugging shorting terminal.
8. The CAN communication board based on the C167 microcontroller according to claim 1, characterized in that, The output interface module includes a 120-ohm matching resistor and a jumper cap. The matching resistor is connected in parallel to the CAN communication differential signal line. The jumper cap is shorted to enable the matching resistor, depending on the actual situation.
Citation Information
Patent Citations
CAN communication circuit
CN221862867U