Mikroelektronika MIKROE-742 데이터 시트

다운로드
페이지 532
PWM 16 BIT LIBRARY
CMO module is available with a number of AVR MCUs. mikroPascal PRO for AVR
provides library which simplifies using PWM HW Module.
Note: For better understanding of PWM module it would be best to start with the exam-
ple provided in Examples folder of our mikroPascal PRO for AVR compiler. When you
select a MCU, mikroPascal PRO for AVR automaticaly loads the correct PWM-16bit
library, 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. 
Library Routines
- PWM16bit_Init 
- PWM16bit_Change_Duty 
- PWM16bit_Start 
- PWM16bit_Stop 
Predefined constants used in PWM-16bit library
330
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroPASCAL 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 prescaling).
_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.
_PWM16_PRESCALER_16bit_1024
Sets prescaler value to 1024.
_PWM16_INVERTED
Selects the inverted PWM-16bit mode.
_PWM16__NON_INVERTED
Selects the normal (non inverted) PWM-
16bit mode.