Microcontroller and abnormality determination program

The microcontroller's configuration with a reference voltage output unit, A/D conversion unit, and determination unit addresses the challenge of detecting reference voltage abnormalities, effectively preventing short-circuit issues and ensuring reliable operation in various applications.

JP2025090363APending Publication Date: 2025-06-17DIAMOND&ZEBRA ELECTRIC MFG CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2023205560
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-12-05
Publication Date
2025-06-17

AI Technical Summary

Technical Problem

Existing microcontrollers face challenges in detecting abnormalities in the reference voltage, particularly when the power supply voltage fluctuates, leading to potential short-circuit abnormalities between the microcontroller's power supply and an external power supply.

Method used

A microcontroller configuration that includes a reference voltage output unit, an A/D conversion unit, and a determination unit. The determination unit performs two A/D conversion steps using different reference voltages and compares the results to determine if an abnormality exists, using a discrimination threshold to differentiate between normal and abnormal states.

Benefits of technology

This configuration effectively detects short-circuit abnormalities and prevents continued operation with deviated A/D conversion values, ensuring reliable load control and adherence to certification standards in applications such as in-vehicle systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025090363000001_ABST
    Figure 2025090363000001_ABST
Patent Text Reader

Abstract

To provide a microcontroller having a function of detecting abnormality in a reference voltage.SOLUTION: A microcontroller includes: a reference voltage output section 2 for outputting a reference voltage Vref; an A / D conversion section 3 for converting an input signal inputted from an input terminal ADIN from analog into digital on the basis of the reference voltage Vref; and a determination section 4 for determining abnormality in the reference voltage Vref. The determination section 4 includes: a first A / D conversion process of outputting an external supply voltage vep as the reference voltage Vref and acquiring a first A / D conversion value; a second A / D conversion process of outputting a supply voltage Vdd3 of the microcontroller as the reference voltage Vref and acquiring a second A / D conversion value; and a determination process of determining that a reference voltage is normal when a difference between the first conversion value and the second conversion value is larger than a predetermined determination threshold while determining that the reference voltage is abnormal when the difference between the first conversion value and the second conversion value is equal to or less than the predetermined determination threshold.SELECTED DRAWING: Figure 2
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a microcontroller having an A / D (Analog to Digital) conversion function and a function of detecting an abnormality in a reference voltage, and an abnormality determination program for detecting the abnormality in the reference voltage.

Background Art

[0002] Generally, a microcontroller has an A / D conversion circuit, and detects an analog signal voltage input from an input terminal with reference to a reference voltage (hereinafter simply referred to as "reference voltage") of the A / D conversion circuit.

[0003] Patent Document 1 discloses a microcomputer (corresponding to a microcontroller) having an A / D converter that performs A / D conversion based on a reference voltage according to a power supply voltage.

Prior Art Documents

Patent Documents

[0004]

Patent Document 1

Summary of the Invention

Problems to be Solved by the Invention

[0005] As described in Patent Document 1, when the power supply voltage of the microcontroller fluctuates, for example, there is a risk of affecting load control using the output signal of the microcontroller.

[0006] In response to such problems, Patent Document 1 is configured to detect fluctuations in the power supply voltage. Also, a method of using an external power supply with higher accuracy than the power supply of the microcontroller as the reference voltage is known.

[0007] Generally, when an external power supply is used as the reference voltage of an A / D conversion circuit, it is set to a voltage lower than the power supply voltage of the microcontroller. Then, for example, when the power supply of the microcontroller and the external power supply are short-circuited due to a circuit failure or the like, the reference voltage changes from the voltage of the external power supply to the power supply voltage of the microcontroller. As a result, the output value of the A / D conversion circuit changes from the original value, and there is a risk that the device to be controlled may perform an unexpected operation by continuing to operate based on the changed output value. When the voltage difference between the power supply of the microcontroller and the external power supply is not sufficiently large, it is difficult to detect a power supply abnormality, so a countermeasure is necessary.

[0008] In view of the above problems, an object of the present invention is to provide a microcontroller having a function of detecting an abnormality of a reference voltage.

Means for Solving the Problems

[0009] A microcontroller according to a first aspect of the present invention includes a reference voltage output unit that outputs, as a reference voltage, either the power supply voltage of the microcontroller or an external power supply voltage that is more accurate and lower than the power supply voltage of the microcontroller; an A / D conversion unit that performs A / D conversion of an input signal input from an input terminal based on the reference voltage; and a determination unit that determines an abnormality of the reference voltage. The determination unit includes: a first A / D conversion step of causing the reference voltage output unit to output the external power supply voltage as the reference voltage in a state where a predetermined first measured signal is input as the input signal, and acquiring a first A / D conversion value by the A / D conversion unit; a second A / D conversion step of causing the reference voltage output unit to output the power supply voltage of the microcontroller as the reference voltage in a state where a predetermined second measured signal is input as the input signal, and acquiring a second A / D conversion value by the A / D conversion unit; and a determination step of determining that there is an abnormality in the reference voltage when a difference between the first A / D conversion value and the second A / D conversion value is equal to or less than a predetermined discrimination threshold, and determining that the reference voltage is normal when the difference between the first A / D conversion value and the second A / D conversion value is greater than the discrimination threshold.

[0010] According to the configuration of the first aspect described above, in the first A / D conversion step and the second A / D conversion step, power supplies with different voltages are switched to each other as the reference voltage, a predetermined input signal is input, and the A / D conversion values obtained are compared with each other, and the presence or absence of an abnormality in the reference voltage is determined based on a discrimination threshold value. Thereby, for example, an abnormal state in which the power supply of the microcontroller and an external power supply are short-circuited (hereinafter referred to as "short-circuit abnormality" or "short-circuit abnormal state") can be detected.

Advantages of the Invention

[0011] According to the present invention, since an abnormality in the reference voltage of the microcontroller can be detected, it is possible to prevent a problem such as the operation continuing in a state where the A / D conversion value (detection value of the signal to be measured) in the A / D conversion unit is deviated.

Brief Description of the Drawings

[0012]

Figure 1

Figure 2

Figure 3

Figure 4

Modes for Carrying Out the Invention

[0013] Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. The following description of the preferred embodiments is merely illustrative in nature and is not intended to limit the present invention, its scope of application, or its uses.

[0014] In the following embodiments, there may be cases where the same reference numerals are used to describe the names of signals and voltages and the voltage values.

[0015] <First Embodiment> FIG. 1 is a diagram showing a configuration example of a microcontroller (hereinafter referred to as "MCU") according to an embodiment. The MCU 1 of the present disclosure is mounted on, for example, a power conditioner, or implemented in devices such as in-vehicle applications and charging facilities for electric vehicles.

[0016] As shown in FIG. 1, the MCU 1 includes a reference voltage output unit 2, an A / D conversion unit 3, and a determination unit 4. The MCU 1 is also provided with a power supply terminal Vdd, a ground terminal Vss, an input terminal ADIN for analog signals, a positive terminal Vrefp and a negative terminal Vrefn for external power supply input. The ground terminal Vss and the negative terminal Vrefn for external power supply input are connected to the ground.

[0017] A voltage Vdd3 of a power supply (hereinafter referred to as "MCU power supply") for operating the MCU 1 is supplied to the power supply terminal Vdd from a power supply circuit (not shown) outside the MCU, etc. An external power supply voltage vep is supplied to the positive terminal Vrefp from an external power supply (hereinafter simply referred to as "external power supply") provided outside the MCU 1. The external power supply is a power supply with higher precision and lower voltage than the MCU power supply. Here, the precision of the power supply includes variations and tolerances of the power supply. "High precision" in the present disclosure includes small variations and tolerances.

