Datasheet

PWM 16 BIT LIBRARY
CMO module is available with a number of AVR MCUs. mikroC PRO for AVR pro-
vides library which simplifies using PWM HW Module.
Note: 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 automaticaly loads the correct PWM-16bit
library, which can be verified by looking at the Library Manager. PWM library han-
dles 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.
Library Routines
- PWM16bit_Init
- PWM16bit_Change_Duty
- PWM16bit_Start
- PWM16bit_Stop
Predefined constants used in PWM-16bit library
382
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroC PRO for AVR
CHAPTER 6
The following variables are used in
PWM library functions:
Description:
_PWM16_PHASE_CORRECT_MODE_8BIT
Selects Phase Correct, 8-bit mode.
_PWM16_PHASE_CORRECT_MODE_9BIT
Selects Phase Correct, 9-bit mode.
_PWM16_PHASE_CORRECT_MODE_10BIT
Selects Phase Correct, 10-bit mode.
_PWM16_FAST_MODE_8BIT
Selects Fast, 8-bit mode.
_PWM16_FAST_MODE_9BIT
Selects Fast, 9-bit mode.
_PWM16_FAST_MODE_10BIT
Selects Fast, 10-bit mode.
_PWM16_PRESCALER_16bit_1
Sets prescaler value to 1 (No prescal-
ing).
_PWM16_PRESCALER_16bit_8
Sets prescaler value to 8.
_PWM16_PRESCALER_16bit_64
Sets prescaler value to 64.
_PWM16_PRESCALER_16bit_256
Sets prescaler value to 256.