PWM_set

Description

Set the period and duty cycle of the PWM hardware

The resolution of the period is restricted to the most significant 8 bits of the period. The resolution of the duty cycle is restricted to the most significant 10 bits of the period.

The period must be in the range 1 to 4095 (12 bits maximum). The PWM hardware prescalers are selected depending on the size of the period.

Definition

PWM_set(uint period, uint duty_cycle)

Library

LIB/pwm_lib.bas

Usage

On entry:
period is the period
The period must be in the range 1 to 4095

duty_cycle is the duty cycle

The duty cycle must be in the range 1 to period
On exit:
There is no return value