Part Number: ADS125H02
Hi,
I'm currently working on ADS125H02 interfacing with stm microcontroller. In this i'm using SPI for communication.
PIN connection :
HvVdd - +15 V
HvVss - -15V
AVdd - 5V
DVdd - 3.3V
CapP n CapN - 1nF
RFout - grounded with 10uF
reset - float
START - assigned a pin as output from MCU for start pin (high n low condition)
SCK,DIN,DOUT,CS1,CS2 - connected with respective spi pins in MCU
DRDY - assigend a MCU gpio pin
BYpass - connected to gnd with 1uF cap
CLKIN - grounded
AINCOM - Ground
AIN0 - +5V
AIN1 - ground (for single end adc conversion)
REF - using internal reference 2.5V
Below is the code :-
int main()
{
//uint8_t dat;
SystemInit();
SPIx_Init();
//for RESET commond________________________________________________________
/*SPIx_EnableSlave();
SPIx_Transfer(0x06);//enable RESET commond
SPIx_Transfer(0x00);
SPIx_Transfer(0xA9); //accroding to crc value calculated
SPIx_Transfer(0x00);
SPIx_DisableSlave();*/
while(1)
{
//for START commond________________________________________________________
Set_On();
START_high();
/*SPIx_Transfer(0x08);//enable START commond
SPIx_Transfer(0x00);
SPIx_Transfer(0x7F); //accroding to crc value calculated
SPIx_Transfer(0x00);*/
START_low();
//UNLOCK_REGS_____________________________________________________________
SPIx_EnableSlave();
SPIx_Transfer(0xF5);//enable UNLOCK commond
SPIx_Transfer(0x00);
SPIx_Transfer(0x82); //accroding to crc value calculated
SPIx_Transfer(0x00);
SPIx_DisableSlave();
//reference___________________________________________________
SPIx_EnableSlave();
SPIx_Transfer(0x46);//enable internal reference commond
SPIx_Transfer(0x05);
SPIx_Transfer(0xE9); //accroding to crc value calculated
SPIx_Transfer(0x00);
SPIx_DisableSlave();
//for MODE 4 WRITE________________________________________________________
//SPIx_EnableSlave();
CS2_EnableSlave();
//SPI_GPIO->BRR = CS_2;
SPIx_Transfer(0x50);//enable MODE4
SPIx_Transfer(0x34);//AIN0-COM , GAIN IS 0.5
SPIx_Transfer(0x57);//accroding to crc value calculated
SPIx_Transfer(0x00);
//SPIx_DisableSlave();
CS2_DisableSlave();
for(i=0;i<100;i++);
START_high();
Set_Off();
//for RDATA commond________________________________________________________
SPIx_EnableSlave();
SPIx_Transfer(0x12);//enable RDATA commond
SPIx_Transfer(0x00);
SPIx_Transfer(0xAA); //accroding to crc value calculated
SPIx_Transfer(0x00);
SPIx_Transfer(0x00);
SPIx_Transfer(0x00);
SPIx_Transfer(0x00);
SPIx_Transfer(0x00);
SPIx_Transfer(0x00);
SPIx_DisableSlave();
START_low();
}
}
While reading RDATA i'm receiving 20FFFF(1.2V) for all voltage.
is there any changes i have to do?
please help me out with this issue.
Thanks in advance