CN114253196A - Stable and reliable communication method for single chip microcomputer system - Google Patents

Stable and reliable communication method for single chip microcomputer system Download PDF

Info

Publication number
CN114253196A
CN114253196A CN202111586624.2A CN202111586624A CN114253196A CN 114253196 A CN114253196 A CN 114253196A CN 202111586624 A CN202111586624 A CN 202111586624A CN 114253196 A CN114253196 A CN 114253196A
Authority
CN
China
Prior art keywords
mcu
slave
data
host
signal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111586624.2A
Other languages
Chinese (zh)
Inventor
廖锡略
唐丰饶
赵进夫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Yufan Microelectronics Co ltd
Original Assignee
Shenzhen Yufan Microelectronics Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Yufan Microelectronics Co ltd filed Critical Shenzhen Yufan Microelectronics Co ltd
Priority to CN202111586624.2A priority Critical patent/CN114253196A/en
Publication of CN114253196A publication Critical patent/CN114253196A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0423Input/output
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/24Pc safety
    • G05B2219/24215Scada supervisory control and data acquisition

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Communication Control (AREA)

Abstract

The invention provides a stable and reliable communication method of a single chip microcomputer system, and relates to the technical field of single chip microcomputers. A stable and reliable single chip microcomputer system comprises an MCU host, an MCU slave, a timer, an MCU host TXD signal transmitting port and an MCU host RXD signal transmitting port. According to the stable and reliable communication method of the single chip microcomputer system, when the MCU host does not receive the response signal of the MCU slave, different signal ports are automatically switched, so that the effects of diversified communication modes, automatic communication signal switching and strong system stability are achieved. When the MCU host port does not receive data, different serial communication modes are automatically switched at the moment, so that the effect of facilitating communication among different types of single-chip microcomputers by automatically switching the multi-serial communication modes is achieved. The command data of each time is valid only once, and after the execution is finished, the data Bn is invalid, so that extremely low single chip microcomputer resources are occupied when the encrypted data are operated, and the effect that the response speed between single chip microcomputers is influenced by the encrypted data is avoided.

Description

