AD chip power-on data acquisition method and system
The method and system address the issue of asynchronous power-on in AD chips by initializing and synchronizing power sequences, ensuring accurate data collection and enhancing system stability.
Patent Information
- Application Number
- CN202411051254.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2024-12-06
AI Technical Summary
The issue of inaccurate power-on data collection in AD chips due to asynchronous power-on between the microcontroller and the AD chip, leading to incorrect data acquisition.
A method and system for collecting power-on data of an AD chip that involves reading an initial ID value from the chip's status register, performing initialization if the value does not match the standard, and ensuring consistent power-on sequences and self-tests to ensure the AD chip is ready before data collection.
Ensures accurate and reliable power-on data acquisition by resetting the AD chip to a known stable state, reducing errors and improving system stability and reliability.
Smart Images

Figure CN119093939A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of industrial equipment control, and in particular to a method and system for collecting power-on data of an AD chip. Background Art
[0002] AD4114 is a low-power, low-noise, 24-bit Σ-Δ analog-to-digital converter (ADC) with an integrated analog front end (AFE) that supports fully differential or single-ended high impedance (≥1 MΩ), bipolar ±10V voltage input. AD4114 has the characteristics of high precision, multi-channel, low power consumption and flexibility, and is widely used in industrial control, instrumentation, sensor signal processing and other fields.
[0003] In a system involving the AD4114 chip (AD chip for short) and a microcontroller, the AD chip is used to convert analog signals into digital signals, while the microcontroller is responsible for controlling the entire system and processing digital signals. When the microcontroller is powered on first and the AD chip is powered on later, a power-on asynchrony problem may occur, causing the microcontroller to start reading the status register of the AD chip before it is ready, thus failing to obtain the correct data of the AD chip after power-on. Summary of the invention
[0004] In view of the above, the present application provides a method and system for collecting power-on data of an AD chip, which solves the technical problem of inaccurate power-on data collection of an AD chip caused by inconsistent power-on of a single-chip microcomputer and an AD chip.
[0005] A first aspect of the present application provides a method for collecting power-on data of an AD chip, the method comprising: Reading an initial ID value corresponding to the AD chip from an ID status register of the AD chip according to a first preset time period; When the initial ID value does not match the standard ID value of the AD chip, performing an AD initialization operation on the AD chip; When the AD initialization is completed, controlling the AD chip to read the initial ID value from the ID status register; When the initial ID value matches the standard ID value, the operation of controlling the AD chip to read the initial ID value from the ID status register is performed.
[0006] In an optional embodiment, the method further comprises: Acquire an input voltage value of the AD chip, and determine whether the AD chip is in a power-off state according to the input voltage value; When it is detected that the AD chip is in the power-off state, determining whether the AD chip is in the power-off state according to a second preset time period; When it is detected that the AD chip is not in the power-off state, the AD initialization operation is performed on the AD chip.
[0007] In an optional embodiment, the method further comprises: When it is detected that the AD chip is in the power-off state, an external interrupt service program is executed, and a flag bit state of an external interrupt flag bit is obtained; When the state of the flag bit is consistent with the preset state, the AD initialization operation is performed on the AD chip.
[0008] In an optional embodiment, the method further comprises: Obtaining a first power-on time of the AD chip and a corresponding second power-on time of the main controller; When the first power-on time and the second power-on time are inconsistent, determining a time difference between the first power-on time and the second power-on time; Performing the AD initialization operation on the AD chip according to the time difference, and performing the main controller initialization operation on the main controller; Repeat the above steps until the first power-on time is consistent with the second power-on time.
[0009] In an optional implementation, the operation of performing the AD initialization operation on the AD chip according to the time difference and the operation of performing the main controller initialization operation on the main controller include: Determine a first power rail corresponding to the AD chip and a second power rail corresponding to the main controller; When the first power rail and the second power rail are consistent, determining a first power-on sequence of the AD chip and a second power-on sequence of the main controller according to the time difference; When the first power-on sequence is greater than the second power-on sequence, adding a delayed execution operation according to the time difference, and performing the main controller initialization operation on the main controller after the delayed execution operation is completed; When the first power-on sequence is less than the second power-on sequence, after the AD initialization operation is performed on the AD chip, the AD chip is controlled to enter a waiting mode according to the time difference.
[0010] In an optional embodiment, the method further comprises: When the first power rail and the second power rail are inconsistent, determining a third power-on time of the first power rail according to the time difference, and determining a fourth power-on time of the second power rail; The first power rail is controlled to perform power-on processing according to the third power-on time, and the second power rail is controlled to perform power-on processing according to the fourth power-on time.
[0011] In an optional embodiment, the method further comprises: When it is detected that both the AD chip and the main controller are in a powered-on state, a first power-on self-test test is performed on the AD chip, and a second power-on self-test test is performed on the main controller; When the first test result of the first power-on self-test test and the second test result of the second power-on self-test test are both test success, performing the AD initialization operation on the AD chip; When both the first test result and the second test result are test failures, performing a restart operation on both the AD chip and the main controller; When the first test result is a test success and the second test result is a test failure, switching the main controller to a standby main controller, and performing a third power-on self-test test on the standby controller; When the first test result is a test failure and the second test result is a test success, the operation of collecting the initial ID value is not performed.
[0012] A second aspect of the present application provides an AD chip power-on data acquisition system, the system comprising: A host computer and a slave computer, wherein the host computer and the slave computer establish a communication connection; The upper computer includes a main controller and a standby controller, and the main controller is used to send a control instruction to the lower computer so that the lower computer performs the operation corresponding to the control instruction; The standby controller is used to send the control instruction to the lower computer when the main controller is in an abnormal state so that the lower computer performs the operation corresponding to the control instruction; The lower computer includes an AD chip, and the AD chip is used to receive the control instruction and execute the operation corresponding to the control instruction.
[0013] In an optional manner, the host computer includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the AD chip power-on data acquisition method when executing the computer program.
[0014] A third aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the above-mentioned AD chip power-on data acquisition method are implemented.
[0015] In summary, the AD chip power-on data acquisition method and system provided by the present application, according to a preset time period (try to read the initial ID value from the ID status register of the AD chip, if the read initial ID value does not match the standard ID value of the AD chip, it means that the AD chip is not ready or is incorrectly configured, then perform an initialization operation on the AD chip to reset it to a known stable state, after the initialization is completed, read the initial ID value from the ID status register again, if the ID value matches the standard ID value at this time, it means that the AD chip is ready and can start normal data acquisition. If the ID value still does not match, repeat the above steps of initialization and reading the ID value until the ID value matches, by repeatedly reading and verifying the ID value of the AD chip within a period of time after power-on, it is ensured that the AD chip is ready and in the correct working state, thereby solving the problem of inaccurate power-on data acquisition of the AD chip caused by asynchronous power-on. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a structural schematic diagram of an AD chip power-on data acquisition system shown in an embodiment of the present application; Figure 2 is a circuit schematic diagram of a first buck circuit shown in an embodiment of the present application; Figure 3 is a circuit schematic diagram of a second step-down circuit shown in an embodiment of the present application; Figure 4 It is a flow chart of a method for collecting data on an AD chip according to an embodiment of the present application; Figure 5 It is a flow chart of another AD chip power-on data collection method shown in an embodiment of the present application; Figure 6 is a flow chart of a 24V flag detection method shown in an embodiment of the present application; Figure 7 is a flow chart of an external interrupt method shown in an embodiment of the present application; Figure 8 It is a structural schematic diagram of a host computer shown in an embodiment of the present application. DETAILED DESCRIPTION
[0017] 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.
[0018] 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.
[0019] Reference Figure 1 , is a structural diagram of an AD chip power-on data acquisition system shown in an embodiment of the present application.
[0020] The AD chip power-on data acquisition system 1 comprises a host computer 10 and a slave computer 20. The host computer 10 refers to a system / device that can execute control instructions, and the slave computer 20 refers to a monitored system / device.
[0021] The host computer 10 may include a main controller 11 and a standby controller 12. The main controller 11, as the core of the host computer 10, is used to send control instructions to the slave computer 20 to control the slave computer 20. In some embodiments, the main controller 11 may be a high-performance processor and microcontroller, which establishes a connection with the slave computer 20 through a communication protocol (for example, a physical connection method, including RS485, RS232, SPI, I2C, etc.; or a wireless connection method, WIFI, ZigBee, etc.), and sends control instructions to the slave computer 20.
[0022] The standby controller 12 is used to take over the control tasks of the main controller 11 when the main controller 11 is in an abnormal state (for example, failure, power failure, etc.), and continue to send control instructions to the lower computer 20 to ensure the reliability of the AD chip power-on data acquisition system 1. Similarly, the standby controller 12 can also be a processor or a microcontroller, which shares a communication interface with the main controller 11 and continuously monitors the operating status of the main controller 11. When the operating status of the main controller 11 is in an abnormal state, the standby controller 12 automatically takes over the control tasks of the main controller 11.
[0023] The lower computer 20 is used to perform corresponding tasks according to the control instructions when receiving the control instructions sent by the upper computer 10. The lower computer 20 may include an AD chip 21, wherein the AD chip 21 may include an AD4114 chip, an AD9834 chip, etc. The specific model of the AD chip is not limited in this application.
[0024] In some embodiments, the AD chip power-on data acquisition system 1 may further include a power supply circuit, wherein the power supply circuit is used to provide input voltage to the main controller and the AD chip so that the main controller and the AD chip are in normal operation.
[0025] Combined Figure 2 and Figure 3 The AD chip power-on data acquisition system 1 also includes two step-down circuits for providing a stable input voltage for the AD chip power-on data acquisition system 1. Figure 2 In the embodiment, the first step-down circuit includes a voltage regulator U1, a plurality of capacitors and a diode D4, and also includes three power supply voltages, namely, two VCC5V (V=5V) and one VCC3V3 (V=3.3V). The voltage regulator U1 is a low voltage drop linear regulator, which is a SIPEX1117 type voltage regulator in the embodiment of the present application, and is used to reduce the voltage from 5V to a stable 3.3V and provide a stable 3.3V power output. The diode D4 is a bidirectional transient suppression diode, which is a P6SMB6.8CA in the embodiment of the present application, and is used to protect the circuit from damage by transient voltage. The plurality of capacitors are used for filtering and decoupling, wherein filtering can smooth the power supply voltage and reduce ripple, while decoupling can prevent power supply noise from affecting other circuit parts. In the embodiment of the present application, the number of capacitors is 12, namely capacitor C1, capacitor C3, capacitor C5, capacitor C16 to capacitor C17, capacitor C20 to capacitor C22 and capacitor C38 to capacitor C29. The specifications of capacitors C1 to capacitor C5, capacitor C17, capacitor C20, capacitor C22 and capacitor C39 are 100nF / 50V, while the specifications of capacitor C2, capacitor C4, capacitor C16, capacitor C21 and capacitor C38 are 100μF / 10V.
[0026] The principle of the first step-down circuit is to reduce the 5V voltage to a stable 3.3V through the voltage regulator U1, and filter and decouple through multiple capacitors to provide high-quality power output.
[0027] exist Figure 3In the embodiment, the second step-down circuit includes a step-down converter U9, which may be an SGM61410, and is used to step down the input voltage 24V to 5V. The second step-down circuit also includes a plurality of capacitors, a plurality of resistors, an inductor L1, a polarized capacitor EC1, a protector F1, and a plurality of resistors. The inductor L1 may be YNR4030-22M-22μH, and is used for filtering or isolation. The protector F1 may be SMD20160P100TF / 33, and is used to disconnect the circuit when an overcurrent occurs in the circuit to protect other components. The polarized capacitor EC1 is used to filter the power supply voltage and output the power supply voltage stably, and the specification of the polarized capacitor EC1 may be 47μF / 10V. The plurality of resistors (for example, resistor R27, resistor R28, and resistor R29) and the plurality of capacitors (for example, capacitor C11, capacitor C12, and capacitor C13, etc.) are used for voltage division, filtering, or decoupling of the power supply voltage. The second step-down circuit also includes an input voltage, wherein the input voltage is 24V, which serves as the main power supply of the second step-down circuit. In an embodiment of the present application, the number of resistors is 3, namely resistor R27, resistor R28 and resistor R29, the specifications of the resistors R27 and R29 can be 10k, and the specification of the resistor R28 is 52.3K / 1%. The number of capacitors is 10, namely capacitor C7, capacitor C9, capacitor C11 to capacitor C15, capacitor C40 to capacitor C42. The specifications of the capacitor C7, the capacitor C11, the capacitor C12, the capacitor C41 and the capacitor C42 are 10μF / 50V, and the specifications of the capacitor C9, the capacitor C13 to the capacitor C15 and the capacitor C40 are 100nF / 50V.
[0028] The principle of the second step-down circuit is to step down the 24V input voltage to 5V through the step-down converter U9, so as to convert the high voltage input into a stable low voltage output.
[0029] Through the first step-down circuit and the second step-down circuit, stable power input / output, filtering and decoupling, protection circuit and overcurrent protection functions are provided, ensuring the stable operation of the AD chip power-on data acquisition system 1. Secondly, the design and optimization of the first step-down circuit and the second step-down circuit not only improve the stability and reliability of the AD chip power-on data acquisition system 1, but also enhance the safety and applicability of the AD chip power-on data acquisition system 1, so that the entire AD chip power-on data acquisition system 1 can operate stably in various complex working environments and meet various data acquisition needs.
[0030] Reference Figure 4, which is a flow chart of a method for collecting power-on data of an AD chip according to an embodiment of the present application, and the method for collecting power-on data of an AD chip includes the following steps.
[0031] S41, reading an initial ID value corresponding to the AD chip from the ID status register of the AD chip according to a first preset time period.
[0032] Refer to Figure 5 In some embodiments, the user can first write the function that needs to perform AD acquisition into the main program, and write the main program into the host computer. When AD acquisition is required, that is, when the acquisition cycle meets the first preset time period (for example, 10 seconds), the main program reads the AD acquisition function, and drives the AD chip to read the ID value corresponding to the AD chip stored in its corresponding ID status register according to the execution logic of the AD acquisition function. After reading the ID register, the main program compares the read ID value (initial ID value) with the expected standard ID value of the AD chip. If the two are consistent, it means that the ID value is correct; otherwise, it means that the ID value is incorrect.
[0033] It should be noted that each AD chip has a unique ID value, and the corresponding ID value has been written into its corresponding ID status register before it leaves the factory to identify its model and batch.
[0034] S42: When the initial ID value does not match the standard ID value of the AD chip, perform an AD initialization operation on the AD chip.
[0035] When it is determined that the initial ID value does not match the standard ID value, a flag bit is set in the main program (for example, a global variable or a bit in a status register), and the main program sets the flag bit to 1, indicating that the AD chip needs to be reinitialized. When it is necessary to perform AD initialization on the AD chip, the main program calls the initialization function of the AD chip to perform the AD initialization operation on the AD chip. In the following embodiment, the initialization function can perform a series of operations, such as setting the working mode of the AD, configuring the clock, resetting the AD, etc., to ensure that the AD chip can work normally.
[0036] S43, when the AD initialization is completed, control the AD chip to read the initial ID value from the ID status register.
[0037] When it is determined that AD initialization is completed, the main program clears the flag position 1 to collect the ID value of the AD chip in the next time period. When AD initialization is completed and the flag position 1 is cleared, the main program starts the AD acquisition function again. Since the AD chip has been reinitialized, the AD chip will be in a known stable state. At this time, when its ID status register is read, the initial ID value read matches the standard ID value.
[0038] In some embodiments, the main program can re-determine whether the ID value is consistent with the standard ID value when reading the ID value after the AD initialization is completed. If it is consistent, the main program ends; if it is inconsistent, the main program continues to execute the above steps.
[0039] Through the above optional implementation, the initialization process of AD4114 ensures that the AD chip can work normally and is in a known stable state. By reading and verifying the ID value, the identity and status of the AD chip can be confirmed, providing a basis for subsequent data collection and processing.
[0040] S44, when the initial ID value matches the standard ID value, executing the operation of controlling the AD chip to read the initial ID value from the ID status register.
[0041] When it is determined that the initial ID value matches the standard ID value, the main program directly calls the AD acquisition function to read the corresponding ID value from the ID status register. The correct ID value means that the AD chip has been successfully initialized and is in normal working condition, which is crucial for subsequent AD data acquisition and processing. Only when the AD chip works normally can the other data collected later be accurate and reliable.
[0042] It should be noted that before collecting the ID value of the AD chip each time, the main program asks the AD chip whether the ID read is correct. If it is not correct, AD initialization is performed until the reading is correct. If the AD chip experiences a power-off and power-on process, AD initialization processing is required. When it is detected that the AD is in a power-off state, AD initialization processing is also performed when the AD chip is powered off.
[0043] This application reads the ID value of the AD chip through a preset time period and compares it with the standard ID value. If there is a mismatch, the AD initialization operation is performed to reset the AD chip to a stable state. After the AD initialization is completed, the ID value is read again to ensure that it is consistent with the standard value before subsequent data collection is performed, ensuring that the AD chip is in the correct working state after power-on, thereby solving the problem of inaccurate data collection caused by asynchronous power-on and improving the stability and reliability of the system.
[0044] In an optional embodiment, the method further comprises: Acquire an input voltage value of the AD chip, and determine whether the AD chip is in a power-off state according to the input voltage value; When it is detected that the AD chip is in the power-off state, determining whether the AD chip is in the power-off state according to a second preset time period; When it is detected that the AD chip is not in the power-off state, the AD initialization operation is performed on the AD chip.
[0045] In some embodiments, before reading the corresponding ID value from the ID status register of the AD chip, the main program can call the voltage acquisition function to obtain the input voltage value of the AD chip, so as to determine whether the AD chip is in the power-on state. When the input voltage value is 0, it can be determined that the AD chip is in the power-off state. Since the main program can read the ID value of the AD chip only after the AD chip is not in the power-off state and the AD chip is in the power-on state, and secondly, since there may be accidental touches or poor contact during the power-on and power-off process, the main program adds an anti-shake operation, that is, a delay function, so that the main program can judge again whether the AD chip is in the power-off state according to the second preset time period during the operation. When it is determined that the AD chip is not in the power-off state, since the AD chip is powered on again, it is necessary to re-perform the AD initialization operation on the AD chip.
[0046] Refer to Figure 6 , 24V is used as the input voltage. The main program calls the 24V voltage detection function to detect the input voltage of the AD chip. When it is detected that the input voltage of the AD chip is not 24V, the 24V flag is set to 1, indicating that the AD chip needs to be reinitialized. When the AD chip is initialized, the AD initialization may reset or affect the voltage detection circuit. The main program needs to re-execute the 24V voltage detection function to detect whether the input voltage of the AD chip is 24V again. If not, continue to execute the above steps. If the input voltage of the AD chip is detected to be 24V, the 24V flag is set to 2, indicating that the system has confirmed the existence of the 24V voltage. At this time, the main program needs to determine whether the AD chip needs to be re-initialized. If it is determined that the AD chip does not need to be re-initialized, the 24V detection is terminated. If it is determined that the AD chip needs to be re-initialized, the AD chip is re-initialized. After the AD initialization is completed, the 24V detection is terminated.
[0047] In some embodiments, after the AD chip is initialized, before re-executing the 24V detection, a delay waiting function can also be added to the main program to ensure that the AD chip performs the 24V detection after it is working stably. In other embodiments, after the AD chip is initialized, before data collection, a delay waiting function can also be added to the democratic program to ensure that the AD chip performs data collection after it is working stably, so as to avoid deviations in the data collected when the initialization is not completed.
[0048] Through the above optional implementation, firstly, by detecting the input voltage value of the AD chip, the system can accurately determine whether the AD chip is in the power-on state, thereby avoiding invalid operations in the power-off state. Secondly, the anti-shake operation reduces the misjudgment caused by accidental touch or poor contact through the delay function, further enhancing the robustness of the system. Finally, by re-executing the AD initialization operation, it is ensured that the system can work normally after the AD chip is powered on again, realizing accurate monitoring and effective management of the AD chip status, and significantly improving the stability and reliability of the system.
[0049] In an optional embodiment, the method further comprises: When it is detected that the AD chip is in the power-off state, an external interrupt service program is executed, and a flag bit state of an external interrupt flag bit is obtained; When the state of the flag bit is consistent with the preset state, the AD initialization operation is performed on the AD chip.
[0050] Due to the multiple rapid power-on and power-off of the AD chip, there is still a probability that the ID value read by the AD chip is inaccurate, which further leads to inaccurate subsequent AD data collection. Therefore, when the power is quickly turned off and on, the main program may not be able to read the correct value of the 24V flag. Figure 7 When the AD chip is detected to be in a power-off state, the main program calls the external interrupt function, causing the main program to perform an external interrupt and set the external interrupt flag to 1, indicating that a 24V power-off event has occurred in the AD chip and that the AD chip needs to be re-initialized. In the main program loop, the flag status of the external interrupt flag is checked according to the preset time period. When it is determined that the flag status is consistent with the preset status (external interrupt flag position 1), it is necessary to re-initialize the AD chip when the next time period arrives to execute the main program, to ensure that the AD chip is in a known and normal state after the power of the AD chip is restored, thereby reducing the possibility of data errors.
[0051] Through the above optional implementation method, an external interrupt mechanism is introduced to handle the problem of inaccurate ID value reading that may be caused by the AD chip during rapid power-on and power-off, thereby improving the response speed of the system and ensuring that the AD chip can quickly return to a normal state after a power fluctuation, thereby reducing the possibility of data errors and improving the accuracy and reliability of data acquisition.
[0052] In an optional embodiment, the method further comprises: Obtaining a first power-on time of the AD chip and a corresponding second power-on time of the main controller; When the first power-on time and the second power-on time are inconsistent, determining a time difference between the first power-on time and the second power-on time; Performing the AD initialization operation on the AD chip according to the time difference, and performing the main controller initialization operation on the main controller; Repeat the above steps until the first power-on time is consistent with the second power-on time.
[0053] In some embodiments, when the main program detects that both the AD chip and the main controller are in the power-on state, it can obtain the power-on time of the AD chip (first power-on time) and the power-on time of the main controller (second power-on time), and determine whether the first power-on time and the second power-on time are consistent. If it is determined that the first power-on time and the second power-on time are inconsistent, the time difference between the first power-on time and the second power-on time is calculated, and the power-on sequence of the AD chip and the main controller can be determined by the time difference. Specifically, the main program can determine the power rail (first power rail) of the input voltage corresponding to the AD chip and the power rail (second power rail) of the input voltage corresponding to the main controller by obtaining the circuit corresponding to the input voltage of the AD chip and the main controller. If the first power rail is consistent with the second power rail, that is, the power supply sources of the AD chip and the main controller are consistent, since the time difference = the first power-on time - the second power-on time, when the time difference is greater than 0, it indicates that the power-on sequence of the AD chip (the first power-on sequence) is before the power-on sequence of the main controller (the second power-on sequence), and if the time difference is less than 0, the second power-on sequence is before the first power-on sequence. If the power-on sequence of the AD chip is greater than that of the main controller (that is, the AD chip is powered on later), the main program needs to add a delay time to the main controller to meet the delay time and initialize the AD chip and the main controller. Among them, the length of the delay time is determined according to the time difference. If the power-on sequence of the AD chip is less than that of the main controller (that is, the AD chip is powered on first), the main program needs to control the AD chip to enter the waiting mode according to the time difference after initializing the AD chip until the AD chip is initialized.
[0054] After the AD chip and the main controller are initialized, the above steps are repeated until it is detected that the power-on time of the AD chip and the main controller are consistent.
[0055] Through the above optional implementation, by accurately controlling the power-on sequence and initialization time of the AD chip and the main controller, it is ensured that both can work correctly after power is restored, thereby avoiding device failure or data errors caused by improper power-on sequence.
[0056] In an optional embodiment, the method further comprises: When the first power rail and the second power rail are inconsistent, determining a third power-on time of the first power rail according to the time difference, and determining a fourth power-on time of the second power rail; The first power rail is controlled to perform power-on processing according to the third power-on time, and the second power rail is controlled to perform power-on processing according to the fourth power-on time.
[0057] In some embodiments, when the first power rail and the second power rail are inconsistent, that is, the power supply sources of the AD chip and the main controller are inconsistent, which power rail should be powered on first is determined according to the above-determined time difference. If the third power-on time of the first power rail (i.e., the power rail of the AD chip) is earlier than the fourth power-on time of the second power rail (i.e., the power rail of the main controller), the main program adds a delay time consistent with the time difference to the power-on function of the first power rail to achieve the simultaneous power-on of the first power rail and the second power rail, that is, to ensure that the main controller and the AD chip are in working state at the same time. Similarly, if the third power-on time of the first power rail (i.e., the power rail of the AD chip) is later than the fourth power-on time of the second power rail (i.e., the power rail of the main controller), the main program adds a delay time consistent with the time difference to the power-on function of the second power rail.
[0058] Through the above-mentioned optional technical method, by determining and adjusting the power-on time of different power rails according to the time difference, simultaneous power-on of two or more different power rails is achieved, thereby ensuring that the AD chip and the main controller can be in working state at the same time, effectively avoiding equipment failure or data errors caused by improper power-on sequence, and improving the stability and reliability of the system.
[0059] In an optional embodiment, the method further comprises: When it is detected that both the AD chip and the main controller are in a powered-on state, a first power-on self-test test is performed on the AD chip, and a second power-on self-test test is performed on the main controller; When the first test result of the first power-on self-test test and the second test result of the second power-on self-test test are both test success, performing the AD initialization operation on the AD chip; When both the first test result and the second test result are test failures, performing a restart operation on both the AD chip and the main controller; When the first test result is a test success and the second test result is a test failure, switching the main controller to a standby main controller, and performing a third power-on self-test test on the standby controller; When the first test result is a test failure and the second test result is a test success, the operation of collecting the initial ID value is not performed.
[0060] In some embodiments, when it is determined that both the AD chip and the main controller are in the power-on state, before the main program needs to read the ID value corresponding to the AD chip from the ID status register of the AD chip, the main program can call the power-on self-test function to perform power-on self-test tests on the AD chip and the main controller respectively, that is, to perform a first power-on self-test test on the AD chip to obtain a first test result, and to perform a second power-on self-test test on the main controller to obtain a second test result. Among them, the power-on self-test test generally includes checking whether the hardware connection is normal, verifying whether the basic functions are available, etc. For the AD chip, the first power-on self-test test can include checking whether its analog input / output is normal; for the main controller, the second power-on self-test test can check the working status of its core components such as memory and processor. If both the first test result and the second test result are successful, indicating that the AD chip and the main controller are working normally, the main program can perform AD initialization operations on the AD chip to prepare for the subsequent reading of the ID value corresponding to the AD chip. If both the first test result and the second test result are test failures, it means that the AD chip and the main controller may not be in normal operation. At this time, the main program will perform a restart operation and try to restore the normal operation of the AD chip and the main controller by re-powering on. If the first test result is a test success, but the second test result is a test failure, it means that the AD chip is working normally but the main controller is abnormal. The main program attempts to switch the main controller to a standby main controller and perform a power-on self-test test (third power-on self-test test) on the standby controller. If the standby controller test is successful, the standby controller is used to replace the main controller to perform the control tasks that the main controller needs to perform; if the test fails, the standby controller needs to be restarted or an alarm signal is sent to the relevant staff. If the first test result is a test failure, but the second test result is a test success, it means that the main controller is working normally but the AD chip is abnormal. Since the AD chip is a key component of data acquisition, if the AD chip is abnormal, subsequent data acquisition and processing will not be possible. Therefore, the main program stops executing the acquisition operation of the initial ID value to avoid invalid data acquisition and processing in the case of AD chip failure.
[0061] Through the above optional implementation, the working status of the AD chip and the main controller is quickly verified after power-on, and corresponding operations are taken according to the test results, thereby ensuring the stability and reliability of the system.
[0062] Reference Figure 8 , is a schematic diagram of the structure of a host computer shown in an embodiment of the present application. In a preferred embodiment of the present application, the host computer 10 is arranged in an AD chip power-on data acquisition system 1, and includes a memory 101, at least one processor 102 and at least one communication bus 103.
[0063] Those skilled in the art should understand that Figure 8 The structure of the terminal controller 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 host computer 10 can also include more or less other hardware or software than shown in the figure, or a different component arrangement.
[0064] In some embodiments, the host computer 10 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 host computer 10 may also include debugger equipment, and the user equipment includes but is not limited to any electronic product that can interact with the user through a keyboard, mouse, remote control, touchpad, or voice control device, such as a personal computer, a tablet computer, and a smart phone.
[0065] It should be noted that the host computer 10 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.
[0066] In some embodiments, the memory 101 stores a computer program, and when the computer program is executed by the at least one processor 102, all or part of the steps in the above-mentioned transceiver line problem diagnosis method are implemented. The memory 101 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. Furthermore, 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, etc.; the data storage area may store data created according to the use of blockchain nodes, etc. The blockchain referred to in this application is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods, each of which contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain may include the underlying blockchain platform, the platform product service layer, and the application service layer.
[0067] In some embodiments, the at least one processor 102 is the control core (ControlUnit) of the host computer 10, and uses various interfaces and lines to connect the various components of the entire host computer 10, and executes various functions and processes data of the host computer 10 by running or executing the program or module stored in the memory 101, and calling the data stored in the memory 101. For example, when the at least one processor 102 executes the computer program stored in the memory, it implements all or part of the steps of the above-mentioned transceiver line problem diagnosis method in the embodiment of the present application. The at least one processor 102 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 (CPU), microprocessors, digital processing chips, graphics processors and various control chips.
[0068] In some embodiments, the at least one communication bus 103 is configured to implement connection and communication between the memory 101 and the at least one processor 102, etc.
[0069] 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 a terminal controller (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.
[0070] The above are all preferred embodiments of the present application, and the protection scope of the present application is not limited thereto. Therefore, any equivalent changes made according to the structure, shape, and principle of the present application should be included in the protection scope of the present application.
Claims
1. A method for collecting data on an AD chip, characterized in that: The method comprises: Reading an initial ID value corresponding to the AD chip from an ID status register of the AD chip according to a first preset time period; When the initial ID value does not match the standard ID value of the AD chip, performing an AD initialization operation on the AD chip; When the AD initialization is completed, controlling the AD chip to read the initial ID value from the ID status register; When the initial ID value matches the standard ID value, the operation of controlling the AD chip to read the initial ID value from the ID status register is performed.
2. The AD chip power-on data acquisition method according to claim 1, characterized in that: The method further comprises: Acquire an input voltage value of the AD chip, and determine whether the AD chip is in a power-off state according to the input voltage value; When it is detected that the AD chip is in the power-off state, determining whether the AD chip is in the power-off state according to a second preset time period; When it is detected that the AD chip is not in the power-off state, the AD initialization operation is performed on the AD chip.
3. The AD chip power-on data acquisition method according to claim 2, characterized in that: The method further comprises: When it is detected that the AD chip is in the power-off state, an external interrupt service program is executed, and a flag bit state of an external interrupt flag bit is obtained; When the state of the flag bit is consistent with the preset state, the AD initialization operation is performed on the AD chip.
4. The AD chip power-on data acquisition method according to any one of claims 1 to 3, characterized in that: The method further comprises: Obtaining a first power-on time of the AD chip and a corresponding second power-on time of the main controller; When the first power-on time and the second power-on time are inconsistent, determining a time difference between the first power-on time and the second power-on time; Performing the AD initialization operation on the AD chip according to the time difference, and performing the main controller initialization operation on the main controller; Repeat the above steps until the first power-on time is consistent with the second power-on time.
5. The AD chip power-on data acquisition method according to claim 4, characterized in that: The operation of performing the AD initialization on the AD chip according to the time difference and the operation of performing the main controller initialization on the main controller include: Determine a first power rail corresponding to the AD chip and a second power rail corresponding to the main controller; When the first power rail and the second power rail are consistent, determining a first power-on sequence of the AD chip and a second power-on sequence of the main controller according to the time difference; When the first power-on sequence is greater than the second power-on sequence, adding a delayed execution operation according to the time difference, and performing the main controller initialization operation on the main controller after the delayed execution operation is completed; When the first power-on sequence is less than the second power-on sequence, after the AD initialization operation is performed on the AD chip, the AD chip is controlled to enter a waiting mode according to the time difference.
6. The AD chip power-on data acquisition method according to claim 5, characterized in that: The method further comprises: When the first power rail and the second power rail are inconsistent, determining a third power-on time of the first power rail according to the time difference, and determining a fourth power-on time of the second power rail; The first power rail is controlled to perform power-on processing according to the third power-on time, and the second power rail is controlled to perform power-on processing according to the fourth power-on time.
7. The method for collecting data on an AD chip according to claim 4, characterized in that: The method further comprises: When it is detected that both the AD chip and the main controller are in a powered-on state, a first power-on self-test test is performed on the AD chip, and a second power-on self-test test is performed on the main controller; When the first test result of the first power-on self-test test and the second test result of the second power-on self-test test are both test success, performing the AD initialization operation on the AD chip; When both the first test result and the second test result are test failures, performing a restart operation on both the AD chip and the main controller; When the first test result is a test success and the second test result is a test failure, switching the main controller to a standby main controller, and performing a third power-on self-test test on the standby controller; When the first test result is a test failure and the second test result is a test success, the operation of collecting the initial ID value is not performed.
8. An AD chip power-on data acquisition system, characterized in that: The system comprises: A host computer and a slave computer, wherein the host computer and the slave computer establish a communication connection; The upper computer includes a main controller and a standby controller, and the main controller is used to send a control instruction to the lower computer so that the lower computer performs the operation corresponding to the control instruction; The standby controller is used to send the control instruction to the lower computer when the main controller is in an abnormal state so that the lower computer performs the operation corresponding to the control instruction; The lower computer includes an AD chip, and the AD chip is used to receive the control instruction and execute the operation corresponding to the control instruction.
9. The AD chip power-on data acquisition system according to claim 8, characterized in that: The host computer includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the AD chip power-on data acquisition method described in any one of claims 1 to 7 are implemented.
10. 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 AD chip power-on data acquisition method described in any one of claims 1 to 7 are implemented.
