1 Reply Latest reply on Oct 1, 2015 1:11 PM by Intel_Alvarado

    PWM Access in Galileo Gen 2 in linux

    D08

      Hi All,

       

      I am using Intel Galileo Gen 2 board using linux and I want to access available 6 channels of PWM interface. I have configured the PWM in Gen2 baord as below script file.

       

      #!/bin/bash

      echo -n "out" > /sys/class/gpio/gpio26/direction

      echo -n "1" > /sys/class/gpio/gpio26/value

       

      echo -n "out" > /sys/class/gpio/gpio27/direction

      echo -n "0" > /sys/class/gpio/gpio27/value

       

      echo -n "1" > /sys/class/gpio/gpio74/value

       

      echo -n "1" > /sys/class/pwm/pwmchip0/pwm11/enable

      echo -n "3000000" > /sys/class/pwm/pwmchip0/device/pwm_period

      echo -n "1500000" > /sys/class/pwm/pwmchip0/pwm11/duty_cycle

       

      while true; do

       

      echo "Start"

       

      echo -n "out" > /sys/class/gpio/gpio26/direction

      echo -n "1" > /sys/class/gpio/gpio26/value

       

      echo -n "out" > /sys/class/gpio/gpio27/direction

      echo -n "0" > /sys/class/gpio/gpio27/value

       

      echo -n "1" > /sys/class/gpio/gpio74/value

       

      echo "Complete"

       

      sleep 1

      done


      But when i run the above script on gen 2 board and by observe in Oscilloscope i have notice some below results

       

      Period               Duty_cycle               Time                

                                                                                        

      3000000              3000000                    2.40ms            

      3000000              1500000                    1.20ms

      3000000               750000                     0.64ms

      3000000               375000                     0.32ms


      So,  According to the above table, i should get Time 3ms, 1.5ms, 0.75ms and 0.375ms instead of above time, but the difference is very large. what may be the reason and is this right output or not? Also when period is 6000000 and duty cycle is 6000000, then also i am getting time as 2.4ms. in this case my duty cycle is of 6ms so should i get 6ms on CRO or 2.4ms is correct?

       

      Thank you.