Serial port communication method and device between chips, medium and equipment
By performing inter-chip serial port communication handshake when the MCU controller is initialized, the problems of long handshake time and slow communication rate in the prior art are solved, and faster handshake completion and response speed are achieved.
Patent Information
- Application Number
- CN202311021434.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-14
- Publication Date
- 2025-02-21
AI Technical Summary
The prior art only performs inter-chip serial communication handshake after the initialization of the MCU controller in automobiles, resulting in a long handshake time and slow communication rate, making it difficult to meet the requirements of fast response speed and short establishment time.
When the MCU controller is initialized, the main chip monitors whether the slave chip sends a requested handshake signal, and after receiving the requested handshake signal, it sends a response signal to the slave chip so that the slave chip can feedback the handshake signal, thereby completing the master chip and slave chip. communication handshake between them.
By performing inter-chip communication handshakes in advance when the MCU controller is initialized, the handshake completion time is significantly accelerated, the response speed is improved, and the needs of high-real-time controllers are met.
Smart Images

Figure CN119493754A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer communication technology, and in particular to an inter-chip serial communication method, device, medium and equipment. Background Art
[0002] In automobiles, the MCU (Micro Controller Unit) controller has the requirements of fast response speed and short setup time. At present, communication with fast data transmission rate and large data volume can be used, such as Ethernet application, but the process is complicated and the setup time is long. Alternatively, chip serial communication can be used; in this scenario, the handshake logic needs to be processed after the MCU controller is initialized, that is, when the MCU controller is fully started, and then the serial communication handshake between chips is performed. This method has a very slow completion time and communication rate, which is difficult to meet the above requirements. Summary of the invention
[0003] In order to solve the above technical problems, the present disclosure provides a method, device, medium and equipment for serial communication between chips to speed up the handshake time of serial communication between chips.
[0004] The present disclosure provides an inter-chip serial port communication method, comprising:
[0005] When the MCU controller is initialized, the master chip monitors whether the slave chip sends a request handshake signal; wherein the master chip and the slave chip are chips in the MCU controller;
[0006] receiving the request handshake signal sent by the slave chip, and generating a response signal to the slave chip, so that the slave chip feeds back a completion handshake signal;
[0007] The handshake completion signal sent by the slave chip is received to complete the communication handshake between the master chip and the slave chip.
[0008] In some embodiments, the receiving the completion handshake signal sent by the slave chip includes:
[0009] The master chip starts timing with the time of sending the response signal as the starting point, and receives the completion handshake signal sent by the slave chip within a preset first time.
[0010] In some embodiments, after the master chip starts timing with the time of sending the response signal as the starting point, the method further includes:
[0011] In the case that the completion handshake signal is not received within the first time, it is determined that the completion handshake signal feedback has timed out, and the response signal is resent.
[0012] In some embodiments, after determining that the completion handshake signal feedback has timed out, the method further includes:
[0013] Recording the first failure number of completing the handshake signal;
[0014] When the first failure number reaches a preset first number threshold, a first reset instruction is generated; wherein the first reset instruction is used to control the master chip and the slave chip to reset.
[0015] The present disclosure provides an inter-chip serial port communication method, comprising:
[0016] When the MCU controller is initialized, the slave chip sends a request handshake signal to the master chip, so that the master chip feeds back a response signal; wherein the master chip and the slave chip are chips in the MCU controller;
[0017] The response signal sent by the master chip is received, and a handshake completion signal is sent to the master chip to complete the communication handshake between the master chip and the slave chip.
[0018] In some embodiments, the receiving the response signal sent by the master chip includes:
[0019] The slave chip starts timing from the time when the request handshake signal is sent, and receives the response signal sent by the master chip within a preset second time.
[0020] In some embodiments, after the slave chip starts timing from the time when the request handshake signal is sent, the method further includes:
[0021] If the response signal is not received within the second time, it is determined that the response signal feedback has timed out, and the request handshake signal is resent.
[0022] In some embodiments, after determining that the response signal feedback times out, the method further includes:
[0023] Recording the second failure number of the response signal;
[0024] When the second failure number reaches a preset second number threshold, a second reset instruction is generated; wherein the second reset instruction is used to control the master chip and the slave chip to reset.
[0025] The present disclosure provides an inter-chip serial communication device, comprising:
[0026] A signal monitoring module, used for the master chip to monitor whether the slave chip sends a request handshake signal when the MCU controller is initialized; wherein the master chip and the slave chip are chips in the MCU controller;
[0027] A response signal sending module, used for receiving the request handshake signal sent by the slave chip, and sending a response signal to the slave chip, so that the slave chip feeds back a completion handshake signal;
[0028] The first handshake completion module is used to receive the handshake completion signal sent by the slave chip, and complete the communication handshake between the master chip and the slave chip.
[0029] The present disclosure provides an inter-chip serial communication device, comprising:
[0030] A request handshake module is used for sending a request handshake signal from a chip to a master chip when the MCU controller is initialized, so that the master chip feeds back a response signal; wherein the master chip and the slave chip are chips in the MCU controller;
[0031] The second handshake completion module is used to receive the response signal sent by the master chip and send a handshake completion signal to the master chip to complete the communication handshake between the master chip and the slave chip.
[0032] The present disclosure also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a program or instruction, wherein the program or instruction enables a computer to execute the steps of any of the above methods.
[0033] The present disclosure also provides an electronic device, comprising:
[0034] one or more processors;
[0035] A memory for storing one or more programs or instructions;
[0036] The processor is used to execute the steps of any of the above methods by calling the program or instruction stored in the memory.
[0037] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:
[0038] The technical solution provided by the embodiment of the present disclosure is that when the MCU controller is initialized, the master chip monitors whether the slave chip sends a request handshake signal; receives the request handshake signal sent by the slave chip, and sends a response signal to the slave chip, so that the slave chip feeds back a completion handshake signal; receives the completion handshake signal sent by the slave chip, and completes the communication handshake between the master chip and the slave chip. In the above technical solution, when the MCU controller is initialized, the master chip and the slave chip interact with each other for multiple times (such as request handshake signals, response signals, and completion handshake signals), thereby completing the communication handshake between the master chip and the slave chip. The timing of the communication handshake is optimized in the above manner, that is, it is advanced to the time when the MCU controller is initialized, and is no longer limited to the startup time of the entire MUC controller. Compared with the existing method of performing a communication handshake after the MUC controller is initialized and fully started, the technical solution performs initialization and communication handshake at the same time, which can significantly speed up the handshake completion time and improve the response speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0041] Figure 1 A flowchart of an inter-chip serial communication method provided by an embodiment of the present disclosure;
[0042] Figure 2 A handshake interaction schematic diagram provided for an embodiment of the present disclosure;
[0043] Figure 3 Another handshake interaction schematic diagram provided for an embodiment of the present disclosure;
[0044] Figure 4 A structural block diagram of an inter-chip serial communication device provided in an embodiment of the present disclosure;
[0045] Figure 5 A structural block diagram of another inter-chip serial communication device provided in an embodiment of the present disclosure;
[0046] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0047] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0048] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0049] In order to better meet the requirements of fast response speed and short establishment time of the MCU controller in the car, the embodiments of the present disclosure provide a method, device, medium and equipment for serial communication between chips, which performs communication handshake between chips when the MCU controller is initialized, optimizes the timing of communication handshake, and effectively shortens the handshake time and improves the response speed. For ease of understanding, the embodiments of the present disclosure are described in detail below.
[0050] Figure 1 A flowchart of an inter-chip serial communication method provided in an embodiment of the present disclosure. This method is applicable to scenarios in which inter-chip communication needs to be established in a vehicle's MCU controller. The MCU controller may include two chips that require communication handshakes, and the two chips can be divided into a master chip and a slave chip according to their computing performance, with the master chip having higher computing performance than the slave chip. This method can be executed by an inter-chip serial communication device, which can be implemented in software and / or hardware, such as a chip. Figure 1 As shown, the method can be applied to the main chip, including the following steps:
[0051] Step S102, when the MCU controller is initialized, the master chip monitors whether the slave chip sends a request handshake signal; wherein the master chip and the slave chip are chips in the MCU controller.
[0052] In this embodiment, when the MCU controller is initialized, a communication handshake is performed between the master chip and the slave chip. In the handshake process, the master chip and the slave chip are started, and the master chip monitors whether the slave chip sends a request handshake signal; the request handshake signal is specifically an INIT signal.
[0053] Step S104, receiving a request handshake signal sent by the slave chip, and generating a response signal to the slave chip, so that the slave chip feeds back a completion handshake signal.
[0054] In this embodiment, the slave chip sends a request handshake signal to the master chip. After successfully receiving the request handshake signal, the master chip can reply an ACK data as a response signal to the slave chip, and the response signal is specifically an ACKINIT signal.
[0055] After successfully receiving the response signal sent by the master chip, the slave chip may feed back a completion handshake signal to the master chip, such as a COMPLETE signal.
[0056] Step S106, receiving a handshake completion signal sent by the slave chip, and completing the communication handshake between the master chip and the slave chip.
[0057] After the master chip successfully receives the completion handshake signal sent by the slave chip, it determines that the communication handshake between the master chip and the slave chip is completed. Therefore, the master chip and the slave chip can communicate normally through the serial port; serial port communication can be understood as a communication method between the external device and the MCU controller, which can transmit data bit by bit through the chip and data signal lines, ground lines, control lines, etc.
[0058] The inter-chip serial communication method disclosed in the present invention is that when the MCU controller is initialized, the master chip and the slave chip exchange handshake signals, thereby completing the communication handshake between the master chip and the slave chip; the scheme optimizes the timing of the communication handshake, that is, it is advanced to the time when the MCU controller is initialized, and is no longer limited to the startup time of the entire MUC controller. Compared with the existing method of completing the initialization of the MUC controller and then performing the communication handshake after it is fully started, this technical solution performs initialization and communication handshake at the same time, which can significantly speed up the handshake completion time, improve the response speed, and is more suitable for use in high real-time controllers.
[0059] In the process of handshaking communication between the master chip and the slave chip, considering that some signals may time out, in order to ensure communication reliability, this embodiment may provide the following inter-chip serial communication method.
[0060] In this embodiment, there are two situations: a normal handshake and an unsuccessful handshake, which are described in detail below.
[0061] like Figure 2 As shown, in one embodiment, when the MCU controller is initialized, the master chip monitors whether the slave chip sends a request handshake signal.
[0062] The slave chip sends a request handshake signal to the master chip; and the slave chip starts timing from the time of sending the request handshake signal, and starts to monitor whether the master chip sends a response signal to the request handshake signal. The slave chip successfully receives the response signal sent by the master chip within a preset second time (such as 15ms), and determines that it is a normal interaction; in this case, the slave chip feeds back a completion handshake signal to the master chip.
[0063] After the master chip sends a response signal to the slave chip, the master chip starts timing from the time of sending the response signal, and starts to monitor whether the slave chip sends a completion handshake signal for the response signal. The master chip receives the completion handshake signal sent by the slave chip within a preset first time (such as 10ms). The master chip successfully receives the completion handshake signal within the first time and determines it as normal interaction. In this case, the communication handshake is completed normally and successfully between the master chip and the slave chip. In addition, it can be understood that the first time and the second time can be the same or different, and can be flexibly set according to actual applications.
[0064] like Figure 3 As shown, in another embodiment, when the MCU controller is initialized, the master chip monitors whether the slave chip sends a request handshake signal.
[0065] The slave chip sends a request handshake signal to the master chip; and the slave chip starts timing from the time when the request handshake signal is sent, and starts monitoring whether the master chip sends a response signal to the request handshake signal. If the response signal is not received within the second time, it is determined that the response signal feedback has timed out, and the request handshake signal is resent.
[0066] After the slave chip resends the request handshake signal to the master chip, the timing is also started from the time of resending the request handshake signal, and it is determined whether the response signal fed back by the master chip is successfully received within the second time. If the response signal of the master chip is received within the second time, the interaction is determined to be successful; if the response signal is not received within the second time, the request handshake signal is resent again until the response signal fed back by the master chip is successfully received, or until the number of times the request handshake signal is resent reaches a certain value. In this embodiment, when the response signal times out, the reliability of serial port communication between chips can be guaranteed by resending the request handshake signal.
[0067] In one possible implementation, after determining that the response signal feedback has timed out, the second failure number n of the response signal can be recorded; when the second failure number n reaches a preset second number threshold N, a second reset instruction is generated; wherein the second reset instruction is used to control the reset of the master chip and the slave chip.
[0068] The second number threshold N is, for example, 5 times. When the second number of failures n reaches 5 times, it means that multiple resending request handshake signals have failed to successfully obtain feedback. The reason may be that an abnormality occurs in the master chip and / or the slave chip, such as a startup failure. In this case, the slave chip generates a second reset instruction, which can be fed back to the MCU controller, and the MCU controller controls the master chip and the slave chip to reset according to the second reset instruction. After the master chip and the slave chip are reset, the above handshake process is performed again. In the case of a timeout of the response signal, this embodiment limits the second number of failures of the response signal, reduces the number of retransmissions, and minimizes interaction while ensuring the reliability of communication, so as to adapt to lower-level serial port communications; and quickly restores the handshake process by resetting, speeds up the handshake completion time, and better meets the power-on time requirements of the MCU controller.
[0069] According to the above embodiment, by resending the request handshake signal, or resetting the master chip and the slave chip, the master chip successfully sends a response signal to the slave chip. After sending the response signal to the slave chip, the master chip starts timing from the time when the response signal is sent, and starts to monitor whether the slave chip sends a completion handshake signal for the response signal. In this case, this embodiment also includes: if the master chip does not receive the completion handshake signal within the first time, it determines that the completion handshake signal feedback has timed out and resends the response signal.
[0070] After the master chip resends the response signal to the slave chip, the timing is also started from the time of resending the response signal, and it is determined whether the completion handshake signal fed back by the slave chip is successfully received within the first time. If the completion handshake signal from the slave chip is received within the first time, the interaction is determined to be successful; if the completion handshake signal is not received within the first time, the response signal is resent again until the completion handshake signal fed back by the slave chip is successfully received, or until the number of times the response signal is resent reaches a certain value. In this embodiment, when the completion handshake signal times out, the reliability of serial port communication between chips can be ensured by resending the response signal.
[0071] In one possible implementation, after determining that the handshake signal feedback has timed out, the first failure number m of the handshake signal is recorded; when the first failure number reaches a preset first number threshold M, a first reset instruction is generated; wherein the first reset instruction is used to control the reset of the master chip and the slave chip.
[0072] The first number threshold M is, for example, 5 times. When the first number of failures m reaches 5 times, it means that multiple resending of the response signal has failed to successfully obtain feedback. The reason may be that an abnormality occurs in the master chip and / or the slave chip, such as a startup failure. In this case, the master chip generates a first reset instruction, which can be fed back to the MCU controller. The MCU controller controls the master chip and the slave chip to reset according to the first reset instruction. After the master chip and the slave chip are reset, the above handshake process is performed again.
[0073] According to the above embodiment, by resending the response signal or resetting the master chip and the slave chip, the slave chip successfully sends the handshake completion signal to the master chip. In this case, by resending the signal or re-performing the handshake process after the chip is reset, the communication handshake is successfully completed between the master chip and the slave chip.
[0074] In the case of a handshake signal timeout, this embodiment limits the first failure number of the handshake signal to reduce the number of retransmissions, and minimizes interaction while ensuring the reliability of communication, so as to adapt to lower-level serial port communications; and quickly restores the handshake process by resetting, speeds up the handshake completion time, and better meets the power-on time requirements of the MCU controller.
[0075] The inter-chip serial communication method provided in the above embodiment includes: when the MCU controller is initialized, the master chip monitors whether the slave chip sends a request handshake signal; receives the request handshake signal sent by the slave chip, and sends a response signal to the slave chip, so that the slave chip feeds back a completion handshake signal; receives the completion handshake signal sent by the slave chip, and completes the communication handshake between the master chip and the slave chip. In the above technical solution, the initialization of the MCU controller and the communication handshake between the chips are carried out at the same time, which can speed up the handshake completion time; it has been found through actual verification that compared with the existing method of handshaking after initialization, this technical solution can shorten the handshake time from the original 150 milliseconds to 50 milliseconds, and the handshake time is significantly faster, which is more suitable for use in high real-time controllers.
[0076] Corresponding to the above-mentioned inter-chip serial communication method applied to the master chip, the embodiment of the present disclosure also provides an inter-chip serial communication method applied to the slave chip. The method comprises the following steps:
[0077] When the MCU controller is initialized, the slave chip sends a request handshake signal to the master chip, so that the master chip feeds back a response signal; wherein the master chip and the slave chip are chips in the MCU controller;
[0078] Receive the response signal sent by the master chip and send a completion handshake signal to the master chip to complete the communication handshake between the master chip and the slave chip.
[0079] In some embodiments, the step of receiving the response signal sent by the master chip may include: starting timing from the time when the slave chip sends the request handshake signal, and receiving the response signal sent by the master chip within a preset second time.
[0080] In some embodiments, the above method further includes: if the response signal is not received within the second time, determining that the response signal feedback has timed out, and resending the request handshake signal.
[0081] In some embodiments, after determining that the response signal feedback has timed out, the above method also includes: recording a second failure number of the response signal; when the second failure number reaches a preset second number threshold, generating a second reset instruction; wherein the second reset instruction is used to control the reset of the master chip and the slave chip.
[0082] The inter-chip serial communication method provided in the above embodiment includes: when the MCU controller is initialized, a communication handshake is performed between the master chip and the slave chip, and the handshake process includes: the slave chip sends a request handshake signal to the master chip so that the master chip feeds back a response signal; receives the response signal sent by the master chip, and sends a completion handshake signal to the master chip to complete the communication handshake between the master chip and the slave chip. In the above technical solution, the initialization of the MCU controller and the communication handshake between the chips are performed simultaneously, which can speed up the handshake completion time and is more suitable for use in high real-time controllers.
[0083] Corresponding to the inter-chip serial communication method provided in the embodiment of the present disclosure, the embodiment of the present disclosure also provides a method as follows: Figure 4 The inter-chip serial communication method and device shown in the figure can be applied to the main chip. Figure 4 As shown, the inter-chip serial communication device includes:
[0084] The signal monitoring module 202 is used for the master chip to monitor whether the slave chip sends a request handshake signal when the MCU controller is initialized; wherein the master chip and the slave chip are chips in the MCU controller;
[0085] A response signal sending module 204, configured to receive the request handshake signal sent by the slave chip, and send a response signal to the slave chip, so that the slave chip feeds back a completion handshake signal;
[0086] The first handshake completion module 206 is configured to receive the handshake completion signal sent by the slave chip, and complete the communication handshake between the master chip and the slave chip.
[0087] In some embodiments, the response signal sending module 204 is further configured to:
[0088] The master chip starts timing with the time of sending the response signal as the starting point, and receives the completion handshake signal sent by the slave chip within a preset first time.
[0089] In some embodiments, after the main chip starts timing with the time of sending the response signal as the starting point, the response signal sending module 204 is further used to:
[0090] In the case that the completion handshake signal is not received within the first time, it is determined that the completion handshake signal feedback has timed out, and the response signal is resent.
[0091] In some embodiments, after determining that the completion handshake signal feedback has timed out, the apparatus further includes a first data recording module, which is configured to:
[0092] Recording the first failure number of completing the handshake signal;
[0093] When the first failure number reaches a preset first number threshold, a first reset instruction is generated; wherein the first reset instruction is used to control the master chip and the slave chip to reset.
[0094] Corresponding to the inter-chip serial communication method provided in the embodiment of the present disclosure, the embodiment of the present disclosure also provides a method as follows: Figure 5 The inter-chip serial communication method and device shown in the figure can be applied to slave chips. Figure 5 As shown, the inter-chip serial communication device includes:
[0095] The request handshake module 302 is used for sending a request handshake signal from a chip to a master chip when the MCU controller is initialized, so that the master chip feeds back a response signal; wherein the master chip and the slave chip are chips in the MCU controller;
[0096] The second handshake completion module 304 is used to receive the response signal sent by the master chip, and send a handshake completion signal to the master chip to complete the communication handshake between the master chip and the slave chip.
[0097] In some embodiments, the second completion handshake module 304 is further configured to:
[0098] The slave chip starts timing from the time when the request handshake signal is sent, and receives the response signal sent by the master chip within a preset second time.
[0099] In some embodiments, the second completion handshake module 304 is further configured to:
[0100] If the response signal is not received within the second time, it is determined that the response signal feedback has timed out, and the request handshake signal is resent.
[0101] In some embodiments, after determining that the response signal feedback has timed out, the apparatus further includes a second data recording module, which is configured to:
[0102] Recording the second failure number of the response signal;
[0103] When the second failure number reaches a preset second number threshold, a second reset instruction is generated; wherein the second reset instruction is used to control the master chip and the slave chip to reset.
[0104] The inter-chip serial communication device disclosed in the above embodiments can execute the inter-chip serial communication method disclosed in the above embodiments, and has the same or corresponding beneficial effects, which will not be described again to avoid repetition.
[0105] The embodiment of the present disclosure further provides a computer-readable storage medium, which stores a program or instruction, and the program or instruction enables a computer to execute the following steps of any of the above methods:
[0106] When the MCU controller is initialized, the master chip monitors whether the slave chip sends a request handshake signal; wherein the master chip and the slave chip are chips in the MCU controller;
[0107] receiving the request handshake signal sent by the slave chip, and generating a response signal to the slave chip, so that the slave chip feeds back a completion handshake signal;
[0108] The handshake completion signal sent by the slave chip is received to complete the communication handshake between the master chip and the slave chip.
[0109] Alternatively, an embodiment of the present disclosure further provides a computer-readable storage medium, which stores a program or instruction, and the program or instruction enables a computer to execute the following steps of any of the above methods:
[0110] When the MCU controller is initialized, the slave chip sends a request handshake signal to the master chip, so that the master chip feeds back a response signal; wherein the master chip and the slave chip are chips in the MCU controller;
[0111] The response signal sent by the master chip is received, and a handshake completion signal is sent to the master chip to complete the communication handshake between the master chip and the slave chip.
[0112] Optionally, when executed by a computer processor, the computer executable instructions may also be used to execute the technical solution of any of the above-mentioned inter-chip serial port communication methods provided in the embodiments of the present disclosure, thereby achieving corresponding beneficial effects.
[0113] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the embodiments of the present disclosure can be implemented with the help of software and necessary general hardware, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the embodiments of the present disclosure is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment of the present disclosure.
[0114] The embodiment of the present disclosure also provides an electronic device, including: one or more processors; a memory for storing one or more programs or instructions; the processor calls the programs or instructions stored in the memory to execute the steps of any of the above methods to achieve corresponding beneficial effects.
[0115] Figure 6 Schematic diagram of the hardware structure of the electronic device provided by the embodiment of the present disclosure. Figure 6 As shown, the electronic device includes one or more processors 401 and a memory 402 .
[0116] The processor 401 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
[0117] The memory 402 may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, a random access memory (RAM) and / or a cache memory (cache), etc. The non-volatile memory may include, for example, a read-only memory (ROM), a hard disk, a flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 401 may run the program instructions to implement the inter-chip serial communication method of the embodiment of the present disclosure described above, and / or other desired functions. Various contents such as input signals, signal components, noise components, etc. may also be stored in the computer-readable storage medium.
[0118] In one example, the electronic device may further include: an input device 403 and an output device 404, and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).
[0119] In addition, the input device 403 may also include, for example, a keyboard, a mouse, and the like.
[0120] The output device 404 can output various information to the outside, including the determined distance information, direction information, etc. The output device 404 can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.
[0121] Of course, to simplify, Figure 6 Only some of the components related to the present disclosure in the electronic device are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device may further include any other appropriate components.
[0122] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0123] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for serial communication between chips, characterized in that: include: When the MCU controller is initialized, the master chip monitors whether the slave chip sends a request handshake signal; wherein the master chip and the slave chip are chips in the MCU controller; receiving the request handshake signal sent by the slave chip, and generating a response signal to the slave chip, so that the slave chip feeds back a completion handshake signal; The handshake completion signal sent by the slave chip is received to complete the communication handshake between the master chip and the slave chip.
2. The method according to claim 1, characterized in that The receiving the completion handshake signal sent by the slave chip comprises: The master chip starts timing with the time of sending the response signal as the starting point, and receives the completion handshake signal sent by the slave chip within a preset first time.
3. The method according to claim 2, characterized in that After the main chip starts timing with the time of sending the response signal as the starting point, the method further includes: In the case that the completion handshake signal is not received within the first time, it is determined that the completion handshake signal feedback has timed out, and the response signal is resent.
4. The method according to claim 3, characterized in that After determining that the handshake signal feedback is timed out, the method further includes: Recording the first failure number of completing the handshake signal; When the first failure number reaches a preset first number threshold, a first reset instruction is generated; wherein the first reset instruction is used to control the master chip and the slave chip to reset.
5. A method for serial communication between chips, characterized in that: include: When the MCU controller is initialized, the slave chip sends a request handshake signal to the master chip, so that the master chip feeds back a response signal; wherein the master chip and the slave chip are chips in the MCU controller; The response signal sent by the master chip is received, and a handshake completion signal is sent to the master chip to complete the communication handshake between the master chip and the slave chip.
6. The method according to claim 5, characterized in that The receiving the response signal sent by the main chip includes: The slave chip starts timing from the time when the request handshake signal is sent, and receives the response signal sent by the master chip within a preset second time.
7. The method according to claim 6, characterized in that After the slave chip starts timing with the time of sending the request handshake signal as the starting point, the method further includes: If the response signal is not received within the second time, it is determined that the response signal feedback has timed out, and the request handshake signal is resent.
8. The method according to claim 7, characterized in that After determining that the response signal feedback has timed out, the method further includes: Recording the second failure number of the response signal; When the second failure number reaches a preset second number threshold, a second reset instruction is generated; wherein the second reset instruction is used to control the master chip and the slave chip to reset.
9. An inter-chip serial communication device, characterized in that: include: A signal monitoring module, used for the master chip to monitor whether the slave chip sends a request handshake signal when the MCU controller is initialized; wherein the master chip and the slave chip are chips in the MCU controller; A response signal sending module, used for receiving the request handshake signal sent by the slave chip, and sending a response signal to the slave chip, so that the slave chip feeds back a completion handshake signal; The first handshake completion module is used to receive the handshake completion signal sent by the slave chip, and complete the communication handshake between the master chip and the slave chip.
10. An inter-chip serial communication device, characterized in that: include: A request handshake module is used for sending a request handshake signal from a chip to a master chip when the MCU controller is initialized, so that the master chip feeds back a response signal; wherein the master chip and the slave chip are chips in the MCU controller; The second handshake completion module is used to receive the response signal sent by the master chip and send a handshake completion signal to the master chip to complete the communication handshake between the master chip and the slave chip.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program or instruction, and the program or instruction enables a computer to execute the steps of the method according to any one of claims 1 to 8.
12. An electronic device, characterized in that: include: one or more processors; A memory for storing one or more programs or instructions; The processor is used to execute the steps of the method according to any one of claims 1 to 8 by calling the program or instruction stored in the memory.