Hello Sir,
we are using ads1230 in our current project.
GAIN: 128
SPEED: 10SPS
REFP: 2.5V
REFN: GND
code of ads1230 interface is on bit banging.
ADS1230 normal works ok. but some time give spike like 0x3FFF , 0x7FFF etc. reading.
I applied filter logic to remove this spike. stable weight filter removes this spike. but unstable weight unable to handle the spike.
I have attached the ads1230 code and schematic.
Please let me know what should I do?
char ADS1230_Read_Byte(void){
unsigned char i=8;
char rdybyte = 0;
while(i--){
rdybyte <<= 1;
ADS1230_SCLK = 1;
_nop_();
_nop_();
rdybyte = (rdybyte | ADS1230_DOUT);
_nop_();
_nop_();
ADS1230_SCLK = 0;
_nop_();
_nop_();
}
return rdybyte;
}
long ADS1230_Result(void){
long temp;
union adtemp{
long l_values;
struct{
char byte_Z;
char byte_H;
char byte_M;
char byte_L;
}adbytes;
}data ADRESULT;
EX0 = 0;
ADRESULT.adbytes.byte_Z = 0;
ADRESULT.adbytes.byte_H = ADS1230_Read_Byte();
ADRESULT.adbytes.byte_M = ADS1230_Read_Byte();
ADRESULT.adbytes.byte_L = ADS1230_Read_Byte();
ADS1230_SCLK = 1;/////
_nop_(); /////////
_nop_(); ////////
_nop_(); //////////
_nop_(); /////////////////
ADS1230_SCLK = 0; ////////
ADS1230_DOUT = 1; /////////
StarADFlag = 0;
temp = (long)(ADRESULT.l_values);
if(temp & 0x800000)
temp |= 0xff000000;
temp = temp / 16;
return (temp);
}