CN209388150U - A kind of port AD self-checking circuit, single-chip microcontroller and the water heater of single-chip microcontroller - Google Patents

A kind of port AD self-checking circuit, single-chip microcontroller and the water heater of single-chip microcontroller Download PDF

Info

Publication number
CN209388150U
CN209388150U CN201920031964.0U CN201920031964U CN209388150U CN 209388150 U CN209388150 U CN 209388150U CN 201920031964 U CN201920031964 U CN 201920031964U CN 209388150 U CN209388150 U CN 209388150U
Authority
CN
China
Prior art keywords
port
self
chip microcontroller
circuit
checking
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201920031964.0U
Other languages
Chinese (zh)
Inventor
卢金山
钟智艺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ALLIED CONTROL SYSTEM Co
Original Assignee
ALLIED CONTROL SYSTEM Co
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ALLIED CONTROL SYSTEM Co filed Critical ALLIED CONTROL SYSTEM Co
Priority to CN201920031964.0U priority Critical patent/CN209388150U/en
Application granted granted Critical
Publication of CN209388150U publication Critical patent/CN209388150U/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Analogue/Digital Conversion (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

The utility model is suitable for singlechip technology field, provide the port AD self-checking circuit, single-chip microcontroller and the water heater of a kind of single-chip microcontroller, it is intended to solve the problems, such as how the converter of single-chip microcontroller, AD censor key realize self-checking function.A kind of port AD self-checking circuit of single-chip microcontroller, comprising: the converter detection sub-circuit being connected between the detection port and the first control port;The AD censor key detection sub-circuit being connected between any port AD to be detected and the second control port.Low level, high level and the reference voltage that the utility model is exported by the first control port on single-chip microcontroller, the level provided between low level and high level gives detection port, whether the analog-to-digital conversion for testing converter is normal, realizes and carries out self-test to the converter that single-chip microcontroller carries;Whether it is switched on the port AD by the channel AD that the second control port exports low level and high level detection single-chip microcontroller, realizes and self-test is carried out to AD censor key.

Description

A kind of port AD self-checking circuit, single-chip microcontroller and the water heater of single-chip microcontroller
Technical field
The utility model belongs to the port AD self-checking circuit, the monolithic of singlechip technology field more particularly to a kind of single-chip microcontroller Machine and water heater.
Background technique
AD conversion (Analog-to-Digital Convert) is exactly analog-to-digital conversion.It as its name suggests, is exactly analog signal It is converted into digital signal, includes mainly integral form, successive approximation, compare type/serial parallel type, sigma-delta modulation type, capacitor parallel Array gradually compares type and voltage to frequency conversion type.Converter is used to that analog quantity is changed into digital quantity by certain circuit.Mould Analog quantity can be the electric signals such as voltage, electric current, be also possible to the non-electrical signals such as pressure, temperature, humidity, displacement, sound.But in AD Before conversion, various physical quantitys must be converted into voltage signal through various sensors by the input signal for being input to converter.
Single-chip microcontroller (Microcontroller Unit, MCU) in the prior art has the function of AD, but does not have AD conversion The self-checking function of device, AD censor key, converter, AD censor key self-checking function usually rely on periphery circuit or Equipment realizes detection, causes entire circuit more complicated, higher cost, and the circuit due to realizing detection or equipment are peripheral hardwares , the requirement of AD self-test can be unable to satisfy.
Utility model content
The utility model provides a kind of port the AD self-checking circuit of single-chip microcontroller, it is intended to solve converter, the AD of single-chip microcontroller The problem of how realizing self-checking function of censor key.
The utility model is realized in this way a kind of port the AD self-checking circuit of single-chip microcontroller, it is provided on the single-chip microcontroller The port AD and control port, the port AD include detection port and several ports AD to be detected, and the control port includes the One control port and the second control port, which is characterized in that the port AD self-checking circuit includes:
The converter detection sub-circuit being connected between the detection port and the first control port;
The AD censor key detection sub-circuit being connected between any port AD to be detected and the second control port.
Further, the port AD self-checking circuit further includes the pressure stabilizing son electricity being connected between microcontroller power supply and ground Road.
Further, the pressure stabilizing sub-circuit includes one end connection microcontroller power supply, the first capacitor of other end ground connection.
Further, which is characterized in that the converter detects sub-circuit and includes:
The current limliting module of third level signal between high level and low level is provided;
Filter module for stable level signal.
Further, the current limliting module includes:
The first resistor of one end connection microcontroller power supply;
Cathode connects the zener diode of the first resistor other end, plus earth;
One end is connected on the connecting line between the first resistor and the zener diode, and the other end connects the filter The second resistance of wave module.
Further, the filter module includes:
It is connected to 3rd resistor between the port to be detected and the first control port;
One end is connected on the connecting line between the port to be detected and the 3rd resistor, other end ground connection first Capacitor.
Further, AD censor key detection sub-circuit include be connected in any port AD to be detected with The 4th resistance between second control port.
Further, the AD censor key detection sub-circuit further includes that cathode connects microcontroller power supply, anode even Connect the first diode on the connecting line between the 4th resistance and second control port.
The utility model also provides a kind of single-chip microcontroller, including the above-mentioned port AD self-checking circuit.
The utility model also provides a kind of water heater, including the above-mentioned port AD self-checking circuit.
In the port the AD self-checking circuit of single-chip microcontroller provided by the embodiment of the utility model, due in detection port and the first control Converter detection sub-circuit, AD have been separately connected between port processed, between any port AD to be detected and the second control port Censor key detects sub-circuit, realizes converter and carries out self-test and the progress self-test of AD censor key.Pass through monolithic Low level, high level and the reference voltage of the first control port output on machine, are provided between low level and high level Level gives detection port, and whether the analog-to-digital conversion for testing converter is normal, realizes and carries out certainly to the converter that single-chip microcontroller carries Inspection;Whether it is switched on the port AD by the channel AD that the second control port exports low level and high level detection single-chip microcontroller, it is real Self-test now is carried out to AD censor key.
Detailed description of the invention
Fig. 1 is the port the AD self-checking circuit block diagram for the single-chip microcontroller that the utility model embodiment one provides;
Fig. 2 is the port the AD self-checking circuit figure for the single-chip microcontroller that the utility model embodiment two to eight provides.
Specific embodiment
In order to make the purpose of the utility model, technical solutions and advantages more clearly understood, below in conjunction with attached drawing and implementation Example, the present invention will be further described in detail.It should be appreciated that specific embodiment described herein is only used to explain The utility model is not used to limit the utility model.
The utility model embodiment provides a kind of port the AD self-checking circuit of single-chip microcontroller, comprising: is connected to detection port Converter between the first control port detects sub-circuit, and is connected to any port AD to be detected and the second control terminal AD censor key between mouthful detects sub-circuit.It is defeated by the first control port on single-chip microcontroller that converter detects sub-circuit Low level, high level and reference voltage out, the level provided between low level and high level give detection port, and test is single Whether the analog-to-digital conversion of the converter of piece machine is normal, realizes converter self-test;AD censor key detects in sub-circuit, leads to Whether the channel AD for crossing the second control port output low level and high level detection single-chip microcontroller is switched on the port AD, realizes that AD is logical Road switch self-test.
Embodiment one
The utility model embodiment provides a kind of port the AD self-checking circuit of single-chip microcontroller, as shown in Figure 1, single-chip microcontroller 100 On be provided with the port AD and control port, the port AD includes detection port and several ports AD to be detected, and control port includes the One control port and the second control port, the port AD self-checking circuit include:
The converter detection sub-circuit 200 being connected between detection port and the first control port;
The AD censor key detection sub-circuit 300 being connected between any port AD to be detected and the second control port.
The working principle of the port the AD self-checking circuit of above-mentioned single-chip microcontroller is:
Converter detects in sub-circuit 200, passes through the low level of the first control port output on single-chip microcontroller 100, height Level and reference voltage, the level provided between low level and high level give detection port, and as sampled level, test is single Whether the analog-to-digital conversion of the converter of piece machine 100 is normal, realizes and carries out self-test to the converter that single-chip microcontroller 100 carries;AD Censor key detects in sub-circuit 300, and the AD for exporting low level and high level detection single-chip microcontroller by the second control port is logical Whether road is switched on the port AD, realizes and carries out self-test to the AD censor key that single-chip microcontroller 100 carries, can satisfy The requirement of EN60730 standard AD self-test.
In the present embodiment, single-chip microprocessor MCU has multi-channel A/D port, but only one converter, so the channel AD is needed to cut Parallel operation realizes the switching of the port AD.It is normal to ensure to switch, before acquiring data, need first to detect the switching of AD censor key It is whether normal.Due between detection port and the first control port, between any port AD to be detected and the second control port It has been separately connected converter detection sub-circuit 200, AD censor key detection sub-circuit 300, has realized that converter carries out certainly Inspection and AD censor key carry out self-test.
In the port the AD self-checking circuit of single-chip microcontroller provided by the embodiment of the utility model, due in detection port and the first control Converter detection sub-circuit, AD have been separately connected between port processed, between any port AD to be detected and the second control port Censor key detects sub-circuit, realizes converter and carries out self-test and the progress self-test of AD censor key.Pass through monolithic Low level, high level and the reference voltage of the first control port output on machine, are provided between low level and high level Level gives detection port, and whether the analog-to-digital conversion for testing converter is normal, realizes and carries out certainly to the converter that single-chip microcontroller carries Inspection;Whether it is switched on the port AD by the channel AD that the second control port exports low level and high level detection single-chip microcontroller, it is real Self-test now is carried out to AD censor key.
Embodiment two
The utility model embodiment provides a kind of port the AD self-checking circuit of single-chip microcontroller, as shown in Fig. 2, in embodiment one On the basis of, the port AD self-checking circuit further includes the pressure stabilizing sub-circuit 400 being connected between 100 power supply of single-chip microcontroller and ground.
In the present embodiment, pass through the setting pressure stabilizing son electricity between 100 power supply (+5V-AD) of single-chip microcontroller and ground (GND-5V-AD) Road 400 avoids single-chip microcontroller line power short circuit.
Embodiment three
The utility model embodiment provides a kind of port the AD self-checking circuit of single-chip microcontroller, as shown in Fig. 2, in embodiment two On the basis of, pressure stabilizing sub-circuit 400 includes that one end connects 100 power supply of single-chip microcontroller, the second capacitor C2 of other end ground connection.
In the present embodiment, pressure stabilizing sub-circuit 400 specifically uses the second capacitor C2, and realizing makes 100 supply voltage of single-chip microcontroller Variation is steady, and stable reference voltage is provided to single-chip microcontroller 100.
Example IV
The utility model embodiment provides a kind of port the AD self-checking circuit of single-chip microcontroller, as shown in Fig. 2, in embodiment one To any embodiment in three, converter detection sub-circuit 200 includes:
The current limliting module 201 of third level signal between high level and low level is provided;
Filter module 202 for stable level signal.
In the present embodiment, the Ain6/P29 (ADcheck-DetSelf) in Fig. 2 is the first control port, P24 It (ADcheck) is detection port, the converter detection sub-circuit 200 being connected between detection port and the first control port In, current limliting module 201 provides the third level signal between high level and low level, and is stablized by filter module 202 Level signal.
Embodiment five
The utility model embodiment provides a kind of port the AD self-checking circuit of single-chip microcontroller, as shown in Fig. 2, in example IV On the basis of, current limliting module 201 includes:
The first resistor R1 of one end connection microcontroller power supply;
Cathode connects the zener diode D2 of the first resistor R1 other end, plus earth;
One end is connected on the connecting line between first resistor R1 and zener diode D2, and the other end connects filter module 202 second resistance R2.
In the present embodiment, zener diode D2 and first resistor R1, second resistance R2 collectively constitute current limliting module, according to the Low level, high level and the reference voltage of one control port output, provide the third level between high level and low level For signal to detection port as sampled level, whether the analog-to-digital conversion for testing the converter of single-chip microcontroller (MCU) is normal.
Embodiment six
The utility model embodiment provides a kind of port the AD self-checking circuit of single-chip microcontroller, as shown in Fig. 2, in example IV On the basis of, filter module 202 includes:
It is connected to 3rd resistor R3 between port to be detected and the first control port;
The first capacitor that one end is connected on the connecting line between port to be detected and 3rd resistor R3, the other end is grounded C1。
In the present embodiment, 3rd resistor R3 and first capacitor C1 constitute RC circuit, for filtering, provide for single-chip microcontroller 100 Stable sampled signal.
Embodiment seven
The utility model embodiment provides a kind of port the AD self-checking circuit of single-chip microcontroller, as shown in Fig. 2, in embodiment one To any embodiment in three, AD censor key detection sub-circuit 300 includes being connected in any AD to be detected The 4th resistance R4 between port and the second control port.
In the present embodiment, the port AD to be detected that connection needs to detect can be arbitrarily replaced, is realized and is limited by the 4th resistance R4 Stream.P22 (I_fan-ADcheck) in Fig. 2 is the second control port, Ain1/P19 (I_fan) be single-chip microcontroller (MCU) wherein One port AD to be detected, the 4th resistance R4 are connected between the port AD Ain1/P19 to be detected and the second control port P22, are led to Whether the channel AD for crossing the second control port P22 output low level and high level detection single-chip microcontroller is switched to the port AD to be detected On Ain1/P19.
Specifically, when the second control port P22 exports low level (0V), the port AD Ain1/P19 to be detected samples 0V Input voltage obtains AD conversion value 0 after the converter of single-chip microprocessor MCU is converted;
When the second control port P22 exports high level (5V), the port AD Ain1/P19 to be detected samples 5V input voltage, AD conversion value 1023 is obtained after the converter of single-chip microprocessor MCU is converted.
If the data that single-chip microprocessor MCU receives in two above step are all correct in allowable range of error, then it represents that AD Censor key correctly switches on the Ain1/P19 of the port AD, and the second control port P22 is set to high-impedance state, the port AD Ain1/P19 can carry out normal sample work.If data are not in allowable range of error, then it represents that switching is abnormal.
Embodiment eight
The utility model embodiment provides a kind of port the AD self-checking circuit of single-chip microcontroller, as shown in Fig. 2, in embodiment seven On the basis of, AD censor key detection sub-circuit 300 further includes that cathode connects 100 power supply of single-chip microcontroller, anode is connected to the 4th First diode D1 on connecting line between resistance R4 and the second control port.
In the present embodiment, by first diode D1 protect single-chip microcontroller 100 the second control port and the end AD to be detected Mouthful.
Embodiment nine
The utility model embodiment provides any embodiment in a kind of single-chip microcontroller, including claim embodiment one to eight The port AD self-checking circuit.
In the present embodiment, by between the detection port and the first control port of single-chip microcontroller, any port AD to be detected Converter detection sub-circuit 200, AD censor key detection sub-circuit 300 are separately connected between the second control port, it is real Existing single-chip microcontroller itself has converter self-test and AD censor key self-checking function is simplified without external circuit Detection circuit, it is at low cost, and AD sampling performance is not influenced.
Embodiment ten
The utility model embodiment provides any embodiment in a kind of water heater, including claim embodiment one to eight The port AD self-checking circuit.
In the present embodiment, using the water heater of the above-mentioned port AD self-checking circuit, it can realize that AD turns in use Parallel operation self-test and AD censor key self-test, and the AD sampling performance of single-chip microcontroller itself is not influenced, it ensure that the electricity of water heater Road uses safe.
In the self-checking circuit of the port AD provided by the utility model, due between detection port and the first control port, appointing Converter detection sub-circuit, the detection of AD censor key have been separately connected between one port AD to be detected and the second control port Sub-circuit realizes that converter carries out self-test and AD censor key carries out self-test.By between microcontroller power supply and ground Pressure stabilizing sub-circuit is set, single-chip microcontroller line power short circuit is avoided.Pressure stabilizing sub-circuit specifically uses the second capacitor, and realizing makes list Piece electromechanical source voltage change is steady, and stable reference voltage is provided to single-chip microcontroller.Converter detects in sub-circuit, current limliting module Third level signal between high level and low level is provided, whether just to test the analog-to-digital conversion of the converter of single-chip microcontroller Often, and pass through filter module stable level signal.3rd resistor and first capacitor constitute the RC electricity for filtering in filter module Road provides stable sampled signal for single-chip microcontroller.AD censor key detects in sub-circuit, can arbitrarily replace connection and need to detect The port AD to be detected, and current limliting is realized by the 4th resistance, can also further pass through first diode protection single-chip microcontroller Second control port and the port AD to be detected.Single-chip microcontroller provided by the utility model realizes single-chip microcontroller itself and has AD conversion Device self-test and AD censor key self-checking function simplify detection circuit without external circuit, at low cost, and not shadow Ring AD sampling performance.Water heater provided by the embodiment of the utility model can used using the water heater of above-mentioned single-chip microcontroller Converter self-test and AD censor key self-test are realized in the process, and does not influence the AD sampling performance of single-chip microcontroller itself, are protected Demonstrate,proved the circuit of water heater use it is safe.
The above is only the preferred embodiment of the utility model only, is not intended to limit the utility model, all at this Made any modifications, equivalent replacements, and improvements etc., should be included in the utility model within the spirit and principle of utility model Protection scope within.

Claims (10)

1. a kind of port the AD self-checking circuit of single-chip microcontroller, which is characterized in that be provided with the port AD and control terminal on the single-chip microcontroller Mouthful, the port AD includes detection port and several ports AD to be detected, and the control port includes the first control port and the Two control ports, the port AD self-checking circuit include:
The converter detection sub-circuit being connected between the detection port and the first control port;
The AD censor key detection sub-circuit being connected between any port AD to be detected and the second control port.
2. the port the AD self-checking circuit of single-chip microcontroller as described in claim 1, which is characterized in that the port AD self-checking circuit is also Including the pressure stabilizing sub-circuit being connected between microcontroller power supply and ground.
3. the port the AD self-checking circuit of single-chip microcontroller as claimed in claim 2, which is characterized in that the pressure stabilizing sub-circuit includes one End connection microcontroller power supply, the second capacitor of other end ground connection.
4. the port the AD self-checking circuit of single-chip microcontroller as claimed any one in claims 1 to 3, which is characterized in that the AD turns Parallel operation detects sub-circuit
The current limliting module of third level signal between high level and low level is provided;
Filter module for stable level signal.
5. the port the AD self-checking circuit of single-chip microcontroller as claimed in claim 4, which is characterized in that the current limliting module includes:
The first resistor of one end connection microcontroller power supply;
Cathode connects the zener diode of the first resistor other end, plus earth;
One end is connected on the connecting line between the first resistor and the zener diode, and the other end connects the filtering mould The second resistance of block.
6. the port the AD self-checking circuit of single-chip microcontroller as claimed in claim 4, which is characterized in that the filter module includes:
It is connected to 3rd resistor between the port to be detected and the first control port;
The first electricity that one end is connected on the connecting line between the port to be detected and the 3rd resistor, the other end is grounded Hold.
7. the port the AD self-checking circuit of single-chip microcontroller as claimed any one in claims 1 to 3, which is characterized in that the AD is logical It includes the 4th resistance being connected between any port AD to be detected and the second control port that road switch, which detects sub-circuit,.
8. the port the AD self-checking circuit of single-chip microcontroller as claimed in claim 7, which is characterized in that the AD censor key detection Sub-circuit further includes that cathode connects microcontroller power supply, anode is connected between the 4th resistance and second control port First diode on connecting line.
9. a kind of single-chip microcontroller, which is characterized in that including the described in any item port the AD self-checking circuits of claim 1-8.
10. a kind of water heater, which is characterized in that including the described in any item port the AD self-checking circuits of claim 1-8.
CN201920031964.0U 2019-01-05 2019-01-05 A kind of port AD self-checking circuit, single-chip microcontroller and the water heater of single-chip microcontroller Expired - Fee Related CN209388150U (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201920031964.0U CN209388150U (en) 2019-01-05 2019-01-05 A kind of port AD self-checking circuit, single-chip microcontroller and the water heater of single-chip microcontroller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201920031964.0U CN209388150U (en) 2019-01-05 2019-01-05 A kind of port AD self-checking circuit, single-chip microcontroller and the water heater of single-chip microcontroller

Publications (1)

Publication Number Publication Date
CN209388150U true CN209388150U (en) 2019-09-13

Family

ID=67863859

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201920031964.0U Expired - Fee Related CN209388150U (en) 2019-01-05 2019-01-05 A kind of port AD self-checking circuit, single-chip microcontroller and the water heater of single-chip microcontroller

Country Status (1)

Country Link
CN (1) CN209388150U (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109709863A (en) * 2019-01-05 2019-05-03 深圳市合信达控制系统有限公司 A kind of port AD self-checking circuit, single-chip microcontroller and the water heater of single-chip microcontroller

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109709863A (en) * 2019-01-05 2019-05-03 深圳市合信达控制系统有限公司 A kind of port AD self-checking circuit, single-chip microcontroller and the water heater of single-chip microcontroller
CN109709863B (en) * 2019-01-05 2024-03-08 深圳市合信达控制系统有限公司 AD port self-checking circuit of singlechip, singlechip and water heater

Similar Documents

Publication Publication Date Title
CN106501714A (en) A kind of digitizing switch detection circuit and method with fault diagnosis functions
CN202931282U (en) General telecommand acquisition module for distribution network terminal
CN104467854A (en) Port state acquisition circuit and method
CN209388150U (en) A kind of port AD self-checking circuit, single-chip microcontroller and the water heater of single-chip microcontroller
CN102768299A (en) High-side current sampling circuit
CN101794682B (en) Intelligent controller of frame circuit breaker
US20130328405A1 (en) Ground test circuit
CN210626919U (en) High-precision analog quantity data acquisition module based on RS-485 communication
CN110350485A (en) A kind of overcurrent protection module, system and method
CN209044598U (en) A kind of voltage detecting isolation circuit
CN109709863A (en) A kind of port AD self-checking circuit, single-chip microcontroller and the water heater of single-chip microcontroller
CN216524427U (en) Multi-channel low-cost real-time temperature acquisition device
CN217467047U (en) Electronic product testing device
CN205691645U (en) A kind of signal detection system
KR101675952B1 (en) Module for analog - digital conversion
CN201663117U (en) Intelligent controller of frame circuit breaker
CN204789952U (en) Special UPS power output power characteristic's of electric power testing arrangement
CN111190047B (en) Current acquisition diagnosis circuit and failure diagnosis method thereof
CN209117756U (en) Fan monitor
CN209231748U (en) Data collecting card
CN220020393U (en) Multichannel signal acquisition device
CN203480829U (en) Analog audio signal self-check system
CN207249419U (en) A kind of cascade circuit with precisely wrong discrimination function
CN220872636U (en) Short-circuit port detection circuit with IO port replaced by ADC port and electric energy meter
CN114646893A (en) Multi-power-supply fault rapid self-detection circuit of debris flow earth sound monitoring module

Legal Events

Date Code Title Description
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20190913

CF01 Termination of patent right due to non-payment of annual fee