The invention provides a
software operation synchronization method and
system based on a dual-
chip architecture, and abandons a traditional mode depending on a UART / SPI / CAN communication protocol or an additional synchronization circuit. Firstly, a unique PWM duty ratio mapping relation with any difference not smaller than 5% is preset for the initial state, the
system self-checking state, the OTA upgrading state, the running state, the fault state, the
dormancy preparation state and other running states of the double-
chip system, and then a
chip A and a chip B continuously output
PWM signals matched with the current states of the chip A and the chip B through common GPIO pins in a push-pull output mode. Meanwhile,
PWM signals of GPIO pins of the opposite side are collected in real time in a bidirectional mode through respective hardware capture units, the duty ratio is analyzed to obtain the state of the opposite side, response operation is executed according to preset logic, synchronization failures caused by communication
delay and data frame error codes of a traditional
software protocol are effectively avoided, the
system stability is guaranteed, meanwhile, a complex
protocol stack does not need to be designed, and the cost is reduced. The
CPU load rate is reduced, an additional
synchronous circuit is omitted, the chip area and
power consumption are reduced, and the hardware cost is reduced.