When I am trying to read ADC values from ADS7830 those values fluctuating from 0-255 even though nothing is connected to the channel.
I'm using the reference circuit provided in the datasheet only . And my STM32 code is:
uint8_t TMP_adc_Read(uint8_t Reg_Addr)
{
//HAL_I2C_IsDeviceReady (&hi2c1, 0x90, 3,10);
/* Initialization of Buffer
* Loading Address of Required data in buf0
*/
TMP_i2c_buf[0] = Reg_Addr;
/* //Transmitting address of required data */
HAL_I2C_Master_Transmit(&hi2c1,(0x48<<1),TMP_i2c_buf,1,20);
/* Receiving Data in buf1 */
HAL_I2C_Master_Receive(&hi2c1,0X91,&TMP_i2c_buf[1],1,20);
return (TMP_i2c_buf[1]);
}
and Reg_Addr=0x8C; I have tried with 0X84,0X88,0X80