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

In summary, the on-board ADC is extremely slow and 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?
  • #1
cnh1995
Homework Helper
Gold Member
3,483
1,164
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
  • #2
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 cnh1995
  • #3
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?
 
  • #4
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 cnh1995
  • #5
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?
 
  • #6
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 cnh1995
  • #7
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??
 
  • #8
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 cnh1995

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

1. What is ADC and how does it work on Intel Galileo gen 2?

ADC stands for Analog to Digital Converter, which is a component that converts analog signals (such as voltage or current) into digital signals that can be processed by a computer. On Intel Galileo gen 2, the ADC is integrated into the processor and can be used to measure analog signals from external sensors or devices.

2. Can I use the ADC on Intel Galileo gen 2 to read multiple analog sensors at once?

Yes, the ADC on Intel Galileo gen 2 has 6 channels, which means you can connect up to 6 analog sensors and read their values simultaneously.

3. What is the voltage range supported by the ADC on Intel Galileo gen 2?

The ADC on Intel Galileo gen 2 supports a voltage range of 0 to 5 volts. Any voltage outside of this range may damage the board or provide inaccurate readings.

4. How accurate is the ADC on Intel Galileo gen 2?

The ADC on Intel Galileo gen 2 has a resolution of 12 bits, which means it can detect 4096 different voltage levels. This results in an accuracy of approximately 0.024% or 2.4 millivolts. However, the actual accuracy may vary depending on external factors such as noise and temperature.

5. Can I use the ADC on Intel Galileo gen 2 to control analog outputs?

No, the ADC on Intel Galileo gen 2 is only used for reading analog inputs. To control analog outputs, you will need to use a digital to analog converter (DAC) or a pulse width modulation (PWM) pin.

Similar threads

Replies
1
Views
1K
Replies
1
Views
2K
Back
Top