Can Linux Improve ADC Sampling Rate on Intel Galileo Gen 2?

  • Thread starter Thread starter cnh1995
  • Start date Start date
  • Tags Tags
    Adc Galileo
Click For Summary
SUMMARY

The discussion centers on improving the ADC sampling rate on the Intel Galileo Gen 2 board, which currently achieves only 500 samples per second using the analogRead() function in Arduino IDE. The expected sampling rate is around 1 million samples per second, limited by software latency and the current configuration. The Texas Instruments ADC108S102 is capable of higher speeds, but achieving this requires using a SPI controller driver with DMA for efficient data buffering. Transitioning to a Linux environment may enhance performance, particularly with the spidev user driver.

PREREQUISITES
  • Understanding of ADC principles and sampling rates
  • Familiarity with Arduino IDE and the analogRead() function
  • Knowledge of SPI communication protocols
  • Experience with Linux operating systems and drivers
NEXT STEPS
  • Research the implementation of SPI controller drivers with DMA for the Texas Instruments ADC108S102
  • Learn about optimizing ADC performance in Linux using the spidev user driver
  • Explore alternative ADC shields compatible with Intel Galileo Gen 2 for higher sampling rates
  • Investigate low-level driver access and block read functions for improved data acquisition
USEFUL FOR

Electronics engineers, embedded systems developers, and hobbyists working with the Intel Galileo Gen 2 who aim to enhance ADC performance and sampling rates in their projects.

cnh1995
Homework Helper
Gold Member
Messages
3,487
Reaction score
1,163
I am working on a little project with intel galileo gen 2 which involves successive analog voltage readings of a sinusoidal waveform. I am using analogRead() function in Arduino IDE for that purpose. But the on-board ADC is extremely slow.The sampling rate I am getting is terribly small which is 500 samples per second. The clock frequency of the processor is 400MHz, so expected rate is around 1 million samples per second but I am getting nowhere near it. Is there any way to achieve that rate,like by changing the ADC's clock frequency? Arduino uno R3 shield is compatible with the board. Will that help?
 
Engineering news on Phys.org
cnh1995 said:
I am working on a little project with intel galileo gen 2 which involves successive analog voltage readings of a sinusoidal waveform. I am using analogRead() function in Arduino IDE for that purpose. But the on-board ADC is extremely slow.The sampling rate I am getting is terribly small which is 500 samples per second. The clock frequency of the processor is 400MHz, so expected rate is around 1 million samples per second but I am getting nowhere near it. Is there any way to achieve that rate,like by changing the ADC's clock frequency? Arduino uno R3 shield is compatible with the board. Will that help?

Is the on-board ADC high resolution? Is that why it is slow?

What resolution and sampling frequency do you want to have? As you say, there are probably shields that would have faster (lower resolution) ADCs on them...
 
  • Like
Likes   Reactions: cnh1995
berkeman said:
Is the on-board ADC high resolution? Is that why it is slow?

What resolution and sampling frequency do you want to have? As you say, there are probably shields that would have faster (lower resolution) ADCs on them...
Any resolution up to 16 bit is available.We can set it via analogReadResolution(x) command where x is the resolution in bits. I am using 10 bit resolution which is sufficient for me but the sampling rate should be much higher than 500 samples per second. The expected rate is around 1 million samples per second. Its a Texas Instruments ADC.
Should I try lower resolution for on-board ADC or go for any shield?
 
You're almost certainly limited by the software latency in the analogRead(x) command. Are there any low-level drivers you can access or any block read functions?

The analogReadResolution(x) function won't necessarily make it faster if it just truncates the output word of the ADC.
 
  • Like
Likes   Reactions: cnh1995
analogdesign said:
You're almost certainly limited by the software latency in the analogRead(x) command. Are there any low-level drivers you can access or any block read functions?

The analogReadResolution(x) function won't necessarily make it faster if it just truncates the output word of the ADC.
Then what is the standard procedure to use this ADC? I am not familiar with low level drivers or any block read functions. Where should I find them? Could you please elaborate?
 
The Gen 2 board seems to be using this device: http://www.ti.com/lit/ds/symlink/adc108s102.pdf
So the bare hardware is capable of 1 MSPS but it's also unlikely to be that fast without a SPI controller driver using DMA to buffer the data. A quick search has the max 'sketch' speed at about 500Hz which seems to be very slow due to the way they handle gpio access. The Linux speed will be faster using the spidev user driver but it seems even then the hardware and software is not optimized for wire speed SP transfers.

https://communities.intel.com/message/257595
 
  • Like
Likes   Reactions: cnh1995
nsaspook said:
The Gen 2 board seems to be using this device: http://www.ti.com/lit/ds/symlink/adc108s102.pdf
So the bare hardware is capable of 1 MSPS but it's also unlikely to be that fast without a SPI controller driver using DMA to buffer the data. A quick search has the max 'sketch' speed at about 500Hz which seems to be very slow due to the way they handle gpio access. The Linux speed will be faster using the spidev user driver but it seems even then the hardware and software is not optimized for wire speed SP transfers.

https://communities.intel.com/message/257595
How much faster will it be in Linux? I am using windows 8.1 now but I could run it on ubuntu.. Is there any shield which will be galileo compatible and get me higher sampling rate??
 
cnh1995 said:
How much faster will it be in Linux? I am using windows 8.1 now but I could run it on ubuntu.. Is there any shield which will be galileo compatible and get me higher sampling rate??

With Linux you should be able to have much faster speeds but using the device with the Arduino IDE might be faster if accessed in blocks.
https://communities.intel.com/message/231977
 
  • Like
Likes   Reactions: cnh1995

Similar threads

Replies
1
Views
2K
Replies
1
Views
2K