CANNY 7, High resolution PWM Driver

General description

Two of eleven IO channels (Channel №1 and №2) CANNY 7 can work in high-resolution pulse-width modulator mode. The channels may be activated independently of each other and also have an independently configured duty cycle and line pull-up. However, the high-resolution PWM period is configured for both channels simultaneously. In HR PWM mode, the PWM timing parameters - the period and duty cycle can be set in the range from 2 to 20,000 microseconds, in 1 microsecond increments.

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 function diagram, which allows for maximum stability of generated signal timing parameters.

The HR PWM driver operates using Discrete Input and Output resources and has a higher priority than the IO driver. When the PWM driver is activated for a channel, the channel resources become inaccessible to the IO driver.

Note: When a channel is set to the high-resolution pulse width modulator 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!

Drivers Registers

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

High Resolution PWM Driver register values table
Register Expected Values
HR PWM 1 & 2 Period Register, μs 1…20000 = specify the period in microseconds of the HR PWM generator for both channels. Values exceeding 20000 will be accepted as 20000.
HR PWM 1 Enable Register
HR PWM 2 Enable Register
1…65535 = set controller channel into high resolution pulse width modulator mode
0 = return controller channel to its standard operation mode
HR PWM 1 Duty Register, μs
HR PWM 2 Duty Register, μs
1…20000 = set HR PWM channel filling (duty cycle) in microseconds. Values exceeding 20000 will be accepted as 20000.
HR PWM 1 Pull-up Enable Register
HR PWM 2 Pull-up Enable Register
1…65535 = HR PWM generation polarity for the channel is «MINUS 100mA» / «positive pull-up»;
0 = HR PWM generation polarity for the channel is «MINUS 100mA» / «float» (open collector mode).

Examples

Below is an example of a function diagram that uses HR PWM. The PWM is set up on channel #1 with a carrier frequency of 10 kHz. Pressing or holding buttons connected to channels #9 and #10 smoothly changes the duty cycle of the PWM.

PWM Function diagram.

SEE ALSO