Semiconductor device and correction method
The semiconductor device adjusts oscillation frequency by deriving a correction amount from communication baud rate, addressing frequency fluctuations due to temperature changes and improving accuracy.
Patent Information
- Application Number
- JP2024057668
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-03-29
- Publication Date
- 2025-10-10
AI Technical Summary
The oscillation frequency of semiconductor devices fluctuates with temperature changes, making it difficult to adjust using a predetermined trimming value effectively.
A semiconductor device with a trimming value setting unit, communication unit, and correction unit that derives a correction amount based on the baud rate of communication to adjust the trimming value, ensuring accurate oscillation frequency.
Improves oscillation accuracy by dynamically correcting the trimming value, maintaining frequency within specified limits despite environmental changes.
Smart Images

Figure 2025154581000001_ABST
Abstract
Description
[Technical Field]
[0001] The present disclosure relates to a semiconductor device and a correction method. [Background technology]
[0002] 2. Description of the Related Art Semiconductor devices equipped with oscillator circuits are known. In such semiconductor devices, a technique for trimming (adjusting) the oscillation frequency of the oscillator circuit is known (see, for example, Patent Document 1). [Prior art documents] [Patent documents]
[0003] [Patent Document 1] Japanese Patent Application Laid-Open No. 2013-153407 Summary of the Invention [Problem to be solved by the invention]
[0004] However, it is known that the oscillation frequency fluctuates depending on the temperature of the operating environment, etc. Therefore, there are cases where the oscillation frequency cannot be adjusted sufficiently using a predetermined trimming value.
[0005] In response to the above problem, an object of the present disclosure is to provide a semiconductor device and a correction method that can improve oscillation accuracy. [Means for solving the problem]
[0006] In order to achieve the above object, the semiconductor device of the present disclosure includes a trimming value setting unit in which a trimming value is set, an oscillation circuit that outputs a signal whose oscillation frequency is trimmed by the trimming value set in the trimming value setting unit, a communication unit that communicates with an external device, and a correction unit that derives a correction amount for the trimming value based on the baud rate of communication by the communication unit and corrects the trimming value using the derived correction amount.
[0007] In addition, in order to achieve the above-mentioned object, the correction method of the present disclosure derives a correction amount of a trimming value set in a trimming value setting unit, which trims the oscillation frequency of an oscillator circuit, based on the baud rate of communication by a communication unit that communicates with an external device, and corrects the trimming value using the derived correction amount. [Effects of the Invention]
[0008] According to the present disclosure, it is possible to improve oscillation accuracy. [Brief explanation of the drawings]
[0009] [Figure 1] 1 is a block diagram showing an example of a configuration of a semiconductor device according to an embodiment; [Figure 2] FIG. 1 is a configuration diagram for LIN communication. [Figure 3] FIG. 10 is a diagram for explaining an initial value of a trimming value. [Figure 4A] FIG. 10 is a diagram for explaining correction of a trimming value. [Figure 4B] FIG. 10 is a diagram for explaining correction of a trimming value. [Figure 4C] FIG. 10 is a diagram for explaining correction of a trimming value. [Figure 5] FIG. 2 is a diagram illustrating a frame structure of LIN communication. [Figure 6] FIG. 2 is a block diagram showing an example of the configuration of a correction unit. [Figure 7] 10 is a flowchart illustrating an example of the flow of a correction process. DETAILED DESCRIPTION OF THE INVENTION
[0010] Hereinafter, embodiments of the present disclosure will be described in detail with reference to the drawings. Note that the following embodiments do not limit the technology of the present disclosure.
[0011] 1 is a block diagram showing an example of the configuration of a semiconductor device 10 according to this embodiment. As shown in Fig. 1, the semiconductor device 10 according to this embodiment includes a communication unit 20, a memory 22, a trimming register 24, a correction unit 26, an oscillation circuit 28, a CPU (Central Processing Unit) 30, a clock monitor 32, and a reset generation circuit 34.
[0012] The communication unit 20 has a function of communicating with devices external to the semiconductor device 10. The communication unit 20 of this embodiment is a communication unit for performing LIN (Local Interconnect Network) communication, and operates as a slave node with respect to an external device 2 which is a master node connected via a LIN bus 4, as shown in FIG.
[0013] A trimming value for trimming (adjusting) the oscillation frequency of the oscillator circuit 28 is set in the trimming register 24. The trimming register 24 of this embodiment is an example of a trimming value setting unit of the present disclosure. The memory 22 stores an initial value of the trimming value to be set in the trimming register 24. A specific example of the memory 22 is a flash memory.
[0014] The oscillator circuit 28 outputs a signal whose oscillation frequency has been trimmed using the trimming value set in the trimming register 24. In this embodiment, a specific example of the oscillator circuit 28 includes an RC oscillator circuit using R (resistance) and C (capacitor). The RC oscillator circuit outputs a sine wave AC signal having an oscillation frequency that is inversely proportional to the product of R (resistance: resistance value) and C (capacitor: electrostatic capacitance). The output of the oscillator circuit 28 is used as the clock (LINCLK) of the communication unit 20.
[0015] The clock monitor 32 monitors the oscillation frequency of the oscillation circuit 28, and when the oscillation frequency exceeds a predetermined threshold, outputs a reset request to the reset generation circuit 34. When the reset generation circuit 34 receives the reset request from the clock monitor 32, it restarts the oscillation circuit 28. In this way, in the semiconductor device 10 of this embodiment, when the oscillation frequency of the oscillation circuit 28 deviates from the range that can be adjusted by trimming, the oscillation circuit 28 is restarted.
[0016] The correction unit 26 has a function of correcting the trimming value set in the trimming register 24. The oscillation frequency of the oscillation circuit 28 changes depending on the operating environment, such as temperature. For example, in the case of an RC oscillation circuit, the resistance value of the resistor (R) may change depending on the temperature, and the capacitance of the capacitor (C) may also change depending on the temperature or applied voltage, so the oscillation frequency changes depending on the temperature, etc. Therefore, as shown in FIG. 3, the initial value of the trimming value is determined so that the oscillation frequency falls within a specified range even if the operating environment (temperature in FIG. 3) changes. Note that in FIG. 3, the specified range is within ±3% of the ideal value.
[0017] However, when the operating environment changes significantly, trimming (adjusting) the oscillation frequency with the initial trimming value may not be sufficient. Therefore, the correction unit 26 of this embodiment corrects the trimming value used to trim (adjust) the oscillation frequency. As shown in FIGS. 4A to 4C, the correction unit 26 corrects the trimming value so that the trimmed oscillation frequency becomes the ideal oscillation frequency value according to the current operating environment (temperature in FIGS. 4A to 4C). The example shown in FIG. 4A illustrates a case where the operating environment temperature is t1°C. In this case, the trimming value is corrected so that the oscillation frequency at t1°C becomes the ideal value. Furthermore, the example shown in FIG. 4B illustrates a case where the operating environment temperature is t2°C. In this case, the trimming value is corrected so that the oscillation frequency at t2°C becomes the ideal value. Furthermore, the example shown in FIG. 4C illustrates a case where the operating environment temperature is t3°C. In this case, the trimming value is corrected so that the oscillation frequency at t3°C becomes the ideal value. By correcting the trimming value in this way so that the oscillation frequency becomes the ideal value, the oscillation frequency of the oscillation circuit 28 can be kept within the specified range even if the usage environment changes slightly after correction.
[0018] Specifically, the correction unit 26 of this embodiment derives the amount of correction for the trimming value based on the baud rate of communication by the communication unit 20, and corrects the trimming value using the derived amount of correction.
[0019] Here, the LIN communication performed by the communication unit 20 will be described. An example of the structure of a LIN frame is shown in Fig. 5. One LIN frame is composed of a header and a response. The header is transmitted from the external device 2, which is the master node. On the other hand, the response is transmitted from the communication unit 20 of the semiconductor device 10, which is the slave node.
[0020] As shown in Figure 5, the header contains a Break field, a Sync field, and a ProtectID (PID) field. The Break field notifies the slave node of the start of the LIN frame. The Sync field is used to correct the slave node's clock error and is a synchronization signal that corrects the error by synchronizing with the master node's clock. Currently, in LIN communication, the master node allows a clock error of ±0.5%, so the master node generates an accurate clock and uses it as a synchronization signal. The slave node measures the waveform of the Sync field embedded in the LIN frame, which is the message transmitted by the master node, as a reference waveform for time correction and corrects the transmission baud rate accordingly. Specifically, the slave node adjusts the clock error based on the 1-bit time interval (TBit), calculated by dividing the time difference between the first and last rising edges of the clock in the Sync field by 8. The ProtectID field represents the LIN frame's identification information.
[0021] As described above, the clock in the Sync field included in the header of the LIN communication received by the communication unit 20 is highly accurate. Therefore, the communication unit 20 derives the correction amount for the trimming value set in the trimming register 24 based on the baud rate derived from the clock in the Sync field. Note that the baud rate is the number of data bits transferred per second, and in this embodiment, refers to the frequency when 1T is one period.
[0022] Specifically, the correction unit 26 of this embodiment derives the correction amount of the trimming value set in the trimming register 24 from the above-mentioned baud rate, the count value of the clock for LIN communication, the ideal clock frequency of the oscillator circuit, and the frequency fluctuation value per code of the trimming value of the oscillator circuit.
[0023] Next, the derivation of the correction amount of the trimming value set in the trimming register 24 by the correction unit 26 will be described in detail. Fig. 6 is a block diagram showing an outline of an example of the configuration of the correction unit 26. As shown in Fig. 6, the correction unit 26 includes a CCLK register 40, a LINBRT register 42, a PCLK register 44, a TCNT register 46, a TRIM register 48, a CCNT register 54, a PCNT register 56, a DCNT register 60, a CRT register 64, a NewTRIM register 68, and logic circuits 50, 52, 58, 62, and 66. Note that in Fig. 6, in the symbols "A" and "B" used to identify operations in the logic circuit, "A" indicates the upper row in Fig. 6, and "B" indicates the lower row.
[0024] The CCLK register 40 holds the frequency variation value CCLK per one code of the trimming value input from the CPU 30 to the correction unit 26. In this embodiment, as an example, the frequency variation value CCLK per one code of the trimming value of the oscillator circuit 28 is held in the CPU 30.
[0025] The LINBRT register 42 holds the baud rate LINBRT of the LIN communication input from the communication unit 20 to the correction unit 26 .
[0026] The PCLK register 44 holds the ideal clock frequency PCLK input from the CPU 30 to the correction unit 26. The ideal clock frequency is the clock frequency that is considered ideal for the oscillation circuit 28, and is held in the CPU 30 in advance.
[0027] The TCNT register 46 holds the clock count TCNT per 1T in the LIN communication input from the communication unit 20 to the correction unit 26 .
[0028] The TRIM register 48 holds the input from the memory 22 to the trimming register 24 .
[0029] The logic circuit 50 has a function of deriving the number of counts CCNT per one code of the trimming value by dividing the frequency fluctuation value CCLK(A) by the baud rate LINBRT(B) (A / B). The number of counts CCNT per one code of the trimming value derived by the logic circuit 50 is output to a CCNT register 54 and temporarily held in the CCNT register 54.
[0030] The logic circuit 52 has a function of deriving the ideal count number PCNT of the oscillator circuit 28 by dividing the ideal clock frequency PCLK(B) by the baud rate LINBRT(A) (B / A). The ideal count number PCNT derived by the logic circuit 52 is output to the PCNT register 56 and temporarily held in the PCNT register 56.
[0031] The logic circuit 58 has a function of deriving a count difference DCNT by subtracting (AB) the clock count TCNT (B) per 1T from the ideal count number PCNT. The count difference DCNT derived by the logic circuit 58 is output to a DCNT register 60 and temporarily held therein.
[0032] The logic circuit 62 has a function of deriving a correction amount CRT of the trimming value currently set in the trimming register 24 by dividing (B / A) the count difference DCNT(B) by the count number CCNT(A) per trimming value code. The correction amount CRT derived by the logic circuit 62 is output to the CRT register 64 and temporarily held therein.
[0033] The logic circuit 66 has a function of adding (A+B) the correction amount CRT(A) and the trimming value TRIM(B) currently set in the trimming register 24. Here, the trimming register 24 is set to the initial value of the trimming value stored in the memory 22, so the trimming value TRIM is the initial value of the trimming value. The logic circuit 66 derives the corrected trimming value NewTRIM by adding the trimming value TRIM, which is the initial value of the trimming value, to the correction amount CRT. The corrected trimming value NewTRIM derived by the logic circuit 66 is output to the NewTRIM register 68 and temporarily held therein.
[0034] The corrected trimming value NewTRIM held in the NewTRIM register 68 is output to the trimming register 24. As a result, the trimming register 24 is set to the corrected trimming value NewTRIM.
[0035] Next, a method for correcting the trimming value set in the trimming register 24 by the semiconductor device 10 of this embodiment will be described in detail. First, an initial value of the trimming value is read from the memory 22 to the trimming register 24 in advance. Then, the oscillator circuit 28 is started, and the clock monitor 32 starts monitoring the oscillation frequency of the oscillator circuit 28. Note that the series of processes for monitoring the oscillation frequency by the clock monitor 32 and performing the reset operation by the reset generation circuit 34 are performed separately from the correction process for correcting the trimming value of the trimming register 24.
[0036] When the pre-processing is completed, the correction processing shown in Fig. 7 is performed. Fig. 7 shows a flowchart showing an example of the flow of the correction processing by the semiconductor device 10.
[0037] In step S100, the trimming register 24 notifies the correction unit 26 of the current trimming value.
[0038] In the next step S102, the communication unit 20 notifies the correction unit 26 of the baud rate LINBRT in the LIN communication.
[0039] In the next step S104, the correction unit 26 determines whether the Sync field included in the above-mentioned LIN frame has ended. As an example, the correction unit 26 of this embodiment determines whether the Sync field has ended based on signals cnt_en and sync_cnt (both of which are shown in FIG. 5) synchronized with the LIN frame signal. The correction unit 26 remains in a standby state until the Sync field ends. On the other hand, if the Sync field ends, the determination is affirmative, and the process proceeds to step S106.
[0040] In step S106, the communication unit 20 notifies the correction unit 26 of the clock count TCNT per 1T in the LIN communication.
[0041] In the next step S108, the communication unit 20 notifies the CPU 30 of the completion of the LIN communication.
[0042] In the next step S110, the correction unit 26 derives the corrected trimming value as described above.
[0043] That is, the logic circuit 50 derives the count number CCNT per trimming value code from the frequency variation value CCLK and the baud rate LINBRT using the following equation (1). CCNT=CCLK / LINBRT (1)
[0044] Furthermore, the ideal count number PCNT of the oscillator circuit 28 is derived from the baud rate LINBRT and the ideal clock frequency PCLK using the following equation (2). PCNT=PCLK / LINBR (2)
[0045] Then, the count difference DCNT is calculated from the ideal count number PCNT and the clock count per 1T TCNT using the following equation (3). DCNT = PCNT - TCNT (3)
[0046] The trimming value correction amount CRT currently set in the trimming register 24 is calculated from the count number CCNT per trimming value code and the count difference DCNT using the following equation (4). CRT=DCNT / CCNT (4)
[0047] The trimming value TRIM set in the trimming register 24 is added to the correction amount CRT to derive the corrected trimming value NewTRIM according to the following equation (5). NewTRIM=CRT+TRIM (5)
[0048] In the next step S112, the correction unit 26 notifies the CPU 30 of an interrupt request for correcting the trimming value.
[0049] In the next step S114, the CPU 30 temporarily stops each of the functions it has installed in response to the interrupt request. Changing the trimming value while a function is running could cause a problem, so the CPU 3 temporarily stops the operation of each function in this way.
[0050] In the next step S116, the CPU 30 notifies the trimming register 24 of a request to update the trimming value.
[0051] In the next step S118, in response to the update request, the trimming register 24 updates the setting to the corrected trimming value NewTRIM notified by the correction unit 26. As a result, the trimming register 24 starts to output the trimming value NewTRIM to the oscillation circuit 28, and the oscillation circuit 28 starts to output a signal whose oscillation frequency has been trimmed (adjusted) by the trimming value NewTRIM.
[0052] In the next step S120, when the oscillation has stabilized, the oscillator circuit 28 notifies the CPU 30. That is, the oscillator circuit 28 notifies the CPU 30 that it has become possible to stably output a signal trimmed by the trimming value NewTRIM.
[0053] In the next step S122, the CPU 30 resumes the operation of each function that was temporarily stopped in the above step S114. When the process of step S122 ends, the series of correction processes by the semiconductor device 10 shown in FIG. 7 ends.
[0054] As described above, the semiconductor device 10 of this embodiment includes the trimming register 24 in which a trimming value is set, the oscillator circuit 28 that outputs a signal whose oscillation frequency is trimmed by the trimming value set in the trimming register 24, and the communication unit 20 that communicates with the external device 2. The semiconductor device 10 also includes a correction unit 26 that derives a correction amount for the trimming value based on the baud rate of communication by the communication unit 20 and corrects the trimming value using the derived correction amount.
[0055] In this way, the semiconductor device 10 can dynamically correct the trimming value because the correction unit 26 derives the correction amount of the trimming value based on the communication baud rate, thereby dynamically correcting the oscillation frequency of the oscillator circuit 28 and improving the oscillation accuracy of the oscillator circuit 28.
[0056] Furthermore, in the semiconductor device 10 of this embodiment, the communication unit 20 functions as a slave node in LIN communication, and the correction unit 26 corrects the trimming value using the Sync field of LIN communication. Because the clock accuracy of the master node in LIN communication is ±0.5%, the corrected oscillation frequency also has an error from the ideal value. For example, if the ideal clock frequency PCLK of the oscillator circuit 28 is 48 MHz and the frequency fluctuation value CCLK per trimming value code is 25 kHz, an error of up to 0.55% occurs. However, this error is sufficiently small compared to the currently set standard of ±3%, which takes into account environmental and aging degradation. Therefore, this embodiment can prevent the standard from expanding.
[0057] Furthermore, according to the semiconductor device 10 of this embodiment, by changing the ideal clock frequency PCLK, it is possible to change to a different oscillation frequency after LIN communication.
[0058] In the above embodiment, the trimming value correction performed by the correction unit 26 is described as deriving the correction amount from the initial value of the trimming value, but the method for deriving the correction amount is not limited to this. For example, it is also possible to derive the correction amount from a trimming value that has been corrected in the past and is currently being used, and then derive a new trimming value from the derived correction amount.
[0059] Furthermore, in the above embodiment, an example was described in which the correction unit 26 was configured as a circuit equipped with various registers, etc., but the correction unit 26 may also be configured as a processor such as a CPU, and function as the correction unit 26 by executing a correction processing program.
[0060] Furthermore, in the above embodiment, the oscillator circuit 28 is described as being an RC oscillator circuit, but the oscillator circuit 28 may be an oscillator circuit of another type as long as the oscillation frequency is trimmed (adjusted) by a trimming value.
[0061] The following additional notes are provided regarding the above-described embodiments. (Appendix 1) deriving a correction amount of the trimming value set in the trimming value setting unit, which is used to trim the oscillation frequency of the oscillation circuit, based on a baud rate of communication by a communication unit that communicates with an external device; The trimming value is corrected using the derived correction amount. Correction method.
[0062] (Appendix 2) the external device is a master node of LIN communication, The communication unit operates as a slave node. 2. The semiconductor device according to claim 1.
[0063] (Appendix 3) The correction unit derives the correction amount from the baud rate, the count value of the clock of the LIN communication, the ideal clock frequency of the oscillator circuit, and a frequency fluctuation value per one code of the trimming value of the oscillator circuit. 3. The semiconductor device according to claim 2.
[0064] (Appendix 4) The correction unit performs the correction at the timing when the sync field of the LIN communication ends. 4. The semiconductor device according to claim 2 or 3.
[0065] (Appendix 5) deriving a correction amount of the trimming value set in the trimming value setting unit, which is used to trim the oscillation frequency of the oscillation circuit, based on a baud rate of communication by a communication unit that communicates with an external device; The trimming value is corrected using the derived correction amount. Correction method. [Explanation of symbols]
[0066] 2 External device 10 Semiconductor devices 20 Communications Department 24 Trimming Resistor 26 Correction unit 28 Oscillator Circuit 30 CPU 40 CCLK Register 42 LINBRT Register 44 PCLK Register 46 TCNT Register 48 TRIM Register CCLK frequency variation (per trimming code) CRT correction amount LINBRT Baud rate PCLK Ideal clock frequency TCNT Clock count per 1T
Claims
1. a trimming value setting unit for setting a trimming value; an oscillation circuit that outputs a signal whose oscillation frequency has been trimmed by the trimming value set in the trimming value setting unit; a communication unit for communicating with an external device; a correction unit that derives a correction amount for the trimming value based on a baud rate of communication by the communication unit and corrects the trimming value using the derived correction amount; A semiconductor device comprising:
2. The external device is a master node of LIN communication, The communication unit operates as a slave node. The semiconductor device according to claim 1 .
3. The correction unit derives the correction amount from the baud rate, the count value of the clock of the LIN communication, the ideal clock frequency of the oscillation circuit, and a frequency fluctuation value per one code of the trimming value of the oscillation circuit. The semiconductor device according to claim 2 .
4. The correction unit performs the correction at the timing when the sync field of the LIN communication ends. The semiconductor device according to claim 2 .
5. deriving a correction amount of the trimming value set in the trimming value setting unit, which is used to trim the oscillation frequency of the oscillation circuit, based on a baud rate of communication by a communication unit that communicates with an external device; The trimming value is corrected using the derived correction amount. Correction method.
Citation Information
Patent Citations
CR oscillation circuit
JP2013153407A