Serial communication system

By connecting the second branch in parallel to the clock port of the chip and using the clock signal to control the strobe state of the slave device, the problem of data errors caused by clock signal interference is solved and the reliability and user experience of the serial communication system are improved.

CN118550859APending Publication Date: 2024-08-27ZHUHAI PANTUM ELECTRONICS CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410683441.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-29
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

In chip design, clock signal interference leads to data errors in the serial communication system. The main device cannot avoid continuously receiving erroneous data, affecting the normal function of the image forming device.

Method used

By connecting the second branch in parallel to the clock port of the master device, the clock signal is used to control the strobe state of the slave device to avoid data transmission errors caused by clock signal interference, thereby improving communication reliability while saving chip select signal pins.

Benefits of technology

It effectively avoids data errors caused by clock signal interference, reduces the abnormal duration, and improves the reliability and user experience of the communication system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118550859A
    Figure CN118550859A
Patent Text Reader

Abstract

The embodiment of the invention provides a serial communication system, which comprises a master device and a slave device, and is characterized in that a clock port of the master device is electrically connected with a clock port of the slave device through a first branch so as to send a clock signal to the clock port of the slave device according to a preset clock period; the clock port of the master device is electrically connected with the chip selection port of the slave device through the second branch, so that the second branch is controlled to output a first level state according to the clock signal when the clock signal is sent, and the first level state is used for enabling the slave device to be in a gating state when the clock signal is stopped to be sent; controlling the second branch to output a second level state, wherein the second level state is used for enabling the slave device to be in a cut-off state; wherein the chip selection port of the master device is not electrically connected with the chip selection port of the slave device. According to the embodiment of the invention, chip selection signal pins of the SOC are saved, and data transmission errors caused by interference of clock signals can be avoided, so that the condition that the SOC resets the MCU due to continuous detection of abnormities can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a serial communication system. Background Art

[0002] In chip design, in order to save chip manufacturing costs, it is necessary to improve the utilization efficiency of chip pins as much as possible. For example, some pins with low utilization rates can be reduced, or the functions of multiple pins can be reused.

[0003] In the prior art, the system-on-chip (SOC) of the image forming device mostly uses the serial peripheral interface (SPI) communication protocol to communicate with the peripheral MCU chip. SPI communication usually requires the use of four pins, one of which is a chip select signal pin for transmitting the chip select signal SPI_CS. Since the communication between the SOC and the MCU is between a master device and a slave device, and there are no other slave devices, in some chips, the SPI_CS pin of the SOC can be used for other purposes to improve the pin usage efficiency, and the SPI_CS pin of the MCU can be grounded, so that the MCU can always be kept in a strobed state, and the SOC can continue to receive data sent by the MCU.

[0004] However, in the above chip, if the clock signal SPI_CLK is interfered, the data after the error may be all erroneous data (for example, the SOC clock signal sends one more or less pulse, causing the subsequent data received by the SOC from the MCU to fail to pass the verification due to misalignment, and therefore will be considered as erroneous data). The SOC cannot avoid receiving erroneous data by stopping the MCU from being selected, and ultimately the SOC continues to receive erroneous data until the abnormality triggers a forced reset of the MCU. This will prolong the duration of the abnormality, aggravate the consequences of the interference signal, and affect the user's normal use of the image forming device. Summary of the invention

[0005] In view of this, the present application provides a serial communication system, which can save the chip select signal pins of the SOC while avoiding the situation where the master device continues to receive erroneous data due to the interference of the clock signal and the slave device being in the enabled state.

[0006] In a first aspect, an embodiment of the present application provides a serial communication system, including a master device and a slave device, wherein:

[0007] The clock port of the master device is electrically connected to the clock port of the slave device through a first branch, so as to send a clock signal to the clock port of the slave device according to a predetermined clock cycle;

[0008] The clock port of the master device is electrically connected to the chip select port of the slave device through a second branch, so as to control the second branch to output a first level state according to the clock signal when sending the clock signal, and the first level state is used to put the slave device in a gated state, and to control the second branch to output a second level state when stopping sending the clock signal, and the second level state is used to put the slave device in an off state;

