This documentation is out of date.
The new version of the documentation is here: https://cannylogic.com/docs |
CANNY 7.2 duo, HR PWM Driver
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 +12V (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 |
| |||||||
|
| |||||||
|
|
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: