Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/14/05 20:05
Read: times


 
#93421 - help with serial adc AD7810!
Hi everyone,

I have interfaced ad7810 to at89c52. I am using bitbanging to get data from adc.
But adc data is highly inaccurate and changes evertime i reset 8051. I suspect my code. Pl help.
Thank you very much.
My adcread function is:

void readAdc(unsigned char bang)
{
unsigned char i;

convst=0; //start conversion (active low)
_nop_();
convst=1; //serial dout latch enable

_nop_();
_nop_();
_nop_(); //conversion complete, 2.3µs delay

for(i=0x00;i<bang;i++) //bang = no. of serial clocks
{
sclk=1;
_nop_();
sclk=0;
_nop_(); //bit bang sclk of AD7810

if(dout) display('1'); //dout is dataout pin of AD7810
else display('0');
}
}

Note: sclk=p1.0, convst=p1.1, dout=p1.2

List of 4 messages in thread
TopicAuthorDate
help with serial adc AD7810!            01/01/70 00:00      
   Ground the input            01/01/70 00:00      
      simulate with an eeprom            01/01/70 00:00      
   Have you measured ?            01/01/70 00:00      

Back to Subject List