A latchup immune microcontroller system, comprising a microcontroller, a clock circuit, a power supply circuit, a reset circuit, and an input signal processing circuit, wherein
- the clock circuit comprises a first capacitor, a crystal oscillator, and a second capacitor that are sequentially connected in series to form a series circuit, wherein two ends of the series circuit are connected, a common terminal of the first capacitor and the crystal oscillator is connected to an XTAL1 pin of the microcontroller, a common terminal of the crystal oscillator and the second capacitor is connected to an XTAL2 pin of the microcontroller, and a common terminal of the first capacitor and the second capacitor is connected to a direct-current stabilized power supply at a common ground;
- the power supply circuit comprises the direct-current stabilized power supply and a filter circuit, wherein the filter circuit comprises a third capacitor, a filter inductor, and a fourth capacitor that are sequentially connected in series to form the series circuit, wherein two ends of the series circuit are connected, a common terminal of the third capacitor and the filter inductor is connected as an input terminal of the filter circuit to the direct-current stabilized power supply, a common terminal of the filter inductor and the fourth capacitor is connected as an output terminal of the filter circuit to a VCC pin of the microcontroller, and a common terminal of the third capacitor and the fourth capacitor is connected to a GND pin of the microcontroller and is connected to the direct-current stabilized power supply at the common ground;
- the reset circuit comprises a first-order reset circuit, a power detection circuit, and a discharge circuit, the first-order reset circuit comprises a first reset element and a second reset element, wherein a first end of the first reset element is connected to the direct-current stabilized power supply, a second end of the first reset element is connected to a first end of the second reset element, a second end of the second reset element is connected to the direct-current stabilized power supply at the common ground, the power detection circuit is connected to the discharge circuit by an optocoupler, the power detection circuit comprises a fifth capacitor, a first diode, and a light-emitting diode that is located inside the optocoupler, an anode of the first diode and a cathode of the light-emitting diode are separately connected to a detection power supply, a positive electrode of the fifth capacitor and a cathode of the first diode are separately connected to an anode of the light-emitting diode, a negative electrode of the fifth capacitor is connected to a detection power ground, the discharge circuit comprises a bipolar phototransistor inside the optocoupler and the second reset element in the first-order reset circuit, an emitter of the bipolar phototransistor is connected to the direct-current stabilized power supply at the common ground, a collector of the bipolar phototransistor is connected to a common terminal of the first reset element and the second reset element, the common terminal of the first reset element and the second reset element is further connected to an RST pin of the microcontroller, the common terminal of the first reset element and the second reset element is further connected to an input terminal of a CMOS buffer, and an output terminal of the CMOS buffer is connected to an external interrupt of the microcontroller, wherein the first reset element is a reset resistor, and the second reset element is a reset capacitor, or the first reset element is a reset capacitor, and the second reset element is a reset resistor;
- and
- the input signal processing circuit comprises a first resistor, a second resistor, a sixth capacitor, a third resistor, a fourth resistor, and a comparator, a first end of the first resistor is connected to an input signal, a second end of the first resistor is separately connected to a first end of the second resistor, a first end of the sixth capacitor, and a positive input terminal of the comparator, a second end of the second resistor is connected to the direct-current stabilized power supply, a second end of the sixth capacitor is connected to the direct-current stabilized power supply at the common ground, a first end of the third resistor is connected to the direct-current stabilized power supply, a second end of the third resistor is connected to Jane a first end of the fourth resistor, a second end of the fourth resistor is connected to the ground of the direct-current stabilized power supply, a common terminal of the third resistor and the fourth resistor is connected to a negative input terminal of the comparator and provides a reference voltage, and an output terminal of the comparator is connected to a signal input terminal of the microcontroller.