[0009] Wherein, the chip select port of the master device is not electrically connected to the chip select port of the slave device.

[0010] In the embodiment of the present application, the first level state and the second level state may also be collectively referred to as a chip select signal.

[0011] In a possible implementation, the first branch includes a delay circuit, the time when the clock signal reaches the slave device is a first time, the time when the first level state reaches the slave device is a second time, and the delay circuit is used to make the first time later than the second time.

[0012] In a possible implementation manner, the delay circuit is an RC delay circuit.

[0013] In the embodiment of the present application, the RC delay circuit includes a resistor R1 and a capacitor C1. Figure 3 As shown, the resistor R1 and the capacitor C1 can not only delay the clock signal, but also filter the clock signal to enhance the driving capability of the clock signal.

[0014] In a possible implementation manner, the difference between the first moment and the second moment meets a preset communication timing requirement.

[0015] In a possible implementation, the second branch includes a transistor, and the transistor is configured to be in an on state according to the clock signal when the master device sends the clock signal, and to be in an off state when the master device stops sending the clock signal.

[0016] In a specific implementation, the user can select a transistor according to the required on-voltage and on-frequency, such as a PNP transistor, an NPN transistor or a triode.

[0017] In a possible implementation, the control end of the transistor is electrically connected to the clock port of the master device and the second end of the transistor, the first end of the transistor is electrically connected to a voltage source and the chip select port of the slave device, and the second end of the transistor is grounded.

[0018] In a possible implementation, the second branch further includes a first resistor, a second resistor and a third resistor, wherein the control end of the transistor is electrically connected to the clock port of the master device through the first resistor, the control end of the transistor is electrically connected to the second end of the transistor through the second resistor, and the first end of the transistor is electrically connected to a voltage source through the third resistor.

[0019] In the embodiment of the present application, the first resistor is the resistor R2 in FIG. 3, the second resistor is the resistor R3 in FIG. 3, the third resistor is the resistor R4 in FIG. 3, and the voltage source is Figure 3 The voltage source VCC in.

[0020] In a possible implementation, the second branch further includes a capacitor, a first end of the capacitor is electrically connected to a connection line between the first end of the transistor and a chip select port of the slave device, and a second end of the capacitor is grounded.

[0021] In the embodiment of the present application, the capacitor is the capacitor C2 in FIG. 3 .

[0022] In a possible implementation, the system further includes a buffer, which is arranged between the master device and the slave device.

[0023] In one possible implementation, the clock port of the master device is electrically connected to the first input terminal of the buffer through the first branch, the clock port of the master device is electrically connected to the second input terminal of the buffer through the second branch, the first output terminal of the buffer is electrically connected to the clock port of the slave device, and the second output terminal of the buffer is electrically connected to the chip select port of the slave device.

[0024] The embodiment of the present application connects a second branch in parallel to the clock port of the master device, and controls the selection of the slave device through the second branch based on the clock signal, so as to save the chip select signal pin of the master device and avoid the situation where the master device continues to receive erroneous data due to interference with the clock signal and the slave device is always in the selected state, thereby improving communication reliability. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0026] Figure 1 A schematic diagram of the circuit structure of a serial communication system between an image forming apparatus and a peripheral device in the prior art;

[0027] Figure 2 A structural block diagram of a serial communication system provided in an embodiment of the present application;

[0028] Figure 3 A schematic diagram of a circuit structure of a serial communication system provided in an embodiment of the present application;

[0029] Figure 4 A schematic diagram of the circuit structure of another serial communication system provided in an embodiment of the present application;

[0030] Figure 5 A schematic diagram of the circuit structure of another serial communication system provided in an embodiment of the present application;

[0031] Figure 6 A control timing diagram of a clock signal and a first state signal provided in an embodiment of the present application;

[0032] Figure 7 A method provided in the embodiment of the present application Figure 6 A magnified schematic diagram of center A. DETAILED DESCRIPTION

[0033] In order to better understand the technical solution of the present application, the embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0034] It should be clear that the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.

