Hello,
In my project using ADS1232 interface with PIC 18F4520. I am using the schematic of Figure 42 from datasheet. instead of 3v in DVDD I put 5v. Without Crystal.
Loadcell : 5Kg
Sensitivity : 2mv / V
In Zero i'm getting: 1032607
With a weight of 3891g: 4092230
With a weight of 2004g: 3137156
i'm using the formula from ADS1232Ref.
m = 3891 / (4092230 - 1032607) 3059623m = 0,001271725Wzs = -0,001271725 * 1032607Wzs = -1313,192W = 0,001271725 * 3137156 -1313,192 W = 2676,40 g (not 2004g)The code is:long ler_adc (void)
{
int i=23;
int j = 1;
long teste = 0;
char txtexp[30];
while(SDI==1)
{
}
for(i=23;i>=0;i--)
{
SCK=1;
if(SDI==1)
{ valor1[i]='1'; }
else
{valor1[i]='0';}
}
SCK=1;
delay_us(10);
SCK=0;
//Binary to Decimal
rawadc = 0;
for(j=0;j<24;j++)
{
if(valor1[j]=='1')
{
teste = 0;
teste = ldexp(1, j);
rawadc = rawadc + teste;
}
else{}
}
UART1_Write_text(" ");
LongToStr(rawadc, txtexp);
UART1_Write_Text(txtexp);
}
SCK = SCLKSDI = DRDY/DOUTWhat's I'm doing wrong?