Stable and reliable communication method for single chip microcomputer system
Technical Field
The invention relates to the technical field of single-chip microcomputers, in particular to a stable and reliable communication method of a single-chip microcomputer system.
Background
The single chip microcomputer is an integrated circuit chip, has data processing capacity, has various I/O ports and interrupt systems, and has functions of a timer/a counter and the like, the existing communication mode between the single chip microcomputers is usually connected by using a TX line and a DX line, but the conditions of line disconnection or poor contact can exist if the existing communication mode is too long, so the communication between the two single chip microcomputers can be influenced, the stability of the connection between the single chip microcomputers is reduced, and the encrypted data can be caught and packaged if the single chip microcomputers are not encrypted during communication.
In order to solve the problems, a stable and reliable communication method of a single chip microcomputer system is provided, and the method has the advantages that when the communication between the single chip microcomputers is abnormal, the communication mode is automatically switched to improve the communication stability between the single chip microcomputers, the service life of the single chip microcomputers is prolonged, the encryption calculation amount is low, the occupied single chip microcomputer resources are few, and the response speed between the single chip microcomputers is improved.
Disclosure of Invention
In order to achieve the purpose, the invention provides the following technical scheme: a stable and reliable singlechip system comprises an MCU host, an MCU slave, a timer, an MCU host TXD signal transmitting port, an MCU host RXD signal transmitting port, an MCU slave TXD signal receiving port, an MCU slave RXD signal receiving port, an MCU host communication mode switching end, an MCU slave receiving signal processing end, an MCU slave signal processing end, an MCU host and an MCU slave communication encryption processing end;
MCU host computer: for transmission of data;
MCU slave machine: a receive and execute/reject command for data;
a timer: used for judging whether the command is overtime;
the TXD signal transmission port of the MCU host: for transmitting data;
the MCU host RXD signal transmitting port: for transmitting data;
the MCU slave TXD signal receiving port: for receiving data;
the MCU slave RXD signal receiving port: for receiving data;
MCU host computer communication mode switching end: used for switching the signal transmission mode;
the MCU slave machine receives a signal processing end: for determining the received data signal;
MCU slave machine signal processing end: for processing the received data signal;
the MCU host and the MCU slave communication encryption processing end: and the method is used for judging whether the data is subjected to packet capturing analysis.
A stable and reliable communication method of a single chip microcomputer system comprises the following steps:
s1, the MCU master sends signals to the MCU slave and the MCU master timer accumulates;
s2, the MCU slave machine receives the data signal and makes response to the MCU host machine; and carrying out encryption judgment processing;
s3, judging the received response signal by the MCU host, resetting the timer of the MCU host if the MCU host receives the response signal, normally processing the response signal by the MCU host, and sending a command to the MCU slave; if the response signal is not received after overtime, switching the communication mode between the MCU host and the MCU slave;
s4, sending a command to the MCU slave;
and S5, the MCU slave machine processes the received data signal.
Preferably, the specific step of S1 is: and the MCU host sends data to TXD and RXD receiving ports of the MCU slave through the TXD and RXD sending ports, and in the step, the MCU initial timer clears the MCU to accumulate when the MCU receives the data.
Preferably, the specific step of S2 is: and the MCU host machine receives the response signal sent by the MCU slave machine and then sends the response signal to the MCU host machine.
Preferably, the specific step of S3 is: the MCU host does not receive the response signal, whether the response signal of the MCU slave is received within the time preset by the timer is judged, if the response signal of the MCU slave is not more than the preset time, the MCU host continues to send the signal to the MCU host, if the response signal of the MCU slave is not received within the time larger than the preset time, the MCU host sends data to the port of the MCU host, and if the response signal of the MCU slave is received, the MCU host and the MCU slave are converted into single-wire communication; if the data is not received, the port communication mode is changed into the serial port communication mode.
Preferably, the specific step of S4 is: when the MCU host and the MCU slave are in a single-wire communication mode:
the MCU host port sends data to the MCU slave port, and the MCU slave receives the data and then performs data processing;
the port of the MCU host computer does not send data, at the moment, the MCU host computer switches the port to send data to the MCU slave computer, and the MCU slave computer processes the data after receiving the data;
the MCU slave timer does not receive data within the time, at the moment, a port switching request is sent to the MCU master, at the moment, the port switching request of the MCU master sends data to the MCU slave, and after the MCU slave receives the data, the data processing is carried out;
when the MCU host and the MCU slave are in a serial port communication mode:
the MCU host sends a signal to the MCU slave machine, the timer starts timing at the moment, the MCU slave machine receives the sent signal, and the MCU host machine and the MCU slave machine perform data processing by using a serial port communication mode at the moment;
the MCU slave machine does not receive the sending signal, and the MCU host machine sends the signal again when the sending signal is not more than the preset time of the timer; if the time is longer than the preset time, switching the serial port communication mode between the MCU host and the MCU slave, sending a signal again by the MCU host at the moment, and if the MCU slave receives the sent data, processing the data by using the switched serial port communication mode by the MCU host and the MCU slave at the moment; the MCU slave machine does not receive the sending signal, and the MCU host machine sends the signal again when the sending signal is not more than the preset time of the timer; if the time is longer than the preset time, the serial port communication mode between the MCU host and the slave is switched again at the moment, and the steps are repeated.
Preferably, the specific step of S5 is: the MCU slave machine sends a plurality of groups of response signals Ai to the MCU master machine to inform the MCU master machine of the position Ii of a command of the master machine, the MCU master machine splices command data Ai, then sends a data group Bi to the MCU slave machine, the MCU slave machine analyzes the data group Bi and takes random data Bn in the data group Bi as an execution command, at the moment, the MCU slave machine judges whether the command accords with the execution command or not, and then executes a rejection command or the execution command for the command sent by the MCU master machine.
Compared with the prior art, the invention provides a stable and reliable communication method of a singlechip system, which has the following beneficial effects:
1. according to the stable and reliable single chip microcomputer system communication method, after the MCU host sends data to the MCU slave machine and the MCU host machine does not receive a response signal of the MCU slave machine, the MCU host machine sends data to the port of the MCU host machine, when the port of the MCU host machine receives the data, the MCU host machine and the MCU slave machine are switched into a single-wire communication mode, and when the single-wire communication mode cannot communicate, different signal ports can be automatically switched, so that the effects of diversification of communication modes, automatic communication signal switching and strong system stability are achieved.
2. According to the stable and reliable single chip microcomputer system communication method, multiple serial port communication modes are used between the MCU host and the MCU slave, and can be automatically switched into serial port types, and the multiple serial port communication modes are used, so that communication between different types of single chips is facilitated, and the effect that the multiple serial port communication modes are automatically switched to facilitate communication between different types of single chips is achieved.
3. According to the stable and reliable communication method of the single chip microcomputer system, the MCU slave machine sends a plurality of groups of response signals Ai to the MCU master machine to inform the host machine of the position Ii of a command, when the execution command is finished or the command data is wrong, the mark is cleared of data interaction failure, the data is prevented from being subjected to packet capture analysis, the MCU master machine splices the command data Ai and takes random data Bn in a data group Bi as the execution command, the command data of each time is effective only once, after the execution is finished, the data Bn is invalid, and when the Bn is sent to the MCU slave machine again, the MCU slave machine cannot execute the command, so that the purposes that the encrypted data occupies extremely low single chip microcomputer resources when running are achieved, and the effect that the encrypted data influence the response speed between the single chip microcomputers is avoided.
Drawings
FIG. 1 is a schematic diagram of a single-chip microcomputer system of the present invention;
FIG. 2 is a schematic flow chart of a system of the single chip microcomputer communication mode of the invention;
FIG. 3 is a schematic flow chart of a communication method of a single chip microcomputer according to the present invention;
FIG. 4 is a schematic view of the flow of FIG. 3;
FIG. 5 is a schematic view of the process of FIG. 3 according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the stable and reliable singlechip system communication method is as follows:
the first embodiment is as follows:
referring to fig. 1 to 5, a stable and reliable single chip microcomputer system includes an MCU master, an MCU slave, a timer, an MCU master TXD signal transmitting port, an MCU master RXD signal transmitting port, an MCU slave TXD signal receiving port, an MCU slave RXD signal receiving port, an MCU master communication mode switching port, an MCU slave received signal processing port, an MCU slave signal processing port, an MCU master and an MCU slave communication encryption processing port;
MCU host computer: for transmission of data;
MCU slave machine: a receive and execute/reject command for data;
a timer: used for judging whether the command is overtime;
the TXD signal transmission port of the MCU host: for transmitting data;
the MCU host RXD signal transmitting port: for transmitting data;
the MCU slave TXD signal receiving port: for receiving data;
the MCU slave RXD signal receiving port: for receiving data;
MCU host computer communication mode switching end: used for switching the signal transmission mode;
the MCU slave machine receives a signal processing end: for determining the received data signal;
MCU slave machine signal processing end: for processing the received data signal;
the MCU host and the MCU slave communication encryption processing end: and the method is used for judging whether the data is subjected to packet capturing analysis.
A stable and reliable communication method of a single chip microcomputer system comprises the following steps:
s1, the MCU master sends signals to the MCU slave and the MCU master timer accumulates;
s2, the MCU slave machine receives the data signal and makes response to the MCU host machine; and carrying out encryption judgment processing;
s3, judging the received response signal by the MCU host, resetting the timer of the MCU host if the MCU host receives the response signal, normally processing the response signal by the MCU host, and sending a command to the MCU slave; if the response signal is not received after overtime, switching the communication mode between the MCU host and the MCU slave;
s4, sending a command to the MCU slave;
the specific steps of S1 are: and the MCU host sends data to TXD and RXD receiving ports of the MCU slave through the TXD and RXD sending ports, and in the step, the MCU initial timer clears the MCU to accumulate when the MCU receives the data.
The specific steps of S2 are: the MCU host receives the response signal sent by the MCU slave machine, and then sends the response signal to the MCU host;
the specific steps of S3 are: the MCU host does not receive the response signal, whether the response signal of the MCU slave is received within the time preset by the timer is judged, if the response signal of the MCU slave is not more than the preset time, the MCU host continues to send the signal to the MCU host, if the response signal of the MCU slave is not received within the time larger than the preset time, the MCU host sends data to the port of the MCU host, and if the response signal of the MCU slave is received, the MCU host and the MCU slave are converted into single-wire communication; if the data is not received, the port communication mode is changed into the serial port communication mode.
The specific steps of S4 are: when the MCU host and the MCU slave are in a single-wire communication mode:
the MCU host port sends data to the MCU slave port, and the MCU slave receives the data and then performs data processing;
the port of the MCU host computer does not send data, at the moment, the MCU host computer switches the port to send data to the MCU slave computer, and the MCU slave computer processes the data after receiving the data;
the MCU slave timer does not receive data within the time, at the moment, a port switching request is sent to the MCU master, at the moment, the port switching request of the MCU master sends data to the MCU slave, and after the MCU slave receives the data, the data processing is carried out;
when the MCU host and the MCU slave are in a serial port communication mode:
the MCU host sends a signal to the MCU slave machine, the timer starts timing at the moment, the MCU slave machine receives the sent signal, and the MCU host machine and the MCU slave machine perform data processing by using a serial port communication mode at the moment;
the MCU slave machine does not receive the sending signal, and the MCU host machine sends the signal again when the sending signal is not more than the preset time of the timer; if the time is longer than the preset time, switching the serial port communication mode between the MCU host and the MCU slave, sending a signal again by the MCU host at the moment, and if the MCU slave receives the sent data, processing the data by using the switched serial port communication mode by the MCU host and the MCU slave at the moment; the MCU slave machine does not receive the sending signal, and the MCU host machine sends the signal again when the sending signal is not more than the preset time of the timer; if the time is longer than the preset time, the serial port communication mode between the MCU host and the slave is switched again at the moment, and the steps are repeated.
In steps S1 to S4 of the present embodiment, after the MCU host sends data to the MCU slave and the MCU host does not receive a response signal from the MCU slave, the MCU host sends data to the MCU host port, and when the MCU host port receives data, the MCU host and the MCU slave are switched to a single-wire communication mode.
The MCU host and the MCU slave use various serial port communication modes and can be automatically switched into serial port types, and the communication between different types of single-chip microcomputers is facilitated by using the various serial port communication modes, so that the effect of facilitating the communication between different types of single-chip microcomputers by automatically switching the multi-serial port communication modes is achieved.
Example two:
referring to fig. 5, a stable and reliable single chip microcomputer system includes an MCU master, an MCU slave, a timer, a TXD signal transmitting port of the MCU master, a RXD signal transmitting port of the MCU master, a TXD signal receiving port of the MCU slave, an RXD signal receiving port of the MCU slave, a communication mode switching port of the MCU master, a receiving signal processing port of the MCU slave, a communication encryption processing port of the MCU master and the MCU slave;
MCU host computer: for transmission of data;
MCU slave machine: a receive and execute/reject command for data;
a timer: used for judging whether the command is overtime;
the TXD signal transmission port of the MCU host: for transmitting data;
the MCU host RXD signal transmitting port: for transmitting data;
the MCU slave TXD signal receiving port: for receiving data;
the MCU slave RXD signal receiving port: for receiving data;
MCU host computer communication mode switching end: used for switching the signal transmission mode;
the MCU slave machine receives a signal processing end: for determining the received data signal;
MCU slave machine signal processing end: for processing the received data signal;
the MCU host and the MCU slave communication encryption processing end: and the method is used for judging whether the data is subjected to packet capturing analysis.
A stable and reliable communication method of a single chip microcomputer system comprises the following steps:
s1, the MCU master sends signals to the MCU slave and the MCU master timer accumulates;
s2, the MCU slave machine receives the data signal and makes response to the MCU host machine; and carrying out encryption judgment processing;
s3, judging the received response signal by the MCU host, resetting the timer of the MCU host if the MCU host receives the response signal, normally processing the response signal by the MCU host, and sending a command to the MCU slave; if the response signal is not received after overtime, switching the communication mode between the MCU host and the MCU slave;
s4, sending a command to the MCU slave;
and S5, the MCU slave machine processes the received data signal.
The specific steps of S5 are: the MCU slave machine sends a plurality of groups of response signals Ai to the MCU master machine to inform the MCU master machine of the position Ii of a command of the master machine, the MCU master machine splices command data Ai, then sends a data group Bi to the MCU slave machine, the MCU slave machine analyzes the data group Bi and takes random data Bn in the data group Bi as an execution command, at the moment, the MCU slave machine judges whether the command accords with the execution command or not, and then executes a rejection command or the execution command for the command sent by the MCU master machine.
In step S5, the MCU slave sends multiple sets of response signals Ai to the MCU master to inform the MCU master that the command of the master is located at Ii, when the execution command is finished or the command data is incorrect, the flag will be cleared of data interaction failure, to avoid data being captured and analyzed, the MCU master splices the command data Ai, and takes the random data Bn in the data set Bi as the execution command, each time the command data is valid only once, and after the execution is finished, the data Bn is invalid, and when the data Bn is sent to the MCU slave again, the MCU slave will not execute the command, so that the MCU slave occupies very low resources of the single chip when running the encrypted data, and avoids the encrypted data affecting the response speed between the single chips.
Example three:
referring to fig. 1 to 5, a stable and reliable single chip microcomputer system includes an MCU master, an MCU slave, a timer, an MCU master TXD signal transmitting port, an MCU master RXD signal transmitting port, an MCU slave TXD signal receiving port, an MCU slave RXD signal receiving port, an MCU master communication mode switching port, an MCU slave received signal processing port, an MCU slave signal processing port, an MCU master and an MCU slave communication encryption processing port;
MCU host computer: for transmission of data;
MCU slave machine: a receive and execute/reject command for data;
a timer: used for judging whether the command is overtime;
the TXD signal transmission port of the MCU host: for transmitting data;
the MCU host RXD signal transmitting port: for transmitting data;
the MCU slave TXD signal receiving port: for receiving data;
the MCU slave RXD signal receiving port: for receiving data;
MCU host computer communication mode switching end: used for switching the signal transmission mode;
the MCU slave machine receives a signal processing end: for determining the received data signal;
MCU slave machine signal processing end: for processing the received data signal;
the MCU host and the MCU slave communication encryption processing end: and the method is used for judging whether the data is subjected to packet capturing analysis.
A stable and reliable communication method of a single chip microcomputer system comprises the following steps:
s1, the MCU master sends signals to the MCU slave and the MCU master timer accumulates;
s2, the MCU slave machine receives the data signal and makes response to the MCU host machine; and carrying out encryption judgment processing;
s3, judging the received response signal by the MCU host, resetting the timer of the MCU host if the MCU host receives the response signal, normally processing the response signal by the MCU host, and sending a command to the MCU slave; if the response signal is not received after overtime, switching the communication mode between the MCU host and the MCU slave;
s4, sending a command to the MCU slave;
and S5, the MCU slave machine processes the received data signal.
The specific steps of S1 are: and the MCU host sends data to TXD and RXD receiving ports of the MCU slave through the TXD and RXD sending ports, and in the step, the MCU initial timer clears the MCU to accumulate when the MCU receives the data.
The specific steps of S2 are: the MCU host receives the response signal sent by the MCU slave machine, and then sends the response signal to the MCU host;
the specific steps of S3 are: the MCU host does not receive the response signal, whether the response signal of the MCU slave is received within the time preset by the timer is judged, if the response signal of the MCU slave is not more than the preset time, the MCU host continues to send the signal to the MCU host, if the response signal of the MCU slave is not received within the time larger than the preset time, the MCU host sends data to the port of the MCU host, and if the response signal of the MCU slave is received, the MCU host and the MCU slave are converted into single-wire communication; if the data is not received, the port communication mode is changed into the serial port communication mode.
The specific steps of S4 are: when the MCU host and the MCU slave are in a single-wire communication mode:
the MCU host port sends data to the MCU slave port, and the MCU slave receives the data and then performs data processing;
the port of the MCU host computer does not send data, at the moment, the MCU host computer switches the port to send data to the MCU slave computer, and the MCU slave computer processes the data after receiving the data;
the MCU slave timer does not receive data within the time, at the moment, a port switching request is sent to the MCU master, at the moment, the port switching request of the MCU master sends data to the MCU slave, and after the MCU slave receives the data, the data processing is carried out;
when the MCU host and the MCU slave are in a serial port communication mode:
the MCU host sends a signal to the MCU slave machine, the timer starts timing at the moment, the MCU slave machine receives the sent signal, and the MCU host machine and the MCU slave machine perform data processing by using a serial port communication mode at the moment;
the MCU slave machine does not receive the sending signal, and the MCU host machine sends the signal again when the sending signal is not more than the preset time of the timer; if the time is longer than the preset time, switching the serial port communication mode between the MCU host and the MCU slave, sending a signal again by the MCU host at the moment, and if the MCU slave receives the sent data, processing the data by using the switched serial port communication mode by the MCU host and the MCU slave at the moment; the MCU slave machine does not receive the sending signal, and the MCU host machine sends the signal again when the sending signal is not more than the preset time of the timer; if the time is longer than the preset time, the serial port communication mode between the MCU host and the slave is switched again at the moment, and the steps are repeated.
The specific steps of S5 are: the MCU slave machine sends a plurality of groups of response signals Ai to the MCU master machine to inform the MCU master machine of the position Ii of a command of the master machine, the MCU master machine splices command data Ai, then sends a data group Bi to the MCU slave machine, the MCU slave machine analyzes the data group Bi and takes random data Bn in the data group Bi as an execution command, at the moment, the MCU slave machine judges whether the command accords with the execution command or not, and then executes a rejection command or the execution command for the command sent by the MCU master machine.
In steps S1 to S4 of the present embodiment, after the MCU host sends data to the MCU slave and the MCU host does not receive a response signal from the MCU slave, the MCU host sends data to the MCU host port, and when the MCU host port receives data, the MCU host and the MCU slave are switched to a single-wire communication mode.
The MCU host and the MCU slave use various serial port communication modes and can be automatically switched into serial port types, and the communication between different types of single-chip microcomputers is facilitated by using the various serial port communication modes, so that the effect of facilitating the communication between different types of single-chip microcomputers by automatically switching the multi-serial port communication modes is achieved.
In step S5, the MCU slave sends multiple sets of response signals Ai to the MCU master to inform the MCU master that the command of the master is located at Ii, when the execution command is finished or the command data is incorrect, the flag will be cleared of data interaction failure, to avoid data being captured and analyzed, the MCU master splices the command data Ai, and takes the random data Bn in the data set Bi as the execution command, each time the command data is valid only once, and after the execution is finished, the data Bn is invalid, and when the data Bn is sent to the MCU slave again, the MCU slave will not execute the command, so that the MCU slave occupies very low resources of the single chip when running the encrypted data, and avoids the encrypted data affecting the response speed between the single chips.
Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that changes, modifications, substitutions and alterations can be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.