[0035] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.

[0036] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0037] It should be understood that in the following description, "circuit" refers to a conductive loop composed of at least one element or subcircuit through electrical connection or electromagnetic connection. When an element or circuit is said to be "connected to" another element or an element / circuit is said to be "connected between" two nodes, it can be directly coupled or connected to another element or there can be an intermediate element, and the connection between the elements can be physical, logical, or a combination thereof. Conversely, when an element is said to be "directly coupled to" or "directly connected to" another element, it means that there is no intermediate element between the two.

[0038] In the present application, a transistor is a transistor that operates in a linear mode to provide a current path, including one selected from a bipolar transistor or a field effect transistor. The first end and the second end of the transistor are respectively a high potential end and a low potential end on the current path, and the control end is used to receive a drive signal to control the voltage drop of the transistor. The transistor can be a P-type MOSFET or an N-type MOSFET. The first end, the second end and the control end of the P-type MOSFET are respectively a source, a drain and a gate, and the first end, the second end and the control end of the N-type MOSFET are respectively a drain, a source and a gate.

[0039] In chip design, in order to save chip manufacturing costs, it is necessary to improve the efficiency of chip pin usage as much as possible. For example, some pins with low usage rates can be reduced, or the functions of multiple pins can be reused. For example, when the image forming device data board SOC communicates with the MCU of other peripheral devices, due to the shortage of SOC resources, the SPI three-wire communication method is generally used, that is, the SPI_CS chip select signal communication is not included.

[0040] See also Figure 1 , is a schematic diagram of the circuit structure of a serial communication system between an image forming apparatus and a peripheral device in the prior art. Figure 1 As shown, the serial communication system includes a SOC arranged on a data board of an image forming device, and an MCU arranged on a peripheral device control panel, wherein the SOC is connected to the MCU through SPI. Specifically, since the serial communication system includes only one master device SOC and one slave device MCU, and there are no other slave devices, during the chip communication process, the SOC can be connected to the MCU through only three pins of SPI: a signal input pin (SPI_MISO pin), a signal output pin (SPI_MOSI pin) and a clock signal pin (SPI_CLK pin), so that the chip select signal pin (SPI_CS pin) of the SOC can be used for other purposes, thereby improving the pin utilization efficiency and saving chip costs. Correspondingly, the SPI_CS pin of the MCU is grounded to keep the MCU always in a strobed state, so that the SOC can continue to receive data sent by the MCU.

[0041] It should be noted that the image forming device of the embodiment of the present application includes but is not limited to a printer, a copier, a fax machine, a multifunctional image making and copying device, an electrostatic printing device and any other similar device.

[0042] But in Figure 1 In a system, if the clock signal SPI_CLK is interfered with, the data after the error may be all erroneous data. For example, if the SOC clock signal sends one more or less pulse, the subsequent data received by the SOC from the MCU cannot pass the verification due to misalignment, and therefore will be considered as erroneous data. In this case, since there is no SPI_CS signal between the SOC and the MCU, the SOC cannot avoid receiving erroneous data by stopping the MCU, which makes the SOC and the MCU always in an abnormal communication state. The SOC continues to receive erroneous data, and eventually the MCU is forced to reset, and the panel of the image forming device flickers, etc. This prolongs the duration of the abnormality, aggravates the consequences of the interference signal, and affects the user's normal use of the image forming device.

[0043] In view of the above problems, an embodiment of the present application provides a serial communication system. The serial communication system connects a second branch in parallel to the clock port of the master device, and controls the gating of the slave device through the second branch based on the clock signal, so that while saving the chip select signal pin of the master device, data transmission errors caused by interference with the clock signal can be avoided, so that the master device resets the slave device due to continuous detection of abnormalities.

[0044] The following is a description with reference to the accompanying drawings.

