Use PWM Pins from M4 // Duty and Period

Discussion in 'UDOO NEO' started by TomFreudenberg, Dec 26, 2022.

  1. TomFreudenberg

    TomFreudenberg Member

    Joined:
    May 12, 2014
    Messages:
    59
    Likes Received:
    2
  2. TomFreudenberg

    TomFreudenberg Member

    Joined:
    May 12, 2014
    Messages:
    59
    Likes Received:
    2
    First of all - "Happy new Year" :)

    ---

    Things I found so far is from Servo library

    ```
    if (!PwmIsEnabled(pwmChn)) {
    // PWM Startup code
    _bsp_pwm_io_init(pwmChn, 0xff);
    pwm_disable(pwmChn);
    pwm_set_clock(pwmChn, kPwmClockSourceIpg);
    pwm_set_fwm(pwmChn, DEF_SERVO_FWM);
    pwm_set_prescaler(pwmChn, DEF_SERVO_PRESCALER);
    pwm_set_poutc(pwmChn, DEF_SERVO_ACT_POL);
    pwm_set_period(pwmChn, DEF_SERVO_TICKS_PERIOD);
    pwm_set_resolution(pwmChn, DEF_SERVO_TICKS_PERIOD);
    pwm_set_repeat(pwmChn, DEF_SERVO_REPEAT);
    pwm_enable(pwmChn);
    }
    pwm_set_sample(pwmChn, defPulseWidth);
    ```

    But without any additional documentation I can't make it for our intention.

    We have to change the PERIOD and not the PULSE.

    We need to change the period from 8 Hz up to 4.500 Hz with a dutycyle of 50% based on the set period.

    Please may someone step in and provide us with the right information to solve this issue shortly.

    Thanks in advance
    Tom
     
  3. TomFreudenberg

    TomFreudenberg Member

    Joined:
    May 12, 2014
    Messages:
    59
    Likes Received:
    2
    @moderator - why are my posting on hold everytime?

    > This message is awaiting moderator approval, and is invisible to normal visitors.
     

Share This Page