Hello,
I have been working with the INA233 and trying to track down the source of a bug. I am using the INA233EVM but connected an external MCU.
When I do a block read from the EIN_READ register every second I should be getting 30 or 31 samples in the accumulation register.
However I get randomly one of the following amounts without any consistent pattern:
30, 30, 30, 31, 30, 0, 30, 30, 0, 30, 90, 60, 61, 30, 30, 31, 30, 30, 120, 30, 30.
The energy register also returns in multiples, for example, if the count is 30 I get 4530 in the accumulator, and if I get 60 counts the accumulator will be double, 9060.
The full debug output is at the bottom of this post, I2C commands are in the format: [R/W/Command, PMBusCommand, Data].
As far as I can tell, Reading READ_VIN corrupts the accumulation sample process somehow, but this may be a red herring.
I also tried Single Shot ADC mode, requesting exactly 10 ADC reads and then reading READ_EIN.
I tried this single shot mode without ever reading READ_VIN and I STILL got 0, 10 and 20 counts.
Let me know if you can think of anything I can try.
Thanks,
Gabriel Maria
[R,0xE0,0x5449] // read TI_MFR_ID, to check for communication [R,0xE1,0x3333] // read TI_MFR_MODEL, to check for communication [C,0x12,0x0] // command RESTORE_DEFAULT_ALL [C,0x3,0x0] // command CLEAR_FAULTS [R,0xD5,0x2] // modify MFR_DEVICE_CONFIG, READ_EIN Autoclear = 1 [W,0xD5,0x6] [R,0xD0,0x4127] // modify MFR_ADC_CONFIG, Averaging mode = 2 [W,0xD0,0x4527] [W,0xD4,0x800] // write MFR_CALIBRATION, CAL value of 2048 [R,0x86,0xB2] // block-read READ_EIN, Power accumulator low byte [R,0x0,0x11] // Power accumulator high byte [R,0x0,0x0] // Power accumulator rollover count [R,0x0,0x1E] // Sample count low byte [R,0x0,0x0] // Sample count mid byte [R,0x0,0x0] // Sample count high byte SampleWindow:4402250 SampleCount:30 EnergyReg:4530 EnergyPerSample:151 EnergyPerTime:1029.02 [R,0x88,0x113A] // read READ_VIN [R,0x86,0xB2] // block-read READ_EIN, Power accumulator low byte [R,0x0,0x11] // Power accumulator high byte [R,0x0,0x0] // Power accumulator rollover count [R,0x0,0x1E] // Sample count low byte [R,0x0,0x0] // Sample count mid byte [R,0x0,0x0] // Sample count high byte SampleWindow:1000580 SampleCount:30 EnergyReg:4530 EnergyPerSample:151 EnergyPerTime:4527.37 [R,0x88,0x113A] // read READ_VIN [R,0x86,0x49] [R,0x0,0x12] [R,0x0,0x0] [R,0x0,0x1F] [R,0x0,0x0] [R,0x0,0x0] SampleWindow:1000590 SampleCount:31 EnergyReg:4681 EnergyPerSample:151 EnergyPerTime:4678.24 [R,0x88,0x113A] [R,0x86,0x0] [R,0x0,0x0] [R,0x0,0x0] [R,0x0,0x0] [R,0x0,0x0] [R,0x0,0x0] SampleWindow:1000580 SampleCount:0 EnergyReg:0 EnergyPerSample:0 EnergyPerTime:0.00 [R,0x88,0x113A] [R,0x86,0xB2] [R,0x0,0x11] [R,0x0,0x0] [R,0x0,0x1E] [R,0x0,0x0] [R,0x0,0x0] SampleWindow:1000570 SampleCount:30 EnergyReg:4530 EnergyPerSample:151 EnergyPerTime:4527.42 [R,0x88,0x113A] [R,0x86,0xB2] [R,0x0,0x11] [R,0x0,0x0] [R,0x0,0x1E] [R,0x0,0x0] [R,0x0,0x0] SampleWindow:1000590 SampleCount:30 EnergyReg:4530 EnergyPerSample:151 EnergyPerTime:4527.33 [R,0x88,0x113A] [R,0x86,0xAD] [R,0x0,0x35] [R,0x0,0x0] [R,0x0,0x5B] [R,0x0,0x0] [R,0x0,0x0] SampleWindow:1000580 SampleCount:91 EnergyReg:13741 EnergyPerSample:151 EnergyPerTime:13733.04 [R,0x88,0x113A] [R,0x86,0xB2] [R,0x0,0x11] [R,0x0,0x0] [R,0x0,0x1E] [R,0x0,0x0] [R,0x0,0x0] SampleWindow:1000580 SampleCount:30 EnergyReg:4530 EnergyPerSample:151 EnergyPerTime:4527.37 [R,0x88,0x113A] [R,0x86,0xB2] [R,0x0,0x11] [R,0x0,0x0] [R,0x0,0x1E] [R,0x0,0x0] [R,0x0,0x0] SampleWindow:1000590 SampleCount:30 EnergyReg:4530 EnergyPerSample:151 EnergyPerTime:4527.33 [R,0x88,0x113A] [R,0x86,0xFB] [R,0x0,0x23] [R,0x0,0x0] [R,0x0,0x3D] [R,0x0,0x0] [R,0x0,0x0] SampleWindow:1000590 SampleCount:61 EnergyReg:9211 EnergyPerSample:151 EnergyPerTime:9205.57 [R,0x88,0x113A] [R,0x86,0xFB] [R,0x0,0x23] [R,0x0,0x0] [R,0x0,0x3D] [R,0x0,0x0] [R,0x0,0x0] SampleWindow:1000590 SampleCount:61 EnergyReg:9211 EnergyPerSample:151 EnergyPerTime:9205.57 [R,0x88,0x113A] [R,0x86,0xB2] [R,0x0,0x11] [R,0x0,0x0] [R,0x0,0x1E] [R,0x0,0x0] [R,0x0,0x0] SampleWindow:1000580 SampleCount:30 EnergyReg:4530 EnergyPerSample:151 EnergyPerTime:4527.37 [R,0x88,0x113A] [R,0x86,0xB2] [R,0x0,0x11] [R,0x0,0x0] [R,0x0,0x1E] [R,0x0,0x0] [R,0x0,0x0] SampleWindow:1000590 SampleCount:30 EnergyReg:4530 EnergyPerSample:151 EnergyPerTime:4527.33 [R,0x88,0x113A] [R,0x86,0xB2] [R,0x0,0x11] [R,0x0,0x0] [R,0x0,0x1E] [R,0x0,0x0] [R,0x0,0x0] SampleWindow:1000590 SampleCount:30 EnergyReg:4530 EnergyPerSample:151 EnergyPerTime:4527.33 [R,0x88,0x113A] [R,0x86,0x0] [R,0x0,0x0] [R,0x0,0x0] [R,0x0,0x0] [R,0x0,0x0] [R,0x0,0x0] SampleWindow:1000590 SampleCount:0 EnergyReg:0 EnergyPerSample:0 EnergyPerTime:0.00 [R,0x88,0x113A] [R,0x86,0x0] [R,0x0,0x0] [R,0x0,0x0] [R,0x0,0x0] [R,0x0,0x0] [R,0x0,0x0] SampleWindow:1000560 SampleCount:0 EnergyReg:0 EnergyPerSample:0 EnergyPerTime:0.00 [R,0x88,0x113A] [R,0x86,0x16] [R,0x0,0x35] [R,0x0,0x0] [R,0x0,0x5A] [R,0x0,0x0] [R,0x0,0x0] SampleWindow:1000570 SampleCount:90 EnergyReg:13590 EnergyPerSample:151 EnergyPerTime:13582.26 [R,0x88,0x113A] [R,0x86,0xB2] [R,0x0,0x11] [R,0x0,0x0] [R,0x0,0x1E] [R,0x0,0x0] [R,0x0,0x0] SampleWindow:1000590 SampleCount:30 EnergyReg:4530 EnergyPerSample:151 EnergyPerTime:4527.33 [R,0x88,0x113A]


