CMO module is available with a
number of AVR MCUs. mikroC PRO for AVR provides library which simplifies using
PWM HW Module.
- AVR MCUs require you to specify the module you want to use. To select the desired PWM, simply change the letter x in the prototype for a number from 1 to 2. Number of UART modules per MCU differs from chip to chip. Please, read the appropriate datasheet before utilizing this library.For the XMEGA family of MCUs change the xn in the routine prototype with C0, C1, D0, D1, E0, E1, F0 or F1 (MCU dependent).
- For better understanding of PWM module it would be best to start with the example provided in Examples folder of our mikroC PRO for AVR compiler.
- When you select a MCU, mikroC PRO for AVR automatically loads the correct PWM library (or libraries), which can be verified by looking at the Library Manager.
- PWM library handles and initializes the PWM module on the given AVR MCU, but it is up to user to set the correct pins as PWM output, this topic will be covered later in this section.
- mikroC PRO for AVR does not support enhanced PWM modules.

