This bean implements a programmable pulse generator that generates a signal with
variable duty and variable cycle (period).
Example of generated signal:
Initial polarity is Low, Ratio is 20%
Initial polarity is High, Ratio is 80%
Initial polarity is Low, Ratio is 80%
Initial polarity is High, Ratio is 20%
Ratio, duty, and period (or frequency) of output signal can be switched using SetRatio, SetDuty and SetPeriod
(or SetFreq) methods. Initial polarity is a
parameter of the bean.
Polarity of the output signal can be switched using SetValue
(High level of the output signal during duty) and ClrValue
(Low level of the output signal during duty) methods.
Version specific information for HCS12, HCS12X derivatives
Emergency shutdown functionality
Note: This feature may not be available on all HCS12, HCS12X derivatives.
There are two properties in the bean that influence the setting of this feature.
Property Emergency shutdown is mirrored from the CPU bean (for details see the CPU bean properties documentation).
When the Emergency shutdown functionality is enabled and if the Emergency
interrupt service/event is enabled the PWM channel with the highest number is forced to input and the PWM module will generate an emergency shutdown
interrupt when Input active level on this pin is changed. The PWM module stops generation of the output signal, forces
all the output pins to the level set in the Shutdown output level property and it also generates the interrupt.
An event OnShutdown is called when the interrupt is invoked.
Note that event is called always when interrupt is invoked both when the emergency shutdown is asserted and de-asserted.
The bean provides GetShutdownStatus and RestartPWM methods for shutdown status
detection and restarting the PWM signal generation.
See Typical Usage for example service of PWM emergency shutdown.
Sharing of the PWM module emergency shutdown interrupt is not supported. The Emergency interrupt service/event
property can be enabled in only one PPG or PWM bean, although the shutdown stops output signal generation of the whole PWM module.
This bean belongs to the category: CPU Internal Peripherals-Timer