**7.2.2 PWM generation program**

The standard method for generating PWM pulses by using a microprocessor or DSP is to utilize one of the built-in PWM modules. In our model, the System Function (S-Function) Block is used to compile the embedded system software to control DC/DC and DC/AC circuits. C programs implement the operations of the microcontroller's control units, that is, MMT which controls the generation of the PWM pulses in the DC/DC and MTU which controls the generation of the PWM in DC/AC stage. These programs are embedded into the S-Function Block, as shown in the lower part of Figure 21.
