Search

CN-122019442-A - Signal identification method, SPI communication circuit and computer program product

CN122019442ACN 122019442 ACN122019442 ACN 122019442ACN-122019442-A

Abstract

The invention provides a signal identification method, an SPI communication circuit and a computer program product. The MISO signal line electrically connecting the normal chip and the MISO port of the host is provided with a first resistor, the MISO signal line electrically connecting the abnormal chip and the MISO port is provided with a second resistor, and the resistance values of the first resistor and the second resistor are different. The signal identification method comprises the steps of communicating a host with one of the normal chips according to a selection instruction, receiving a communication signal on a MISO signal line by the host, and determining the communication signal actually sent by the normal chip according to the resistance relation between the first resistor and the second resistor and the received communication signal. It can be seen from this that the interference signal can be effectively identified based on the relationship between the resistance value of the first resistor and the resistance value of the second resistor. The problem that in the prior art, interference signals sent by abnormal chips cannot be identified can be solved, so that smooth and stable communication between a host and a normal chip can be ensured.

Inventors

  • ZHANG ZENGREN
  • SHI JIATAO
  • CHEN NANA
  • XU LONGZENG
  • DU JINJIAN
  • Man Jinru

Assignees

  • 潍柴动力股份有限公司

Dates

Publication Date
20260512
Application Date
20260105

Claims (10)

  1. 1. A signal identification method of an SPI communication circuit is characterized in that the SPI communication circuit comprises a host, a normal chip and an abnormal chip, wherein the host comprises a MISO port, a first resistor is arranged on a MISO signal line electrically connecting the normal chip and the MISO port, a second resistor is arranged on a MISO signal line electrically connecting the abnormal chip and the MISO port, and the resistance values of the first resistor and the second resistor are different; The signal identification method comprises the following steps: The host computer is communicated with one of the normal chips according to the selection instruction; The host receives a communication signal on the MISO signal line; and determining the communication signal actually sent by the normal chip according to the resistance relation between the first resistor and the second resistor and the received communication signal.
  2. 2. The signal recognition method according to claim 1, wherein the step of determining the communication signal actually transmitted by the normal chip based on the resistance relation of the first resistor and the second resistor and the received communication signal further comprises: and determining the condition that the abnormal chip sends the communication signal according to the resistance relation between the first resistor and the second resistor and the received communication signal.
  3. 3. The signal recognition method according to claim 2, wherein the step of determining the communication signal actually transmitted by the normal chip according to the resistance relation of the first resistor and the second resistor and the received communication signal comprises: Determining that the sum of the resistance value of the first resistor and the resistance value of the second resistor is A, the ratio of the resistance value of the first resistor to the A is B, and identifying whether the ratio of a received communication signal to a preset reference high level is greater than or equal to 1-B; And if the ratio of the received communication signal to the reference high level is greater than or equal to 1-B, confirming that the normal chip actually transmits a high level signal.
  4. 4. A signal recognition method according to claim 3, wherein the recognition method further comprises: If the ratio of the received communication signal to the reference high level is greater than 1-B, confirming that the abnormal chip sends a high level signal or does not send any signal; and if the ratio of the received communication signal to the reference high level is equal to 1-B, confirming that the abnormal chip sends a low level signal.
  5. 5. The signal recognition method of claim 3, wherein the step of determining the communication signal actually transmitted by the normal chip according to the resistance relation of the first resistor and the second resistor and the received communication signal comprises: identifying whether a ratio of the received communication signal to the reference high level is less than or equal to the B; and if the ratio of the received communication signal to the reference high level is smaller than or equal to the B, confirming that the normal chip actually transmits a low level signal.
  6. 6. The signal recognition method according to claim 5, wherein the recognition method further comprises: if the ratio of the received communication signal to the reference high level is equal to the B, confirming that the abnormal chip sends a high level signal; And if the ratio of the received communication signal to the reference high level is smaller than the B, confirming that the abnormal chip sends a low level signal or does not send any signal.
  7. 7. An SPI communication circuit for use in a signal recognition method according to any one of claims 1 to 6, comprising: a host including a MISO port; At least two chips, each chip is electrically connected with a MISO port of the host through a MISO signal line, each chip comprises at least one normal chip and at least one abnormal chip, a first resistor is arranged on the MISO signal line for electrically connecting the normal chip with the host, a second resistor is arranged on the MISO signal line for electrically connecting the abnormal chip with the host, and the resistance values of the first resistor and the second resistor are different; And after the host receives the communication signal on the MISO signal, identifying the communication signal actually sent by the normal chip according to the relation between the first resistor and the second resistor.
  8. 8. The SPI communication circuit according to claim 7, wherein a ratio of the values of the first resistor and the second resistor ranges from one fifth to one twentieth.
  9. 9. The SPI communication circuit of claim 7, wherein the host further comprises an SCK port, a MOSI port, and a plurality of CS ports, wherein: each chip is electrically connected with an SCK port of the host through an SCK signal line; each chip is electrically connected with the MOSI of the host through one MOSI signal line; the number of the CS ports is equal to that of the chips, and each chip is electrically connected with one CS port of the host through one CS signal line.
  10. 10. A computer program product, characterized in that it stores a computer program executable by at least one processor to cause the at least one processor to perform a signal recognition method of an SPI communication circuit according to any of claims 1-6.

Description

Signal identification method, SPI communication circuit and computer program product Technical Field The present invention relates to the field of communications technologies, and in particular, to a signal identification method for an SPI communications circuit, and a computer program product. Background In current SPI (SeriBl PeripherBl InterfBce, serial peripheral interface) communications, all communication chips are not initialized in some specific code environments. When the host and the communication chips communicate through the same SPI signal line (such as MISO signal line), the communication chip which is not initialized easily transmits the abnormal interference signal, and the host cannot correctly identify the abnormal interference signal and the normal signal, so that the normal communication between the host and other normal communication chips is affected. Disclosure of Invention In view of the above, embodiments of the present invention are directed to a signal identifying method of an SPI communication circuit, and a computer program product, so as to solve the problem that in the prior art, an interference signal of an abnormal chip cannot be identified, thereby affecting communication between a host and a normal chip. The invention provides a signal identification method of an SPI communication circuit, which comprises a host, a normal chip and an abnormal chip, wherein the host comprises a MISO port, a first resistor is arranged on a MISO signal line electrically connected with the normal chip and the MISO port, a second resistor is arranged on a MISO signal line electrically connected with the abnormal chip and the MISO port, and the resistance values of the first resistor and the second resistor are different; The signal identification method comprises the following steps: The host computer is communicated with one of the normal chips according to the selection instruction; The host receives a communication signal on the MISO signal line; and determining the communication signal actually sent by the normal chip according to the resistance relation between the first resistor and the second resistor and the received communication signal. In one embodiment, the step of determining the communication signal actually sent by the normal chip according to the resistance relation between the first resistor and the second resistor and the received communication signal further includes: and determining the condition that the abnormal chip sends the communication signal according to the resistance relation between the first resistor and the second resistor and the received communication signal. In one embodiment, the step of determining the communication signal actually transmitted by the normal chip according to the resistance relation between the first resistor and the second resistor and the received communication signal includes: Determining that the sum of the resistance value of the first resistor and the resistance value of the second resistor is A, the ratio of the resistance value of the first resistor to the A is B, and identifying whether the ratio of a received communication signal to a preset reference high level is greater than or equal to 1-B; And if the ratio of the received communication signal to the reference high level is greater than or equal to 1-B, confirming that the normal chip actually transmits a high level signal. In one embodiment, the identification method further comprises: If the ratio of the received communication signal to the reference high level is greater than 1-B, confirming that the abnormal chip sends a high level signal or does not send any signal; and if the ratio of the received communication signal to the reference high level is equal to 1-B, confirming that the abnormal chip sends a low level signal. In one embodiment, the step of determining the communication signal actually transmitted by the normal chip according to the resistance relation between the first resistor and the second resistor and the received communication signal includes: identifying whether a ratio of the received communication signal to the reference high level is less than or equal to the B; and if the ratio of the received communication signal to the reference high level is smaller than or equal to the B, confirming that the normal chip actually transmits a low level signal. In one embodiment, the identification method further comprises: if the ratio of the received communication signal to the reference high level is equal to the B, confirming that the abnormal chip sends a high level signal; And if the ratio of the received communication signal to the reference high level is smaller than the B, confirming that the abnormal chip sends a low level signal or does not send any signal. In another aspect, the present invention provides an SPI communication circuit, which is applied to the signal identification method described above, and includes: a host including a MISO port; At leas