AN-1135 Application Note One Technology Way P.O. Box 9106 Norwood, MA 02062-9106, U.S.A. Tel: 781.329.4700 Fax: 781.461.3113 www.analog.com ADC Sampling Information ADM1275/ADM1276/ADM1075 by Paul O’Sullivan INTRODUCTION UI/UV UP/UE ADC CONVERSIONS The ADM1275 features current and voltage readback via the PMBus interface. Figure 1 shows the sampling order. The current is sampled first, followed by a current register update. Then, the voltage is sampled followed by a voltage register update. The register update completes in one clock cycle. On the ADM1275, the user can select whether to monitor the VIN voltage or the VOUT voltage but cannot monitor both at the same time. Figure 1. ADM1275 ADC Updates, Single Sample V I V I V .... I VIN × I Figure 3. ADM1276 ADC Updates, Single Sample As shown in Figure 4, when averaging is enabled, a single power and energy calculation is completed following the last voltage and current samples. After these calculations complete, all of the registers update. UI/UV UP/UE VOUT DISABLED VIN I VIN I .... VIN I VIN × I VOUT VIN × I VOUT ENABLED VIN I VOUT .... VIN I Figure 4. ADM1276 ADC Updates, Device Averaging UV V VOUT UP = UPDATE POWER UE = UPDATE ENERGY UI/UV UP/UE VAUX DISABLED VIN I VIN × I VAUX ENABLED VIN I VAUX VIN × I UP = UPDATE POWER UE = UPDATE ENERGY Figure 5. ADM1075 ADC Updates, Single Sample 10384-002 I I 10384-003 VIN Figure 2 shows the current and voltage conversions and updates in the case where averaging is enabled on the device. The current register updates after the final current sample; the voltage register updates after the final voltage sample. Again, the voltage conversion corresponds to VIN or VOUT. UI VIN × I 10384-005 10384-001 V UI = UPDATE CURRENT UV = UPDATE VOLTAGE I The ADM1075 is very similar to the ADM1276. The order of current and voltage conversions is the same. The main difference between them is that the VOUT measurement on the ADM1276 is a VAUX measurement on the ADM1075, as shown in Figure 5 and Figure 6. UV I VIN VOUT ENABLED UI/UV UP/UE Figure 2. ADM1275 ADC Updates, Device Averaging The ADM1276 and ADM1075 both have power metering as well as voltage and current monitoring. The power is calculated as VIN × I; therefore, the VIN voltage is always sampled. The user can opt to sample another ADC voltage input, as well. In the case of the ADM1276, the VOUT voltage can be measured. After the power calculation is complete, all of the voltage, current, power, and energy registers update. See Figure 3 for details. Rev. 0 | Page 1 of 4 VAUX DISABLED VIN I VIN I .... VIN I VIN × I VAUX ENABLED VIN I VAUX .... VIN I VAUX VIN × I Figure 6. ADM1075 ADC Updates, Device Averaging 10384-006 UI VOUT DISABLED 10384-004 The ADM1275, ADM1276, and ADM1075 all share the same basic analog-to-digital converter (ADC) core and PMBus interface. There are some subtle differences between the devices with regard to averaging calculations and ADC register updates. There are also factors and limitations to consider when reading data quickly from any of the ADM1275, ADM1276, or ADM1075 devices. This document describes the ADC operation for each of these devices and describes how to maximize the data rate from each device, if required. AN-1135 Application Note of 115 μs bus free time is needed after the readback command is completed to allow for the current conversion and register update to complete. The time required to update the registers is very small (a single clock period). Figure 7 shows how the power and energy calculations are performed. V1 V2 .... Vn VAVG I1 I2 .... In IAVG ADM1276 ADM1075 The ADC is locked out from voltage and current updates while the I2C bus is active (or more accurately, if the device address is recognized, then lockout occurs between the acknowledge at the end of the command code and the stop bit). Therefore, the bus free time includes the time from the end of the last PMBus command until the command code is recognized in the next PMBus command. AVERAGE POWER ENERGY ACCUMULATOR 10384-007 ADM1275 ADM1276 ADM1075 Figure 7. Power and Energy Calculations The average power or accumulated energy can be read directly from the device. To perform an energy metering function, an external microprocessor is required for a real-time clock. The average power used over a period of time can be calculated from the delta in energy (ΔE) between the register readbacks divided by the delta in samples (between the register readbacks). The total energy can then be calculated by multiplying this result with the delta in time (Δt) from the time stamps of each readback. MICROPROCESSOR PART REGISTERS ROLLOVER COUNTER ∆E ÷ kWh AVERAGE POWER SAMPLE COUNTER 10384-008 ENERGY ACCUMULATOR Figure 8. Calculating Average Power in Time CONVERSIONS AND TIMING In the majority of cases where device averaging is enabled, the ADC timing is not a major concern to the user. However, in the case where the user wants to read back all of the ADC samples and postprocess the data externally, care needs to be taken to ensure all ADC samples are captured. The first example is the case of the ADM1275 wherein the user reads back all of the current samples. The total time for a voltage and current conversion is 305 μs maximum (see Table 1). Table 1. Maximum Conversion Times (μs) ADM1275 ADM1276 115 190 Total (1× averaging) 305 VIN IOUT VOUT PIN Total (1× averaging) These values determine the maximum duration of the PMBus command and, therefore, determine the minimum speed at which the I2C needs to operate for optimum sampling. For example, in the case of the ADM1275, when the I2C is optimized for current readback, set the time between readbacks to 305 μs (see Figure 9). That means that the portion of the READ_IOUT command after the command code has been recognized must be less than 190 μs. The read current command is three or four bytes of data following the command code, depending on whether the packet error checking (PEC) byte is used (see Figure 10). Assuming the PEC byte is used, and including the acknowledge and stop bits, there are a total of 40 bits of data after the command code. Consequently, the I2C needs to operate at >210 kHz (40 bits in 190 μs) to ensure that the remainder of the current readback command is completed within 190 μs. In the case where averaging is enabled, set the bus free time to greater than the voltage conversion time. This setting ensures that both the current and the voltage registers are updated before the next readback command (see Figure 2). Set the time between readbacks to greater than Number of Averages × 305 μs ADM1075 IOUT VIN or VOUT In the case of a voltage readback, a minimum bus free time of 115 μs guarantees no duplicate samples. The voltage readback is one sample offset unless there is a bus free time of at least 190 μs to allow the voltage conversion to occur before the next readback. 146 118 146 16 426 VIN IOUT VAUX PIN Total (1× averaging) 82 120 82 17 301 Use the CONV function of the GPIO1/ALERT1/CONV pin to synchronize ADC samples to ensure that the sampling always occurs at the desired time. This procedure allows for other I2C activity after the readback command and before the next ADC sampling sequence initiates. CONV functionality is not available on the ADM1276. Therefore, each I2C/PMBus readback command must be spaced at least 305 μs apart. If the current is being read back, a minimum Rev. 0 | Page 2 of 4 Application Note AN-1135 400µs 600µs ADM1275 ADC STATE I1 <115µs <190µs I2 V2 WAIT I2C V1 >305µs I2C READ_IOUT CODE 800µs 1000µs THE TIME TO SAMPLE CURRENT AND VOLTAGE ARE FIXED. I3 V3 <190µs FREE DATA CODE FREE DATA CODE FREE DATA READ I2 READ I1 READ I3 10384-009 200µs Figure 9. Optimal Current Readback on ADM1275 S SLAVE ADDRESS W DATA BYTE HIGH S A SLAVE ADDRESS COMMAND CODE A Sr SLAVE ADDRESS R A DATA BYTE LOW A A COMMAND CODE A Sr SLAVE ADDRESS R A DATA BYTE LOW A P W DATA BYTE HIGH A PEC A P 10384-010 A MASTER TO SLAVE SLAVE TO MASTER Figure 10. Read Word and Read Word with PEC 200µs 400µs 600µs P1 <16µs ADM1275 ADC STATE <146µs <118µs <146µs VIN1 I1 VOUT1 800µs 1000µs THE TIME TO SAMPLE CURRENT, VOLTAGE AND POWER ARE FIXED. WAIT VIN2 I2 1200µs P3 P2 VOUT2 VIN3 I3 VOUT3 DATA ADD DATA ADD READ I0 READ I1 DATA READ I2 10384-011 >426µs ADD Figure 11. Register Readback on ADM1276 In the case of the ADM1276 and ADM1075, the update of all registers occurs at the end of the sampling sequence and after the power calculation has been completed. Hence, the time taken by the read command is not important; rather, the critical time is the time between commands. The time between commands must be longer than the entire sampling to avoid duplicate samples (see Figure 11). Similarly, in the case where averaging is enabled, all register updates are done at the end of the sampling sequence after the power calculation. Therefore, set the time between readbacks to greater than the sampling time. This time can be calculated from Table 1 using the following formula: Rev. 0 | Page 3 of 4 Min Readback Time = [Number Averages × (Voltage Sample + Current Sample + Optional Voltage Sample)] + Power Calculation Time AN-1135 Application Note CONCLUSION The ADM1275, ADM1276, and ADM1075 provide different combinations of voltage, current, and power monitoring. There are subtle differences between the order of sampling, where ADC register updates occur, and the ADC timing on each device. Consider these differences to optimize the PMBus transactions for maximum data rate and to avoid duplicate samples. The minimum I2C data rate and minimum bus free time (for the ADM1275 only) are the critical specifications when optimizing data readback, for example, where postprocessing of data is con- ducted externally to the device (that is, in a microprocessor). In a case such as this, the user needs to set single average sampling and must readback every sample from the device. In most cases where device averaging is used, this level of readback optimization is not required. When timing is critical, the CONV function of the GPIO1/ ALERT1/CONV pin helps to synchronize the sampling. On the ADM1275, where some bus free time is required for optimal readback, use the CONV pin function to delay ADC sampling to allow for other I2C activity following the initial readback command. ©2012 Analog Devices, Inc. All rights reserved. Trademarks and registered trademarks are the property of their respective owners. AN10384-0-8/12(0) Rev. 0 | Page 4 of 4