A control flow of a multi-microcontroller system based on a network bridge, the multi-microcontroller system comprising a master microcontroller and a plurality of slave microcontrollers, wherein the master microcontroller is connected with the plurality of slave microcontrollers respectively via a network bridge, the control flow comprises the following steps:
- step 1:
- initializing the master microcontroller, the network bridge and the plurality of slave microcontrollers;
- step 2:
- inquiring the master microcontroller and the plurality of slave microcontrollers and assigning IDs and addresses to the master microcontroller and the plurality of slave microcontrollers by the network bridge;
- step 3:
- returning the number of the plurality of slave microcontrollers to the master microcontroller and then judging whether the master microcontroller sends a command of data retrieval by the network bridge;
- if so, proceeding with step 4, and if not, returning to step 1;
- step 4:
- analyzing the command sent by the master microcontroller by the network bridge, wherein the command includes a designated ID of one of the plurality of slave microcontrollers and a control command;
- step 5:
- executing the control command on the designated ID of the slave microcontroller;
- and
- step 6:
- receiving a value returned by the slave microcontroller, and returning to step 1 upon the completion of reception;
- wherein a memory interface functions as a data communication interface and an SPI interface functions as a state control interface among the master microcontroller, the network bridge and the slave microcontroller.