This documentation is out of date.

The new version of the documentation is here: https://cannylogic.com/docs

Difference between revisions of "CANNY 5.3 pico, HR PWM Driver"

From CANNY Wiki
Jump to: navigation, search
[checked revision][checked revision]
(Created page with "=== General description === One input-output channel of CANNY 5.3 pico (channel 8) supports operation in the mode of a high-frequency pulse-width modulator, herewith the peri...")
 
Line 60: Line 60:
 
|}
 
|}
 
|}
 
|}
 +
<br clear="all">
  
 
== Features ==
 
== Features ==

Revision as of 13:54, 29 August 2019

General description

One input-output channel of CANNY 5.3 pico (channel 8) supports operation in the mode of a high-frequency pulse-width modulator, herewith the period and duty cycle are set in the range from 2 to 32767 microseconds, in increments of 1 microsecond.

In HR PWM, the channel has a fixed pulse polarity - GND 100mA. Generation can be conducted in either open collector (no pull-up lines or external pull-up) or with internal pull-up to supply voltage (specified by setting the value in the appropriate register). In this mode, the channel is asynchronous to functional diagram, which allows maximum timing stability of generated signal.

The driver of high resolution pulse width modulator (HR PWM) operates using Discrete Inputs and Outputs resources, wherein, having a higher priority. Thus, upon activation of the HR PWM driver, controller channels used are unavailable to input-output drivers.

Note: In high resolution pulse width modulator mode, the electrical protection from short circuit is disabled! Overload or channel short-circuit in high resolution PWM mode can lead to controller failure!

Drivers Registers

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

Address Expected Values
HR PWM Period Register, μs
2...32767 = specify the period in microseconds RR 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

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

Disabling the HR PWM driver is done by setting the HR PWM Period Register, μs value to 0, while 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 value is set equal to 0, then, regardless of the specified period value, the PWM channel will always be in the initial state, i.e. "air" if the internal pull-up to the plus of the HR PWM of the corresponding channel is not turned on, or the supply voltage, when the pull-up is on.

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

When changing the period values ​​or filling the HR PWM while the channel is 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, it is necessary to change the value by turning off the PWM mode and then turning it on.

Functional diagram of a smooth, cyclic change in the brightness of the LED connected to channel 0 of the controller:

16 12 3 1.png

See also

CANNY 5.3 pico

CANNY 5.3 pico, Discrete IO Driver