[0018] The voltage difference between the power supply voltage Vdd3 and the external power supply voltage vep is set to a value larger than, for example, the power supply voltage × tolerance. Taking a specific example, when the power supply voltage Vdd3 is 5 [V] and the power supply tolerance is 5%, the external power supply voltage vep is 4.5 [V] and the power supply tolerance is 0.2%. Also, when the power supply voltage Vdd3 is 3.3 [V] and the power supply tolerance is 5%, the external power supply voltage vep is 3 [V] and the power supply tolerance is 0.2%.

[0019] By using a high-precision external power supply as the reference voltage Vref of the MCU 1, specifications that satisfy certifications such as in-vehicle applications or system connection protection of a power conditioner, which require the accuracy of the A / D conversion unit 3, can be achieved.

[0020] -Reference voltage output section- Based on the internal settings (for example, register settings) of the microcomputer 1, the reference voltage output section 2 outputs either the power supply voltage Vdd3 input from the power supply terminal Vdd or the external power supply voltage vep input from the positive terminal Vrefp as the reference voltage Vref of the A / D conversion section 3.

[0021] Specifically, based on the internal functions (for example, register settings) of the microcomputer 1, the reference voltage output section 2 switches between the power supply voltage Vdd3 and the external power supply voltage vep and outputs them to the A / D conversion section 3 as the reference voltage Vref. More specifically, in the "abnormal determination process of the reference voltage" described later, in the first A / D conversion step, the reference voltage output section 2 outputs the external power supply voltage vep as the reference voltage Vref, and in the second A / D conversion step, it is configured to output the power supply voltage Vdd3 as the reference voltage Vref.

[0022] -A / D conversion section- Based on the reference voltage Vref output from the reference voltage output section 2, the A / D conversion section 3 performs A / D conversion of the input signal IN (measured signal vin) input from the input terminal ADIN. The measured signal vin includes, for example, analog signals such as a control power supply voltage whose signal variation due to the state of the product is small and can be regarded as almost a fixed value.

[0023] As a specific configuration of the A / D conversion section 3, an A / D conversion circuit built in the generally known microcomputer 1 can be used, and the description of the circuit configuration of the A / D conversion section 3 is omitted here.

[0024] -Determination section- The determination unit 4 is configured to execute a determination process (hereinafter simply referred to as "abnormality determination process") for determining an abnormal state of the reference voltage Vref input to the microcomputer 1. The "abnormal state of the reference voltage" includes an abnormal state (hereinafter referred to as "short-circuit abnormality") in which the microcomputer power supply and the external power supply are short-circuited, and the voltage Vdd3 of the microcomputer power supply is applied as the reference voltage Vref even though the reference voltage Vref is set to the external power supply voltage vep.

[0025] The function of the determination unit 4 is realized, for example, by the CPU built in the microcomputer 1 executing an abnormality determination program stored in a memory (not shown).

[0026] Note that the function of the determination unit 4 may be realized by a circuit (for example, a combinational circuit or a sequential circuit combining logic circuits) having a function equivalent to that executed by the abnormality determination program.

[0027] Note that the memory may store a program executed by the CPU other than the abnormality determination program. Further, the memory is not limited to being built in the microcomputer 1, and the abnormality determination program may be stored in a memory provided outside the microcomputer 1, and the CPU of the microcomputer 1 may access that memory.

[0028] <Abnormality determination process of reference voltage> The abnormality determination program is configured to cause the microcomputer 1 to execute a first A / D conversion step, a second A / D conversion step, and a determination step. FIG. 2 is a flowchart showing the abnormality determination process of the reference voltage Vref. Hereinafter, the abnormality determination process of the reference voltage executed based on the abnormality determination program will be described with reference to FIG. 2 as well.

[0029] -Method for setting discrimination threshold- First, the procedure for setting the discrimination threshold between the normal state of the reference voltage (hereinafter simply referred to as "normal state") and the short-circuit abnormality state will be described. Note that the "discrimination threshold" can be calculated in advance and set in the microcomputer 1, and it is not necessary to include the setting of the discrimination threshold in the abnormality determination process.

[0030] The "discrimination threshold value" can be set according to the following procedures 1 to 3.

[0031] Procedure 1: Calculate the detection range of the A / D conversion unit 3 when the external power supply voltage vep is applied as the reference voltage Vref. Procedure 2: Calculate the detection range of the A / D conversion unit 3 when the power supply voltage Vdd3 of the microcontroller power supply is applied as the reference voltage Vref. Procedure 3: Based on the detection ranges obtained in Procedures 1 and 2, obtain the minimum value of the A / D conversion value by the A / D conversion unit 3 generated in the normal state, and determine the discrimination threshold value based on the minimum value. Here, based on the reference voltage Vref, when the signal to be measured vin is input as the input signal IN, the A / D conversion value ADmcu by the A / D conversion unit 3 can be calculated by the following formula (1).

[0032]

Equation

[0033] The parameters used in the above formula (1) are as follows.

[0034] ·vin[V]: Voltage of the signal to be measured ·Vref[V]: Reference voltage ·X[LSB]: Resolution of the A / D conversion unit 3 ·ADerr[LSB]: A / D conversion error of the A / D conversion unit 3

[0035] 〔Procedure 1〕 In the above formula (1), a predetermined first signal to be measured vin1 is input as an input signal from the input terminal ADIN, and the first A / D conversion value AD1 by the A / D conversion unit 3 when the external power supply voltage vep is applied as the reference voltage Vref is calculated.

[0036] Here, each parameter in the above equation (1) has variations due to circuit variations. Therefore, in the following equation (2), the upper limit value AD1max of the first A / D conversion value AD1 is calculated, and the lower limit value AD1min of the first A / D conversion value AD1 is calculated by the following equation (3).

[0037]

Number

[0038]

Number

[0039] The parameters used in the above equations (2) and (3) are as follows.

[0040] ·vin1 [V]: Voltage of the first measured signal ·vep ± Δvep [V]: External power supply voltage (Δvep: Tolerance of the external power supply voltage) ·X [LSB]: Resolution of the A / D conversion unit 3 ·ADerr [LSB]: A / D conversion error of the A / D conversion unit 3

[0041] 〔Procedure 2〕 In the above equation (1), the same first measured signal vin1 as in "Procedure 1" is input as an input signal from the input terminal ADIN, and the second A / D conversion value AD2 by the A / D conversion unit 3 when the voltage Vdd3 of the microcomputer power supply is applied as the reference voltage Vref is calculated.

[0042] Similar to "Procedure 1", since each parameter in the above equation (1) has variations due to circuit variations, in the following equation (4), the upper limit value AD2max of the second A / D conversion value AD2 is calculated, and the lower limit value AD2min of the second A / D conversion value AD2 is calculated by the following equation (5).

[0043]

Number

[0044]

Number

[0045] The parameters used in the above equations (4) and (5) are as follows.

[0046] · vin1 [V]: Voltage of the first measured signal · Vdd3 ± ΔVdd3 [V]: Voltage of the microcontroller power supply (ΔVdd3: Tolerance of the microcontroller power supply voltage) · X [LSB]: Resolution of the A / D conversion unit 3 · ADerr [LSB]: A / D conversion error of the A / D conversion unit 3

[0047] 〔Step 3〕 When the values calculated in "Step 1" and "Step 2" are illustrated, it becomes as shown in Figure 3.

[0048] As shown in Figure 3, in the normal state, the detection range of the first A / D conversion value AD1 is between the upper limit value AD1max and the lower limit value AD1min, and the detection range of the second A / D conversion value AD2 is between the upper limit value AD2max and the lower limit value AD2min. As shown in Figure 3, the external power supply voltage vep is set such that the upper limit value AD2max of the second A / D conversion value AD2 is smaller than the lower limit value AD1min of the first A / D conversion value AD1 when the external power supply voltage vep is used as a reference.

