Page 258 - ARM Based Microcontroller Projects Using MBED
P. 258

244                          8. INTERMEDIATE LEVEL PROJECTS

                 8.33.6 Suggestions for Additional Work
                   Modify the program given in Fig. 8.99 by moving the code inside a timer ISR.



                                            8.34 USING THE PWM

                   In many microcontroller-based applications, we may want to drive loads which may re-
                 quire large currents or voltages. Some examples are large motors, actuators, heaters, etc.
                 The output current and voltage capabilities of microcontrollers are very limited where the
                 maximum output current capacity is around 20mA and the maximum output voltage is
                 +3.3 or +5V depending on the type of microcontroller used. PWM is used to drive loads that
                 require large currents or voltages.
                   Basically, PWM is a positive going square waveform as shown in Fig. 8.116. The waveform
                 has two parts: On time where the pulse if present, and the OFF time where there is no pulse.
                 By varying the ratio of the ON time to OFF time, we can effectively vary the average DC volt-
                 age applied to the load. The PWM waveform usually drives the load through a switching
                 power transistor or a transducer.











































                 FIG. 8.115  Generating an arbitrary waveform.
   253   254   255   256   257   258   259   260   261   262   263