[0045] See also Figure 2 , is a structural block diagram of a serial communication system provided in an embodiment of the present application. Figure 2As shown, the serial communication system includes a master device 100 and a slave device 200, wherein the master device 100 is provided with a clock port 101, and the slave device 200 is provided with a clock port 201 and a chip select port 202, the clock port 101 of the master device 100 is electrically connected to the clock port 201 of the slave device 200 through a first branch 300, and the clock port 101 of the master device 100 is electrically connected to the chip select port 202 of the slave device 200 through a second branch 400. During the communication process, the clock port 101 on the master device 100 is used to output a clock signal SPI_CLK according to a predetermined clock cycle, and send the clock signal SPI_CLK to the clock port 201 of the slave device 200 through the first branch 300, so that the slave device 200 receives or sends an SPI communication signal according to the clock signal SPI_CLK. At the same time, the clock port 101 of the master device 100 is also used to transmit the clock signal SPI_CLK to the second branch 400, so as to control the second branch 400 to output a first level state to the chip select port 202 of the slave device 200 through the clock signal SPI_CLK, and the first level state is used to put the slave device 200 in a gated state. When the clock port 101 on the master device 100 stops outputting the clock signal SPI_CLK, the second branch 400 outputs a second level state to the chip select port 202 of the slave device 200, and the second level state is used to put the slave device 200 in a cut-off state.

[0046] In the embodiment of the present application, the first level state is 0, and the second level state is 1; or, the first level state is 1, and the second level state is 0. In some embodiments, the level state "1" may also be referred to as a high level, and the level state "0" may also be referred to as a low level. In some embodiments, the first level state and the second level state may also be collectively referred to as a chip select signal SPI_CS.

[0047] The embodiment of the present application sets a parallel control branch (second branch) on the clock signal output branch (first branch), and converts the clock signal into a gating control for the slave device through the control branch, so that the slave device is in a gating state when the master device sends a clock signal, and is in a cut-off state when the master device stops sending the clock signal. In this way, even if there is an interference signal in the clock signal, it will only affect the data reception in this cycle, and the data reception will return to a normal state in the next cycle.

[0048] It should be noted that the chip select port ( Figure 2 ) is not electrically connected to the chip select port 202 of the slave device 200.

[0049] The first branch and the second branch in the embodiment of the present application are described in detail below.

[0050] See also Figure 3, is a schematic diagram of a circuit structure of a serial communication system provided in an embodiment of the present application. Figure 3 As shown, the first branch 300 includes a resistor R1 and a capacitor C1, wherein a first end of the resistor R1 is electrically connected to a clock port 101 of the master device 100, a second end of the resistor R1 is electrically connected to a first end of the capacitor C1, the first end of the capacitor C1 is also electrically connected to a clock port 201 of the slave device 200, and a second end of the capacitor C1 is grounded.

[0051] In practical applications, the resistor R1 and the capacitor C1 form an RC delay circuit for delaying the moment when the clock signal SPI_CLK reaches the clock port 201 of the slave device 200. Specifically, the moment when the clock signal SPI_CLK reaches the clock port 201 of the slave device 200 is the first moment, and the moment when the first level state reaches the chip select port 202 of the slave device 200 is the second moment. The delay circuit is arranged on the first branch 300 to make the first moment later than the second moment, that is, to make the clock signal SPI_CLK reach the slave device 200 later than the first level state, so as to ensure that when the clock signal SPI_CLK reaches the slave device 200, the slave device 200 is in a strobe state, thereby ensuring the accuracy of the SPI communication signal data transmission.

[0052] In a specific implementation, in order to meet the communication timing requirements, the difference between the first moment and the second moment can be set to 160ns, that is, the clock signal SPI_CLK arrives at the slave device 200 160ns later than the first level state. Of course, the user can also set the delayed arrival time of the clock signal SPI_CLK according to their own needs, and the embodiment of the present application does not make specific requirements for this.

[0053] Please continue reading Figure 3 .like Figure 3 As shown, the second branch 400 includes a transistor M, a resistor R2, a resistor R3, a resistor R4 and a capacitor C2, wherein the control end of the transistor M is electrically connected to the clock port 101 of the master device 100 through the resistor R2, the control end of the transistor M is electrically connected to the second end of the transistor M through the resistor R3, the first end of the transistor M is electrically connected to a voltage source VCC through the resistor R4, the first end of the transistor M is electrically connected to the chip select port 202 of the slave device 200, the second end of the transistor M is grounded, the first end of the capacitor C2 is connected to the connection line between the first end of the transistor M and the chip select port 202 of the slave device 200, and the second end of the capacitor C2 is grounded.

