A circuit system and communication method for parallel cooperation of heterogeneous buses
By configuring processors, resistors and diodes in multi-chip systems, parallel collaborative work of SPI and I2C buses is realized, which solves the problem of heterogeneous buses not being able to work together, improves data rate and sensing accuracy, and reduces system cost and power. Consumption.
Patent Information
- Application Number
- CN202410334951.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-22
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-03-22
AI Technical Summary
In the existing technology, multi-chip systems cannot realize parallel cooperative work of heterogeneous buses due to pin multiplexing, resulting in problems such as high design complexity, high cost, high power consumption, and the inability to work cooperatively in multiple application scenarios.
A heterogeneous bus parallel collaborative circuit system is used, including a processor, N chips, N resistors and N diodes. By configuring the GPIO working mode, the parallel collaborative work of the SPI and I2C buses is realized, and the diodes are used to select the transmission direction. Resistor current limiting enables two-way communication and data differentiation, reducing common mode interference.
It realizes the collaborative work of heterogeneous buses, increases the data rate, suppresses circuit common-mode interference, saves processor pins, reduces system cost and power consumption, and improves sensing accuracy.
Smart Images

Figure CN118227544B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of heterogeneous buses, and in particular relates to a circuit system and a communication method for parallel coordination of heterogeneous buses. Background Art
[0002] As we all know, in order to save chip area and cost, the same pin of most chips will support multiple functions, especially multi-chip modules (MCM), whose pin reuse is more obvious. However, these pins can only work in time-division multiplexing mode, and only one function can be selected in a single application scenario, which further limits the ability of multiple chips and multiple functions to work together. At the same time, in the field of high-precision data acquisition, multi-sensor integration has become an extremely common phenomenon, and the use of multi-sensor parallel and differential operation has also become a necessary means to eliminate common-mode interference and improve sensor performance. Furthermore, buses composed of multiple pins, heterogeneous buses, etc. make it difficult for chips to work together in various application scenarios.
[0003] Existing methods provide methods for different types of (heterogeneous) buses to work in parallel and collaboratively, using a single chip bus, that is, the processor communicates with other chips through a separate bus pin, or multiple slave chips (slave devices) are mounted on the same bus, and multiple devices can only work in time-sharing mode. There are problems such as low pin utilization, large circuit area, and high cost, and it is impossible to achieve parallel collaborative work of heterogeneous buses in the same circuit system. Multiple modes (multiple hardware structures) need to be adopted in hardware to ensure that heterogeneous buses can work in collaboration, which increases the design complexity and requires changes to the circuit structure.
[0004] Therefore, a low-power, low-cost method is urgently needed to solve the problem that chip pin multiplexing causes multiple chips to be unable to work in parallel and multiple functions cannot work together. Summary of the invention
[0005] In order to solve the above technical problems, the present invention provides a circuit system and communication method for parallel collaboration of heterogeneous buses, which can not only realize parallel communication of the same type of buses and improve the data rate, but also suppress common-mode interference in the circuit and improve the sensing accuracy. It can also solve the problem that heterogeneous buses can only work independently, realize the collaborative work of heterogeneous buses, save processor pins, and thus reduce system costs.
[0006] The technical solution adopted by the present invention is: a circuit system of heterogeneous buses in parallel and coordination, including: 1 processor, N chips, N resistors R, and N diodes D.
[0007] The processor is connected to chips 1-N via wires, and includes (2N+3) GPIOs for implementing bus protocol processing, pin input or output switching, assigning values to output pins, and receiving data from input pins.
[0008] Among them, GPIO represents a general-purpose input and output pin, which is configured as an input or output mode according to requirements, and is used to realize communication between at least two heterogeneous buses. The processor receives chip data or the processor sends data to the chip, realizing a two-way communication function.
[0009] The chips 1-N are set according to actual needs and can be any chips, and N represents the number of chips of the same type. The chips 1-N all include CS, SCLK / SCL, SDI / SDA, and SDO pins.
[0010] Among them, CS represents the chip select pin of the chip; SCLK / SCL represents the clock pin of the chip and has a multiplexing function; SDI / SDA represents the data pin of the chip and has a multiplexing function; SDO represents the data pin of the chip.
[0011] The N diodes D1-DN are used to select the working direction of SDI / SDA to realize the unidirectional transmission function; the N resistors R1-RN realize the current limiting function.
[0012] Furthermore, in the circuit system, pins GPIO01, GPIO02 and GPIO03 are respectively connected to CS, SCLK / SCL, SDI / SDA of N chips; diodes D1-DN are respectively located on the wires connecting pin GPIO03 and N chips; pins GPIO11, GPIO21, ... GPION1 correspond to SDI / SDA of chips 1-N respectively, and resistors R1-RN are respectively located on the connecting wires; pins GPIO12, GPIO22, ... GPION2 correspond to SDO of chips 1-N respectively.
[0013] Furthermore, in the circuit system, CS, SCLK, SDI and SDO form an SPI bus, and SCL and SDA form an I2C bus.
[0014] Among them, SCLK represents the SPI bus clock line, SDI represents the SPI bus input data line, SDO represents the SPI bus output data line; SCL represents the I2C bus clock line, SDA represents the I2C bus data line.
[0015] The present invention also provides a circuit communication method for parallel coordination of heterogeneous buses, and the specific steps are as follows:
[0016] S1, the processor selects the SPI or I2C bus of the circuit system for communication according to actual needs, if the SPI bus is selected, it goes to step S2, otherwise it goes to step S3;
[0017] S2. Set the GPIO connected to the chip CS, SCLK, and SDI to output mode, and set the GPIO connected to the SDO of chip 1-N to input mode, output CS to low level, start communication, and then control chip 1-N through the standard SPI bus protocol, set SCLK as the clock signal, and set the value of SDI to 1 / 0 on the falling edge of SCLK. If the processor reads the data of chip 1-N through SPI, the processor will judge SDO1~SDON to 1 / 0 at the same rising edge of the same SCLK clock after m SCLK clock cycles, so as to simultaneously receive the data of chip 1-N. After n SCLK clock cycles, set CS to high level to end communication;
[0018] S3, set the GPIO connected to the chip SCL and SDA to output mode, and when SCL is high, set SDA to low level to start communication, set SCL to the clock signal, set the SDA value to 1 / 0 on the falling edge of SCL, and then use the standard I2C bus protocol to control chips 1-N. If the processor reads the data of chips 1-N through I2C, the processor sets the GPIO connected to the chip SDI to input mode after k SCL clock cycles, and then after q SCL clock cycles, at the same rising edge of the same SCL clock, simultaneously judge SDA1-SDAN to be 1 / 0, so as to simultaneously receive the data of chips 1-N. After p SCL clock cycles, set SDA to high level to end communication;
[0019] Among them, m, n, k, q and p are set to different values according to the different address bit widths and data bit widths of the SPI and I2C buses.
[0020] S4. Based on steps S2-S3, the processor configures the working mode of GPIO to realize the parallel cooperation of SPI and I2C to complete the communication of the circuit system.
[0021] Furthermore, in step S2, when the SPI bus is selected for communication, the processor connects the CS, SCLK, and SDI of N chips respectively through pins GPIO01, GPIO02, and GPIO03, controls chips 1-N to work simultaneously, and chips 1-N are arranged in a differential manner, and the output data SDO1-SDON of chips 1-N have differential characteristics, and the differential data in SDO1~SDON are subtracted in the processor.
[0022] The diode D1-DN works in a forward conduction mode, that is, the processor sets the GPIO connected to SDI to an output mode, and the diode is turned on when the GPIO output is a high level.
[0023] Furthermore, in step S3, when the I2C bus is selected for communication, the processor connects the SCL of N chips through pin GPIO02, controls chips 1-N to work simultaneously, and then provides clocks to all chips through SCL, and sends data to chips 1-N through SDA, and chips 1-N are arranged differentially so that the chip output data changes signs.
[0024] Among them, chips 1~N can also send data to the processor through SDA1~N, so as to realize parallel communication between the processor and chips 1~N; diodes D1-DN work in cutoff mode, that is, the processor sets the GPIO connected to SDI as input, and the diode is not conducting.
[0025] Beneficial effects of the present invention: The system of the present invention comprises: 1 processor, N chips, N resistors R, and N diodes D; the processor can realize parallel collaborative work of SPI and I2C only by configuring the working mode of GPIO, and can realize parallel collaborative work of heterogeneous buses when SPI and I2C buses exist at the same time and have shared pins. The method of the present invention can not only realize parallel communication of the same type of buses and improve the data rate, but also suppress the common mode interference in the circuit and improve the sensing accuracy, and can also solve the problem that heterogeneous buses can only work independently, realize the collaborative work of heterogeneous buses, save the pins of the processor, thereby greatly reducing the system cost and power consumption, while improving the data rate of the system and reducing the common mode interference of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 This is a structural diagram of a circuit system for parallel collaboration of heterogeneous buses of the present invention.
[0027] Figure 2 A flow chart of a circuit communication method for parallel coordination of heterogeneous buses of the present invention
[0028] Figure 3 This is a simplified diagram of the architecture of a circuit system for parallel cooperation of heterogeneous buses in an embodiment of the present invention working in SPI mode.
[0029] Figure 4 It is a simplified diagram of the architecture of a circuit system for parallel cooperation of heterogeneous buses in an embodiment of the present invention working in I2C mode. DETAILED DESCRIPTION
[0030] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0031] like Figure 1 As shown, a circuit system of heterogeneous buses in parallel collaboration of the present invention includes: 1 processor, N chips, N resistors R, and N diodes D.
[0032] The processor is connected to chips 1-N through wires, including (2N+3) GPIOs, which are used to implement bus protocol processing, pin input or output switching, assign values to output pins, and receive data from input pins, thereby realizing the parallel coordination function of heterogeneous buses. The processor can be any MCU, DSP, ARM, FPGA or CPU, etc.
[0033] Among them, GPIO represents a general-purpose input and output pin, which is configured as an input or output mode according to requirements, and is used to realize communication between at least two heterogeneous buses. The processor receives chip data or the processor sends data to the chip, realizing a two-way communication function.
[0034] The chips 1-N are set according to actual needs and can be any chips (including processors), and N represents the number of chips of the same type. The chips 1-N all include CS, SCLK / SCL, SDI / SDA, and SDO pins.
[0035] Among them, CS represents the chip select pin of the chip; SCLK / SCL represents the clock pin of the chip and has a multiplexing function; SDI / SDA represents the data pin of the chip and has a multiplexing function; SDO represents the data pin of the chip.
[0036] The N diodes D1-DN are used to select the working direction of SDI / SDA to realize the unidirectional transmission function
[0037] The N resistors R1-RN implement a current limiting function to avoid the problem that the chip may be burned when the processor switches SDI or SDA.
[0038] In this embodiment, in the circuit system, pins GPIO01, GPIO02 and GPIO03 are respectively connected to CS, SCLK / SCL, SDI / SDA of N chips; diodes D1-DN are respectively located on the wires connecting pin GPIO03 and N chips; pins GPIO11, GPIO21, ... GPION1 correspond to SDI / SDA of chips 1-N respectively, and resistors R1-RN are respectively located on the connecting wires; pins GPIO12, GPIO22, ... GPION2 correspond to SDO of chips 1-N respectively.
[0039] In this embodiment, in the circuit system, CS, SCLK, SDI and SDO form an SPI bus (a data bus), and SCL and SDA form an I2C bus (another data bus).
[0040] Among them, SCLK represents the clock line of the SPI bus, SDI represents the input data line of the SPI bus, and SDO represents the output data line of the SPI bus; SCL represents the clock line of the I2C bus, and SDA represents the data line of the I2C bus (which can realize input or output data in time-sharing).
[0041] The situation where two or more data buses exist on the same chip is called a chip with heterogeneous buses. Figure 1 In the example, chips 1-N are called slave devices, and the processor controls multiple slave devices through SPI or I2C, which is often used to realize the communication function between multiple devices. In the field of Internet of Things, in order to improve the sensing accuracy, multiple sensors (slave devices) can be used to form an array, and then the sensor output data can be summed and averaged to reduce the system interference; further, multiple sensors can be used to form a differential array, and then some sensor output data can be negatively signed and summed and averaged with other sensor output data to reduce the system common mode interference. However, high-performance sensors often integrate multiple data buses, and in order to reduce chip area and cost, there is a phenomenon of pin sharing between multiple data buses, such as Figure 1 Chips 1-N in the example have two buses, SPI and I2C, and the pins of the two buses are shared.
[0042] In this embodiment, if Figure 2 As shown, in order to realize the above-mentioned SPI and I2C parallel collaborative work, the present invention also provides a circuit communication method for parallel collaboration of heterogeneous buses, and the specific steps are as follows:
[0043] S1, the processor selects the SPI or I2C bus of the circuit system for communication according to actual needs, if the SPI bus is selected, it goes to step S2, otherwise it goes to step S3;
[0044] S2. Set the GPIO connected to the chip CS, SCLK, and SDI to output mode, and set the GPIO connected to the SDO of chip 1-N to input mode, output CS to low level, start communication, and then control chip 1-N through the standard SPI bus protocol, set SCLK as the clock signal, and set the value of SDI to 1 / 0 on the falling edge of SCLK. If the processor reads the data of chip 1-N through SPI, the processor will judge SDO1~SDON to 1 / 0 at the same rising edge of the same SCLK clock after m SCLK clock cycles, so as to simultaneously receive the data of chip 1-N. After n SCLK clock cycles, set CS to high level to end communication;
[0045] S3, set the GPIO connected to the chip SCL and SDA to output mode, and when SCL is high, set SDA to low level to start communication, set SCL to the clock signal, set the SDA value to 1 / 0 on the falling edge of SCL, and then use the standard I2C bus protocol to control chips 1-N. If the processor reads the data of chips 1-N through I2C, the processor sets the GPIO connected to the chip SDI to input mode after k SCL clock cycles, and then after q SCL clock cycles, at the same rising edge of the same SCL clock, simultaneously judge SDA1-SDAN to be 1 / 0, so as to simultaneously receive the data of chips 1-N. After p SCL clock cycles, set SDA to high level to end communication;
[0046] Among them, m, n, k, q and p are set to different values according to the address bit width and data bit width of the SPI and I2C buses, and are generally 8.
[0047] S4. Based on steps S2-S3, the processor configures the working mode of GPIO to realize the parallel cooperation of SPI and I2C to complete the communication of the circuit system.
[0048] In this embodiment, in step S2, when the SPI bus is selected for communication, the circuit operates in the SPI mode, and the circuit system architecture is simplified to Figure 3 As shown in the figure, the solid lines represent the pins and signal lines to be worked. The processor connects the CS, SCLK, and SDI of N chips through the pins GPIO01, GPIO02, and GPIO03 respectively, controls chips 1-N to work simultaneously, and chips 1-N are arranged in a differential manner. The output data SDO1-SDON of chips 1-N has a differential characteristic. The differential data in SDO1~SDON are subtracted in the processor to reduce the common-mode interference of the system. Figure 3 The parallel operation of the SPI bus is realized, which can improve the data rate of the system and reduce the common mode interference of the sensor array composed of differentially placed sensor chips 1 to N.
[0049] The diode D1-DN works in a forward conduction mode, that is, the processor sets the GPIO connected to SDI to an output mode, and the diode is turned on when the GPIO output is a high level.
[0050] In this embodiment, in step S3, when the I2C bus is selected for communication, the circuit works in the I2C mode, and the circuit system architecture is simplified as follows: Figure 4As shown in the figure, the solid lines represent the pins and signal lines to be worked. The processor connects the SCL of N chips through pin GPIO02, controls chips 1-N to work simultaneously, and then provides clocks to all chips through SCL, and sends data to chips 1-N through SDA (writes data to the chip). Chips 1-N are arranged differentially (rotated 180°) so that the chip output data changes sign, thereby realizing the differential function and suppressing circuit common-mode interference. Figure 3 The parallel operation of the I2C bus is realized, which can improve the data rate of the system and reduce the common mode interference of the sensor array composed of differentially placed sensor chips 1 to N.
[0051] Among them, chips 1~N can also send data to the processor through SDA1~N (the processor reads the data of the chip), realize parallel communication between the processor and chips 1~N, and improve the communication data rate; diode D1-DN works in cutoff mode, that is, the processor sets the GPIO connected to SDI as input, and the diode is not conducting.
[0052] In summary, the processor can realize SPI and I2C parallel collaborative work only by configuring the working mode of GPIO, and can realize heterogeneous bus parallel collaborative work when SPI and I2C buses exist at the same time and have shared pins. The method of the present invention can not only realize parallel communication of the same type of bus, improve the data rate, and suppress the common mode interference in the circuit, improve the sensing accuracy, but also solve the problem that heterogeneous buses can only work independently, realize heterogeneous bus collaborative work, save processor pins, thereby greatly reducing system cost and power consumption, while improving the data rate of the system and reducing the system common mode interference.
[0053] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the implementation methods of the present invention, and should be understood that the protection scope of the present invention is not limited to such special statements and embodiments. Those skilled in the art can make various other specific variations and combinations that do not deviate from the essence of the present invention based on the technical revelations disclosed by the present invention, and these variations and combinations are still within the protection scope of the present invention.
Claims
1. A circuit system for parallel coordination of heterogeneous buses, comprising: 1 processor, N chips, N resistors R, N diodes D; The processor is connected to chips 1-N via wires, and includes (2N+3) GPIOs for implementing bus protocol processing, pin input or output switching, assigning values to output pins, and receiving data from input pins; Among them, GPIO represents a general purpose input and output pin, which is configured as an input or output mode according to requirements, and is used to realize the communication of at least two heterogeneous buses, the processor receives chip data or the processor sends data to the chip, and realizes a two-way communication function; The chips 1-N are set according to actual needs and can be any chips, and N represents the number of chips of the same type; the chips 1-N all include CS, SCLK / SCL, SDI / SDA, and SDO pins; Among them, CS represents the chip select pin of the chip; SCLK / SCL represents the clock pin of the chip and has a multiplexing function; SDI / SDA represents the data pin of the chip and has a multiplexing function; SDO represents the data pin of the chip; The N diodes D1-DN are used to select the working direction of SDI / SDA to realize the unidirectional transmission function; the N resistors R1-RN realize the current limiting function; In the circuit system, pins GPIO01, GPIO02 and GPIO03 are respectively connected to CS, SCLK / SCL, SDI / SDA of N chips; diodes D1-DN are respectively located on the wires connecting pin GPIO03 and N chips; pins GPIO11, GPIO21, ... GPION1 correspond to SDI / SDA of chips 1-N respectively, and resistors R1-RN are respectively located on the connecting wires; pins GPIO12, GPIO22, ... GPION2 correspond to SDO of chips 1-N respectively; In the circuit system, CS, SCLK, SDI and SDO form an SPI bus, and SCL and SDA form an I2C bus; Among them, SCLK represents the SPI bus clock line, SDI represents the SPI bus input data line, SDO represents the SPI bus output data line; SCL represents the I2C bus clock line, SDA represents the I2C bus data line.
2. A circuit communication method for parallel coordination of heterogeneous buses, applied to a circuit system for parallel coordination of heterogeneous buses as claimed in claim 1, comprising the following specific steps: S1, the processor selects the SPI or I2C bus of the circuit system for communication according to actual needs, if the SPI bus is selected, it goes to step S2, otherwise it goes to step S3; S2. Set the GPIO connected to the chip CS, SCLK, and SDI to output mode, and set the GPIO connected to the SDO of chip 1-N to input mode, output CS to low level, start communication, and then control chip 1-N through the standard SPI bus protocol, set SCLK as the clock signal, and set the value of SDI to 1 / 0 on the falling edge of SCLK. If the processor reads the data of chip 1-N through SPI, the processor will judge SDO1~SDON to 1 / 0 at the same rising edge of the same SCLK clock after m SCLK clock cycles, so as to simultaneously receive the data of chip 1-N. After n SCLK clock cycles, set CS to high level to end communication; S3, set the GPIO connected to the chip SCL and SDA to output mode, and when SCL is high, set SDA to low level to start communication, set SCL to the clock signal, set the SDA value to 1 / 0 on the falling edge of SCL, and then use the standard I2C bus protocol to control chips 1-N. If the processor reads the data of chips 1-N through I2C, the processor sets the GPIO connected to the chip SDA to input mode after k SCL clock cycles, and then after q SCL clock cycles, at the same rising edge of the same SCL clock, simultaneously judge SDA1-SDAN to be 1 / 0, so as to simultaneously receive the data of chips 1-N. After p SCL clock cycles, set SDA to high level to end communication; in, m, n, k, q and p are set to different values according to the address bit width and data bit width of SPI and I2C buses; S4. Based on steps S2-S3, the processor configures the working mode of GPIO to realize the parallel cooperation of SPI and I2C to complete the communication of the circuit system.
3. The circuit communication method for parallel coordination of heterogeneous buses according to claim 2, characterized in that: In the step S2, when the SPI bus is selected for communication, the processor connects the CS, SCLK, and SDI of N chips respectively through the pins GPIO01, GPIO02, and GPIO03, controls chips 1-N to work simultaneously, and chips 1-N are arranged in a differential manner, and the output data SDO1-SDON of chips 1-N have differential characteristics, and the differential data in SDO1-SDON are subtracted in the processor; The diode D1-DN works in a forward conduction mode, that is, the processor sets the GPIO connected to SDI to an output mode, and the diode is turned on when the GPIO output is a high level.
4. The circuit communication method for parallel coordination of heterogeneous buses according to claim 2, characterized in that: In step S3, when the I2C bus is selected for communication, the processor connects the SCL of N chips through the pin GPIO02, controls chips 1-N to work simultaneously, and then provides clocks to all chips through SCL, and sends data to chips 1-N through SDA, and chips 1-N are arranged differentially so that the chip output data changes signs; Among them, chips 1~N can also send data to the processor through SDA1~N, so as to realize parallel communication between the processor and chips 1~N; diodes D1-DN work in cutoff mode, that is, the processor sets the GPIO connected to SDI as input, and the diode is not conducting.
