CANNY 5.3 Pico, HR PWM Driver

General description

One input-output channel of CANNY 5.3 Pico (channel 8) can work in high-frequency pulse-width modulator mode. In HR PWM mode, the PWM timing parameters - the period and duty cycle can be set in the range from 2 to 32767 microseconds, in 1 microsecond increments.

An HR PWM channel has a fixed pulse polarity - GND 100mA. Generation can be done in either open collector (no pull-up or external pull-up) mode or internal pull-up mode to +12V (specified by setting value in the appropriate register). In this mode, the channel is asynchronous to the function diagram, which allows for maximum stability of generated signal timing parameters.

HR PMW driver operates using the controller’s channel resources, but has a higher priority than the discrete input-output driver. This means that for all channels, for which the HR PMW driver is activated, all value changes in registers associated with discrete input-output driver will be ignored.

Attention! When a channel is set to the high-resolution pulse width modulator mode the electrical short circuit protection for the channel is disabled! Overload or short circuit of a channel set to this mode can cause damage to the controller!

Driver registers

The following shows the expected values for for control registers of the high resolution PWM driver.

High Resolution PWM Driver register values
Address Expected values
HR PWM Period Register, μs 2…32767 = specify the period in microseconds of the HR PWM generator
HR PWM Duty Register, μs 1…32767 = set HR PWM channel filling (duty cycle) in microseconds
HR PWM Pull-up Enable Register ≥ 1 = HR PWM generation polarity for the channel «MINUS 100mA» / «positive pull-up»;
0 = HR PWM generation polarity for the channel «MINUS 100mA» / «air» (open collector mode).

Features

Activate the HR PWM driver by setting a value other than 0 in the HR PWM Period Register, μs. If the channel number of the HR PWM is not specified, the driver is activated on channel 0.

Disable the HR PWM driver by setting the HR PWM Period Register, μs value to a value of 0. The operation of the HR PWM channel immediately stops and the channel is transferred to the control of the input-output driver.

When the HR PWM driver is turned on, if the duty cycle is set equal to 0, then, regardless of the specified period value, the PWM channel will remain in the initial state, i.e:

  • “air” when the internal pull-up to plus of the HR PWM of the respective channel is not turned on;
  • supply voltage, when the pull-up is turned on.

If the actual duty cycle is greater than or equal to the actual period value, then the PWM channel will always remain in the GND state.

When changing the period values ​​or filling of HR PWM while the channel is actively operating in the HR PWM mode, the new values ​​of the updated parameters will be applied by the driver only at the beginning of the next HR PWM period. To accelerate the application of the new HR PWM parameters, turn off the HR PWM mode and then turn it on again after writing the necessary values.

Function diagram of a smooth, cyclic change in the brightness of the LED connected to channel 8 of the controller.

SEE ALSO