ts-7000
[Top] [All Lists]

Re: [ts-7000] TS-ADC24 max sample rate?

To:
Subject: Re: [ts-7000] TS-ADC24 max sample rate?
From: mike ingle <>
Date: Mon, 7 Sep 2009 11:04:46 -0700


You are seeing the result of linux being a multi-tasking OS.  Your application runs for xxx cycles the gets switched from to some other task.  You need to use a device driver and interrupts to get the data off the adc card before the buffer overflows. 
 
ftp://ftp.embeddedarm.com/pc104-peripherals/ts-adc24/   has .lib files I am not sure where the expected .o files and the api description is.  You should contact technologics.
 
 
On Mon, Sep 7, 2009 at 9:44 AM, bburtan65 <> wrote:
 

Okay, so Technologic states several times in the literature for the ADC24 board that it has a 1Msps sample rate. However, in my experience so far just sampling the minimum four channels, the absolute best I seem to be able to do is 100ksps before the buffer overflows and the ADC stops.

Here is a code snippet:

adc = (ADC_Data_Type *)mmap(0, getpagesize(), PROT_READ|PROT_WRITE, MAP_SHARED, fd, IO_BASE);
adc += (ADC_OFFSET)/sizeof(ADC_Data_Type);
adc_channel_address = adc + 0x4; // For slightly faster access to the channel register
adc_data_address = adc + 0x5; // For slightly faster access to the sample data

ADC(2) = 0; // Reset the ADC
configuration = configuration | diff_mode;
if (diff_mode == kDiff_Mode_Single_Ended)
configuration = configuration | kDiff_Mode_Single_Ended_8bit;
configuration = configuration | input_range;
configuration = configuration | ((num_channel_blocks-1) << 1);
num_channels = num_channel_blocks * 4;
ADC(2) = configuration | 1;

The main loop is here:

do {
current_channel = ((*(adc_channel_address)) >> 1) & 0x1f;
sample_data = (*(adc_data_address));
} while (current_channel != 0);

adcValue = (sample_data & 0x07ff) + (!(sample_data & 0x800)*0x800);

If I do nothing else but the above do/while and adcValue lines, 100ksps is about the maximum. If I'm running other threads that slows way down. So why can I never get 1Msps?




__._,_.___


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