PWM
 
Component PWM
Pulse width modulation
Component Level: High
Properties:
(Properties are parameters of the component. Please see the Embedded Components page for more information.)
  • Component name - Name of the component.
  • PWM or PPG device - Pulse Width Modulation compare device or Programmable Pulse Generation period compare/reload device.
  • Duty compare - Duty compare/reload register (for PPG timer only).
  • Output pin - Pin used for output of the generated signal.
  • Output pin signal - Signal name of output pin.
  • Counter - Name of the counter used by this component (for information only).
  • Interrupt service/event - Support of interrupt service. Event OnEnd and OnShutdown is available only when supported by hardware and when the property "Interrupt service" is enabled. If this property is set to "Enabled", the component functionality depends on the interrupt service and will not operate if the CPU interrupts are disabled. For details please refer to chapter "interrupt service in the component's generated code".
    The following items are available only if the group is enabled (the value is "Enabled"):
  • Period - Period of the output signal. It is necessary to specify both a value and a unit (see Timing Setting Syntax). The setting can be made with the help of the Timing dialog box that opens when clicking on the button (...).
  • Starting pulse width - Starting pulse width. It specifies the length of time that the output signal spends in the active level during the output cycle. The active level is defined in the Initial polarity. It is necessary to specify both a value and a unit (see Timing Setting Syntax). The setting can be made with the help of the Timing dialog box that opens when clicking on the button (...).
  • Settings supported for HC08 derivatives only.
    • PWM signal generation - If "Buffered" then other channel of the timer is used for buffering and the problems with incorrect pulse width change will not occur.
      The following items are available only if the group is enabled (the value is "Buffered"):
  • Initial polarity - Initial polarity of the output signal: "O" = "Low", "1" = "High". It is possible to change it at runtime using methods: ClrValue and SetValue .
  • Same period in modes - Period is exactly the same in all speed modes (high, low, slow). If you select 'Yes' the timing will be kept with a tolerance of one tick. If you select 'No' timing will be kept with setting precision only.
  • Component uses entire timer - If this property is set to yes, it prevents the used timer peripheral from being shared by other components. If the timer is not shared, the component can use every subsystem of the timer, more actions may be done by the peripheral instead of driver code, e.g. generated code can be more efficient.
  • Initialization - Initial settings (after power-on or reset).
  • CPU clock/speed selection - Settings for the CPU speed modes: identifies whether the component is supported or not.
    For details about speed modes please refer to page Speed Modes Support.