Part Number: ADS8684
SDI running at 15MHz. I get AD values from device, but I am not able to change GAIN.
After Reset (Hardware) I try to initialize device by sending gain (+/- 0.6125Vref) for chan0...3
Then I like to set AUTO_Chan to chan 0,1,2
for(i=0;i<CHAN;i++) // set gain for all 3 channels // configure chan0...2 GAIN to 0.625*Vref => +/-2.56V
{
SS2_Clear();
SPI2BUF = (uint8_t)(wrCH0gain[0])+(i*2); // starting from 0x0B,0x0D,0x0E
SPI2BUF = (uint8_t)wrCH0gain[1]; // 0x02
SPI2BUF = (uint8_t)wrCH0gain[2]; // 0x00
IFS1bits.SPI2TXIF = 0;
while(IFS1bits.SPI2TXIF == 0);
SS2_Set();
Nop();
Nop();
Nop();
}
SS2_Clear(); // configute auto chan sequencing 0,1,2
SPI2BUF = (uint8_t)wrCHANen[0]; // 0x03
SPI2BUF = (uint8_t)wrCHANen[1]; // 0x03
SPI2BUF = (uint8_t)wrCHANen[2]; // 0x00
IFS1bits.SPI2TXIF = 0;
while(IFS1bits.SPI2TXIF == 0);
SS2_Set();
When adding "Standby" before code above there is no output amymore even I send a AUTO_RESTART (0xA0000000) every third sample request.
SPI2CONbits.STXISEL = 0;
SS2_Clear(); // set standby
SPI2BUF = 0x82;
SPI2BUF = 0;
SPI2BUF = 0;
SPI2BUF = 0;
IFS1bits.SPI2TXIF = 0;
while(IFS1bits.SPI2TXIF == 0);
SS2_Set();
Please advice by gining me a stepwise esbplanation
What do I have to send .... step by step from Reset to sample request,,,,
Thanks