STM32 使用ADS1220 使用外部REF0 +-2.5V 0V时ADS1220采集值1.2V -2.5V电压时采集值为0.0003V
请问如何让0V对应采集值0,
long ADS1220ReadData()
{
long Data;
/* assert CS to start transfer */
ADS1220AssertCS(1);
/* send the command byte */
// ADS1220SendByte(ch,ADS1220_CMD_RDATA);
/* get the conversion result */
#ifdef ADS1120
Data = ADS1220ReceiveByte(ch);
Data = (Data << 8) | ADS1220ReceiveByte(ch);
/* sign extend data */
if (Data & 0x8000)
Data |= 0xffff0000;
#else
Data = ADS1220ReceiveByte();
Data = (Data << 8) | ADS1220ReceiveByte();
Data = (Data << 8) | ADS1220ReceiveByte();
/* sign extend data */
if (Data & 0x800000)
Data |= 0xff000000;
#endif
/* de-assert CS */
ADS1220AssertCS(0);
return Data;
}
temp = ADS1220ReadData();
printf("temp %ld\r\n",temp);
Vin[0] = (temp)*2.5f/8388608;