Download presentation
Presentation is loading. Please wait.
Published byJesse Craig Modified over 9 years ago
1
PWM ECE 4437-EMBEDDED SYSTEMS DR. GLOVER CHRISTOPHER AHN & KHOA VAN
2
WHAT IS COVERED AND WHAT IS NOT Cover: Count down mode and basic configuration to get the motor run. Not cover: Count up/down mode Dead band Interrupt Others
6
LOAD: Determines PWM period based on system clock ADown/BDown: determine pulsewidth COMPA/COMPB: we set the value to get Adown/BDown
7
ILLUSTRATION Example: System clock is 80[Mhz] (can be reduced). PWM Clock will be: 80[Mhz]/64=1.25[Mhz] (period is 0.8 [us]) We want: 2[ms] period. What is the Load value? Answer: LOAD= (2[ms]/0.8[us])-1
8
ILLUSTRATION Now we need to generate pulse width, We will generate 20% duty cycle for PWMA for this example HOW? Easy: LOAD is 100%, so 20%*LOAD is the value for COMPA.
9
SUMMARY OF THE CODE: Initialize and enable the Clocks Enable the PWM Modules Configure Pin types Set Duty Cycle Enable the gate Enable generators
10
CODING EXAMPLE
11
Can be found on page 489 in: spmu298a_TivaWare_Peripheral_Driver_Lib.pdf
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.