I am using ADS8689. I am getting ADS conversion results successfully from the converter with default settings. Now I want to change range of the AD converter. But when I try to write the register, it does not change the range. I have tried lot of combination to write 32bit command word. But I am not getting success.
code snippet is below. Clock is given using bit banging
uint32_t BitMask = 0x80000000, Command = 0xD0140002;
uint8_t ClkCntr = 0;
CLRPIN(0, SPI1_CS1);
SmallDelay(CLOCK_DELAY);
{
// put data
if(BitMask & Command){
SETPIN(0, SPI1_MOSI);
}
else{
CLRPIN(0, SPI1_MOSI);
}
SmallDelay(CLOCK_DELAY);
// Data latched on rising edge
SETPIN(0, SPI1_SCK);
SmallDelay(CLOCK_DELAY);
BitMask = BitMask >> 1;
ClkCntr++;
}
SETPIN(0, SPI1_CS1);