[0054] During the communication process, when the control end of the transistor M receives the clock signal SPI_CLK sent by the clock port 101 of the master device 100, the voltage of the control end of the transistor M increases, and the transistor M is turned on. At this time, the voltage of the chip select port 202 of the slave device 200 is pulled down, that is, the first level state is a low level state, and the slave device 200 is in a gated state. When the control end of the transistor M does not receive the clock signal SPI_CLK sent by the clock port 101 of the master device 100, the voltage of the control end of the transistor M decreases, and the transistor M is turned off. At this time, the voltage of the chip select port 202 of the slave device 200 is increased, that is, the second level state is a high level state, and the slave device 200 is in a cut-off state.

[0055] In a possible implementation, the voltage source VCC may be 3.3V.

[0056] The embodiment of the present application controls the conduction of the transistor M through the clock signal, thereby controlling the selection of the slave device. The overall circuit structure is simple, and there is no need to change the program code of the master device and the slave device in the communication system, that is, there is no need to change the original SPI communication logic. The problem of hard reset of the slave device caused by interference with the clock signal can be solved only by the hardware circuit.

[0057] In order to coordinate the working rates between the master device and the slave device, a buffer 500 is further provided between the master device 100 and the slave device 200 in the embodiment of the present application.

[0058] See also Figure 4 , is a schematic diagram of the circuit structure of another serial communication system provided in an embodiment of the present application. Figure 4As shown, the clock port 101 of the master device 100 is electrically connected to the first input end of the buffer 500 through the first branch 300, the clock port 101 of the master device 100 is electrically connected to the second input end of the buffer 500 through the second branch 400, the first output end of the buffer 500 is electrically connected to the clock port 201 of the slave device 200, and the second output end of the buffer 500 is electrically connected to the chip select port 202 of the slave device 200. During the communication process, the clock port 101 of the master device 100 stores the output clock signal SPI_CLK from the first input end to the buffer 500 through the first branch 300, and after being buffered by the buffer 500, sends the clock signal SPI_CLK_Z to the clock port 201 of the slave device 200 through the first output end (the clock signal SPI_CLK_Z is the signal after the clock signal SPI_CLK is buffered by the buffer). And the clock port 101 of the master device 100 also controls the second branch 400 to output the chip select signal SPI_CS by whether to output the clock signal SPI_CLK, and stores it in the buffer 500 through the second input terminal, and after being buffered by the buffer 500, sends the chip select signal SPI_CS_Z to the chip select port 202 of the slave device 200 through the second output terminal (the chip select signal SPI_CS_Z is the signal of the chip select signal SPI_CS after being buffered by the buffer). Specifically, when the clock port 101 of the master device 100 outputs the clock signal SPI_CLK, the chip select signal SPI_CS is in a first level state, and the first level state is used to put the slave device 200 in a gated state. When the clock port 101 of the master device 100 stops outputting the clock signal SPI_CLK, the chip select signal SPI_CS is in a second level state, and the second level state is used to put the slave device 200 in a cut-off state.

[0059] In a specific implementation, the master device 100 also includes a signal output port 102 and a signal input port 103, and the slave device 200 also includes a signal input and output port 203 and a signal output port 204, wherein the signal output port 102 of the master device 100 is electrically connected to the third input terminal of the buffer 500, the third output terminal of the buffer 500 is electrically connected to the signal input port 203 of the slave device 200, the signal output port 204 of the slave device 200 is electrically connected to the fourth input terminal of the buffer 500, and the fourth output terminal of the buffer 500 is electrically connected to the signal input port 103 of the master device 100. When the slave device 200 is selected, the master device 100 outputs the signal SPI_MOSI according to the clock signal SPI_CLK, and obtains the signal SPI_MOSI_Z after being buffered by the buffer 500, and sends the signal SPI_MOSI_Z to the slave device 200. The slave device 200 outputs the signal SPI_MISO_Z according to the signal SPI_MOSI_Z, and obtains the signal SPI_MISO after being buffered by the buffer 500, and sends the signal SPI_MISO to the master device 100.

