This documentation is out of date.

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

Difference between revisions of "CANNY 7.2 duo, HR PWM Driver"

From CANNY Wiki
Jump to: navigation, search
[checked revision][checked revision]
(General description)
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:
 
CANNY 7.2 duo supports high-resolution pulse-width modulator mode for any of nine input-output channels, however, at the same time, only one controllers output can be used as an HR PWM channel. During the operation of the controller, using a user diagram, the HR PWM channel can be reassigned. In HR PWM mode, PWM timing - the period and duty cycle are set in the range from  2 to 65535 microseconds, in increments of 1 microsecond.
 
CANNY 7.2 duo supports high-resolution pulse-width modulator mode for any of nine input-output channels, however, at the same time, only one controllers output can be used as an HR PWM channel. During the operation of the controller, using a user diagram, the HR PWM channel can be reassigned. In HR PWM mode, PWM timing - the period and duty cycle are set in the range from  2 to 65535 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.
+
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 [[CANNY 7.2 duo, Discrete IO Driver | 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.
 
The driver of high resolution pulse width modulator (HR PWM) operates using [[CANNY 7.2 duo, Discrete IO Driver | 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.
Line 51: Line 51:
 
{|border="0" align="left"
 
{|border="0" align="left"
 
|- valign="top"
 
|- valign="top"
|width="70px" style="padding-left:0.5em;"|&ge1
+
|width="70px" style="padding-left:0.5em;"|≥ 1
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|HR PWM generation polarity for the channel [[«MINUS 100mA»]] / [[«positive pull-up»]];
 
|style="padding-left:0.5em;"|HR PWM generation polarity for the channel [[«MINUS 100mA»]] / [[«positive pull-up»]];

Latest revision as of 12:29, 29 August 2019

General description

CANNY 7.2 duo supports high-resolution pulse-width modulator mode for any of nine input-output channels, however, at the same time, only one controllers output can be used as an HR PWM channel. During the operation of the controller, using a user diagram, the HR PWM channel can be reassigned. In HR PWM mode, PWM timing - the period and duty cycle are set in the range from 2 to 65535 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
3...65535 = specify the period in microseconds RR PWM generator.
HR PWM Duty Register, μs
1...65535 = 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.

Due to the features of the microsecond timer, the actual values ​​of the period and duty of the HR PWM slightly differ from the values ​​set by the user. The value of the actual period is 1.0667 times greater than the set value, as well as the actual value of duty.

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

17 12 3 1.png

See also

CANNY 7.2 duo

CANNY 7.2 duo, Discrete IO Driver