Semiconductor device and measurement processing system
1. A semiconductor device, comprising:
an average processing unit that calculates an average measurement value that is an average of a plurality of observation values for each of a plurality of measurement objects output from a switching unit that switches and outputs a measurement value acquired from each of the plurality of measurement objects;
a timer for generating a timer signal, the timer signal being a timing signal of a predetermined interval; and
and a control unit configured to control the switching unit and the averaging unit based on the timer signal and a measurement sequence in which a measurement order and a number of measurements for the plurality of measurement objects are set, to calculate an average measurement value for each of the plurality of measurement objects.
2. The semiconductor device according to claim 1,
the control unit controls the switching unit and the averaging unit so as to repeat the measurement sequence, and the control unit controls the averaging unit so as to output a plurality of average measurement values for each measurement sequence.
3. The semiconductor device according to claim 1 or 2,
the measurement value obtained by the switching part is an analog measurement value,
the average processing unit calculates the average measurement value for a plurality of digital measurement values,
further comprising an analog-to-digital conversion section between the switching section and the averaging section,
the control unit further controls the analog-to-digital conversion unit according to the timer signal.
4. The semiconductor device according to any one of claims 1 to 3,
the timer generates a first timer signal and a second timer signal, wherein the first timer signal is a predetermined timing signal, the second timer signal is a timing signal faster than the first timer signal,
the control unit sets a section of the measurement sequence based on the first timer signal, and sets a switching timing of the switching unit and measurement timings of the plurality of measurement targets in the measurement sequence based on the second timer signal.
5. The semiconductor device according to any one of claims 1 to 4,
the measurement device further includes a change setting unit that changes a measurement value output from at least one of the plurality of measurement objects.
6. The semiconductor device according to any one of claims 1 to 5,
further comprises a CPU having a communication function with the outside,
the CPU supplies the average measurement value of the plurality of measurement objects calculated by the average processing unit to an external circuit corresponding to each measurement object by using the communication function.
7. A measurement processing system, comprising:
a switching unit that switches and outputs a measurement value acquired from each of a plurality of measurement objects; and
a microcomputer includes: an average processing unit configured to calculate an average measurement value that is an average value of a plurality of observation values for each of the plurality of measurement objects output from the switching unit; a timer for generating a timer signal, the timer signal being a timing signal of a predetermined interval; a control unit configured to control the switching unit and the averaging unit based on the timer signal and a measurement sequence in which a measurement order and a number of measurements for the plurality of measurement objects are set, to calculate an average measurement value for each of the plurality of measurement objects; and a CPU configured to supply the average measurement value of the plurality of measurement objects calculated by the average processing unit to an external circuit corresponding to each measurement object by using a communication function.
Background
As one field of semiconductor devices, there is a field of semiconductor devices having a function of collecting measured values output from a sensor or the like. In such a semiconductor device, a measured value received from a sensor or the like may be supplied to a circuit that executes predetermined processing based on the measured value. In this case, in order to appropriately execute the predetermined processing, there is a case where a highly accurate measurement value is desired in which the influence of the noise or the like is suppressed. On the other hand, as one method for improving the accuracy of the measurement value, there is a method of averaging a plurality of measurement values. This is a method using the principle that the average value of a plurality of sample values approaches the true value. Further, by averaging a plurality of sample values, an effect of reducing the influence of noise is expected.
As a document that discloses an averaging process for a measurement value, for example, patent document 1 is known. The measurement system disclosed in patent document 1 is configured to connect a plurality of measurement devices and a management device so as to enable communication. The measuring device measures the electric quantity via a sensor of the detection circuit. When a sensor ID is acquired from the management device, the measured electric power is transmitted to the management device via a detection circuit including a sensor specified by the acquired sensor ID, the sensor ID identifying all sensors connected to the plurality of measurement devices. The management device further includes a control unit that communicates with the measurement device by using a communication function. Further, the measurement system of patent document 1 describes a statistical storage unit that stores, as statistical data, statistical values such as an average value of the measurement data stored in the measurement storage unit.
Fig. 6 shows a semiconductor device 100 of a comparative example having an averaging function. The semiconductor device 100 shown in fig. 6 includes: a CPU20, a memory 21, an ADC (analog-digital conversion circuit) 14, a switch setting unit 15, a switch unit 16-2, and a bus 22. Further, to the outside of the semiconductor device 100, there are connected: switches 16-3, 16-4, 16-5, circuits A1, A2, …, An, B1, C1, C2.
The CPU20 has a function of calculating an average value of a plurality of measurement values (hereinafter, sometimes referred to as "average measurement value") by software. The memory 21 has a function of storing the average measurement value calculated by the CPU 20. The CPU20, the memory 21, the ADC14, and the switch setting unit 15 can communicate with each other via the bus 22.
The circuits a1, a2, …, An, B1, C1, and C2 are independent measurement targets, and output respective measurement values at specific periods. The output signals of the respective measurement objects are analog signals. The measurement values of the analog signals switched by the switches 16-2 to 16-5 are converted into digital signals by the ADC14, and the digital signals are input to the CPU20 via the bus 22.
The switching units 16-2, 16-3, 16-4, and 16-5 (hereinafter, collectively referred to as "switching unit 16") are, for example, selectors for switching the connection of a plurality of measurement targets. Each switching unit 16 is controlled by the switching setting unit 15, and inputs the measured values to the ADC14 one by one at a predetermined timing. The switching setting unit 15 switches the switching units 16-2, 16-3, 16-4, and 16-5 based on the instruction of the CPU, and controls the measurement object input to the ADC 14. The switching unit 16-2 is built in the semiconductor device 100, and the switching units 16-3 to 16-5 are provided outside the semiconductor device 100, but the functions are the same.
In the semiconductor device 100, the order of measuring a plurality of measurement objects while switching the input to the ADC14 is described using software, and measurement of a plurality of sensors is performed by outputting average measurement values at predetermined cycles. In general, when a steady variation (a variation not including a disturbance) in a measurement value output from a sensor is not so large and when it is not desired to further improve the accuracy of a measurement target, the number of times of measurement is increased and more parameters are averaged, whereby the influence of noise can be reduced and the accuracy of an average measurement value can be improved.
Patent document 1: japanese patent laid-open publication No. 2016-095683
However, in the semiconductor device 100 of the comparative example, there are two technical problems in achieving an improvement in the accuracy of the average measurement value by increasing the number of measurements of the measurement value.
The first technical problem is that: in order to perform measurement processing by software, a CPU, a memory, a bus, and the like are occupied, and the CPU cannot execute other processing in the measurement processing. In many cases, the semiconductor device on which the CPU and the memory are mounted is generally a microcomputer, and when the semiconductor device is regarded as a system such as a communication function, the semiconductor device has a function of giving higher priority than the measurement processing. Therefore, there is a case where the measurement process is forced to be stopped when some process with a higher priority level is generated. In addition, a method of allocating the processing time in advance so as not to stop the measurement processing is also considered, but in such a method, the measurable time is reduced. As a result, the desired number of measurements cannot be realized.
The second technical problem is that: in the case of performing software-based measurement, time required for one measurement requires time corresponding to a plurality of operation clocks of hardware. The time required for the measurement depends on the rate of software processing, e.g. the measurement cannot be made at the sampling frequency of the ADC. Although the averaging process is also executed by software, measurement (acquisition of measurement data) cannot be performed in the averaging process.
As described above, when the software-based measurement process is performed, the number of times of measurement is generally limited, and in many cases, only the number of times of measurement that is insufficient to obtain an average effect of a plurality of populations can be realized. On the other hand, in order to compensate for the small number of measurements, a method of further improving the performance of the measurement circuit is also considered, but in this case, there is a problem of high cost.
Disclosure of Invention
In view of the above, it is an object of the present invention to provide a semiconductor device and a measurement processing system that have a configuration in which an average measurement value is calculated by averaging a plurality of measurement values, and that can acquire a more accurate average measurement value in a shorter time than in the case of software processing.
In order to solve the above-mentioned problems, a semiconductor device of the present invention includes: an average processing unit that calculates an average measurement value that is an average of a plurality of observation values for each of the plurality of measurement objects output from a switching unit that switches and outputs a measurement value acquired from each of the plurality of measurement objects; a timer for generating a timer signal, the timer signal being a timing signal of a predetermined interval; and a control unit configured to control the switching unit and the averaging unit based on the timer signal and a measurement sequence in which a measurement order and a number of measurements for the plurality of measurement objects are set, to calculate an average measurement value for each of the plurality of measurement objects.
In order to solve the above-mentioned technical problem, a measurement processing system of the present invention includes: a switching unit that switches and outputs a measurement value acquired from each of a plurality of measurement objects; and a microcomputer including: an average processing unit configured to calculate an average measurement value, which is an average value calculated for a plurality of observation values for each of the plurality of measurement objects output from the switching unit; a timer for generating a timer signal, the timer signal being a timing signal of a predetermined interval; a control unit configured to control the switching unit and the averaging unit based on the timer signal and a measurement sequence in which a measurement order and a number of measurements for the plurality of measurement objects are set, to calculate an average measurement value for each of the plurality of measurement objects; and a CPU configured to supply the average measurement value of the plurality of measurement objects calculated by the average processing unit to an external circuit corresponding to each measurement object by using a communication function.
According to the present invention, the following effects are obtained: it is possible to provide a semiconductor device and a measurement processing system which have a configuration in which a plurality of measurement values are averaged to calculate an average measurement value, and which can acquire a more accurate average measurement value in a shorter time than in the case of software processing.
Drawings
Fig. 1 (a) is a block diagram showing an example of the configuration of the semiconductor device according to the first embodiment, and fig. 1 (b) is a block diagram showing an example of the configuration of the averaging unit according to the first embodiment.
Fig. 2 (a) is a timing chart showing the relationship between the timer signal TIM1 and the TIM2 in the averaging process i of the semiconductor device according to the first embodiment, fig. 2 (b) is a timing chart showing the arrangement of the switching timing and the measurement timing in the measurement sequence of the semiconductor device according to the first embodiment, and fig. 2 (c) is a schematic diagram showing an example of the measurement sequence of the semiconductor device according to the first embodiment.
Fig. 3 is a block diagram showing an example of the configuration of the semiconductor device and the measurement processing system according to the second embodiment.
Fig. 4 is a block diagram showing an example of the configuration of the semiconductor device and the measurement processing system according to the third embodiment.
Fig. 5 is a block diagram showing an example of the configuration of the semiconductor device and the measurement processing system according to the fourth embodiment.
Fig. 6 is a block diagram showing a structure of a semiconductor device of a comparative example.
Description of reference numerals
10. 10A, 10B, 10C, 100 … semiconductor device, 11 … averaging section, 12 … control section, 13 … timer, 14 … ADC, 15 … switching setting section, 16-1 to 16-7 … switching section, 20 … CPU, 21 … memory, 22 … bus, 23 … DAC control section, 24 … DAC, 31-1, 31-2, …, 31-n … storage circuit, 32 … averaging circuit, Cv, Ca, Cs … control signal, Sa … analog measurement value, Sd … digital measurement value, TIM1, TIM2 … timer signal, Tm … measurement period, Tw … preparation period, tset … switching timing, es Tm … measurement timing, TIMA … ADC timer signal, Tc … timer control signal.
Detailed Description
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
[ first embodiment ]
A semiconductor device 10 according to the present embodiment will be described with reference to fig. 1 and 2. The semiconductor device 10 exemplifies a mode of performing measurement of two measurement objects, i.e., a circuit a and a circuit B. The measured value of the measurement target in the present embodiment is not limited to the characteristics of the circuit (for example, voltage, current, and the like), and may be a characteristic that is generally applied to the sensor output such as temperature and pressure.
The structure of the semiconductor device 10 will be described with reference to fig. 1. As shown in fig. 1 (a), the semiconductor device 10 includes: an averaging unit 11, a control unit 12, a timer 13, and an ADC 14. The external semiconductor device 10 includes a switching unit 16-1. The switching unit 16-1 is constituted by, for example, a selector or a switch, and switches whether the measurement target is the circuit a or the circuit B.
The ADC14 converts the analog measurement value Sa from the circuit a or the circuit B sent from the switching unit 16-1 into a digital measurement value Sd and sends the digital measurement value Sd to the averaging unit 11.
The average processing unit 11 calculates an average value of a plurality of measurement values from the measurement object, which are sequentially input from the ADC14, and outputs the average measurement value from an output unit (not shown). In the semiconductor device of the present invention, the digital measurement value Sd may be directly input to the averaging section 11 without passing through the ADC14, and the averaging process may be performed. In this case, for example, the measurement object outputs a digital measurement value Sd.
The control unit 12 controls the operation timing in the averaging unit 11, and controls the switching timing of the switching unit 16-1 in conjunction with the operation timing. In the semiconductor device 100 of the comparative example, the CPU20 needs to perform switching one by one according to software, but in the semiconductor device 10, the control unit 12 controls the switching unit 16-1 to perform switching according to timing (switching timing tset shown by < 2 > in fig. 2 (b)) in consideration of time required for each switching (for example, convergence time of an internal state of an analog circuit to be measured) in conjunction with the operation of the ADC 14.
That is, the switching timing in the switching unit 16-1 is set by software provided in the control unit 12, taking into account the setup time and the like at the time of switching each measurement object, or taking into account the switching characteristics and the like of the switching unit 16-1. In the present embodiment, the control by the control unit 12 is described by taking the switching control by the switching unit 16-1 as an example, but the control may be configured to perform the control of an external circuit that is not switched. The controller 12 of the present embodiment controls the averaging unit 11 with the control signal Cv, the ADC14 with the control signal Ca, and the switching unit 16-1 with the control signal Cs, based on two timer signals TIM1, TIM2 from the timer 13.
The timer 13 generates a timer signal, which is a timing signal used for generating a control signal for the control unit 12 to control each part. As described above, the timer signals include two timer signals TIM1 and TIM2, timer signal TIM1 is synchronized with TIM2, and the timing interval of timer signal TIM2 is narrower than the timing interval of timer signal TIM 1. Once the timer 13 is started, the timer signals TIM1, TIM2 continue to be output even without software-based control or the like thereafter. Note that the timer signal does not necessarily need to be divided into two TIM1 and TIM2, and one timer signal may be used. As the timer signal in this case, a timer signal TIM2 is used.
The configuration of the averaging unit 11 will be described with reference to fig. 1 (b). As shown in fig. 1 (b), the averaging unit 11 includes: an averaging circuit 32, and a plurality of memory circuits 31-1, 31-2, … 31-n (hereinafter, collectively referred to as "memory circuits 31"). The storage circuit 31 is a storage circuit (buffer memory) that temporarily stores the measurement value sent from the ADC14, and one storage circuit 31 is assigned to each of a plurality of measurement objects. In the present embodiment, since there are two measurement targets, two memory circuits 31 (or two memory circuits 31) of a plurality of memory circuits 31 (illustrated as n in fig. 1 b) are used. A specific example of the memory circuit 31 is, for example, a memory, but an integration circuit may be used instead of the memory.
The averaging circuit 32 performs averaging processing on the measurement value of each measurement object transmitted from the storage circuit 31, calculates an average measurement value, and outputs the average measurement value.
Next, details of the averaging process performed in the semiconductor device 10 will be described with reference to fig. 2. Fig. 2 (a) shows a relationship between timer signals TIM1 and TIM2 in the averaging process, fig. 2 (b) shows a timing relationship between switching and measurement controlled by timer signal TIM2, and fig. 2 (c) shows an example of a measurement sequence.
As indicated by < 1 > in fig. 2 (a), the averaging process according to the present embodiment is configured by successive averaging processes 1, 2, 3, 4, and … (hereinafter, referred to as "averaging process i" in some cases) defined at regular intervals based on the timer signal TIM 1. The average processing unit 11 outputs the average measurement value of each measurement object at each of times t0, t1, t2, t3, t4, and … indicated by the timer signal TIM1, that is, at times indicated by < 2 > in fig. 2 (a).
< 3 > of FIG. 2 (a) shows the internal processing of each averaging processing i. As shown in (a) of fig. 2, each averaging process i includes: a measurement period Tm and a preparatory period Tw. The measurement period Tm is a period during which measurement of a plurality of measurement objects is performed (digital measurement data is acquired from the ADC 14). The preparatory period Tw is a period provided between the measurement periods Tm and during which no processing is performed. The preliminary period Tw is not necessarily required, and may be omitted when it is desired to accelerate the averaging process, for example.
Here, in the semiconductor device 10 of the present embodiment, the process in each averaging process i is executed in accordance with the measurement sequence. The measurement sequence is a table for setting the measurement order and the number of measurements for each measurement object, and is created in the control unit 12 in the present embodiment. Fig. 2 (c) shows an example of a measurement sequence. The length of time for measuring the sequence is the measurement period Tm. Fig. 2 (c) illustrates a case where ten measurements are performed on the circuit a and six measurements are performed on the circuit B. In addition, the measurement sequence is set so that the circuit a and the circuit B are alternately measured as much as possible. This is to suppress as much as possible the variation in the measurement value of each measurement target in the measurement timing.
Fig. 2 (b) shows the measurement timing of the switching controlled by the timer signal TIM 2. < 1 > of (b) of FIG. 2 is the measurement sequence shown in (c) of FIG. 2. In the present embodiment, the switching timing tset and the measurement timing tmes are set for each measurement object (circuit a and circuit B) included in the measurement sequence. The switching timing tset is the switching timing of the switching unit 16-1 transmitted by the control signal Cs, and the measurement timing tmes is the timing at which the averaging unit 11 transmitted by the control signals Cv and Ca acquires the measurement value from the ADC 14. As shown by < 2 > in fig. 2 (b), a time lag is provided between the switching timing tset and the measurement timing tmes (in the example of < 2 > in fig. 2 (b), a time lag of the amount of two pulses of the timer signal TIM2 is provided). This time lag is set in consideration of the time until the switching unit 16-1 stabilizes after receiving the switching timing tset, the time until the measurement value of the measurement target stabilizes, and the like. In the present embodiment, the time lag between the switching timing tset and the measurement timing tmes is a fixed value, but the time lag can be set to any value by software used in the control unit 12.
As described above in detail, in the semiconductor device 10 of the present embodiment, each process in the switching unit 16, the ADC14, and the averaging unit 11 is executed by an independent process by hardware based on a preset timer signal according to a preset measurement sequence. In this case, the control unit 12 can set the measurement sequence by software, and can flexibly set the measurement order, the number of measurements, and the like of the measurement target. The timer signal is autonomously generated by the timer 13, and is continuously supplied at a predetermined processing timing, for example, unless a stop signal is transmitted from the control unit 12. The processing timing is set to execute the processing for the shortest time, taking into consideration the processing time of each of the switching unit 16, ADC14, averaging unit 11, and control unit 12. The timing interval of the timer signal in the timer 13 and the like can also be flexibly set by software.
Further, in the semiconductor device 10 of the present embodiment, two timer signals are used: a timer signal TIM1 that defines a timing for setting an interval for executing the averaging process i and outputting an average measurement value; and a timer signal TIM2 that defines a switching timing tset and a measurement timing tmes in the measurement sequence. This simplifies the processing in each of the switching unit 16-1, ADC14, and averaging unit 11 by the control unit 12, and therefore reduces the load on the control unit 12.
[ second embodiment ]
The semiconductor device and the measurement processing system according to the present embodiment will be described with reference to fig. 3. As shown in fig. 3, the measurement processing system according to the present embodiment includes: a semiconductor device 10A, and switching units 16-3, 16-4, and 16-5. As shown in fig. 3, the semiconductor device 10A includes: an averaging unit 11, a control unit 12, a timer 13, an ADC14, a switch setting unit 15, a switch unit 16-2, a CPU20, and a memory 21. The semiconductor device 10A is provided with switching units 16-3, 16-4, and 16-5 on the outside. The measurement targets of the semiconductor device 10A are circuits a1, a2, …, An, a1, C1, and C2.
The functions of the averaging unit 11, the control unit 12, the timer 13, and the ADC14 are the same as those of the first embodiment, and therefore, detailed description thereof is omitted. In the semiconductor device 10A of the present embodiment, the switching setting unit 15, the switching unit 16-2, the CPU20, the memory 21, and the bus 22 are added to the semiconductor device 10.
The switching unit 16-2 is a switching unit provided in the vicinity of the input of the ADC14, and is provided in the semiconductor device 10A in a standard manner. In this manner, the switching unit may be provided not only outside but also inside. In the semiconductor device 10A, the number of measurement targets is (n +3), and the four switching units control the measurement targets, so that switching is frequent. Therefore, in the present embodiment, a dedicated switching setting unit 15 is provided for controlling switching of each switching unit. The switching setting unit 15 switches the measurement values of the measurement objects input to the ADC14 one by one based on the instruction of the control unit 12.
In the semiconductor device 10A of the present embodiment, the control unit 12, the averaging unit 11, the ADC14, and the switching setting unit 15 operate based on the timer signals TIM1 and TIM2 generated by the timer 13, and perform the averaging process i based on the measurement sequence set in the control unit 12.
The CPU20 supplies each average measurement value received from the average processing unit 11 via the bus 22 to an external functional unit that executes predetermined processing using the average measurement value, for example, by a communication function (not shown). The memory 21 stores, for example, the average measurement value calculated by the average processing unit 11.
In the semiconductor device 10A, as in the semiconductor device 10 described above, averaging processing is performed on the measurement values of the measurement targets transmitted from the ADC14 by a predetermined number of samples. In addition, the averaging process independently sets the number of measurements and the order of measurement for each measurement object based on the measurement sequence.
For example, when the measurement values of the circuit a1 and the circuit a2 (hereinafter, the circuit a1 and the like are referred to as "a 1" and the like) shown in fig. 3 are alternately measured and averaged, the order and the number of times of measurement objects are defined by setting the measurement sequence to, for example, < a1, a2, a1, a2, …, a1, and a2 >. The repetition period in the measurement sequence in this case is (a1, a 2). The measurement values a1 and a2 are sequentially and alternately taken into the ADC14 and distributed to the memory circuit 31 (see fig. 1 (b)), and the average measurement value is independently calculated. In the above measurement sequence, the manner in which a1 and a2 are alternately arranged is exemplified, but the arrangement is not limited to this, and a1 and a2 may be arranged continuously, respectively. The number of measurement objects is not limited to two, and may be any number, and the switching unit 16 may be provided only as many as necessary according to the number of measurement objects. Further, the repetition need not be performed in units of (a1, a2), and different numbers may be arranged depending on the number of measurements of each of a1 and a 2.
Further, the present embodiment can also be applied to a case where the measurement value of a certain circuit is controlled based on the output of another circuit. For example, when a value is changed using a measured value of a certain circuit as a parameter, in such a case, a measured value of a circuit as another circuit is changed. The change of the measurement value here includes, for example, a case where the gain of the circuit to be measured is changed. In the circuit shown in FIG. 3, for example, A1 changes the measured value in accordance with B1 or C1 which is the output of the switching unit 16-4, and A2 changes the measured value in accordance with C1 or C2 which is the output of the switching unit 16-5. In such a case, the measurement can be performed by setting the switching unit 16-4 or the switching unit 16-5.
Here, a1, for example, whose value has been changed according to B1, is hereinafter referred to as a1 (B1). In this case, the measurement sequence is set to, for example, < a1(B1), a2, a1(C1), a2, a1(B1), a2, a1(C1), a2, …, a1(B1), a2, a1(C1), a2 >. The repetition period in the measurement sequence in this case is: (A1(B1), A2, A1(C1) and A2). This makes it possible to specify the number of samples for a1(B1), a2, and a1(C1) and obtain the average measurement values of the samples. As described above, it is not always necessary to repeat the operations at the cycle of (a1(B1), a2, a1(C1), and a 2).
More specifically, it is also possible to successively measure each of a1(B1), a2, a1(C1), and calculate the average measurement value in the number of samples different from each other. For example, the measurement conditions of a1(B1), a1(C1) and a2 are set as follows.
A1 (B1): the number of consecutive measurements is 2 and the number of samples is 4.
A1 (C1): the number of consecutive measurements is 3 and the number of samples is 10.
A2: the number of consecutive measurements is 1 and the number of samples is 6.
The measurement sequence in this case is as follows.
<A1(B1)、A1(B1)、A1(C1)、A1(C1)、A1(C1)、A2、A1(B1)、A1(B1)、A1(C1)、A1(C1)、A1(C1)、A2、A1(C1)、A1(C1)、A1(C1)、A2、A1(C1)、A2、A2、A2>
The measurement sequence is set by software in the control unit 12.
As described above in detail, according to the semiconductor device 10A of the present embodiment, in the mode in which the switching unit 16 is provided not only outside but also inside, in the semiconductor device and the measurement processing system having the configuration in which the average measurement value is calculated by performing the average processing on a plurality of measurement values, it is possible to acquire a more accurate average measurement value in a shorter time than in the case of performing the software processing. In addition, according to the semiconductor device 10A of the present embodiment, since the averaging process is executed by hardware independent of the CPU20, the load of the software process in the CPU20 can be reduced as compared with the semiconductor device 100 of the comparative example. Therefore, the CPU20 can also take in other software processing. Alternatively, as a result of reducing the load, the operation speed of the CPU20 can be reduced, and the storage capacity for programs and data can be reduced.
[ third embodiment ]
The semiconductor device and the measurement processing system according to this embodiment will be described with reference to fig. 4. As shown in fig. 4, the measurement system of the present embodiment includes: semiconductor device 10B, and switching units 16-3, 16-4, 16-5, and 16-7. As shown in fig. 4, the semiconductor device 10B is a system in which a DAC (digital-to-analog converter) control unit 23, a DAC24, and a switching unit 16-6 are added to the semiconductor device 10A shown in fig. 3. Therefore, the same components as those of the semiconductor device 10A are denoted by the same reference numerals, and detailed description thereof is omitted. In the semiconductor device 10B, a switching unit 16-7 is also connected to the outside. The DAC control unit 23, DAC24, and switching units 16-6 and 16-7 are examples of the "change setting unit" according to the present invention.
The DAC control unit 23, DAC24, and switching units 16-6 and 16-7 have a function of changing the measurement value of an external circuit (measurement target) by an analog signal. That is, the semiconductor device 10B has a structure in which an external circuit is controlled by an internal circuit. For example, in fig. 4, B1 and C1 can be controlled by switching the switching unit 16-7 in accordance with the output from the semiconductor device 10B.
Here, in some cases, a circuit to be measured needs to change a value of a signal supplied to the circuit in accordance with a measurement result. In some cases, the value of the signal supplied to the circuit is changed depending on the type of the measurement item of the circuit. The semiconductor device 10B of the present embodiment can be equipped with such a standard function by including the DAC control unit 23, the DAC24, and the switching unit 16-6.
The DAC control unit 23 has a function of controlling the DAC24 based on an instruction from the control unit 12. The DAC control unit 23 generates a digital signal for controlling the external circuit (B1 or C1 in the example of fig. 4) based on the instruction from the control unit 12. The DAC control unit 23 may be configured to acquire a digital signal for controlling an external circuit from outside the semiconductor device 10B.
The DAC24 converts the digital signal received from the DAC control unit 23 into an analog signal. The switches 16-6 and 16-7 switch circuits (B1 and C1) for supplying analog signals from the DAC 24.
As shown in fig. 4, control signals are input from the control unit 12 to the DAC control unit 23 and the DAC24, and are controlled by the DAC control unit 23. The processing in the DAC control section 23, DAC24, and switching sections 16-6 and 16-7 is also executed based on timing signals supplied from the timer signals TIM1 and TIM2 shown in fig. 1. The order and the number of times of the analog signals supplied from the DAC24 are also set to be included in the measurement sequence shown in fig. 2 (c).
[ fourth embodiment ]
The semiconductor device and the measurement processing system according to the present embodiment will be described with reference to fig. 5. As shown in fig. 5 (a), the measurement system according to the present embodiment includes: a semiconductor device 10C and a switching unit 16-1. As shown in fig. 5 (a), the semiconductor device 10C is a system in which an ADC timer signal TIMA input from the timer 13 to the controller 12 and a timer control signal Tc input from the controller 12 to the timer 13 are added to the semiconductor device 10 shown in fig. 1. Therefore, the same components as those of the semiconductor device 10 are denoted by the same reference numerals, and detailed description thereof is omitted.
The ADC timer signal TIMA according to the present embodiment is a signal for setting a period from the measurement timing tmes to the switching timing tset. On the other hand, the timer control signal Tc is a signal for generating a timer start trigger, which generates the timer signal TIM2 and the ADC timer signal TIMA.
In the first embodiment, the time lag, which is the period from the switching timing tset to the measurement timing tmes, is a fixed value. In the first embodiment, the time lag is set in consideration of the time until the switching unit 16-1 stabilizes after receiving the switching timing tset, and in consideration of the time until the measured value of the measurement target stabilizes for each of the circuit a and the circuit B as the measurement target. However, depending on the characteristics of the measurement processing system and the like, there is a case where the time lag needs to be set more flexibly. The present embodiment is configured to be compatible with such a system.
The operation of the semiconductor device 10C will be described in more detail with reference to fig. 5 (b). The measurement sequence shown in fig. 2 (c) is the same as the measurement sequence in fig. 5 (b) < 1 >, and the measurement period Tm is a cycle. Further, a time lag from the switching timing tset to the measurement timing tmes is set based on the timer signal TIM2, and a period from the measurement timing tmes to the switching timing tset is set based on the ADC timer signal TIMA. Here, in the semiconductor device 10C, when a trigger signal for starting the timer is input to a timer (not shown) that generates the timer signal TIM2 and the ADC timer signal TIMA, the timer is turned on for a predetermined time (time counting) and then turned off automatically. In the present embodiment, the timer signal TIM2 is timed at a time different from the time counted by the ADC timer signal TIMA, but may be timed at the same time.
The timer control signal Tc has a function of generating a signal for triggering the start of a timer, which generates the timer signal TIM2 and the ADC timer signal TIMA. That is, in the first measurement of the circuit a indicated by < 1 > in (b) of fig. 5, the timer control signal Tc generates one pulse at each of the times t1, t2, and t 3. The timer of the timer signal TIM2 starts with the pulse at time t1 as a start trigger to define the switching timing tset, and the timer of the timer signal TIM2 is turned off after a predetermined count time. The timer signal TIM2 at this time is transmitted to the control unit 12. The timer signal TIM2 is set to a timer off timing tmes, and the measurement of the circuit a is executed.
On the other hand, the control unit 12 detects the timer for the timer signal TIM2 being turned off, and transmits the detection result to the timer 13. The timer 13 issues a start trigger for starting the timer using the ADC timer signal at time t2 based on the detection signal. The ADC counts the pulse at time t2 as a start trigger for a predetermined time using the timer of timer signal TIMA, and then shuts down. The ADC timer signal TIMA at this time is sent to the control unit 12. The period from the measurement timing tmes to the switching timing tset is defined based on the timer count time of the ADC timer signal TIMA. The control unit 12 detects the timer for the ADC timer signal TIMA to be turned off, and sends the timer 13 that the turn-off is detected. The detection signal is a pulse of the timer control signal Tc at time t3, and the timer signal TIM2 starts the pulse as a start trigger, and thereafter, the measurement of the circuit B is continued by the same operation.
Here, in the present embodiment, the period from the switching timing tset to the measurement timing tmes for the circuit B is the same period as the period from the switching timing tset to the measurement timing tmes for the circuit a, but may be a different period from the circuit a. At this time, the timer signal TIM2 may be changed by changing the setting of a timer that generates the timer signal TIM2 based on the timer control signal Tc, or a timer (not shown) that generates a timer signal different from the timer signal TIM2 may be further provided and started. The same applies to the period from the measurement timing tmes to the switching timing tset for the circuit B.
Further, the present embodiment can be applied to a case where a plurality of switching units are provided as in the second embodiment. In this case, the configuration may be such that: further, a timer for setting a period from the switching timing tset to the measurement timing tmes and a timer for setting a period from the measurement timing tmes to the switching timing tset are provided according to the number of switching units or circuits to be measured.
As described above, according to the semiconductor device and the measurement processing system of the present embodiment, the period from the switching timing tset to the measurement timing tmes can be set flexibly according to the measurement target or the like.