Skip to content
Benjamin Vernoux edited this page Mar 24, 2023 · 11 revisions

HydraFW PWM (Pulse Width Modulation)

This guide is updated towards firmware release HydraFW v0.9 Beta and later

Output type: 0 or 3.3volt

PWM configuration syntax description:

  • Usage: pwm <frequency (1Hz to 42MHz)> [duty-cycle (0 to 100%)] [exit]
  • PWM1 is mapped on PB11 pin

Syntax:

  • frequency PWM frequency integer value in Hz <value 1Hz to 42MHz> (support k, m suffix or no suffix)

    • Returns real frequency depending on Hardware (for frequency >10KHz error increase)
  • duty-cycle Duty Cycle in % <value 0 to 100>

    • Returns real duty-cycle depending on Hardware (for frequency >10KHz error increase)
  • exit Exit PWM mode (reinit PWM1 pin to safe mode/in)

PWM examples:

> pwm frequency 12 duty-cycle 33
PWM1 Frequency: 12, Duty Cycle: 33%(+/-1%)

> pwm duty-cycle 50
PWM1 Frequency: 12, Duty Cycle: 50%(+/-1%)

> pwm frequency 1234
PWM1 Frequency: 1234, Duty Cycle: 50%(+/-1%)

> pwm frequency 5432 duty-cycle 33
PWM1 Frequency: 5432, Duty Cycle: 33%(+/-1%)

> pwm frequency 10123 duty-cycle 33
PWM1 Frequency: 10124, Duty Cycle: 33%(+/-1%)

> pwm frequency 54321 duty-cycle 33
PWM1 Frequency: 54333, Duty Cycle: 34%(+/-1%)

> pwm frequency 1000123 duty-cycle 33
PWM1 Frequency: 1012048, Duty Cycle: 32%(+/-1%)

> pwm frequency 40000000 duty-cycle 33
PWM1 Frequency: 42000000, Duty Cycle: 0%(+/-1%)

> pwm duty-cycle 50
PWM1 Frequency: 42000000, Duty Cycle: 50%(+/-1%)

> pwm frequency 42000000 duty-cycle 75
PWM1 Frequency: 42000000, Duty Cycle: 50%(+/-1%)

How to Flash/Use HydraFW

How to Build/Flash/Use HydraFW

Developer Getting-Started with HydraBus and STM32CubeIDE

Hardware

Firmware (hydrafw) performances

Firmware (hydrafw) Application guides

Firmware (hydrafw) guides

How to Help

Clone this wiki locally