[0049] Therefore, as shown in the following equation (6), the minimum difference of the A / D conversion values generated in the normal state is obtained, and this difference is set as the discrimination threshold Jt. More specifically, the difference between the lower limit value AD1min of the first A / D conversion value AD1 and the upper limit value AD2min of the second A / D conversion value AD2 is set as the discrimination threshold Jt.

[0050]

Number

[0051] - First A / D Conversion Step - In the first A / D conversion step, in a state where a predetermined first signal to be measured vin1 is input as the input signal IN, the reference voltage output unit 2 is caused to output the external power supply voltage vep as the reference voltage Vref, and the process of obtaining the first A / D conversion value AD1 by the A / D conversion unit 3 is executed.

[0052] Specifically, in S1 of FIG. 2, the determination unit 4 sets the reference voltage Vref of the reference voltage output unit 2 to the external power supply voltage vep. This setting is executed using, for example, the internal function (e.g., register setting) of the microcomputer 1 as described above. Then, the external power supply voltage vep is applied to the A / D conversion unit 3 as the reference voltage Vref.

[0053] At this time, a predetermined first signal to be measured vin1 is input as the input signal IN to the A / D conversion unit 3 from the input terminal ADIN. The signal form of the first signal to be measured vin1 is not particularly limited, but for example, it is an analog signal with little signal fluctuation due to the state of the product and can be regarded as a fixed value.

[0054] In S2, the A / D conversion unit 3 performs A / D conversion of the first signal to be measured vin1 based on the external power supply voltage vep (reference voltage Vref). When the A / D conversion by the A / D conversion unit 3 is completed (YES in S3), the determination unit 4 stores the first A / D conversion value AD1, which is the A / D conversion value at that time (S4). The storage destination is, for example, the memory of the microcomputer 1.

[0055] - Second A / D Conversion Step - In the second A / D conversion step, in a state where a predetermined second signal to be measured vin2 is input as the input signal IN, the reference voltage output unit 2 is caused to output the voltage Vdd3 of the microcomputer power supply as the reference voltage Vref, and the process of obtaining the second A / D conversion value AD2 by the A / D conversion unit 3 is executed.

[0056] Specifically, in S5 of FIG. 2, the determination unit 4 sets the reference voltage Vref of the reference voltage output unit 2 to the power supply Vdd3 of the microcontroller power supply. This setting is executed using, for example, the internal function (e.g., register setting) of the microcontroller 1 as described above. Then, the voltage Vdd3 of the microcontroller power supply is applied to the A / D conversion unit 3 as the reference voltage Vref.

[0057] At this time, a predetermined second signal to be measured vin2 is input as the input signal IN from the input terminal ADIN to the A / D conversion unit 3. The second signal to be measured vin2 is, for example, a signal having the same voltage waveform as the first signal to be measured Vin1. By making the first signal to be measured Vin1 and the second signal to be measured Vin2 signals having the same voltage waveform in this way, the processing of the determination step can be facilitated. However, the first signal to be measured Vin1 and the second signal to be measured Vin2 do not necessarily have the same voltage waveform, and different signals may be used as long as the correlation between the respective signals to be measured is known in advance.

[0058] In S6, the A / D conversion unit 3 performs A / D conversion of the second signal to be measured vin2 based on the voltage Vdd3 (reference voltage Vref) of the microcontroller power supply. When the A / D conversion by the A / D conversion unit 3 is completed (YES in S7), the determination unit 4 stores the second A / D conversion value AD2, which is the A / D conversion value at that time, (S8). The storage destination is, for example, the memory of the microcontroller 1.

[0059] -Determination step- In the determination step, the following processes (1) and (2) are executed.

