ts-7000
[Top] [All Lists]

Re: [ts-7000] Re:U Sleep

To:
Subject: Re: [ts-7000] Re:U Sleep
From: Girisha De Silva <>
Date: Sat, 21 Feb 2009 17:59:43 -0800 (PST)
Hey

Thanks Rod for your reply. Anyways this is what I do in the loop.

cur_ch = ADC_CH2;
   
        //discard two samples
        read_channel(adc_page, cur_ch);
        read_channel(adc_page, cur_ch);


        //read 1000 more samples
        for(j = 0; j < NOSAMPLE; j++)
        {
            usleep(1000);
            adc_result[j] = read_channel(adc_page, cur_ch);
   
            avg = adc_result[j];

            if(avg < 0x7000)
            avg = avg + 0x10000;

            avg = avg - 0x9E58;
            val = ((double)avg * 3.3) / 0xC350;
   
            sprintf(pBuff,"%f",val);   
            fprintf(file,"%s\n",pBuff);
   
        }

Hope I am doing it the correct way.

Regards Girisha


From: Rod Nussbaumer <>
To:
Sent: Sunday, February 22, 2009 1:11:06 AM
Subject: [ts-7000] Re:U Sleep

How are you reading the ADC? Most ADCs have a bit somewhere to signal
End-of-Conversion. If your loop is simply reading a register that is
supposed to contain converted data, but is not waiting for EoC, that
would explain erratic readings. If a time-delay is inserted, as with
usleep(), it would allow time for the conversion to complete, and
provide you with valid readings. Again, this is consistent with the
behavior you are seeing. Can you confirm that you are reading the ADC in
a way that assures it has completed a conversion?
--- rod.



__._,_.___


Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: =Email Delivery: Digest | m("yahoogroups.com?subject","ts-7000-fullfeatured");=Change Delivery Format: Fully Featured">Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | =Unsubscribe

__,_._,___
<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU