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

Discussion Overview

The discussion revolves around the challenges of achieving higher ADC sampling rates on the Intel Galileo Gen 2 board while using the Arduino IDE. Participants explore potential solutions, including hardware modifications, software optimizations, and the use of compatible shields.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant notes that the current sampling rate is limited to 500 samples per second, despite the processor's 400MHz clock frequency suggesting a potential of around 1 million samples per second.
  • Another participant questions whether the slow sampling rate is due to the high resolution of the on-board ADC and suggests that lower resolution might allow for higher speeds.
  • Concerns are raised about software latency in the analogRead() command, with suggestions to explore low-level drivers or block read functions for improved performance.
  • It is mentioned that the hardware is capable of 1 MSPS, but achieving this speed may require a SPI controller driver using DMA to buffer data.
  • Participants discuss the potential for faster speeds when using Linux compared to the Arduino IDE, although specifics on how much faster remain unclear.
  • There is inquiry about the availability of compatible shields that could enhance the sampling rate.

Areas of Agreement / Disagreement

Participants express varying opinions on the factors affecting the ADC's performance, including software limitations and hardware capabilities. There is no consensus on the best approach to achieve higher sampling rates, with multiple competing views on the effectiveness of different strategies.

Contextual Notes

Participants highlight limitations related to software latency, the need for low-level access, and the dependency on specific hardware configurations. The discussion does not resolve these issues, leaving them open for further exploration.

Who May Find This Useful

This discussion may be useful for developers and hobbyists working with the Intel Galileo Gen 2 board, particularly those interested in optimizing ADC performance for projects involving analog signal processing.

cnh1995
Homework Helper
Gold Member
Messages
3,489
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