1 Reply Latest reply on Dec 2, 2013 12:15 PM by Clayton Hofrock

    Performing a sequence of analogReads faster?


      I am working on a program that performs a sequence of 512 analogReads.


      I have noticed that the Galileo board uses a I2C interface with the Mux, and SPI interface with the ADC. However, during a long sequence of sequential reads, the Mux should not need to be changed since all of the A/D conversions are being performed from the same analog input port (A0, for example).


      So, is there anyway that I could write a function that would setup the Mux once in the beginning in order to decrease the overall conversion time? Are there any low-level Linux-based functions that I could call in order to interface with the Mux and A/D?


      I found the code below at this website: (Faster Analog Read? - Arduino Forum)

        • 1. Re: Performing a sequence of analogReads faster?
          Clayton Hofrock

          When you say not working with the Galileo do you mean it does not even compile? When I tried to compile this code on the Galileo it did not work, it seems like there are some defines missing.


          At this point there are two different options. Try to figure out what the android defines are doing, and then figure out how to create those defines for the Galileo. This could be done by searching through the library files for the Arduino.


          The other option, and perhaps better option, would be to do the analog read from Linux. For that, you would need two documents. One is the IO Mapping document, second, is Sergey's blog on how to use the pins from within Linux. http://www.malinov.com/Home/sergey-s-blog/intelgalileo-programminggpiofromlinux  (look in the Analog Input section).


          I have tried the analog reading from Linux, and it works, and it seems fast. I am not sure if it is fast enough?

          1 of 1 people found this helpful