Hello!
I am using the ADS1258 single end channel. The channel 1 shows me the values bellow:
32700
32701
32700
32830
32700
32701
32303
Note: I put the channel 0 direct with ground signal.
Could you send me a code example? I am using port I/O from a PIC32 microcontroller. I choose the scan option, but for test I am using just channel 0.
My code is:
void le_ads1258(void)
{
byte c;
byte sts;
unsigned long leit_conv;
contador_aux[0] = 0;
contador_aux[1] = 0;
contador_aux[2] = 0;
contador_aux[3] = 0;
while(1)
{
sts = 0;
leit_conv = 0;
write_ads1258(0x30);//00110000
// Le byte de status
for (c=1;c<9;c++)
{
SCLK_AD = 1; // SCLK = 1
sts *= 2;
if (DOUT_AD == 1) sts += 1;
SCLK_AD = 0; // SCLK = 0
}
// Le os 3 bytes de dados
for (c=1;c<25;c++)
{
SCLK_AD = 1; // SCLK = 1
leit_conv *= 2;
if (DOUT_AD == 1)
leit_conv += 1;
SCLK_AD = 0; // SCLK = 0
}
leit_conv = (leit_conv ^ 0x800000)/256;
if ((sts & 128) == 128)
{
switch (sts & 0x1f)
{
case 8:
if (contador_aux[0]<media)
{
somatoria[0] += leit_conv;
contador_aux[0]++;
}
break;
case 9:
if (contador_aux[1]<media)
{
somatoria[1] += leit_conv;
contador_aux[1]++;
}
break;
case 10:
if (contador_aux[2]<media)
{
somatoria[2] += leit_conv;
contador_aux[2]++;
}
break;
case 11:
if (contador_aux[3]<media)
{
somatoria[3] += leit_conv;
contador_aux[3]++;
}
break;
}
}
if ((canais_ativos & 2)==0) contador_aux[1] = contador_aux[0];
if ((canais_ativos & 4)==0) contador_aux[2] = contador_aux[0];
if ((canais_ativos & 8)==0) contador_aux[3] = contador_aux[0];
if ((contador_aux[0] == media) && (contador_aux[1] == media) && (contador_aux[2] == media) && (contador_aux[3] == media)) break;
}
for (c=0;c<4;c++)
{
leit_ad[c] = somatoria[c]/media;
somatoria[c] = 0;
}
}
Thanks,
Mr. Galbas