method of modularization design, which is the structure
of the main program and subprogram. This designer can
easily debug and modify the program. The program of
control software using C language includes the main
program and the subprogram of signal acquisition, data
processing, hydrogen and water spraying, ignition, backfire
control.
6.1.1. Main program
Main program is the central link in the entire software. It
includes initializing program, starting program, the program
determining and processing engine’s operating conditions.
Initializing program includes the initialization of RAM, special
function register, and I/O port. According to the throttle
position and engine’s speed, the main program judges the
engine’s operating conditions and enters into the corresponding
process automatically.