[0060] In the embodiment of the present application, a buffer is provided between the master device and the slave device, which can coordinate and buffer the high-speed master device and the slow-speed slave device, thereby achieving synchronization of data transmission.

[0061] The serial communication system of the present application is described in detail below in conjunction with specific embodiments.

[0062] See also Figure 5 , is a schematic diagram of the circuit structure of another serial communication system provided in an embodiment of the present application. Figure 5 As shown (for simplicity, Figure 5 Only the circuit structure related to the clock signal is shown in the figure), the voltage source V1 on the data board SOC is used to output the clock signal SPI_CLK, and the on and off of the clock signal is controlled by the switch S1; after the clock signal SPI_CLK passes through the buffer U2A and the RC delay circuit, it is input into the buffer U2B through the a1 port, and is output to the control panel MCU (not shown in the figure) through the b1 port of the buffer U2B to achieve signal delay and enhance the signal driving capability; at the same time, the clock signal SPI_CLK is also input into the signal processing circuit (the second branch), so that the transistor Q1 in the signal processing circuit is in the on state, so that point B is set to a low level, and the low-level signal is input into the buffer U2B through the a2 port, and is output to the control panel MCU through the b2 port of the buffer U2B, thereby generating a low-level valid SPI_CS signal, ensuring the communication relationship between the data board SOC and the control panel MCU.

[0063] In the specific implementation, in order to clearly understand the situation of each signal, the embodiment of the present application electrically connects the clock signal SPI_CLK output by the voltage source V1 to the first input terminal 1 of the oscilloscope 600, electrically connects the clock signal SPI_CLK after the delay circuit to the second input terminal 2 of the oscilloscope 600, electrically connects the clock signal SPI_CLK output by the buffer U2B to the third input terminal 3 of the oscilloscope 600, and electrically connects the chip select signal SPI_CS output by the buffer U2B to the fourth input terminal 4 of the oscilloscope 600. Among them, the control timing of the clock signal SPI_CLK output by the buffer U2B and the chip select signal SPI_CS output by the buffer U2B is as follows: Figure 5 and Figure 6 As shown (the clock signal SPI_CLK output by the voltage source V1 and the clock signal SPI_CLK after delay by the delay circuit have little to do with the specific application of the present application and will not be analyzed for the time being).

[0064] like Figure 5As shown, when the clock signal SPI_CLK exists (that is, when point A is at a high level), the chip select signal SPI_CS will be set to the first level state (that is, point B is at a low level state), and the MCU is enabled. When the clock signal SPI_CLK is sent after the transmission is completed (that is, when point A is at a low level), the chip select signal SPI_CS is set to the second level state (that is, point B is at a high level state), and the MCU stops being enabled. Therefore, even if the clock signal SPI_CLK is disturbed and an error occurs within a certain clock cycle, the erroneous data will stop being received after the clock cycle ends, thereby preventing the SOC from resetting the MCU due to continuous detection of abnormalities.

[0065] Specifically, since one clock cycle includes multiple pulses, when the clock signal SPI_CLK is disturbed, the number of pulses may increase or decrease. At this time, the SOC's received and sent data is abnormal, but after a normal clock cycle, point A is set to a low level, transistor Q1 is not turned on, point B is set to a high level due to the pull-up, and the SPI_CS signal high level is invalid, thus ending the communication between the data board SoC and the control panel MCU. Therefore, even if the received and sent data are disordered, the control panel will not be hard reset due to abnormal communication. At the same time, after the received and sent data is abnormal, communication can be restarted in the next clock cycle and data can be resent, thereby improving the reliability of communication.