Claims (7)

1. A reliable and stable single chip microcomputer system is characterized in that: the system comprises an MCU host, an MCU slave, a timer, an MCU host TXD signal transmitting port, an MCU host RXD signal transmitting port, an MCU slave TXD signal receiving port, an MCU slave RXD signal receiving port, an MCU host communication mode switching end, an MCU slave receiving signal processing end, an MCU slave signal processing end, an MCU host and an MCU slave communication encryption processing end;
MCU host computer: for transmission of data;
MCU slave machine: a receive and execute/reject command for data;
a timer: used for judging whether the command is overtime;
the TXD signal transmission port of the MCU host: for transmitting data;
the MCU host RXD signal transmitting port: for transmitting data;
the MCU slave TXD signal receiving port: for receiving data;
the MCU slave RXD signal receiving port: for receiving data;
MCU host computer communication mode switching end: used for switching the signal transmission mode;
the MCU slave machine receives a signal processing end: for determining the received data signal;
MCU slave machine signal processing end: for processing the received data signal;
the MCU host and the MCU slave communication encryption processing end: and the method is used for judging whether the data is subjected to packet capturing analysis.
2. A communication method suitable for the stable and reliable one-chip microcomputer system of claim 1, characterized in that: the method comprises the following steps:
s1, the MCU master sends signals to the MCU slave and the MCU master timer accumulates;
s2, the MCU slave machine receives the data signal and makes response to the MCU host machine; and carrying out encryption judgment processing;
s3, judging the received response signal by the MCU host, resetting the timer of the MCU host if the MCU host receives the response signal, normally processing the response signal by the MCU host, and sending a command to the MCU slave; if the response signal is not received after overtime, switching the communication mode between the MCU host and the MCU slave;
s4, sending a command to the MCU slave;
and S5, the MCU slave machine processes the received data signal.
3. The communication method of the stable and reliable singlechip microcomputer system according to claim 2, characterized in that: the specific steps of S1 are as follows: and the MCU host sends data to TXD and RXD receiving ports of the MCU slave through the TXD and RXD sending ports, and in the step, the MCU initial timer clears the MCU to accumulate when the MCU receives the data.
4. The communication method of the stable and reliable singlechip microcomputer system according to claim 2, characterized in that: the specific steps of S2 are as follows: and the MCU host machine receives the response signal sent by the MCU slave machine and then sends the response signal to the MCU host machine.
5. The communication method of the stable and reliable singlechip microcomputer system according to claim 2, characterized in that: the specific steps of S3 are as follows: the MCU host does not receive the response signal, whether the response signal of the MCU slave is received within the time preset by the timer is judged, if the response signal of the MCU slave is not more than the preset time, the MCU host continues to send the signal to the MCU host, if the response signal of the MCU slave is not received within the time larger than the preset time, the MCU host sends data to the port of the MCU host, and if the response signal of the MCU slave is received, the MCU host and the MCU slave are converted into single-wire communication; if the data is not received, the port communication mode is changed into the serial port communication mode.
6. The communication method of the stable and reliable singlechip microcomputer system according to claim 2, characterized in that: the specific steps of S4 are as follows: when the MCU host and the MCU slave are in a single-wire communication mode:
the MCU host port sends data to the MCU slave port, and the MCU slave receives the data and then performs data processing;
the port of the MCU host computer does not send data, at the moment, the MCU host computer switches the port to send data to the MCU slave computer, and the MCU slave computer processes the data after receiving the data;
the MCU slave timer does not receive data within the time, at the moment, a port switching request is sent to the MCU master, at the moment, the port switching request of the MCU master sends data to the MCU slave, and after the MCU slave receives the data, the data processing is carried out;
when the MCU host and the MCU slave are in a serial port communication mode:
the MCU host sends a signal to the MCU slave machine, the timer starts timing at the moment, the MCU slave machine receives the sent signal, and the MCU host machine and the MCU slave machine perform data processing by using a serial port communication mode at the moment;
the MCU slave machine does not receive the sending signal, and the MCU host machine sends the signal again when the sending signal is not more than the preset time of the timer; if the time is longer than the preset time, switching the serial port communication mode between the MCU host and the MCU slave, sending a signal again by the MCU host at the moment, and if the MCU slave receives the sent data, processing the data by using the switched serial port communication mode by the MCU host and the MCU slave at the moment; the MCU slave machine does not receive the sending signal, and the MCU host machine sends the signal again when the sending signal is not more than the preset time of the timer; if the time is longer than the preset time, the serial port communication mode between the MCU host and the slave is switched again at the moment, and the steps are repeated.
7. The communication method of the stable and reliable singlechip microcomputer system according to claim 2, characterized in that: the specific steps of S5 are as follows: the MCU slave machine sends a plurality of groups of response signals Ai to the MCU master machine to inform the MCU master machine of the position Ii of a command of the master machine, the MCU master machine splices command data Ai, then sends a data group Bi to the MCU slave machine, the MCU slave machine analyzes the data group Bi and takes random data Bn in the data group Bi as an execution command, at the moment, the MCU slave machine judges whether the command accords with the execution command or not, and then executes a rejection command or the execution command for the command sent by the MCU master machine.
CN202111586624.2A 2021-12-23 2021-12-23 Stable and reliable communication method for single chip microcomputer system Pending CN114253196A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111586624.2A CN114253196A (en) 2021-12-23 2021-12-23 Stable and reliable communication method for single chip microcomputer system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111586624.2A CN114253196A (en) 2021-12-23 2021-12-23 Stable and reliable communication method for single chip microcomputer system

