Time division multiplexing IO communication bus
Through the CPLD controller gating and Buffer processing of the IO module, the chip select signal line of the SPI bus is reduced, and the differential bus is used to improve the anti-interference ability, which solves the problem of excessive occupation of the existing IO bus chip select signal and achieves high efficiency. , low-cost IO communication.
Patent Information
- Application Number
- CN202410477575.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-19
- Publication Date
- 2024-08-27
AI Technical Summary
When the existing IO bus communicates between multiple IO modules, the chip select signal occupies too many controller ports and backplane bus data lines, resulting in high cost and poor real-time performance.
The slave device is selected through the IO module's own CPLD controller, and after receiving the CLK signal, Buffer processing is performed to delay the output of the chip select signal, which reduces the external chip select data line of the SPI bus and uses a 485 bus controller to convert the single-ended The SPI bus is converted into a differential bus to ensure the accuracy of the strobe moment and communication efficiency.
It reduces the number of communication signal lines between master and slave devices, improves communication efficiency and anti-interference ability, meets the requirements of low cost and high real-time performance, and alleviates the problem of chip select signals occupying ports and data lines.
Smart Images

Figure CN118550862A
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of industrial automation, in particular to a time division multiplexing IO communication bus. Background Art
[0002] IO bus has a wide range of applications in the field of industrial control. Automation devices need to collect some switching input, analog input, switching output, analog output and other operations. The main control CPU module relies on the IO module to realize these operations, and the CPU module and the IO module exchange data through the IO bus. At present, the main buses used for the main processing module to exchange data with multiple IO modules are CAN bus and SPI bus.
[0003] CAN bus is an asynchronous serial bus that supports lossless conflict-free multi-master communication. It is a half-duplex communication. Only one node's data transmission is valid at the same time. When the amount of data changes little, the real-time transmission of important data changes on the CAN bus is high. However, when the amount of data sent is relatively large, it is easy to cause IO bus data frame conflicts.
[0004] The SPI bus is a high-speed, full-duplex, synchronous communication bus. It usually has one master device and one or more slave devices. It requires at least four lines, namely MISO (master input slave output), MOSI (master output slave input), SCLK (clock), and CS (chip select). When there are multiple slave devices, multiple CS signal lines are required, occupying more controller ports. Summary of the invention
[0005] The purpose of the present invention is to provide a time-division multiplexing IO communication bus in order to solve at least one of the above technical problems.
[0006] In the first aspect, an embodiment of the present invention provides a time-division multiplexing IO communication bus, comprising: a CPU module and an IO module; the CPU module and the IO module are communicatively connected via an SPI bus; wherein the SPI bus comprises a MOSI data line, a MISO data line and a CLK clock line; the CPU module is communicatively connected to the SPI bus; the IO module comprises a CPLD controller and an MCU controller; the MOSI data line and the MISO data line are both connected to the MCU controller, the CLK clock line is connected to the CPLD controller, and the CPLD controller is connected to a chip select pin of the MCU controller; the CPLD controller is used to output a chip select signal to the MCU controller based on the number of clock signals sent by the CLK clock line.
[0007] Furthermore, a buffer unit is also provided in the CPLD controller, and the CLK clock line is connected to the buffer unit; the buffer unit is used for delaying the clock signal sent by the CLK clock line.
[0008] Furthermore, the number of the CPU module is one, and it is a master device; the number of the IO module is at least one, and it is a slave device.
[0009] Furthermore, the chip select signal includes a CS signal and a / CS signal; the CS signal is connected to the transmit enable pin of the RS485 transceiver of the IO module, and the / CS signal is connected to the chip select pin of the MCU controller; the CS signal is used to control the output of the RS485 transceiver; and the / CS signal is used to enable the SPI bus of the MCU controller.
[0010] Furthermore, the IO module includes: an input module, an output module, a DC module and an analog module.
[0011] Furthermore, the CPU module and the IO module both use a 485 bus controller to convert the single-ended SPI bus into a differential bus.
[0012] The invention provides a time-division multiplexing IO communication bus. By selecting the slave device through the CPLD controller of the slave IO module itself, the external chip selection data line of the SPI bus is omitted, and the number of communication signal lines between the master and slave devices is greatly reduced. After receiving the CLK signal, the CPLD controller of the slave device first performs buffer processing and then outputs the chip selection signal, so as to ensure that the chip selection signal output by the CPLD controller is later than the rising edge of the CLK signal, so as to ensure that the selection of two slave devices will not occur at the same time when switching the selection. The slave device MCU control can send data for multiple cycles in one communication cycle according to its own capability, so that both the communication requirement and the low cost requirement are met, and the technical problem that the chip selection signal of the existing IO communication bus occupies multiple ports of the controller and occupies multiple data lines of the backplane bus is alleviated. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] In order to more clearly illustrate the implementation methods of the present application or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0014] Figure 1 A schematic diagram of a time division multiplexing IO communication bus provided by an embodiment of the present invention;
[0015] Figure 2 A schematic diagram of cyclic uploading of IO module data provided by an embodiment of the present invention;
[0016] Figure 3 A schematic diagram of cyclic uploading of IO module data within a communication cycle is provided in an embodiment of the present invention.
[0017] In the figure: 10, CPU module, 20, IO module, 21, CPLD controller, 22, MCU controller, 23, buffer unit, 30, SPI bus, 31, MOSI data line, 32, MISO data line, 33, CLK clock line. DETAILED DESCRIPTION
[0018] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0019] Figure 1 Schematic diagram of a time division multiplexing IO communication bus provided according to an embodiment of the present invention. Figure 1 As shown, it includes: a CPU module 10 and an IO module 20; the CPU module 10 and the IO module 20 are connected to each other through a SPI bus 30. The SPI bus 30 includes a MOSI data line 31, a MISO data line 32 and a CLK clock line 33.
[0020] Specifically, Figure 1 As shown, the CPU module 10 is communicatively connected to the SPI bus 30 .
[0021] The IO module 20 includes a CPLD controller 21 and an MCU controller 22 .
[0022] The MOSI data line 31 and the MISO data line 32 are both connected to the MCU controller 22 , the CLK clock line 33 is connected to the CPLD controller 21 , and the CPLD controller 21 is connected to a chip select pin of the MCU controller 22 .
[0023] Specifically, the CPLD controller 21 is used to output a chip selection signal to the MCU controller 22 based on the number of clock signals sent by the CLK clock line 33 .
[0024] Specifically, Figure 1 As shown, there is one CPU module 10, which is a master device; there is at least one IO module 20, which is a slave device.
[0025] Specifically, in the embodiment of the present invention, the chip select signal includes a CS signal and a / CS signal. Figure 1 As shown, the CS signal is connected to the transmit enable pin of the RS485 transceiver of the IO module 20, and the / CS signal is connected to the chip select pin of the MCU controller 22.
[0026] Among them, the CS signal is used to control the output of the RS485 transceiver;
[0027] / CS signal is used to select the SPI bus of the MCU controller.
[0028] Preferably, if Figure 1 As shown, a buffer unit 23 is also provided in the CPLD controller 21, and a CLK clock line 33 is connected to the buffer unit 23;
[0029] The buffer unit 23 is used for delaying the clock signal sent by the CLK clock line 33 .
[0030] In the embodiment of the present invention, the chip select signal of the IO module 20 is controlled by the CPLD controller 21 inside the IO module 20. After the CLK signal enters the CPLD controller 21 of the IO module 20, it is first buffered and then the chip select signal is output. The CLK signal is delayed by the CPLD to ensure that the chip select signal output by the CPLD controller 21 is later than the rising edge of the CLK signal, so as to ensure that the two IO modules will not be selected at the same time at the time of switching the selection; the CPLD controller 21 simultaneously outputs the CS signal and the / CS signal to control the RS485 transceiver and the MCU controller 22, and double selection is performed to ensure the accuracy of the selection signal.
[0031] In the embodiment of the present invention, all IO modules 20 have fixed addresses and can automatically identify their own communication addresses, ensuring that the addresses of each IO module 20 in the entire device are unique.
[0032] Preferably, the CPU module 10 and the IO module 20 both use a 485 bus controller to convert the single-ended SPI bus into a differential bus to improve the anti-interference capability.
[0033] Preferably, the IO module 20 includes: a digital input module, a digital output module, a DC module and an analog module, and can collect signals such as digital input, DC, temperature, AC voltage and current, as well as digital output.
[0034] Figure 2 1 is a schematic diagram of cyclic uploading of IO module data according to an embodiment of the present invention. Figure 2As shown, within a specified communication time period, each IO module sends data to the master device CPU module in sequence without gaps. After all the data is sent, each slave device sends data again in sequence after a certain delay.
[0035] Figure 3 1 is a schematic diagram of cyclic uploading of IO module data within a communication cycle provided by an embodiment of the present invention. Figure 3 As shown, the IO module MCU controller itself is insufficient. In one communication cycle, the IO module divides the uploaded data into several parts, and each IO module uploads one of the parts in turn, and the uploads are cyclically sent until all the parts are sent.
[0036] Taking the requirements of the power system relay protection device as an example, the IO module switch input change must be able to mark the 1ms time difference, that is, the time difference between different modules must be less than 1ms. For reliable identification, the time difference between each IO module is controlled at 0.5ms. That is, the time for each IO module to send a round is 0.5ms. Assuming that the communication rate of the communication IO bus is 2Mbps, the number of IO modules is 10, and each IO module sends 8 bytes, then the IO module sending time is 320us, and the waiting time Wait is 180us.
[0037] As can be seen from the above description, the embodiment of the present invention provides a time-division multiplexing IO communication bus, which enables the slave device by the CPLD controller of the IO module itself, thereby eliminating the external chip select data line of the SPI bus, greatly reducing the number of communication signal lines between the master and slave devices; the CPLD controller of the slave device first performs buffer processing after receiving the CLK signal, and then outputs the chip select signal to ensure that the chip select signal output by the CPLD controller is later than the rising edge of the CLK signal, so as to ensure that the two slave devices will not be enabled at the same time when switching the enable; the slave device MCU control can send data multiple times in a communication cycle according to its own capabilities, which not only meets the communication requirements, but also meets the low cost requirements, and alleviates the technical problem that the chip select signal of the existing IO communication bus occupies multiple ports of the controller and occupies multiple data lines of the backplane bus.
[0038] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
[0039] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.
Claims
1. A time division multiplexing IO communication bus, characterized in that: include: CPU module and IO module; the CPU module and the IO module are connected to each other through an SPI bus communication; wherein the SPI bus includes a MOSI data line, a MISO data line and a CLK clock line; The CPU module is communicatively connected with the SPI bus; The IO module includes a CPLD controller and an MCU controller; The MOSI data line and the MISO data line are both connected to the MCU controller, the CLK clock line is connected to the CPLD controller, and the CPLD controller is connected to a chip select pin of the MCU controller; The CPLD controller is used to output a chip select signal to the MCU controller based on the number of clock signals sent by the CLK clock line.
2. The time division multiplexing IO communication bus according to claim 1, characterized in that: A buffer unit is also provided in the CPLD controller, and the CLK clock line is connected to the buffer unit; The buffer unit is used to delay the clock signal sent by the CLK clock line.
3. The time division multiplexing IO communication bus according to claim 1, characterized in that: The number of the CPU module is one, and it is a master device; the number of the IO module is at least one, and it is a slave device.
4. The time division multiplexing IO communication bus according to claim 1, characterized in that: The chip select signal includes a CS signal and a / CS signal; the CS signal is connected to the transmit enable pin of the RS485 transceiver of the IO module, and the / CS signal is connected to the chip select pin of the MCU controller; The CS signal is used to control the output of the RS485 transceiver; The / CS signal is used to enable the SPI bus of the MCU controller.
5. The time division multiplexing IO communication bus according to claim 1, characterized in that: The IO modules include: an input module, an output module, a DC module and an analog module.
6. The time division multiplexing IO communication bus according to claim 1, characterized in that: The CPU module and the IO module both use a 485 bus controller to convert the single-ended SPI bus into a differential bus.
