SBOS790A April 2017 – March 2025 INA233
PRODUCTION DATA
READ_EIN is a command that returns information that the host can use to calculate energy or to average input power consumption. Use the PMBus block read protocol to access this command. Six bytes of data are returned by this command. The first two bytes are the 16-bit, unsigned output of an accumulator that continuously sums samples of the instantaneous input power. These two data bytes are formatted such that returned values can be converted to watts using the power m, b, and R coefficients. The third data byte is a count of the rollover events for the accumulator. This byte is an unsigned integer indicating the number of times that the accumulator has rolled over from the maximum positive value (FFFFh) to zero. The last three data bytes are a 24-bit unsigned integer that counts the number of samples of the instantaneous input power that are applied to the accumulator.
The combination of the accumulator and the rollover count can overflow within a few seconds depending on the ADC conversion time. The host software must detect and appropriately handle this overflow. Similarly, the sample count value overflows, but this event only occurs one time every few hours using 1ms ADC conversion times.
To convert the data obtained with the READ_EIN command to average power, first convert the accumulator and rollover count to an unsigned integer.
Total Accumulated Unscaled Power (Accumulator_24) = (rollover_count × 216) + Accumulator
Overflow detection and handling are done on the 24 bits of accumulator data and the sample count now. As shown in Equation 6, data from the previous calculation must be saved and used in this calculation to obtain the unscaled average power. Table 6-16 lists the definitions for this command.

where
| BYTE | MEANING | DEFAULT |
|---|---|---|
| 6 | Sample count high byte | 0 |
| 5 | Sample count mid byte | 0 |
| 4 | Sample count low byte | 0 |
| 3 | Power accumulator rollover count | 0 |
| 2 | Power accumulator high byte | 0 |
| 1 | Power accumulator low byte | 0 |
| 0 | Number of bytes | 6 |
When the average power is calculated over a known number of samples, energy can be calculated by taking the product of the average power and the time interval for that average. The time interval can be externally measured or calculated by multiplying the number of samples reported by the ADC conversion time inclusive of any device averaging modes. However, calculating the energy consumption using the ADC conversion time results in a 10% error in the energy reading because of variations in the internal sampling oscillator. For increased precision in the energy measurement, using a higher accuracy external time measurement method is recommended.
The energy accumulator can be configured by the MFR_DEVICE_CONFIG command to automatically clear with each READ_EIN command. The ability to clear the accumulator on a read permits the device to be easily synchronised to an external timer and allows the accumulator to always start at 0, thus eliminating the need to subtract the initial accumulated values and sample counts.
The READ_EIN power accumulator can also be cleared by issuing a CLEAR_EIN command or RESTORE_DEFAULTS_ALL command. Clearing the power accumulator with the RESTORE_DEFAULTS_ALL command is not recommended because this command also clears the calibration register used to scale the accumulated power.