Publications (1)

Publication Number Publication Date
CN114253196A true CN114253196A (en) 2022-03-29

Family

ID=80796910

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111586624.2A Pending CN114253196A (en) 2021-12-23 2021-12-23 Stable and reliable communication method for single chip microcomputer system

Country Status (1)

Country Link
CN (1) CN114253196A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112199316A (en) * 2020-10-10 2021-01-08 海尔海斯(西安)控制技术有限公司 Configuration method and communication method of chain type master-slave serial port communication device
CN112363421A (en) * 2020-09-29 2021-02-12 华帝股份有限公司 Stable and reliable communication method for single chip microcomputer system
CN112579509A (en) * 2020-12-14 2021-03-30 珠海格力电器股份有限公司 Single-wire communication method, device, electronic equipment and readable storage medium
CN112632646A (en) * 2020-12-30 2021-04-09 国网河北省电力有限公司物资分公司 Single-chip microcomputer serial port communication encryption method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112363421A (en) * 2020-09-29 2021-02-12 华帝股份有限公司 Stable and reliable communication method for single chip microcomputer system
CN112199316A (en) * 2020-10-10 2021-01-08 海尔海斯(西安)控制技术有限公司 Configuration method and communication method of chain type master-slave serial port communication device
CN112579509A (en) * 2020-12-14 2021-03-30 珠海格力电器股份有限公司 Single-wire communication method, device, electronic equipment and readable storage medium
CN112632646A (en) * 2020-12-30 2021-04-09 国网河北省电力有限公司物资分公司 Single-chip microcomputer serial port communication encryption method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李友全: "《51单片机轻松入门 C语言版 第2版》", 北京:北京航空航天大学出版社, pages: 5 *

