ZHCSDB9D August 2013 – June 2026 ADS1120
PRODUCTION DATA
下面的列表展示了一个伪代码序列,包含设置器件以及与 ADC 连接的微控制器所需的步骤,以便在连续转换模式下从 ADS1120 获取后续读数。专用的 DRDY 引脚用于指示新转换数据的可用性。默认的配置寄存器设置更改为:增益 = 16,连续转换模式,以及同步抑制 50Hz 和 60Hz。
Power-up;
Delay to allow power supplies to settle and power-up reset to complete (minimum of 50µs);
Configure the SPI of the microcontroller to SPI mode 1 (CPOL = 0, CPHA = 1);
If the CS pin is not tied low permanently, configure the microcontroller GPIO connected to CS as an output;
Configure the microcontroller GPIO connected to the DRDY pin as a falling edge triggered interrupt input;
Set CS to the device low;
Delay for a minimum of td(CSSC);
Send the RESET command (06h) to make sure the device is properly reset after power-up;
Delay for a minimum of 50µs + 32 × t(CLK);
Write the respective register configuration with the WREG command (43h, 08h, 04h, 10h, and 00h);
As an optional sanity check, read back all configuration registers with the RREG command (23h);
Send the START/SYNC command (08h) to start converting in continuous conversion mode;
Delay for a minimum of td(SCCS);
Clear CS to high (resets the serial interface);
Loop
{
Wait for DRDY to transition low;
Take CS low;
Delay for a minimum of td(CSSC);
Send 16 SCLK rising edges to read out conversion data on DOUT/DRDY;
Delay for a minimum of td(SCCS);
Clear CS to high;
}
Take CS low;
Delay for a minimum of td(CSSC);
Send the POWERDOWN command (02h) to stop conversions and put the device in power-down mode;
Delay for a minimum of td(SCCS);
Clear CS to high;
在执行任何测量之前或更改 PGA 增益时,运行偏移电压校准。例如,可通过将输入短接至 1/2 Vs (MUX[3:0] = 1110b) 来测量器件的内部偏移电压。然后,微控制器在输入短接的情况下从器件读取多个读数,并将平均值存储在微控制器存储器中。测量传感器信号时,微控制器随即从每个器件读数中减去所存储的偏移值,以获得经偏移补偿的结果。偏移值可为正或负。