Other Parts Discussed in Thread: ADS1247, ADS1248
Dear All,
In my analog input application i am using ADC ADS1247 interfaced with PIC32mx575f512l ucontroller. Everything is working fine. my readings are ok.
but now i am facing a problem for automatic register change while running.
my problem is GPIO register value change automatically. i am never writeing its value.
my firmware is as below and inside you can see i am never write GPIO register but still its changing to (GPIO0 = 0x3F).
Please help as soon as possible.
SpiWriteByte_ADC(ADC_no, 0x40); //4: WRITE 0: ADDRESS SYS0
SpiWriteByte_ADC(ADC_no, 0x03); // = total data-1 (no. of bytes to send -1)
SpiWriteByte_ADC(ADC_no, RTD_CH); //CH1 [AIN0=+ and AIN1=-]
SpiWriteByte_ADC(ADC_no, 0x00); //0x00 BIAS VOLTAGE OFF
SpiWriteByte_ADC(ADC_no, 0x30); //00:EXT REF 30: int ref on board //33 INT REF+TEM DIODE
SpiWriteByte_ADC(ADC_no, 0x42); //0x41; //16 gain//62--64 gain//gain =4, 20SPS
SpiWriteByte_ADC(ADC_no, 0x4A); // 4: WRITE A: Address IDAC0
SpiWriteByte_ADC(ADC_no, 0x01); // Length = total data -1
SpiWriteByte_ADC(ADC_no, 0x0B); //DRDY & Current value selection - 08 = no current
SpiWriteByte_ADC(ADC_no, 0x3F); //current channel select = 500uA = 0x0C , 250uA = 0x0B
void SpiWriteByte_ADC(unsigned char ADC_No, unsigned char byte)
{
unsigned char j = 128;
while (j > 0)
{
SET_SCLK_ADC_1;
Delay2us(1);
if (byte & j) SET_MOSI_ADC_1;
else RESET_MOSI_ADC_1;
RESET_SCLK_ADC_1;
Delay2us(1);
j >>= 1;
}
}