5 Replies Latest reply on Feb 3, 2015 9:16 AM by DiegoV_Intel

    PWM Error: Error initialising PWM on pin

    jogarock

      So I've gone through the tutorials on enabling PWM using the mraa library for Edison pin 182 on the Arduino breakout board (IO6 on the arduino breakout), and am still unable to get it to work.  I followed both the Intel documentation and that at EmutexLabs.  I'm pasting the short code snippet where the error is occuring and the corresponding error output:


      Code at PWM initialization:


      static int redpin = 182;

      mraa::Pwm* red_pwm;

      red_pwm = new mraa::Pwm(redpin); //Exception thrown here


      Output:

       

      terminate called after throwing an instance of 'std::invalid_argument'

        what():  Error initialising PWM on pin

      Aborted


      I suspect that something is incorrect in the documentation, as I am only initializing the pin.  Note that this error also occurs when attempting to use the mraa python bindings.

       

      I've tried the code before and issuing the following sequence through a SSH console (from the Intel documentation):

      $ echo 254 > /sys/class/gpio/export

      $ echo 222 > /sys/class/gpio/export

      $ echo 214 > /sys/class/gpio/export

      $ echo low > /sys/class/gpio/gpio214/direction

      $ echo high > /sys/class/gpio/gpio254/direction

      $ echo in > /sys/class/gpio/gpio222/direction

      $ echo mode1 > /sys/kernel/debug/gpio_debug/gpio182/current_pinmux

      $ echo high > /sys/class/gpio/gpio214/direction


      Thanks.