[0060] (1) Calculate the difference between the first A / D conversion value AD1 obtained in the first A / D conversion step and the second A / D conversion value AD2 obtained in the second A / D conversion step.

[0061] (2) When the difference between the first A / D conversion value AD1 and the second A / D conversion value AD2 is equal to or less than a predetermined discrimination threshold value Jt, it is determined that there is an abnormality in the reference voltage Vref. On the other hand, when the difference between the first A / D conversion value AD1 and the second A / D conversion value AD2 is greater than the discrimination threshold value Jt, it is determined that the reference voltage Vref is in a normal state.

[0062] Specifically, in S9 of FIG. 2, the determination unit 4 calculates the difference between the first A / D conversion value AD1 and the second A / D conversion value AD2 stored in the memory, and determines whether it is equal to or less than the discrimination threshold value Jt calculated by the above-described formula (6).

[0063] When the difference between the first A / D conversion value AD1 and the second A / D conversion value AD2 is equal to or less than the discrimination threshold value Jt (YES in S9), the determination unit 4 determines that there is an abnormality in the reference voltage Vref (S10). That is, it is determined that a short-circuit abnormality has occurred between the power supply of the microcomputer 1 and the external power supply. When a short-circuit abnormality is detected, the microcomputer 1 stops subsequent processing and notifies the outside that an abnormality has occurred.

[0064] On the other hand, when the difference between the first A / D conversion value AD1 and the second A / D conversion value AD2 is greater than the discrimination threshold value Jt (NO in S9), the determination unit 4 determines that the reference voltage Vref is normal (S11). In this case, the microcomputer 1 continues subsequent processing.

[0065] As described above, according to the present embodiment, with respect to the reference voltage Vref of the A / D conversion unit 3, the external power supply and the power supply of the microcomputer 1 are switched and applied, and the A / D conversion values at the same measured signal vin (in the embodiment, the first measured signal vin1) are compared, whereby a short-circuit abnormality between the external power supply and the microcomputer power supply can be detected. Thereby, it is possible to prevent a problem that the operation of the microcomputer 1 and the devices associated therewith continues in a state where the A / D conversion value (the detected value of the measured signal vin) in the A / D conversion unit 3 is deviated.

[0066] <Second Embodiment> FIG. 4 is a diagram showing a configuration example of a microcontroller unit (hereinafter referred to as "microcontroller unit") according to an embodiment. The microcontroller unit of the present disclosure is mounted on, for example, a power conditioner, an in-vehicle application, a charging facility for an electric vehicle, etc., in the same manner as in the first embodiment.

[0067] In this embodiment, the description will focus on the differences from the first embodiment, and the description of overlapping configurations and operations may be omitted.

[0068] In this embodiment, it is different from the first embodiment in that a reference voltage output unit 5 corresponding to the reference voltage output unit 2 of the first embodiment is provided outside the microcontroller 1. In addition to the terminal configuration of the first embodiment, a control terminal TC is provided on the microcontroller 1.

[0069] -Reference voltage output unit- The reference voltage output unit 5 outputs either the power supply voltage Vdd3 input from the power supply terminal Vdd or the external power supply voltage vep supplied from an external power supply to the positive terminal Vrefp of the microcontroller 1 based on the switch drive signal SC output from the control terminal TC of the microcontroller 1. The reference voltage output unit 5 only needs to have a function of outputting either the power supply voltage Vdd3 or the external power supply voltage vep based on the switch drive signal SC, and its specific configuration is not particularly limited. FIG. 4 shows an example of the configuration of the reference voltage output unit 5.

[0070] The reference voltage output unit 5 illustrated in FIG. 4 includes a switch SW1.

[0071] The switch SW1 is configured to select either the power supply voltage Vdd3 input from the power supply terminal Vdd or the external power supply voltage vep supplied from an external power supply based on the switch drive signal SC and output it to the positive terminal Vrefp.

