Product Specs

Table 3-7: PWM Parameters
Parameter
Value
PWM Pin
PIN0
-
PIN8
Duty Cycle
0
-
100%
(resolution based on frequency)
Frequency
3.8Hz to 5.333 MHz
PWM Modules
3
Channels per Module
4 (each channel on same module must be same frequency)
An example using PWM is shown in Figure 3-17.
1 Define PinMode Pin0 As PwmOutput
2
3 Public Sub SetPwm()
4 Dim pwm1kHz As Pwm
5 pwm1kHz = Pwm.Create(1000) // create PWM with 1000µs period
6 pwm1kHz.SetDutyCycle(Pin0, 200) // set PWM to 20% duty cycle on Pin0
7 pwm1kHz.Start() // start PWM
8 End Sub
Figure 3-17: PWM Example
©2020 mc-Things Inc. Page |15