Hi ,
I have been trying to read the values from the ADS7924 but each time i read the data from the data register of any channel i get the digital data as 11111111 .
below is the snippet of the code implemented .
can u please help me out in solving this .Am i missing anything.
---------------------------------------------------------------------------------------------code-----------------------------------------------------------------------------
extern void I2CSend_ADC(uint16 slave_addr_adc, uint16 num_of_args_adc, ...);
extern uint8 I2CReceive_ADC(uint16 slave_addr_adc, uint16 reg_adc);
#define ADC_ADD 0x48
#define ADC_MODE 0x00
#define ADC_INT_CNTRL 0x01
#define ADC_DATA0_U 0x02
#define ADC_DATA0_L 0x03
#define ADC_DATA1_U 0x04
#define ADC_DATA1_L 0x05
#define ADC_DATA2_U 0x06
#define ADC_DATA2_L 0x07
#define ADC_DATA3_U 0x08
#define ADC_DATA3_L 0x09
#define ADC_ULR0 0x0A
#define ADC_LLR0 0x0B
#define ADC_ULR1 0x0C
#define ADC_LLR1 0x0D
#define ADC_ULR2 0x0E
#define ADC_LLR2 0x0F
#define ADC_ULR3 0x10
#define ADC_LLR3 0x11
#define ADC_INT_CONFIG 0x12
#define ADC_RESET 0x16
uint8 data_upper,data_lower,data1_upper,data1_lower,data_interupt,power_config,data2_lower,data2_upper,dev_id;
uint32 data_pd_vmon ,data_aux_vmon,veq_53V_aux,data_53V_aux_vmon;
uint32 veq_pd ,veq_aux;
uint32 voltage_pd,voltage_aux ;
void kk_ADC()
{
I2CSend_ADC(ADC_ADD, 1, ADC_MODE, 0X80);
I2CSend_ADC(ADC_ADD, 1, ADC_MODE, 0XCC);
data_upper = I2CReceive_ADC(ADC_ADD,ADC_DATA0_U);
kk_printf("\n the upper byte data of pd vmon is %d \n",data_upper);
data_lower = I2CReceive_ADC(ADC_ADD,ADC_DATA0_L);
kk_printf("\n the lower byte data of pd vmon is %d \n" ,data_lower);
data_pd_vmon = (((data_upper<<8)|data_lower)>>4);
kk_printf("\n the digital data of pd vmon is %d \n ",data_pd_vmon);
veq_pd = (data_pd_vmon*3300)/4096UL;
kk_printf("\n the voltage of pd is = %d.%d \n",veq_pd/1000,(veq_pd-(veq_pd/1000)*1000));
}
---------------------------------------------------------------------------------------------------------------------------------------------------------------end--------------------------------------------------------