4 Replies Latest reply on Sep 8, 2015 6:05 AM by Laurentg91

    DigitalReadDestruction

    VictorLexand

      Hello,

       

      I am trying to read input from an adc microphone sensor at the 2.93 Mhz rate and I am trouble understanding the use of your fast gpio functions.

      Following from another discussion (Re: I/O speeds?) Intel provides 4 examples for fast gpio output but there doesn't seem to be alternative fast read functions. Could you please provide sample code on how to do a fast read on pin 2 2.93 Mhz? Is there any reference document for this?

       

      Secondly, who is responsible for releasing the updated Arduino support package for Matlab? You (intel), arduino, or Matlab? There is a common arduino.m file that needs to be updated to read and write fast gpio.

       

      Lastly, for example 4 on the previously reference discussion, there seems to be no information on OUTPUT_FASTMODE as an actual option for pin mode on the wiring_digital.c file. Please explain this.

        • 1. Re: DigitalReadDestruction

          Hi Victor,

           

          Interesting questions, I am currently investigating this topics.

          I will post my results as soon as I can.

           

          Regards,

          LDiego_Intel.

          • 2. Re: DigitalReadDestruction
            VictorLexand

            Hi LDiego,

             

            It seems I am more interested in faster analog read. I am told that because of the I2C expander, the analog read is grossly limited to a mere 100+Hz. That's terrible. But it seems that I can access fast analog read through the linux operating system. But I am not told how much faster it is on linux. I have not used linux on arduino before but I have it now installed. Now that I have linux working on ssh putty for the galileo board, what next?

            From this board (Sergey's Blog - Malinov Family Web Presence), I can see that typing once the analog port is connected, the value at A0 can be read with

            root@clanton:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage0_raw

            But how fast is this?

            Thank you.

            • 3. Re: DigitalReadDestruction

              HelloVictor,

               

              Here is what I got, the AnalogRead does not have different modes like fast Read, currently has only one speed and  is about 7 to 8 millisecond  (as you mentioned is 100 Hz approximately). You can control the speed of the sampling using the delay function  as long as they stay under or 100 Hz, any speed requirement for more than 100Hz is currently unsupported.

               

              Also, As mentioned in post https://communities.intel.com/message/207904#207904 , OUTPUT_FAST mode is an option for pin 2 and 3 only and it can achieve a speed of 2.93 Mhz in destructive mode.

               

              Regarding the Matlab package,  Matlab will be the appropriate place to look for support information for their library/package.

               

              Regards,

              LDiego.

              • 4. Re: DigitalReadDestruction
                Laurentg91

                Can you please detail how to acces fastgpio read with galileo gen 2 ?