Chip adjustment method, electronic device and storage medium with C2 interface bus
The MCU temperature sensing chip is powered on and registered to configure the register through the C2 interface bus protocol, which solves the problem of low adjustment efficiency caused by slow communication speed of JTAG interface, and realizes efficient and reliable temperature calibration and adjustment, improving chip performance and stability.
Patent Information
- Application Number
- CN202410512476.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-26
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-04-26
AI Technical Summary
During the MCU temperature sensing chip, due to the slow communication speed of JTAG interface, the adjustment efficiency is low, which extends the adjustment cycle and increases production costs.
The C2 interface bus protocol is used to power on the chip and register configuration. The actual output temperature value is collected through the C2 interface, the target temperature adjustment value is determined and the register is reconfigured to determine whether the chip is qualified for repair and adjustment. The dual configuration mechanism is used to ensure the repair results. reliability.
It improves the efficiency and accuracy of chip repair and adjustment, reduces the risk of performance problems or failures caused by improper repair and adjustment, and significantly improves the performance and stability of the chip.
Smart Images

Figure CN118425748B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of chips with a C2 interface bus, and in particular to a chip adjustment method, electronic device and storage medium with a C2 interface bus. Background Art
[0002] MCU temperature sensor chips are usually debugged and programmed using interfaces such as the Joint Test Action Group (JTAG). However, as a serial interface, the JTAG interface has a relatively slow communication speed and cannot meet the needs of high-performance chips. During the adjustment process, the slower communication speed will reduce the adjustment efficiency, extend the adjustment cycle, and increase production costs. Summary of the invention
[0003] In view of this, the present application provides a chip trimming method, electronic device and storage medium with a C2 interface bus to solve the technical problem of low chip trimming efficiency.
[0004] A first aspect of the present application provides a chip trimming method having a C2 interface bus, the method comprising:
[0005] Powering on the chip and configuring registers of the chip;
[0006] Collecting a first actual output temperature value of the chip under a first specified environment through a C2 interface bus protocol;
[0007] Determining a target temperature adjustment value based on the first actual output temperature value;
[0008] Reconfiguring the register using the target temperature adjustment value, and collecting a second actual output temperature value of the reconfigured chip through the C2 interface bus protocol;
[0009] Whether the chip is trimmed and adjusted properly is determined according to the second actual output temperature value.
[0010] In an optional implementation, configuring the register of the chip includes:
[0011] Determine a first register and a second register related to temperature in the chip according to the model of the chip;
[0012] Determine whether the preset configuration conditions are met;
[0013] When the preset configuration condition is met, reading a first value of the first register and a second value of the second register;
[0014] Combining the first value and the second value into a first hexadecimal value;
[0015] The first hexadecimal value is assigned to the register.
[0016] In an optional implementation, the determining whether the preset configuration condition is met includes:
[0017] Repeatedly read the value of the register at address 0xA7 until the value of the register at address 0xA7 is 30h;
[0018] Determine whether the 6th bit of the register with address 0xE8 is 1;
[0019] When the sixth bit of the register with the address 0xE8 is not 1, repeatedly read the value of the register with the address 0xA7 until the sixth bit of the register with the address 0xE8 is 1;
[0020] Read the register with address 0xA7 again to see if it is 30h;
[0021] When the value of the register with the address 0xA7 read again is 30h, it is determined that the preset configuration condition is met.
[0022] In an optional implementation, determining the target temperature adjustment value based on the first actual output temperature value includes:
[0023] Input the first actual output temperature value into a preset temperature adjustment model for calculation to obtain a first initial temperature adjustment value, wherein the preset temperature adjustment model is: t*7702 / 256, where t is the actual output temperature value;
[0024] Converting the first initial temperature adjustment value into a second hexadecimal value;
[0025] The target temperature adjustment value is calculated according to the first hexadecimal value and the second hexadecimal value.
[0026] In an optional implementation, judging whether the chip is qualified for trimming according to the second actual output temperature value includes:
[0027] Acquire a first preset standard output temperature value and a second preset standard output temperature value corresponding to the chip in the first specified environment;
[0028] Determining whether the second actual output temperature value is between the first preset standard output temperature value and the second preset standard output temperature value;
[0029] When the second actual output temperature value is between the first preset standard output temperature value and the second preset standard output temperature value, it is determined that the chip is trimmed to be qualified.
[0030] In an optional embodiment, the method further comprises:
[0031] Determine a target FLASH memory location corresponding to the target temperature adjustment value, and write the target temperature adjustment value into the target FLASH memory; and / or
[0032] Write the hexadecimal value 30 to the register at address 0xA7, write the hexadecimal value 40 to the register at address 0xA1, and write the hexadecimal value 01 to the register at address 0xE8.
[0033] In an optional embodiment, the method further comprises:
[0034] After determining that the chip is qualified for adjustment, resetting the C2 interface and configuring the registers of the chip;
[0035] Collecting a third actual output temperature value of the chip under a second specified environment through the C2 interface bus protocol;
[0036] Inputting the third actual output temperature value into the preset temperature adjustment model for calculation to obtain a second initial temperature adjustment value;
[0037] Converting the second initial temperature adjustment value into a third hexadecimal value;
[0038] Calculate a temperature threshold based on the third hexadecimal value;
[0039] The trimming of the chip is verified based on the temperature threshold.
[0040] In an optional implementation, the verifying the trimming of the chip based on the temperature threshold comprises:
[0041] Obtaining a first preset standard temperature threshold and a second preset standard temperature threshold corresponding to the chip in the second specified environment;
[0042] Determining whether the temperature threshold is between the first preset standard temperature threshold and the second preset standard temperature threshold;
[0043] When the temperature threshold is between the first preset standard temperature threshold and the second preset standard temperature threshold, it is verified that the chip is trimmed and qualified.
[0044] The second aspect of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the chip trimming method having a C2 interface bus when executing the computer program.
[0045] A third aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the chip trimming method having a C2 interface bus.
[0046] The chip trimming method, electronic device and storage medium with a C2 interface bus provided in the embodiment of the present application can accurately collect the first actual output temperature value of the chip under a specified environment through the C2 interface bus protocol after the chip is powered on and the register of the chip is configured. Based on the first actual output temperature value, the target temperature trimming value can be accurately determined. The register is reconfigured again using the target temperature trimming value to achieve high-precision temperature calibration. The second actual output temperature value of the reconfigured chip is collected through the C2 interface bus protocol, and it is determined whether the chip is trimmed and qualified based on the second actual output temperature value. The dual configuration mechanism ensures the reliability of the trimming results and reduces the performance problems or failure risks caused by improper trimming. Since the C2 interface bus protocol is used to collect the output temperature value, the efficiency of trimming is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 is a structural diagram of C2 interface bus communication shown in an embodiment of the present application;
[0048] Figure 2 is a flow chart of a chip adjustment method for a C2 interface bus shown in an embodiment of the present application;
[0049] Figure 3 It is a structural diagram of an electronic device shown in an embodiment of the present application. DETAILED DESCRIPTION
[0050] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to any or all possible combinations comprising one or more of the listed items.
[0051] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0052] To facilitate description of the chip trimming method with a C2 interface bus provided in the present application, the communication of the C2 interface bus is first described below.
[0053] The C2 interface is a two-wire serial communication protocol that uses a clock signal (C2CK) and a bidirectional C2 data signal (C2D) to transmit information between the device and the host. Compared with the JTAG interface, the C2 interface maps the three JTAG data signals (TDI, TDO, TMS) into a bidirectional C2 data signal (C2D), avoiding contention between the master and slave of the device interface. The signal direction of C2D is strictly determined by the instructions in the C2 interface specification. All data in the C2 interface is transmitted and received by the least significant bit (LSB), ensuring the integrity and accuracy of the data. Therefore, applying the C2 interface bus to the MCU temperature sensor chip can significantly improve the performance and stability of the chip. The start state of the C2CK signal starts the transmission of each C2 data frame, and the stop state of the C2CK signal terminates the transmission of each C2 data frame. Through an address register and a series of data registers, the C2 interface can perform on-chip programming and debugging hardware for the C8051F series microcontroller. During the data register read and write instructions (similar to the instruction register of the JTAG interface), the address register determines the data register to be accessed. The data register provides access to various device-related functions. Read and write access to all registers is achieved through a shift register. A C2 host machine accesses a C2 target machine through four basic data frame formats: write address, read address, write data, and read data. The C2 interface specification also specifies the C2 timing that these four basic data frame formats should follow. The C2 target machine collects the received data and updates the data to be sent on the rising edge of the C2CK clock signal.
[0054] See also Figure 1 As shown, the C2 chip includes an 8-bit Device ID register and an 8-bit Revision ID register. These registers are read-only. After a device reset, the C2 address register defaults to 0x00, selecting the 8-bit device ID register. This allows the C2 host to perform a Device ID register read without knowing the length of the target device's Address register. The length of the target Address register can be determined by the contents of the Device ID register.
[0055] Figure 2 The flowchart of the chip trimming method with C2 interface bus provided in the first embodiment of the present application is as follows. The chip trimming method with C2 interface bus includes the following steps.
[0056] S21, power on the chip and configure the registers of the chip.
[0057] The chip is a chip with a C2 interface that needs to be adjusted before leaving the factory. Exemplarily, the chip is a temperature sensor chip.
[0058] In order to ensure that all components of the chip can start and run normally, the chip needs to be powered on first. Prepare a stable power supply and ensure that the voltage, current and other parameters of the power supply meet the requirements of the chip to avoid chip damage or unstable performance due to power problems. During the power-on process, you can confirm whether the chip has been powered on normally by monitoring certain status pins or indicator lights of the chip.
[0059] After the chip is powered on normally, the registers in the chip are configured. Registers are special storage units inside the chip for storing data and control information. By configuring registers, the operating mode, parameter settings, and behavior of the input and output interfaces of the chip can be changed. The embodiment of the present application configures the registers through the C2 interface. According to the data sheet or reference design of the chip, a configuration code or script containing information such as register address, data, and configuration order can be written. Run the configuration code or script to write the configuration data into the registers of the chip.
[0060] In an optional implementation, configuring the register of the chip includes:
[0061] Determine a first register and a second register related to temperature in the chip according to the model of the chip;
[0062] Determine whether the preset configuration conditions are met;
[0063] When the preset configuration condition is met, reading a first value of the first register and a second value of the second register;
[0064] Combining the first value and the second value into a first hexadecimal value;
[0065] The first hexadecimal value is assigned to the register.
[0066] After the chip is powered on and the registers are configured, the chip can be trimmed and tested.
[0067] Due to different chips, the addresses of the registers related to the temperature sensing function are different. Therefore, it is necessary to match the first register and the second register corresponding to the chip model in the mapping relationship table between the chip signal and the register address. For example, the first register can be a register with an address of 0xBD, and the second register can be a register with an address of 0xBE. The value of the first register and the value of the second register represent a certain state or parameter of the temperature sensor chip.
[0068] Since the chip has just been powered on, its internal state may not be stable yet, and the value read at this time may be wrong or unpredictable. By waiting for the chip to stabilize or complete initialization, it can be ensured that the value read is accurate and reliable. Therefore, in order to ensure the correctness and safety of the operation, when the preset configuration conditions are met, the first value is read from the first register and the second value is read from the second register. Then, in order to meet the communication protocol of the C2 interface, the read first value and the second value are spliced and merged into a hexadecimal value (for ease of description, the hexadecimal value obtained after the merger is called the first hexadecimal value). Finally, the combined hexadecimal value is configured to the corresponding register to realize the configuration or initialization of the chip temperature sensing function.
[0069] In the above optional implementation manner, by reading the value of a specific address and performing a merging process, the accuracy of the register configuration can be ensured, thereby avoiding errors that may occur in manual configuration.
[0070] In an optional implementation, the determining whether the preset configuration condition is met includes:
[0071] Repeatedly read the value of the register at address 0xA7 until the value of the register at address 0xA7 is 30h;
[0072] Determine whether the 6th bit of the register with address 0xE8 is 1;
[0073] When the sixth bit of the register with the address 0xE8 is not 1, repeatedly read the value of the register with the address 0xA7 until the sixth bit of the register with the address 0xE8 is 1;
[0074] Read the register with address 0xA7 again to see if it is 30h;
[0075] When the value of the register with the address 0xA7 read again is 30h, it is determined that the preset configuration condition is met.
[0076] You can initialize the registers first, as follows:
[0077] 0xA7=10h: write the hexadecimal value 10 to the register at address 0xA7;
[0078] 0xEF=08h: write the hexadecimal value 08 to the register at address 0xEF;
[0079] 0xA9=00h: Write the hexadecimal value 00 to the register at address 0xA9;
[0080] 0xA7=30h: write the hexadecimal value 30 to the register at address 0xA7;
[0081] 0xE8=81h: Write the hexadecimal value 81 to the register at address 0xE8;
[0082] 0xA1=40h: write the hexadecimal value 40 to the register at address 0xA1;
[0083] 0xDF=7Fh: Write the hexadecimal value 7F to the register at address 0xDF;
[0084] 0xBB=14h: write the hexadecimal value 14 to the register at address 0xBB;
[0085] 0xA1=C0h: Write the hexadecimal value C0 to the register at address 0xA1;
[0086] delay=1ms: wait for 1 millisecond;
[0087] 0xE8=91h: Write the hexadecimal value 91 to the register at address 0xE8.
[0088] The 1 millisecond wait is to allow the internal state of the chip to stabilize.
[0089] Setting the value of the register at address 0xA7 to 30h indicates that the chip is in a certain calibration state. The value of the register at address 0xA7 is continuously read through the C2 interface protocol and waits for it to become 30h to ensure that the adjustment operation can begin.
[0090] The 6th bit of the register with address 0xE8 (counting from 0, i.e. the 5th bit) is a control bit or status bit, indicating whether the trimming operation is activated or completed. If the 6th bit of the register with address 0xE8 is not 1, it indicates that the trimming condition has not been met. Only when the 6th bit of the register with address 0xE8 is 1, the system considers that the trimming condition is met.
[0091] If the 6th bit of the register at address 0xE8 is not 1, return to check the status of the register at address 0xA7 again, and repeat this process until the 6th bit of the register at address 0xE8 is 1. If the 6th bit of the register at address 0xE8 is 1, it indicates that the chip is ready for the next operation or the data is stable, then check the value of the register at address 0xA7 again to ensure that after the state of the register at address 0xE8 changes, the register at address 0xA7 still indicates that the chip is in the expected calibration state. If the value of the register at address 0xA7 is still 30h after checking, it is determined that a specific condition has been met, which usually means that the chip or sensor has successfully completed the calibration operation and is in a state where it can start normal operation.
[0092] The above optional implementation method can make it more certain that the system has correctly entered the expected state by checking and verifying the status of the register multiple times.
[0093] S22, collecting a first actual output temperature value of the chip under a first specified environment through a C2 interface bus protocol.
[0094] The first designated environment refers to a preset environment for temperature collection, for example, 27 degrees Celsius.
[0095] Configure and initialize the C2 interface bus to establish a communication connection with the chip. After successfully establishing a communication connection with the chip, send a command to read the temperature value to the chip through the C2 interface bus. Since the chip is an electronic component that contains a temperature sensor function, it can sense the temperature of the surrounding environment and convert it into a measurable electrical signal. Therefore, the chip responds to the read instruction, converts the temperature value it measures into a digital signal and sends it back through the C2 interface bus.
[0096] The above optional implementation method can accurately read the temperature value from the chip through the C2 interface bus protocol, avoiding the error that may be introduced by manual reading. The C2 interface bus protocol usually has a high data transmission rate and stability, and can quickly and accurately obtain temperature data.
[0097] S23: Determine a target temperature adjustment value based on the first actual output temperature value.
[0098] The first actual output temperature value is the actual temperature value measured by the chip under the first specified environment, and is the basis for subsequent analysis and calibration.
[0099] In an optional implementation, determining the target temperature adjustment value based on the first actual output temperature value includes:
[0100] Inputting the first actual output temperature value into a preset temperature adjustment model for calculation to obtain a first initial temperature adjustment value;
[0101] Converting the first initial temperature adjustment value into a second hexadecimal value;
[0102] The target temperature adjustment value is calculated according to the first hexadecimal value and the second hexadecimal value.
[0103] The preset temperature adjustment model is a pre-established mathematical model used to calculate the initial temperature adjustment value according to the actual output temperature value. The first actual output temperature value is input into the preset temperature adjustment model, and the first initial temperature adjustment value is calculated by the preset temperature adjustment model to adjust the output temperature value of the temperature sensor chip. The preset temperature adjustment model can be adjusted and optimized according to the characteristics and calibration requirements of different temperature sensor chips, making the entire adjustment process more flexible and adaptable.
[0104] In order to meet the communication requirements of the C2 interface protocol, the first initial temperature adjustment value needs to be converted into a hexadecimal value to facilitate data transmission and processing between different systems or components, thereby improving the integration and maintainability of the entire system. For the convenience of context description, the hexadecimal value converted from the first initial temperature adjustment value is referred to as the second hexadecimal value.
[0105] The difference between the first hexadecimal value and the second hexadecimal value is calculated to obtain a target temperature adjustment value. The target temperature adjustment value is a final adjustment value and is used to update the calibration parameters of the temperature sensor chip to improve the measurement accuracy.
[0106] In an optional embodiment, the preset temperature adjustment model is: t*7702 / 256, where t is the actual output temperature value. Assuming that the first register is a register with an address of 0xBE, and the second register is a register with an address of 0xBD, and {0xBE, 0xBD} is used to represent the 16-bit value of the values of the two registers (the first register and the second register), the first hexadecimal value is expressed as register {0xBE, 0xBD}, and the target temperature adjustment value OFFSET1[15:0]=register {0xBE, 0xBD}-t1*7702 / 256. Here, t1 represents the temperature corresponding to the first specified environment, in degrees Celsius. OFFSET1[15:0] is the adjustment result of TEMP_OFFSET1, which is used to compensate for errors caused by temperature or other factors.
[0107] S24, reconfiguring the register using the target temperature adjustment value, and collecting a second actual output temperature value of the reconfigured chip through a C2 interface bus protocol.
[0108] After the register is powered on and initially configured, the first actual output temperature value of the chip is collected to evaluate the initial performance of the chip. The first actual output temperature value provides direct feedback on the current measurement accuracy of the chip and is the basic data for subsequent trimming operations. Based on the first actual output temperature value, the target temperature trimming value is determined to compensate for the initial measurement error of the chip and make it closer to the true temperature value. After the target temperature trimming value is determined, it needs to be applied to the chip to adjust its measurement performance. By modifying the value in the register, the chip function can be adjusted. After the register is reconfigured, the second actual output temperature value of the chip needs to be collected again. The second actual output temperature value reflects the performance of the chip after trimming and is the key basis for judging whether the trimming is successful.
[0109] By configuring the registers twice, it is ensured that the temperature measurement function of the chip can reach the expected performance standard after accurate calibration.
[0110] S25, judging whether the chip is qualified for trimming according to the second actual output temperature value.
[0111] By comparing the second actual output temperature value with the expected temperature value, it can be determined whether the chip adjustment has achieved the expected effect. If the output temperature value after adjustment is within the allowable error range, the chip adjustment is considered qualified; otherwise, further adjustment or analysis may be required.
[0112] In an optional implementation, judging whether the chip is qualified for trimming according to the second actual output temperature value includes:
[0113] Acquire a first preset standard output temperature value and a second preset standard output temperature value corresponding to the chip in the first specified environment;
[0114] Determining whether the second actual output temperature value is between the first preset standard output temperature value and the second preset standard output temperature value;
[0115] When the second actual output temperature value is between the first preset standard output temperature value and the second preset standard output temperature value, it is determined that the chip is trimmed to be qualified.
[0116] When judging the performance of the chip after adjustment, it is first necessary to determine a standard range, that is, the temperature measurement range that the chip should reach under the first specified environment. The temperature measurement range is a temperature range consisting of a first preset standard output temperature value and a second preset standard output temperature value, and the first preset standard output temperature value is less than the second preset standard output temperature value.
[0117] It is determined whether the second actual output temperature value obtained by the chip after the adjustment in the second measurement falls within the temperature range formed by the first preset standard output temperature value and the second preset standard output temperature value. If the second actual output temperature value is between the first preset standard output temperature value and the second preset standard output temperature value, it can be preliminarily considered that the temperature measurement function of the chip has been effectively calibrated and the temperature measurement function of the chip has achieved the expected precision and accuracy, and therefore, it is determined that the adjustment operation is successful.
[0118] In the above optional implementation, by setting a standard temperature range, the judgment method based on the standard temperature range is more intuitive and simple, thereby improving the judgment efficiency; by ensuring that the output temperature value of the chip after adjustment is within the standard range, the reliability and stability of the chip in practical applications are improved.
[0119] In an optional embodiment, in order to ensure that the calibration state of the temperature sensor chip can be maintained after the system is powered off or restarted, after the target temperature adjustment value (OFFSET1[15:0]) is calculated, the target FLASH memory location corresponding to the target temperature adjustment value can be determined according to the preset correspondence table (including the mapping relationship between the temperature adjustment value and the FLASH memory address), that is, the target write address of the FLASH is determined, and the target temperature adjustment value is written into the corresponding target FLASH memory through the C2 interface communication protocol. Since FLASH memory is usually used for non-volatile storage, the data stored in the FLASH memory can remain unchanged even if the system is powered off or restarted. Therefore, writing the target temperature adjustment value into the FLASH can ensure that the target temperature adjustment value can still be used after the system is restarted, thereby maintaining the calibration state of the temperature sensor.
[0120] In an optional embodiment, in order to adapt to the storage requirements of the FLASH memory or optimize storage efficiency, the calculated target temperature adjustment value can be converted into a format suitable for FLASH storage, and then the converted target temperature adjustment value can be written to the target FLASH memory location through the C2 interface communication protocol.
[0121] In an optional embodiment, in order to mark that the trimming operation of the chip has been completed, a specific hexadecimal value can be written into different registers of the chip through the C2 interface communication protocol to inform the system or other related components that the temperature trimming process of the chip has been successfully executed and the chip is now in a calibrated state. Specifically, the hexadecimal value 30 can be written into the register with address 0xA7 (i.e., 0xA7=30h), the hexadecimal value 40 can be written into the register with address 0xA1 (i.e., 0xA1=40h), and the hexadecimal value 01 can be written into the register with address 0xE8 (i.e., 0xE8=01h) through the C2 interface communication protocol.
[0122] In an optional embodiment, the method further comprises:
[0123] After determining that the chip is qualified for adjustment, resetting the C2 interface and configuring the registers of the chip;
[0124] Collecting a third actual output temperature value of the chip under a second specified environment through the C2 interface bus protocol;
[0125] Inputting the third actual output temperature value into the preset temperature adjustment model for calculation to obtain a second initial temperature adjustment value;
[0126] Converting the second initial temperature adjustment value into a third hexadecimal value;
[0127] Calculate a temperature threshold based on the third hexadecimal value;
[0128] The trimming of the chip is verified based on the temperature threshold.
[0129] Perform the c2_reset operation to restore the C2 interface to its initial state or default configuration, ensuring that the C2 interface status is clear, thereby ensuring the stability and reliability of the interface in subsequent operations.
[0130] After resetting the C2 interface, the registers of the chip are configured. Repeatedly read the value of the register with address 0xA7 until the value of the register with address 0xA7 is 30h; determine whether the 6th bit of the register with address 0xE8 is 1; when the 6th bit of the register with address 0xE8 is not 1, repeatedly read the value of the register with address 0xA7 until the 6th bit of the register with address 0xE8 is 1; read the value of the register with address 0xA7 again to see if it is 30h; when the value of the register with address 0xA7 read again is 30h, collect the third actual output temperature value of the chip under the second specified environment through the C2 interface bus protocol. The second specified environment is similar to the first specified environment and is used to verify the performance of chip adjustment. The temperature of the second specified environment is higher than that of the first specified environment. Exemplarily, the second specified environment is a high temperature environment, for example, 80 degrees Celsius.
[0131] The third actual output temperature value is input into the preset temperature adjustment model for calculation to obtain the second initial temperature adjustment value; the second initial temperature adjustment value is converted into a third hexadecimal value. According to the first hexadecimal value and the third hexadecimal value, the target temperature adjustment value OFFSET2[15:0]=register {0xBE, 0xBD}-t2*7702 / 256 is calculated, where t2 represents the temperature corresponding to the second specified environment, in degrees Celsius.
[0132] In an optional implementation, the temperature threshold TEMP_TH[15:0] may be calculated using the following formula:
[0133] Calculated by TEMP_TH[15:0]=register {0xBE, 0xBD}-OFFSET2[15:0]*0.6875.
[0134] Register {0xBE, 0xBD} is the first hexadecimal value.
[0135] In the above optional implementation manner, through the reset operation of the C2 interface bus, possible interface failures or configuration errors can be eliminated, thereby improving the reliability of subsequent data acquisition and processing; through the use of delay instructions of the C2 interface bus, it helps to ensure the stability and reliability of communication; by collecting actual output temperature values under different specified environments and calculating the temperature threshold based on these values, the chip adjustment effect can be more comprehensively verified to ensure that it can maintain good performance under different conditions.
[0136] In an optional implementation, the verifying the trimming of the chip based on the temperature threshold comprises:
[0137] Obtaining a first preset standard temperature threshold and a second preset standard temperature threshold corresponding to the chip in the second specified environment;
[0138] Determining whether the temperature threshold is between the first preset standard temperature threshold and the second preset standard temperature threshold;
[0139] When the temperature threshold is between the first preset standard temperature threshold and the second preset standard temperature threshold, it is verified that the chip is trimmed and qualified.
[0140] The first preset standard temperature threshold is smaller than the second preset standard temperature threshold.
[0141] If the temperature threshold is between the first preset standard temperature threshold and the second preset standard temperature threshold, it can be considered that the chip is qualified under the second specified environment, that is, its temperature measurement function has achieved the expected precision and accuracy.
[0142] By comparing the temperature threshold with the standard temperature value, it can be ensured that the temperature measurement performance of the chip in the second specified environment meets the preset standard, thereby improving the reliability and stability of the chip. Using a specific standard temperature value as a verification basis is more accurate and reliable than simply comparing temperature values, and can effectively reduce the possibility of misjudgment.
[0143] After the chip is adjusted and verified, it can be shipped. The final factory data is divided into two parts. The first part is the reserved area programming data, that is, the second sector of the information bit, a total of 512 bytes. The second part is the bootloader data, a total of one sector 512 bytes.
[0144] This application uses the advantages of the C2 interface bus to achieve high-speed, stable, and reliable data transmission and control, and improve the performance and stability of the MCU temperature sensor chip. The application of C2 interface bus technology can realize parallel processing of multiple chip adjustments, improve test efficiency and chip performance, and has significant technical effects and broad application prospects.
[0145] The implementation of this application not only improves the test efficiency of MCU temperature sensor chips, but also provides useful reference and reference for the testing of other similar chips, promoting the technological progress of the entire industry and promoting the widespread application of MCU temperature sensor chips in industrial automation, environmental monitoring, smart home and other fields.
[0146] The present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the chip trimming method having a C2 interface bus are implemented. The chip trimming method having a C2 interface bus includes:
[0147] Powering on the chip and configuring registers of the chip;
[0148] Collecting a first actual output temperature value of the chip under a first specified environment through a C2 interface bus protocol;
[0149] Determining a target temperature adjustment value based on the first actual output temperature value;
[0150] Reconfiguring the register using the target temperature adjustment value, and collecting a second actual output temperature value of the reconfigured chip through a C2 interface bus protocol;
[0151] Whether the chip is trimmed and adjusted properly is determined according to the second actual output temperature value.
[0152] Optionally, when the computer program is executed by the processor, determining the target temperature adjustment value based on the first actual output temperature value specifically includes:
[0153] Input the first actual output temperature value into a preset temperature adjustment model for calculation to obtain a first initial temperature adjustment value, wherein the preset temperature adjustment model is: t*7702 / 256, where t is the actual output temperature value;
[0154] Converting the first initial temperature adjustment value into a second hexadecimal value;
[0155] The target temperature adjustment value is calculated according to the first hexadecimal value and the second hexadecimal value.
[0156] Optionally, when the computer program is executed by a processor, configuring the register of the chip specifically includes:
[0157] Determine a first register and a second register related to temperature in the chip according to the model of the chip;
[0158] Determine whether the preset configuration conditions are met;
[0159] When the preset configuration condition is met, reading a first value of the first register and a second value of the second register;
[0160] Combining the first value and the second value into a first hexadecimal value;
[0161] The first hexadecimal value is assigned to the register.
[0162] Optionally, when the computer program is executed by the processor, the determination of whether a preset configuration condition is met is implemented, specifically including:
[0163] Repeatedly read the value of the register at address 0xA7 until the value of the register at address 0xA7 is 30h;
[0164] Determine whether the 6th bit of the register with address 0xE8 is 1;
[0165] When the sixth bit of the register with the address 0xE8 is not 1, repeatedly read the value of the register with the address 0xA7 until the sixth bit of the register with the address 0xE8 is 1;
[0166] Read the register with address 0xA7 again to see if it is 30h;
[0167] When the value of the register with the address 0xA7 read again is 30h, it is determined that the preset configuration condition is met.
[0168] Optionally, when the computer program is executed by the processor, judging whether the chip is qualified for trimming according to the second actual output temperature value specifically includes:
[0169] Acquire a first preset standard output temperature value and a second preset standard output temperature value corresponding to the chip in the first specified environment;
[0170] Determining whether the second actual output temperature value is between the first preset standard output temperature value and the second preset standard output temperature value;
[0171] When the second actual output temperature value is between the first preset standard output temperature value and the second preset standard output temperature value, it is determined that the chip is trimmed to be qualified.
[0172] Optionally, when the computer program is executed by a processor, it further implements:
[0173] Determine a target FLASH memory location corresponding to the target temperature adjustment value, and write the target temperature adjustment value into the target FLASH memory; and / or
[0174] Write the hexadecimal value 30 to the register at address 0xA7, write the hexadecimal value 40 to the register at address 0xA1, and write the hexadecimal value 01 to the register at address 0xE8.
[0175] Optionally, when the computer program is executed by a processor, it further implements:
[0176] After determining that the chip is qualified for adjustment, resetting the C2 interface and configuring the registers of the chip;
[0177] Collecting a third actual output temperature value of the chip under a second specified environment through the C2 interface bus protocol;
[0178] Inputting the third actual output temperature value into the preset temperature adjustment model for calculation to obtain a second initial temperature adjustment value;
[0179] Converting the second initial temperature adjustment value into a third hexadecimal value;
[0180] Calculate a temperature threshold based on the third hexadecimal value;
[0181] The trimming of the chip is verified based on the temperature threshold.
[0182] Optionally, when the computer program is executed by the processor, the verification of the trimming of the chip based on the temperature threshold is implemented, specifically including:
[0183] Obtaining a first preset standard temperature threshold and a second preset standard temperature threshold corresponding to the chip in the second specified environment;
[0184] Determining whether the temperature threshold is between the first preset standard temperature threshold and the second preset standard temperature threshold;
[0185] When the temperature threshold is between the first preset standard temperature threshold and the second preset standard temperature threshold, it is verified that the chip is trimmed and qualified.
[0186] See also Figure 3 FIG. 2 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. In a preferred embodiment of the present application, the electronic device 3 includes a C2 interface 30 , a memory 31 , at least one processor 32 and at least one communication bus 33 .
[0187] Those skilled in the art should understand that Figure 3 The structure of the electronic device shown does not constitute a limitation of the embodiments of the present application, and can be either a bus structure or a star structure. The electronic device 3 can also include more or less other hardware or software than shown in the figure, or a different component arrangement.
[0188] In some embodiments, the electronic device 3 is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application-specific integrated circuits, programmable gate arrays, digital processors, and embedded devices. The electronic device 3 may also include client devices, which include but are not limited to any electronic product that can interact with a client through a keyboard, mouse, remote control, touchpad, or voice-controlled device, such as a personal computer, tablet computer, smart phone, digital camera, etc.
[0189] It should be noted that the electronic device 3 is only an example, and other existing or future electronic products that are suitable for the present application should also be included in the protection scope of the present application and included here by reference.
[0190] In some embodiments, the memory 31 stores a computer program, and when the computer program is executed by the at least one processor 32, all or part of the steps in the chip trimming method with a C2 interface bus are implemented. The memory 31 includes a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data. Further, the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, and the like.
[0191] In some embodiments, the at least one processor 32 is the control core (ControlUnit) of the electronic device 3, and uses various interfaces and lines to connect various components of the entire electronic device 3, and executes various functions and processes data of the electronic device 3 by running or executing programs or modules stored in the memory 31, and calling data stored in the memory 31. For example, when the at least one processor 32 executes the computer program stored in the memory, it implements all or part of the steps of the chip trimming method with C2 interface bus described in the embodiment of the present application; or implements all or part of the functions of the chip trimming device with C2 interface bus. The at least one processor 32 can be composed of an integrated circuit, for example, it can be composed of a single packaged integrated circuit, or it can be composed of multiple integrated circuits with the same function or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips.
[0192] In some embodiments, the at least one communication bus 33 is configured to realize the connection and communication between the memory 31 and the at least one processor 32. Although not shown, the electronic device 3 may also include a power supply (such as a battery) for powering each component. Preferably, the power supply may be logically connected to the at least one processor 32 through a power management device, so as to realize the functions of managing charging, discharging, and power consumption management through the power management device. The power supply may also include any components such as one or more DC or AC power supplies, recharging power supply fault detection circuits, power converters or inverters, power status indicators, etc. The electronic device 3 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0193] The above-mentioned integrated unit implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling an electronic device (which can be a personal computer, electronic device, or network device, etc.) or a processor to execute part of the method described in each embodiment of the present application.
[0194] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0195] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
Claims
1. A chip trimming method having a C2 interface bus, characterized in that: The method comprises: Powering on the chip and configuring registers of the chip; Collecting a first actual output temperature value of the chip under a first specified environment through a C2 interface bus protocol; Determining a target temperature adjustment value based on the first actual output temperature value; Reconfiguring the register using the target temperature adjustment value, and collecting a second actual output temperature value of the reconfigured chip through the C2 interface bus protocol; Determining whether the chip is trimmed and adjusted properly according to the second actual output temperature value; The configuring the register of the chip includes: Determine a first register and a second register related to temperature in the chip according to the model of the chip; Determine whether the preset configuration conditions are met; When the preset configuration condition is met, reading a first value of the first register and a second value of the second register; Combining the first value and the second value into a first hexadecimal value; The first hexadecimal value is assigned to the register.
2. The chip trimming method with a C2 interface bus according to claim 1, characterized in that: The determining whether the preset configuration condition is met includes: Repeatedly read the value of the register at address 0xA7 until the value of the register at address 0xA7 is 30h; Determine whether the 6th bit of the register with address 0xE8 is 1; When the sixth bit of the register with the address 0xE8 is not 1, repeatedly read the value of the register with the address 0xA7 until the sixth bit of the register with the address 0xE8 is 1; Read the register with address 0xA7 again to see if it is 30h; When the value of the register with the address 0xA7 read again is 30h, it is determined that the preset configuration condition is met.
3. The chip trimming method with a C2 interface bus according to claim 1, characterized in that: The determining of the target temperature adjustment value based on the first actual output temperature value includes: Input the first actual output temperature value into a preset temperature adjustment model for calculation to obtain a first initial temperature adjustment value, wherein the preset temperature adjustment model is: t*7702 / 256, where t is the actual output temperature value; Converting the first initial temperature adjustment value into a second hexadecimal value; The target temperature adjustment value is calculated according to the first hexadecimal value and the second hexadecimal value.
4. The chip trimming method with a C2 interface bus according to claim 3, characterized in that: The step of judging whether the chip is qualified for trimming according to the second actual output temperature value comprises: Acquire a first preset standard output temperature value and a second preset standard output temperature value corresponding to the chip in the first specified environment; Determining whether the second actual output temperature value is between the first preset standard output temperature value and the second preset standard output temperature value; When the second actual output temperature value is between the first preset standard output temperature value and the second preset standard output temperature value, it is determined that the chip is trimmed to be qualified.
5. The chip trimming method with a C2 interface bus according to claim 3, characterized in that: The method further comprises: Determine a target FLASH memory location corresponding to the target temperature adjustment value, and write the target temperature adjustment value into the target FLASH memory; and / or Write the hexadecimal value 30 to the register at address 0xA7, write the hexadecimal value 40 to the register at address 0xA1, and write the hexadecimal value 01 to the register at address 0xE8.
6. The chip trimming method with a C2 interface bus according to any one of claims 2 to 5, characterized in that: The method further comprises: After determining that the chip is qualified for adjustment, resetting the C2 interface and configuring the registers of the chip; Collecting a third actual output temperature value of the chip under a second specified environment through the C2 interface bus protocol; Inputting the third actual output temperature value into the preset temperature adjustment model for calculation to obtain a second initial temperature adjustment value; Converting the second initial temperature adjustment value into a third hexadecimal value; Calculate a temperature threshold based on the third hexadecimal value; The trimming of the chip is verified based on the temperature threshold.
7. The chip trimming method with a C2 interface bus according to claim 6, characterized in that: The verifying the trimming of the chip based on the temperature threshold comprises: Obtaining a first preset standard temperature threshold and a second preset standard temperature threshold corresponding to the chip in the second specified environment; Determining whether the temperature threshold is between the first preset standard temperature threshold and the second preset standard temperature threshold; When the temperature threshold is between the first preset standard temperature threshold and the second preset standard temperature threshold, it is verified that the chip is trimmed and qualified.
8. An electronic device, characterized in that: It comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the chip trimming method with a C2 interface bus as claimed in any one of claims 1 to 7 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the chip trimming method with a C2 interface bus as claimed in any one of claims 1 to 7 are implemented.