[0072] -Microcontroller- The microcontroller 1 according to this embodiment includes an A / D conversion unit 3 and a determination unit 4.

[0073] [A / D Conversion Unit] The A / D conversion unit 3 performs A / D conversion of the input signal IN (measured signal vin) input from the input terminal ADIN based on the reference voltage Vref input from the positive terminal Vrefp for reference voltage input. The specific circuit configuration is the same as that of the first embodiment.

[0074] [Judgment Unit] The judgment unit 4 has a function of executing a judgment process (hereinafter simply referred to as "abnormality judgment process") for judging the abnormal state of the reference voltage Vref input to the microcomputer 1, and a function of outputting a switch drive signal SC to the reference voltage output unit 2 when executing the abnormality judgment process. The switch drive signal SC is a signal for controlling so that the external power supply voltage vep is output as the reference voltage Vref in the first A / D conversion step of the abnormality judgment process, and the voltage Vdd3 of the microcomputer power supply is output as the reference voltage Vref in the second A / D conversion step of the abnormality judgment process.

[0075] The function of the judgment unit 4 is realized, for example, by the CPU built in the microcomputer 1 executing an abnormality judgment program stored in a memory (not shown). Regarding the point that it can be replaced with a circuit or the like, it is the same as that of the first embodiment. Also, regarding the "abnormality judgment process of the reference voltage", the operations other than the output of the switch drive signal SC are the same as those of the first embodiment, and the same effects can be obtained by the process, so the detailed description here is omitted.

[0076] Also in this embodiment, regarding the reference voltage Vref of the A / D conversion unit 3, by switching between the external power supply and the power supply of the microcomputer 1 and comparing the A / D detection values of the same measured signal vin (in the embodiment, the first measured signal vin1), a short circuit abnormality between the external power supply and the microcomputer power supply can be detected. Thereby, it is possible to prevent a problem that the operation continues in a state where the A / D conversion value (detection value of the measured signal vin) in the A / D conversion unit 3 is deviated.

Industrial Applicability

[0077] According to the present invention, it is possible to prevent problems such as the operation continuing in a state where the A / D conversion value (detection value of the signal to be measured) in the A / D conversion unit of the microcomputer is deviated. Therefore, it can be mounted on in-vehicle devices, power conditioners, and other devices using a microcomputer, and is extremely useful.

Explanation of symbols

[0078] 1 Microcontroller 2 Reference voltage output unit 3 A / D conversion unit 4 Judgment unit 5 Reference voltage output unit Vdd3 Power supply voltage of the microcontroller vep External power supply voltage Vref Reference voltage

Claims

1. A microcontroller, comprising: a reference voltage output unit that outputs, as a reference voltage, either the power supply voltage of the microcontroller or an external power supply voltage that is more accurate and lower in voltage than the power supply voltage of the microcontroller; an A / D conversion unit that performs A / D conversion of an input signal input from an input terminal based on the reference voltage; and a determination unit that determines an abnormality of the reference voltage, wherein the determination unit: in a state where a predetermined first measured signal is input as the input signal, causes the reference voltage output unit to output the external power supply voltage as the reference voltage, and obtains a first A / D conversion value by the A / D conversion unit in a first A / D conversion step; in a state where a predetermined second measured signal is input as the input signal, causes the reference voltage output unit to output the power supply voltage of the microcontroller as the reference voltage, and obtains a second A / D conversion value by the A / D conversion unit in a second A / D conversion step; and executes a determination step of determining that there is an abnormality in the reference voltage when a difference between the first A / D conversion value and the second A / D conversion value is equal to or less than a predetermined discrimination threshold, and determining that the reference voltage is normal when the difference between the first A / D conversion value and the second A / D conversion value is greater than the discrimination threshold.

