2 Replies Latest reply on Jul 21, 2016 2:59 PM by Intel Corporation

    Intel Edison pwm using mraa not going low

    Hari_CR

      Hi

      I'm using the pwm3 interface for starting a vibration motor, so I wrote these functions for it

       

      #define MRAA_PWM3_PIN_NUM 21
      
      void InitVibrationPWM(void) {    
          pwm3Context = mraa_pwm_init(MRAA_PWM3_PIN_NUM);
          mraa_pwm_enable (pwm3Context,0);
          mraa_pwm_period_us(pwm3Context, 1000);
          mraa_pwm_pulsewidth_us(pwm3Context,500);
      }
      
      void StartVibrationPWM(void) {   
            mraa_pwm_enable (pwm3Context,0);
           mraa_pwm_pulsewidth_us(pwm3Context,500);
          mraa_pwm_enable (pwm3Context,1);
      }
      
      void StopVibrationPWM(void) {    
          mraa_pwm_enable (pwm3Context,0);
           mraa_pwm_pulsewidth_us(pwm3Context,1);
      }
      
        
      
       

       

      But the issue is when I stop and start the PWM several times the PWM output wont get low when I eventually stop the PWM, that line always stays high eventhough I called StopVibrationPWM(). This happens randomly so that I cant figure out the exact issue.

      Any thoughts