[0066] Will Figure 5 After zooming in on A in Figure 6 As shown, the difference between the first moment t1 when the clock signal SPI_CLK is output and the second moment t2 when the first level state is output is Δt, that is, after the first level state reaches the MCU, it takes Δt for the clock signal SPI_CLK to reach the MCU, where Δt satisfies: being greater than the establishment time required by the SPI communication timing.

[0067] The embodiment of the present application, based on the existing circuit, can obtain the chip select signal SPI_CS based on the clock signal SPI_CLK by adding a signal processing circuit (second branch), thereby realizing the transformation of 3-wire communication into 4-wire communication and improving the reliability of communication. In addition, the embodiment of the present application utilizes the original clock signal as the chip select signal, and there is no need to modify the original port configuration, thereby reducing development costs and reducing the difficulty of system maintenance.

[0068] Corresponding to the above embodiment, the embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium may store a program, wherein when the program is running, the device where the computer-readable storage medium is located may be controlled to perform some or all of the steps in the above method embodiment. In a specific implementation, the computer-readable storage medium may be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).

[0069] Corresponding to the above-mentioned embodiment, the embodiment of the present application further provides a computer program product, which includes executable instructions. When the executable instructions are executed on a computer, the computer executes some or all of the steps in the above-mentioned method embodiment.

[0070] In the embodiments of the present application, "at least one" refers to one or more, and "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0071] Those of ordinary skill in the art will appreciate that the various units and algorithm steps described in the embodiments disclosed herein can be implemented in a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0072] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0073] In several embodiments provided in the present application, any function can be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., and other media that can store program codes.

[0074] The above is only a specific implementation of the present application. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. The protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A serial communication system, comprising a master device and a slave device, characterized in that: The clock port of the master device is electrically connected to the clock port of the slave device through a first branch, so as to send a clock signal to the clock port of the slave device according to a predetermined clock cycle; The clock port of the master device is electrically connected to the chip select port of the slave device through a second branch, so as to control the second branch to output a first level state according to the clock signal when sending the clock signal, and the first level state is used to put the slave device in a gated state, and to control the second branch to output a second level state when stopping sending the clock signal, and the second level state is used to put the slave device in an off state; Wherein, the chip select port of the master device is not electrically connected to the chip select port of the slave device.

2. The system according to claim 1, characterized in that The first branch includes a delay circuit, the time when the clock signal reaches the slave device is a first time, the time when the first level state reaches the slave device is a second time, and the delay circuit is used to make the first time later than the second time.

3. The system according to claim 2, characterized in that The delay circuit is an RC delay circuit.

4. The system according to claim 2, characterized in that The difference between the first moment and the second moment meets the preset communication timing requirement.

5. The system according to claim 1, characterized in that The second branch includes a transistor, which is configured to be in a conducting state according to the clock signal when the master device sends the clock signal, and to be in a cut-off state when the master device stops sending the clock signal.

6. The system according to claim 5, characterized in that The control end of the transistor is electrically connected to the clock port of the master device and the second end of the transistor, the first end of the transistor is electrically connected to a voltage source and the chip select port of the slave device, and the second end of the transistor is grounded.

7. The system according to claim 6, characterized in that The second branch also includes a first resistor, a second resistor and a third resistor, wherein the control end of the transistor is electrically connected to the clock port of the master device through the first resistor, the control end of the transistor is electrically connected to the second end of the transistor through the second resistor, and the first end of the transistor is electrically connected to a voltage source through the third resistor.

8. The system according to claim 6, characterized in that The second branch further includes a capacitor, a first end of the capacitor is electrically connected to a connection line between the first end of the transistor and a chip select port of the slave device, and a second end of the capacitor is grounded.

9. The system according to claim 1, characterized in that The system further includes a buffer disposed between the master device and the slave device.

10. The system according to claim 9, characterized in that The clock port of the master device is electrically connected to the first input end of the buffer through the first branch, the clock port of the master device is electrically connected to the second input end of the buffer through the second branch, the first output end of the buffer is electrically connected to the clock port of the slave device, and the second output end of the buffer is electrically connected to the chip select port of the slave device.

Citation Information

Cited By

  • Serial data communication method, electronic equipment, communication system and storage medium

    CN120336239A