2. An abnormality determination program for causing a microcontroller to execute an abnormality determination of a reference voltage input to the microcontroller, wherein the microcontroller: includes a reference voltage output unit that outputs, as the reference voltage, either an external power supply voltage that is more accurate and lower in voltage than the power supply voltage of the microcontroller or the power supply voltage of the microcontroller; and an A / D conversion unit that performs A / D conversion of an input signal based on the reference voltage, and the abnormality determination program causes the microcontroller to: In a state where a predetermined first signal to be measured is input as the input signal, a first A / D conversion step of causing the reference voltage output unit to output the external power supply voltage as the reference voltage and acquiring a first A / D conversion value by the A / D conversion unit; In a state where a predetermined second signal to be measured is input as the input signal, a second A / D conversion step of causing the reference voltage output unit to output the power supply voltage of the microcontroller as the reference voltage and acquiring a second A / D conversion value by the A / D conversion unit; An abnormality determination program that executes a determination step of determining that there is an abnormality in the reference voltage when the difference between the first A / D conversion value and the second A / D conversion value is equal to or less than a predetermined determination threshold, and determining that the reference voltage is normal when the difference between the first A / D conversion value and the second A / D conversion value is greater than the determination threshold.

3. A microcontroller unit, A microcontroller; A reference voltage output unit that outputs either the power supply voltage of the microcontroller or an external power supply voltage that is more accurate and has a lower voltage than the power supply voltage of the microcontroller as the reference voltage; The microcontroller includes An A / D conversion unit that performs A / D conversion of an input signal input from an input terminal based on the reference voltage; A determination unit having a setting function for setting the reference voltage output from the reference voltage output unit and a determination function for determining an abnormality of the reference voltage; The determination unit includes In a state where a predetermined first signal to be measured is input as the input signal, a first A / D conversion step of setting the reference voltage output from the reference voltage output unit to the external power supply voltage and acquiring a first A / D conversion value by the A / D conversion unit; In a state where a predetermined second signal to be measured is input as the input signal, the reference voltage output from the reference voltage output unit is set to the power supply voltage of the microcontroller, and a second A / D conversion step of acquiring a second A / D conversion value by the A / D conversion unit is performed. When the difference between the first A / D conversion value and the second A / D conversion value is equal to or less than a predetermined discrimination threshold value, it is determined that there is an abnormality in the reference voltage. On the other hand, when the difference between the first A / D conversion value and the second A / D conversion value is greater than the discrimination threshold value, it is determined that the reference voltage is normal. A microcontroller that executes a determination step.

4. An abnormality determination program for causing a microcontroller to execute an abnormality determination of a reference voltage input to the microcontroller, Outside the microcontroller, a reference voltage output unit that outputs either an external power supply voltage that is more accurate and has a lower voltage than the power supply voltage of the microcontroller or the power supply voltage of the microcontroller as the reference voltage is provided. The microcontroller is Equipped with an A / D conversion unit that performs A / D conversion of an input signal based on the reference voltage. The abnormality determination program causes the microcontroller to In a state where a predetermined first input signal is input as the input signal, a reference voltage setting signal for outputting the external power supply voltage as the reference voltage is output to the reference voltage output unit, and a first A / D conversion value by the A / D conversion unit based on the external power supply voltage is obtained. A first A / D conversion step. In a state where the first input signal is input as the input signal, a reference voltage setting signal for outputting the power supply voltage of the microcontroller as the reference voltage is output to the reference voltage output unit, and a second A / D conversion value by the A / D conversion unit based on the power supply voltage of the microcontroller is obtained. A second A / D conversion step. An abnormality determination program that executes a determination step of determining that there is an abnormality in the reference voltage when the difference between the first A / D conversion value and the second A / D conversion value is equal to or less than a predetermined discrimination threshold, and determining that the reference voltage is normal when the difference between the first A / D conversion value and the second A / D conversion value is greater than the discrimination threshold.

Citation Information

Patent Citations

  • Control device

    JP2015222228A