|Top Previous Next|
Gets the clock frequency for the PWM module.
The clock frequency of PWM module n, where n is 0 or 1.
The resolution constant can be use to calculate the pulse width value needed to set the PWM pulse width to a specific amount of time. The value to use for pulse width given a duration in fractional seconds can be computed as follows:
Cell.PWM[n].width[channel] = duration * Cell.PWM[n].resolution;
where duration has been assigned the pulse width in fractional seconds, channel is in the range 0 - 3, and n is 0 or 1.
Cell.PWM.frequency = 60;
Cell.PWM.width = 0.001 * Cell.PWM.resolution; // pulse width is 1 ms