Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

ADS1120: input signal is 0V,output value is not 0(ADC result is 1300).

$
0
0

Part Number: ADS1120

1. reg configre : uiADS1120_WrBuff[4] = { 0x08, 0xC1, 0xC5, 0x80};  circuit is figure 79 in datasheet.

2. my code as follow:

int ADS1220ReadData(void)//TFQ改
{
   int Data;
   u8 TempData;
   /* assert CS to start transfer */
   ADS1220AssertCS(1);
   Delay_us(20);        //  之前是10us
   /* send the command byte */
   TempData = SPI2_ReadWriteByte(ADS1220_CMD_RDATA);
   /* get the conversion result */
    // ADS1120
   Data = SPI2_ReadWriteByte(0xff);
   Data = (Data << 8) | SPI2_ReadWriteByte(0xff);
   /* sign extend data */
   if (Data & 0x8000)
      Data |= 0xffff0000;
   Delay_us(20);                //houjia
   /* de-assert CS */
   ADS1220AssertCS(0);
   return Data;
}

3. read reg value  is  equal write value. but,when i modified the reg0 0xe8, the adcputput is not near zero, it's a 1300.

connect sensor, the ADC value is 2103, when change the sensor state, the adc value is changed .it looks like plus a offset in the input port.


Viewing all articles
Browse latest Browse all 262198


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>