Software is the soul of the system, starting in the software design, this paper from the system's practicability, reliability, and convenient and flexible aspects, make the program meet the functional requirements of the design. The system software consists of main program and an external interrupt service program, digital Lv Bocheng sequence comparative judgement subroutine and luminous alarm several sub programs. Software using assembly language to write, and the modular design, so as to make the program structure clear, for the future of the further expansion of the system functions.
The main program initialization after the interrupt control EA bit AT89C51, CPU open interrupt. And then through the detection of RAM 30H in numerical value to determine whether the acquisition of reference voltage, if not collected, then start ADC0809 on IN3 channel analog input A/D conversion. In the circuit design, ADC0809 and AT89C51 are connected using interrupt mode, so the data acquisition and processing system is realized in the interrupt service program, see from the principle diagram, ADC0809 EOC AT89C51 INT inverter side through the 1 end as interrupt request. Using interrupt mode, which can greatly save time. CPU software programming allows the AT89C51 external interrupt response 1, and set the the response to edgetriggered. When the A/D conversion is completed, ADC0809 EOC AT89C51 INT1 to an end to an interrupt request signal, AT89C51 signal in response to the interrupt request, call interrupt service subroutine Order INT1 interrupt service program is pushed onto the stack, protect the scene, read from 0809 data output port 8-bit digital and digital content stored in the ram of the MCU, and then start the next ADC0809 conversion. After filtering software, data will be stored in the microcontroller ram 30 h, as a reference voltage.
After repeated experiments measured the sensitivity of delta U value is stored in the monolithic integrated circuit RAM address for 20h memory. In the detection process, collected by the A / D converter voltage signal after filtering software, data stored in the internal RAM to 31h data memory, then this data u and a reference electric pressure were compared, the difference between the two and sensitivity of delta u were compared, to determine whether the alarm.