Similar Documents

Publication Publication Date Title
CN104317765B (en) A kind of one-to-many communication system and implementation method based on serial communication
CN101692675B (en) Multichannel intelligent data communication processing system
CN105610876A (en) Industrial control type automatic network communication protocol converter and communication protocol conversion method
CN104794089B (en) The method, apparatus and system to be communicated suitable for the modified UART of single-chip microcomputer
EP0418907B1 (en) Frame strip method and apparatus therefor
CN112367313B (en) Message anti-attack method and device
CN103650401B (en) A kind of mobile terminal internal communication method
CN113904762B (en) Full duplex 485 bus communication system with annular buffer zone and method
CN115484047A (en) Method, device, equipment and storage medium for identifying flooding attack in cloud platform
US20200136912A1 (en) Method, Device, and System for Implementing MUX Machine
US8737419B2 (en) Network concentrator and method of controlling the same
CN114253196A (en) Stable and reliable communication method for single chip microcomputer system
CN104536853B (en) A kind of device ensureing dual controller storage device resource continuous availability
CN101241451A (en) Embedded system serial reliable communicating control method
CN101136756B (en) Electric self-checking method, system and BMC chip on network long-range control host machine
CN102831007B (en) Accessing method for real-time processing shared resource in system and real-time processing system
CN101860459A (en) Network device and connection state detecting method thereof
CA2039730A1 (en) No-owner frame and multiple token removal for token ring networks
CN100445973C (en) Method for arbitrating bus control right and its arbitrator
CN111447110A (en) Data monitoring method and system
JPH0728320B2 (en) Digital trunk interface
CN116137603A (en) Link fault detection method and device, storage medium and electronic device
CN202870525U (en) Networked data acquisition apparatus applied to changing environment
CN108476245B (en) Method for establishing port connection and port chip
JPS61224537A (en) Transmission right managing system of ring network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20220329