4 Replies Latest reply on Feb 2, 2015 1:04 PM by CMata_Intel

    Edison ADC

    omrisTeam

      Is there a way to use the ADC in the Arduino environment at increased speeds?

      On an atmel processor I would have used interrupts, but I wasn't able to find any code examples for Edison.

       

        • 1. Re: Edison ADC
          Intel_Alvarado

          Hi omrisTeam,

           

          I found a link which discusses ADC sampling rate https://communities.intel.com/message/257924#257924 , you may find it helpful. The increased speeds you are refereeing are to the ones in which the SPI bus communicates with the ADC chip right? If you want to change those speeds from the default you would have to try and edit the SPI.cpp file for this. Give it a try and post your results.

           

          If you want more details on ADC and examples on Linux take a look at https://communities.intel.com/docs/DOC-23161

           

          Regards

          Sergio

          • 2. Re: Edison ADC
            omrisTeam

            Thanks Sergio,

            I've looked into the links you posted, however I'm trying to sample at a rate of 1MHz, and in addition would prefer to avoid working in linux. Is there a way to change the SPI speeds and thus get samples at a 1MHz rate in the arduino framework? Currently I'm having difficulties changing the clock divider in a way that truely changes the SPI rate (as seen in a scope).

             

            Regards,

            Omri

            • 3. Re: Edison ADC
              Intel_Alvarado

              Hi omrisTeam,

               

              To change the clock divider in the Edison you would have to alter the .cpp file. You can find that in the Arduino folder under hardware/Arduino/Edison/libraries/spi. In the .cpp file you will find a where to adjust the clock speed.  The different cases have different spi clock dividers which will set maximum speeds.The higher the number after the << is the higher speed the SPI will be set to.  Try changing this file so that the max speed is the one you are looking for.

               

              Regards

              Sergio

              • 4. Re: Edison ADC
                CMata_Intel

                Hi omrisTeam ;

                 

                Were you able to change the libraries and work with the rate that you need?

                 

                Regards;

                CMata