Dear Sir,
I am using ADS1230 for my weighing scale application. I was able to read the data properly, but when I switch ON/OFF my nearby electrical unit/instrument, the ADC hangs, not the uC. ADC PDWN is controlled from uC.
A brief about my S/W flow;
ADC Data pin connected to INTERRUPT PIN, Falling edge of DATA, points to ISR, where, after a small delay, I start reading all the 20 bits and then give one clk pulse with DATA pin high(20 bit format). Come out from ISR, display & wait for ADC reading.
But when some external electrical switching
happens, the reading becomes the maximum(0x7FFFF) and at this moment, I monitored (DSO) the
SCK & SDATA pins, where the falling edge timing signal on DATA pin is more.
i-e., the DATA pin going low doesn’t
happens at 100ms(10SPS), it happens even much faster at 10-25ms. As the DATA
pin falling edge increases, SCLK follows the same signal pattern of DATA pin.
Kindly reply me, how to handle this problem. I don’t want the ADC to be in single conversion mode by entering into StandBy mode. I want to read the ADC in its fly (continuous conversion) i;e through interrupt method. My code:
if(INTCONbits.INT0IF) //BUSY
{
TOTAL_COUNTS_MAIN = full_byte_read();
second_byte_read2();
Bits.eocf = 1; //Indication to main routine for end of conversion.
INTCONbits.INT0IF = 0;
}
/*****************************************************************************************************************
unsigned long int full_byte_read(void)
{
valq = 0;
q=0x80000;
delay(10);
for (q=0x80000;q>0;q/=2) //shift bit for masking
{
CLK = 1;
{ _asm nop _endasm};
{ _asm nop _endasm};
{ _asm nop _endasm};
CLK = 0;
{ _asm nop _endasm};
{ _asm nop _endasm};
{ _asm nop _endasm};
if (BUSY) valq=(valq | q); //read bit
{ _asm nop _endasm};
{ _asm nop _endasm};
{ _asm nop _endasm};
}
return valq;
}
//*****************************************************************************************************************
Doubt 2:
Also reply me, what happens to ADC, if there is an abrupt change in VCC, at PDWN controlled by uC?
Jayaraj.A