Part Number: INA228
Tool/software:
Working with an INA228. I am wanting to accurately sync the conversion with a PWM signal.
I am seeing an unexpected short delay when carrying out 1-shot triggered measurement of VBUS. In the trace below, the red trace indicates the I2C write to ADC_CONFIG triggering the conversion, while the blue trace shows the alert pin. The alert pin stays high for 1.1mS. I was expecting shorter because:
- no averaging, single measurement of VBUS only
- 150uS conversion time
- conversion delay is set to zero.
My code is below:
writereg_ina228(0xb,0b0100000000000000); //set alert pin to conversion-ready
if(div_status.duty!=0)
{
while (PWM_LATCH==0);
while (PWM_LATCH==1); //have negative-going transition after this
}
LATC2=1;
writereg_ina228(1,0b0001101000000000); //trigger single voltage conversion, 150uS conversion time
LATC2=0;
while (ALERT); //active low
The CONFIG register is set to
0b0000000000010000 //40.96mV shunt range
Have I missed something or made a mistake with registers? Also, from the datasheet I am not certain of the time between actual conversion occurring and the conversion-ready alert pin being high/low. Are there undocumented delays?
I can work around this delay, but would like to understand what is happening.
Thanks!
Ben
