3 Replies Latest reply on Aug 20, 2014 11:37 AM by DiegoV_Intel

    Timer Library differences with Arduino

    bartt1

      I was hoping to use the Galileo board in an upcoming project that must do some PWM work (at 21 Khz) and some frequency measurements. All this data was to be displayed via a web interface.

      Unfortunately it appears that the TimerOne arduino library has been rendered brain-dead for the Galileo. This would have provided a means for me to adjust the PWM frequency, but most of the function bodies have been taken out by some odd use of  #if preprocessor directives.

      When I put the bodies back in by changing the directives, the library will not build.

      Is there some hidden work around for this situation?

      Thanks in advance

        • 1. Re: Timer Library differences with Arduino
          DiegoV_Intel

          Hi bartt1,

           

          You can do PWM applications with the Galileo Board and there are different ways to do it. You can configure the PWM using the Arduino IDE for Galileo or through Linux terminal. I will recommend you to check this site where there is a good description about PWM (and other topics) on Galileo: Intel Galileo - Programming GPIO From Linux. In that site the configuration is from Linux terminal but you can use the same commands in the Arduino IDE for Galileo using the following syntax: system("Linux command");

           

          Let us know if this is helpful for your upcoming project. Have a nice day!

           

          Regards,

          Diego.

          • 2. Re: Timer Library differences with Arduino
            bartt1

            Hmm..

            Thanks for the reply. That is very interesting. But I still have a disconnect with the info in the article and the source code in TimerOne library. For compatibility I would think that the library would have been modified to make the appropriate calls as illustrated in the article you linked. As it stands I need to write my own library to make this happen.

             

            One other question on PWM details. The article implies that the PWM can be set to some very high frequencies / high resolution (nS values passed as params). This would be great for my project, since I need to output several frequencies in the mid to high khz range and cannot get the resolution from a standard arduino (which seems to only support a few frequencies due to the PWM hardware).

            Can you shed any light on this?

             

            Thanks in advance

            Bart

            • 3. Re: Timer Library differences with Arduino
              DiegoV_Intel

              Hi bartt1,

               

              At this momment the TimerOne library is not supported on the Galileo Board. You can know what are the libraries supported in this document: Intel® Galileo Software.

               

              Now, the article I posted before is about how to use the PWM, which I think is what you needed since the TimerOne library is not supported, however the higher frequency we were able to get was 13.97kHz. You can check this post where there are more details about it: What is the default, and maximum PWM frequencies on the Galileo?.

               

              If you want higher frequencies you might found this post interesting: Using Galileo for IR remote control, check it out and let us know if this answered your questions. Have a great day!

               

              Regards,

              Diego.