Universal serial bus (USB)-to-multipath controller area network (CAN) module with adjustable module ID
By using a USB-to-multi-channel CAN module with adjustable module ID, bidirectional conversion between USB and multi-channel CAN signals and parallel management of multiple modules are achieved. This solves the problems of communication delay, complex multi-module management, and insufficient bandwidth in existing technologies, improves the real-time performance and communication control bandwidth of the system, and is suitable for multi-joint robot control.
Patent Information
- Application Number
- CN202511205764.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-27
- Publication Date
- 2025-11-14
AI Technical Summary
Existing USB-to-CAN modules suffer from increased communication latency, reduced system stability, complex multi-module management, and insufficient bandwidth in multi-joint robot control scenarios, making them particularly difficult to meet the requirements.
Design a USB to multi-channel CAN module with adjustable module ID. Through USB to multi-channel CAN hardware and software modules, module ID configuration hardware and software modules, and dedicated communication protocols, it realizes bidirectional conversion between USB and multi-channel CAN signals and parallel management of multiple modules, and supports direct control of external CAN devices by the host computer.
It simplifies the system architecture, reduces hardware costs, improves the real-time performance and accuracy of control, expands multiple CAN buses, increases communication control bandwidth, and supports reinforcement learning control of multi-joint robots.
Smart Images

