Mikroelektronika MIKROE-742 데이터 시트

다운로드
페이지 532
PWM_Stop
Note: Not all the AVR MCUs support both PWM and PWM1 library. The best way to verify this is
by checking the datasheet for the desired MCU. Also you can check this by selecting a MCU in
mikroPascal PRO for AVR looking at the Library Manager. If library manager loads both PWM and
PWM1 library (you are able to check them) then this MCU supports both PWM libraries. Here you
can take full advantage of our Code Assistant and Parameter Assistant feature of our compiler.
PWM1_Init
325
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroPASCAL PRO for AVR
CHAPTER 6
Prototype
procedure PWM_Stop();
Returns
Nothing.
Description
Stops the PWM.
Requires
MCU must have CMO module to use this library. PWM_Init and PWM_Start
must be called before using this routine using this routine, otherwise it will have
no effect as the PWM module is not running. 
Example
PWM_Stop();
Prototype
procedure PWM1_Init(wave_mode : byte; prescaler : byte; inverted
: byte; duty : byte);
Returns
Nothing.
Description
Initializes the PWM module. Parameter wave_mode is a desired PWM mode.
There are two modes: Phase Correct and Fast PWM. Parameter prescaler
chooses prescale value N = 1,8,64,256 or 1024 (some modules support 32 and
128, but for this you will need to check the datasheet for the desired MCU).
Paremeter inverted is for choosing between inverted and non inverted PWM
signal. Parameter duty sets duty ratio from 0 to 255. PWM signal graphs and
formulas are shown below.