Figure CN120950435A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data conversion technology, and in particular to a USB to multi-channel CAN module with adjustable module ID. Background Technology
[0002] Against the backdrop of the continuous evolution of modern electronic communication technology, the USB interface, with its high-speed transmission and plug-and-play characteristics, has become a key bridge for data exchange between devices. Among them, USB-to-CAN technology is particularly widely used in fields such as multi-driver robot control. However, existing CAN communication technology still faces many limitations and shortcomings in practical applications, which urgently need to be addressed.
[0003] On the one hand, most single modules only support one CAN bus, requiring multiple conversions in multi-device connection scenarios. This not only increases hardware costs but also significantly increases communication latency and reduces system stability due to the increased number of conversion steps. For example, the USB conversion module proposed in the patent "A USB Interface Conversion Module" (Publication No.: CN104409090A), although providing multiple communication interface accesses, can only expand one CAN bus, making it difficult to achieve efficient and stable data transmission when facing the needs of multi-device connection.
[0004] On the other hand, when multiple modules are connected to the same host computer, existing technologies struggle to effectively distinguish and independently control different modules. Users typically need to manually query the USB port number of the connected module for differentiation and use. Changing the port number requires re-querying and modifying the code, making the process cumbersome and error-prone. This presents a high barrier to entry for ordinary users, severely impacting the user experience and deployment efficiency. For example, the relevant patent "A Multi-Serial Port Communication Control Circuit" (Publication No.: CN119920212A) proposes a USB-to-multi-serial-port conversion invention but does not address methods for handling multiple controllers connected to the same host computer.
[0005] Furthermore, in the field of multi-joint robot control, the insufficient bandwidth of existing USB-to-CAN modules is particularly prominent. While traditional CAN protocol conversion devices support RS485 / RS232 / TTL, they typically only have one serial port and one CAN bus, failing to meet multi-channel requirements. In practical applications, multi-joint robots need to control multiple motors simultaneously, placing higher demands on the bandwidth of the CAN bus. For example, the patent "An FPGA Upgrade System and Method Based on USB to SPI" (Publication No.: CN111857769A) emphasizes the urgent need for high-speed, stable data transmission in complex application scenarios, and the bandwidth limitations of existing USB-to-CAN technology have become a bottleneck hindering the further development of multi-joint robot control technology. Summary of the Invention
[0006] To address the shortcomings of traditional USB-to-CAN communication technology in terms of data transmission rate, multi-module management, anti-interference capability, and bandwidth support in complex application scenarios, this invention provides a USB-to-multichannel CAN module with adjustable module ID.
[0007] The technical solutions provided by the embodiments of the present invention are as follows: This invention provides a USB to multi-channel CAN module with adjustable module ID, comprising: a USB to multi-channel CAN hardware and software module, a module ID configuration hardware and software module, and a dedicated communication protocol; Through the collaboration of the USB to multi-channel CAN hardware and software module, the module ID configuration hardware and software module, and the dedicated communication protocol, bidirectional conversion between USB and multi-channel CAN signals and parallel management of multiple modules are achieved. The USB to multi-channel CAN hardware and software module provides physical communication interface and data conversion support; the module ID configuration hardware and software module realizes multi-module identification and distinguishable calling; and the dedicated communication protocol completes instruction format conversion and direct control logic. Through the coordinated combination of the USB to multi-channel CAN hardware and software module, the module ID configuration hardware and software module, and the dedicated communication protocol, the host computer can directly control external CAN devices without the need for a relay microcontroller.
[0008] The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following: In this embodiment of the invention, the host computer can directly control external CAN devices without the need for a relay microcontroller. This not only simplifies the system architecture and reduces hardware costs, but also greatly improves the real-time performance and accuracy of control. At the same time, it can easily expand to multiple CAN buses. Compared with existing technologies that can only support a single CAN bus, this greatly improves the communication control bandwidth and provides sufficient communication resources for the reinforcement learning control of multi-joint robots. Attached Figure Description
[0009] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0010] Figure 1 This is a PCB diagram of a USB to multi-channel CAN module with adjustable module ID, provided as an embodiment of the present invention.
[0011] Figure 2This is a schematic diagram of the architecture of a USB to multi-channel CAN module with adjustable module ID, provided in an embodiment of the present invention.
[0012] Figure 3 This is a schematic diagram of the circuit structure of a USB to multi-channel CAN module with adjustable module ID, provided in an embodiment of the present invention.
[0013] Figure 4 This is a schematic diagram of a host computer expanding a multi-channel CAN bus connection, provided as an embodiment of the present invention.
[0014] Figure 5 This is a flowchart of the MCU firmware program for a USB to multi-channel CAN hardware and software module provided in an embodiment of the present invention.
[0015] Reference numerals in the attached diagram: 1. USB communication port; 2. MCU; 3. Multi-channel CAN transceiver; 4. CAN transceiver indicator; 5. Multi-channel CAN communication port; 6. CAN bus resistor switch; 7. ID switching dial switch.
[0016] As shown in the figure, specific structures and devices are marked in the figure to clearly illustrate the structure of the embodiments of the present invention. However, this is only for illustrative purposes and is not intended to limit the present invention to this specific structure, device and environment. Those skilled in the art can adjust or modify these devices and environments according to specific needs. Detailed Implementation
[0017] The technical solutions of the present invention will now be described with reference to the accompanying drawings. It should also be noted that, to make the embodiments more detailed, the following embodiments are the best and preferred embodiments. For some well-known technologies, those skilled in the art can also use other alternative methods to implement the invention; moreover, the accompanying drawings are only for more specific description of the embodiments and are not intended to specifically limit the present invention.
[0018] It should be noted that the use of terms such as "an embodiment," "an embodiment," "an exemplary embodiment," and "some embodiments" in the specification indicates that the described embodiment may include a specific feature, structure, or characteristic, but not every embodiment necessarily includes that specific feature, structure, or characteristic. Furthermore, when a specific feature, structure, or characteristic is described in connection with an embodiment, implementing such a feature, structure, or characteristic in conjunction with other embodiments (whether explicitly described or not) should be within the knowledge of those skilled in the art.
[0019] Generally, terms can be understood at least partly from their use in context. For example, depending at least partly on the context, the term "one or more" as used herein can be used to describe any feature, structure, or characteristic in a singular sense, or a combination of features, structures, or characteristics in a plural sense. Additionally, the term "based on" can be understood not necessarily to convey an exclusive set of factors, but rather, alternatively, depending at least partly on the context, to allow for the presence of other factors that are not necessarily explicitly described.
[0020] It is understood that the meanings of “on”, “above”, and “above” in this invention should be interpreted in the broadest manner, such that “on” means not only “directly on” something, but also includes the meaning of being “on” something with an intervening feature or layer, and that “above” or “above” means not only “on” something, but also includes the meaning of being “on” something without an intervening feature or layer.
[0021] Furthermore, spatially related terms such as “below,” “under,” “lower,” “above,” and “upper” are used herein for convenience to describe the relationship of one element or feature to one or more other elements or features, as illustrated in the accompanying drawings. Spatially related terms are intended to cover different orientations in the use or operation of the device other than those depicted in the accompanying drawings. The device may be oriented in other ways, and the spatially related descriptive terms used herein can be interpreted similarly.
[0022] Reference manual attached Figure 1 The diagram shows a PCB schematic of a USB-to-multichannel CAN module with adjustable module ID provided in an embodiment of the present invention.
[0023] Reference manual attached Figure 2 The diagram illustrates the architecture of a USB-to-multichannel CAN module with adjustable module ID, as provided in an embodiment of the present invention.
[0024] Reference manual attached Figure 3 The diagram shows a circuit structure schematic of a USB to multi-channel CAN module with adjustable module ID provided in an embodiment of the present invention.
[0025] This invention provides a USB-to-multichannel CAN module with adjustable module ID, comprising: a USB-to-multichannel CAN hardware and software module, a module ID configuration hardware and software module, and a dedicated communication protocol.
[0026] By coordinating USB to multi-channel CAN hardware and software modules, module ID configuration hardware and software modules, and dedicated communication protocols, bidirectional conversion between USB and multi-channel CAN signals and parallel management of multiple modules can be achieved.
[0027] The USB-to-multichannel CAN hardware and software module provides physical communication interfaces and data conversion support. The module ID configuration hardware and software module enables multi-module identification and differentiation, and the dedicated communication protocol completes instruction format conversion and direct control logic.
[0028] Specifically, the USB-to-multichannel CAN hardware and software module includes components such as a USB communication port, an MCU, multiple CAN transceivers, and a CAN bus port. During reception and transmission, the USB port interacts with the host computer, and the MCU processes the data and converts it into CAN bus protocol for transmission. Conversely, it can also receive differential signals from the CAN bus, convert them, and send them back to the host computer for processing. In this way, with hardware-level support, stable communication between USB and a multichannel CAN bus can be achieved.
[0029] Furthermore, the module ID configuration hardware and software modules work in conjunction with a host computer rule file via a hardware dial switch to identify and distinguish multiple modules. The hardware dial switch is used to set the module ID, while the host computer rule file defines the mapping relationship between USB IDs and device names. The advantage of this configuration method is that it can easily enable the parallel access and management of multiple modules on the same host computer. The host computer does not need to distinguish modules by querying USB port numbers; it only needs to call the corresponding module and CAN channel by device name, greatly simplifying the operation process and avoiding the tedious process of manual searching and setting by the user.
[0030] Furthermore, the dedicated communication protocol defines the data format conversion rules between USB and CAN buses, directly converting USB commands sent by the host computer into a CAN-compliant format, enabling the host computer to directly control external CAN devices. This dedicated communication protocol not only ensures the accuracy and real-time performance of data transmission but also simplifies the interaction process between the host computer and CAN devices, avoiding the complex processing required by relay microcontrollers in traditional systems. Through this protocol, commands can be directly converted into CAN bus format, enabling precise control of multiple external CAN devices.
[0031] By combining USB-to-multichannel CAN hardware and software modules, module ID configuration hardware and software modules, and dedicated communication protocols, the host computer can directly control external CAN devices without the need for a relay microcontroller, simplifying the system architecture and reducing response latency.
[0032] The core innovation of this invention lies in the design of hardware and software that integrate "single-module multi-channel CAN parallel conversion" with "multi-module USB hardware ID adjustment and recognition", thereby improving the robot control bandwidth by utilizing the scalability of the USB protocol.
[0033] In one possible implementation, the hardware portion of the USB to multi-channel CAN hardware and software module includes: a USB communication port 1, an MCU 2, a multi-channel CAN transceiver 3, a CAN transceiver indicator 4, a multi-channel CAN communication port 5, and a CAN bus resistor switch 6, which are connected in sequence.
[0034] USB communication port 1 is used to power the module and for data exchange with the host computer. USB communication port 1 supports both power supply and USB data transfer, and is compatible with the USB standard. During data exchange, USB communication port 1 receives and transmits instructions from the host computer to the MCU; conversely, the MCU sends data from the CAN bus back to the host computer via USB communication port 1. This dual function of power supply and data transfer via USB communication port 1 reduces additional hardware requirements, making the system more compact and efficient.
[0035] MCU2 is the core control unit, featuring rich peripheral interfaces and powerful data processing capabilities. It can quickly handle data conversion between USB and CAN buses and manage the scheduling of multiple CAN signals. MCU2's built-in firmware enables it to automatically handle data packet transmission and reception, ensuring reliable and real-time data transmission.
[0036] The multi-channel CAN transceiver 3 is electrically connected to both MCU2 and the multi-channel CAN communication port 5. The multi-channel CAN transceiver 3 integrates multiple independent CAN transceivers, each responsible for one CAN bus, ensuring that each CAN bus can operate independently without interference.
[0037] CAN transceiver indicator 4 is used to indicate the status of bus data interaction. The corresponding indicator light illuminates when data is being transmitted or received, and turns off when no data is being transmitted or received. Through CAN transceiver indicator 4, users can intuitively understand the system's operating status, promptly detect communication interruptions or other faults, thus facilitating system maintenance and troubleshooting.
[0038] The multi-channel CAN communication port 5 is electrically connected to the multi-channel CAN transceiver 3, used to connect external CAN devices and transmit CAN communication signals. It extends CAN H and CAN L lines to connect to external CAN devices. The design of the multi-channel CAN communication port 5 allows each port to operate independently, enabling the connection of different CAN devices and ensuring the stability and efficiency of communication on each CAN bus.
[0039] The CAN bus resistor switch 6 is electrically connected between the CAN H and CAN L circuits of the multi-channel CAN communication port 5, and is connected in parallel with the CAN devices on the CAN bus. Each CAN bus resistor switch 6 integrates a CAN terminating resistor. Users can use the CAN bus resistor switch 6 to adjust the CAN bus resistance value to meet the needs of connecting different numbers of CAN devices.
[0040] In this embodiment of the invention, a multi-channel CAN parallel conversion architecture is designed, which can expand a single module to multiple CAN buses and allow a single host computer to access multiple modules, thereby solving the problem of insufficient control bandwidth in certain application scenarios, such as multi-joint robot control.
[0041] Reference manual attached Figure 4 The diagram illustrates a host computer expansion of a multi-channel CAN bus connection according to an embodiment of the present invention.
[0042] In one possible implementation, the multiplexer 3 is used to convert the TTL signal output by the MCU2 into a CAN bus differential signal, or to convert the CAN bus differential signal into a TTL signal supported by the MCU2.
[0043] Each CAN bus is equipped with a CAN bus resistor switch 6, which allows users to adjust the bus resistance value to accommodate different numbers of external CAN devices.
[0044] In this embodiment of the invention, a multi-channel CAN transceiver converts the TTL signal output by MCU2 into a CAN bus differential signal and then reverses the conversion, ensuring compatibility between different communication standards. Furthermore, each CAN bus is equipped with a CAN bus resistor switch 6, allowing users to flexibly adjust the bus resistance value according to the number of external CAN devices, thereby optimizing signal transmission stability and anti-interference capabilities. This not only improves the system's adaptability and reliability but also ensures efficient and stable communication in various application scenarios.
[0045] In one possible implementation, the module ID configuration hardware and software module includes: an ID switching dial switch 7 in the hardware layer and a host computer rule file in the software layer.
[0046] ID switching dial switch 7 is electrically connected to the IO pin of MCU2 for hardware setting of ID.
[0047] The host computer rule file is used to define the mapping relationship between USBID and device name, supporting the host computer to identify and independently call multiple modules in parallel.
[0048] In this embodiment of the invention, the ID switching dial switch 7, in conjunction with the host computer rule file, enables dynamic adjustment of module IDs, supports the access of the same host computer and the differentiation of multiple modules, so that users usually do not need to manually query the USB port number of the module access, and do not need to modify the code when changing the access point, thus solving the problem of multi-module identification and management.
[0049] Furthermore, MCU2 is used to read the N-bit status value of ID switching dial switch 7 and generate a unique USBID.
[0050] In one possible implementation, the host computer rule file supports multiple platforms and defines the mapping relationship between USB IDs and device names, allowing users to call the corresponding CAN channel by device name, thus enabling parallel control and management of multiple modules. Through the preset "USBID-device name" binding relationship, the host computer can directly call the specific CAN channel of the corresponding module by device name and channel, without needing to call it through the USB port number the module is connected to. This allows for precise calling of the CAN bus of all connected modules, enabling parallel identification and independent calling of multiple modules, and supporting up to 128 modules connected to the host computer in parallel.
[0051] In one possible implementation, the USB-to-multichannel CAN hardware and software module also includes: supporting software. The supporting software includes: firmware and multi-platform SDK dynamic libraries.
[0052] The firmware integrates virtual serial port technology, enabling the module to be recognized by the host as a plug-and-play serial device without the need for additional driver installation. The host computer communicates with the module via a standard serial interface, avoiding the cumbersome process of installing additional drivers required by traditional devices. Through the firmware, the module can run on different operating system platforms without user intervention, providing high compatibility and convenience.
[0053] Multi-platform SDK dynamic libraries enable developers to quickly integrate the hardware module into their applications. The SDK dynamic library contains a series of pre-packaged interfaces and functions to help developers simplify interaction with the module and achieve device control and management.
[0054] The firmware program integrates virtual serial port technology, enabling the module to be recognized by the host as a plug-and-play serial port device without the need for additional driver installation.
[0055] In one possible implementation, the firmware program specifically includes: after module initialization, it first detects the state of the ID switching dial switch 7, and sets its own USB ID according to the state of the ID switching dial switch 7. This part of the function is implemented in the main function initialization. A hybrid mode of "USB interrupt reception + main function loop feedback" is used to process and transmit data. That is, the USB receive interrupt processes the USB input data in real time and forwards it to CAN, while the main function loops to check the CAN receive flag and sends the CAN received data back to the USB.
[0056] Reference manual attached Figure 5 The diagram shows a flowchart of the MCU firmware program for a USB to multi-channel CAN hardware and software module provided in an embodiment of the present invention.
[0057] When data is sent, the host computer sends data to USB communication port 1, triggering a USB receive interrupt. In the USB receive interrupt service function, the received USB data is read, parsed, and processed. MCU2 sends the processed data to the multi-channel CAN transceiver 3 in the form of a TTL signal.
[0058] When receiving data, when the multi-channel CAN transceiver 3 transmits a TTL signal to the MCU2, the MCU main function checks the CAN signal reception flag in a loop, then reads the data, performs necessary parsing and processing, and finally sends the processed data back to the host computer through USB communication port 1.
[0059] It should be noted that the firmware program can implement USB and CAN communication conversion. During initialization, GPIO scanning is performed to read the dial status and generate a USBID. A hybrid mode of "USB interrupt reception + main function loop feedback" is adopted, meaning that the USB receive interrupt processes USB input data in real time and forwards it to CAN, while the main function loops to check the CAN receive flag and sends the received CAN data back to USB, ensuring real-time performance. A virtual serial port function is integrated, allowing the module to be recognized as a serial device in the host computer, simplifying application development.
[0060] The workflow provided by this invention is described below: For the sending direction: The host computer sends control commands via USB → The MCU receives data via USB interrupt → Parses the commands and splits them into multiple CAN channels → The CAN transceiver converts the TTL signal into a differential signal → It is sent to the external device through the CAN interface. For the receiving direction: Data from the external CAN device → The CAN interface receives the differential signal → The CAN transceiver converts it into a TTL signal → The MCU main function reads and packages the data in a loop → It feeds back to the host computer via USB.
[0061] In one possible implementation, a dedicated communication protocol is used to directly convert host computer USB commands into the CAN bus protocol format, enabling the host computer to directly control external CAN devices. This dedicated protocol not only ensures correct data format conversion but also efficiently supports parallel operation of multiple CAN buses.
[0062] In one possible implementation, the protocol frame ID in the dedicated communication protocol is used to identify the data transmission direction. The number of channels in the dedicated communication protocol is used to select the CAN channel. Each CAN protocol segment corresponds one-to-one with the CAN protocol frame configuration, including the CAN ID, CAN frame type, data length, and the specific data, used for direct connection to the CAN protocol. The checksum segment is used to ensure the accuracy of data transmission. The protocol parameters of the dedicated communication protocol are shown in Table 1.
[0063] Table 1 Protocol Parameters of Dedicated Communication Protocol The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following: (1) Direct control without relay microcontroller: The technical solution of this invention successfully replaces the traditional relay microcontroller, realizing the function of directly controlling the motor using a host computer. This breakthrough not only simplifies the system architecture and reduces hardware costs, but also greatly improves the real-time performance and accuracy of control.
[0064] (2) Multi-channel CAN parallel conversion improves bandwidth: This invention can easily expand to multiple CAN buses, which greatly improves the communication control bandwidth compared to existing devices that can only support a single CAN bus. It provides sufficient communication resources for the reinforcement learning control of multi-joint robots.
[0065] (3) Adjustable Module ID Enables Parallel Access of Multiple Modules: By adjusting the module's USBID via a dial and working with the host computer's rule file, multiple modules can be accessed and distinguished from each other on the same host computer. This eliminates the need for users to manually query the USB port number of the accessed module, and code modifications are not required when changing the access point, thus solving the problem of multi-module identification and management. During MCU initialization, the PID field in the USB device descriptor is automatically written by reading the dial switch status, achieving hardware-level ID differentiation. The "USBID - Device Name" binding relationship is implemented through the host computer's rule file, allowing the host computer to directly call the corresponding module by device name.
[0066] (4) Plug and play and high compatibility: It adopts virtual serial port technology to achieve plug and play, without the need to install drivers, and supports use on multiple platforms. The built-in virtual serial port technology enables the module to be recognized as a plug and play serial port device in the host computer, which can be widely used in industrial control, automotive electronics and other fields, and has strong versatility.
[0067] This invention encompasses any substitutions, modifications, equivalent methods, and solutions made within the spirit and scope of this invention. To provide the public with a thorough understanding of this invention, specific details are described in detail in the preferred embodiments, while those skilled in the art will fully understand the invention even without these details. Furthermore, to avoid unnecessary misunderstanding of the essence of this invention, well-known methods, processes, procedures, components, and circuits are not described in detail.
[0068] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A USB-to-multichannel CAN module with adjustable module ID, characterized in that, include: USB to multi-channel CAN hardware and software module, module ID configuration hardware and software module, and dedicated communication protocol; Through the collaboration of the USB to multi-channel CAN hardware and software module, the module ID configuration hardware and software module, and the dedicated communication protocol, bidirectional conversion between USB and multi-channel CAN signals and parallel management of multiple modules are achieved. The USB to multi-channel CAN hardware and software module provides physical communication interface and data conversion support; the module ID configuration hardware and software module realizes multi-module identification and distinguishable calling; and the dedicated communication protocol completes instruction format conversion and direct control logic. Through the coordinated combination of the USB to multi-channel CAN hardware and software module, the module ID configuration hardware and software module, and the dedicated communication protocol, the host computer can directly control external CAN devices without the need for a relay microcontroller.
2. The USB to multi-channel CAN module with adjustable module ID according to claim 1, characterized in that, The hardware component of the USB to multi-channel CAN software and hardware module includes: a USB communication port, an MCU, a multi-channel CAN transceiver, a CAN transceiver indicator light, a multi-channel CAN communication port, and a CAN bus resistor switch, which are connected in sequence. The USB communication port is used to power the module and for data interaction with the host computer device. The multi-channel CAN transceiver is electrically connected to the MCU and the multi-channel CAN communication port, respectively. The CAN transceiver indicator light is used to indicate the bus data interaction status. When there is data transmission or reception, the corresponding indicator light is lit, and when there is no data transmission or reception, it is turned off. The multi-channel CAN communication port is electrically connected to the multi-channel CAN transceiver, used to connect to external CAN devices and transmit CAN communication signals, and leads out CAN H line and CAN L line to connect to external CAN devices. The CAN bus resistor switch is electrically connected between the CAN H and CAN L circuits of the multi-channel CAN communication port and is connected in parallel with the CAN devices on the CAN bus. Each CAN bus resistor switch integrates a CAN terminating resistor. Users can use the CAN bus resistor switch to adjust the CAN bus resistance value to meet the needs of connecting different numbers of CAN devices.
3. The USB to multi-channel CAN module with adjustable module ID according to claim 2, characterized in that, The multi-channel CAN transceiver is used to convert the TTL signal output by the MCU into a CAN bus differential signal, or to convert the CAN bus differential signal into a TTL signal supported by the MCU. Each of the CAN buses is equipped with a CAN bus resistor switch, which allows users to adjust the bus resistance value to accommodate different numbers of external CAN devices.
4. The USB to multi-channel CAN module with adjustable module ID according to claim 1, characterized in that, The module ID configuration software and hardware module includes: an ID switching dial switch in the hardware layer and a host computer rule file in the software layer; The ID switching dial is electrically connected to the IO pin of the MCU and is used for hardware setting of the ID; The host computer rule file is used to define the mapping relationship between USBID and device name, supporting the host computer to identify and independently call multiple modules in parallel.
5. The USB to multi-channel CAN module with adjustable module ID according to claim 4, characterized in that, The MCU is used to read the N-bit status value of the ID switching dial switch and generate a unique USBID.
6. The USB to multi-channel CAN module with adjustable module ID according to claim 5, characterized in that, The host computer rule file supports multiple platforms. Through the preset "USBID-device name" binding relationship, the host computer can directly call the specific CAN channel of the corresponding module through the device name and channel, without having to call it through the USB port number to which the module is connected.
7. The USB to multi-channel CAN module with adjustable module ID according to claim 4, characterized in that, The USB to multi-channel CAN hardware and software module also includes: supporting software; the supporting software includes: firmware program and multi-platform SDK dynamic library; The firmware program integrates virtual serial port technology, enabling the module to be recognized by the host as a plug-and-play serial port device without the need for additional driver installation.
8. The USB to multi-channel CAN module with adjustable module ID according to claim 7, characterized in that, The firmware program specifically includes: after module initialization, it first detects the state of the ID switching dial switch, and sets its own USB ID according to the state of the ID switching dial switch. This part of the function is implemented in the main function initialization. It adopts a hybrid mode of "USB interrupt reception + main function loop back transmission" to process and transmit data. That is, the USB reception interrupt processes the USB input data in real time and forwards it to CAN, while the main function loops to check the CAN reception flag and transmits the CAN received data back to the USB. When data is sent, when the host computer sends data to the USB communication port, a USB receive interrupt is triggered. In the USB receive interrupt service function, the received USB data is read out, parsed and processed. The MCU sends the processed data to the multi-channel CAN transceiver in the form of a TTL signal. When receiving data, when the multi-channel CAN transceiver transmits a TTL signal to the MCU, the MCU main function cyclically checks the CAN signal reception flag, then reads the data, performs necessary parsing and processing, and finally sends the processed data back to the host computer through the USB communication port.
9. The USB to multi-channel CAN module with adjustable module ID according to claim 1, characterized in that, The dedicated communication protocol is used to directly convert the host computer's USB commands into the CAN bus protocol format, enabling the host computer to directly control external CAN devices.
10. The USB to multi-channel CAN module with adjustable module ID according to claim 9, characterized in that, The protocol frame ID in the dedicated communication protocol is used to identify the data transmission direction; the number of channels in the dedicated communication protocol is used to select the CAN channel; the CAN protocol segment corresponds one-to-one with the CAN protocol frame configuration, including CANID, CAN frame type, data length and specific data, and is used to directly connect to the CAN protocol; the check segment is used to ensure the accuracy of data transmission.
Citation Information
Patent Citations
USB interface conversion module
CN104409090A
FPGA upgrading system and method based on USB-to-SPI conversion
CN111857769A
Multi-serial-port communication control circuit
CN119920212A