How Pulse Width Modulation (PWM) Works + Example | Embedded Systems Explained
Your go-to PCB & 3D Printing - PCBWay: https://www.pcbway.com
Learn how to setup microcontrollers to output pulse width modulated (PWM) signals and watch until the end for a real life example with an MSP430!
DSO150 hobby oscilloscope: https://amzn.to/36x7QgR
Siglent SDS1104X-E oscilloscope: https://amzn.to/3EvjSUH
Texas Instruments MSP430 LaunchPad (US): https://amzn.to/3KzlePN
Texas Instruments MSP430 LaunchPad (UK): https://amzn.to/2UipjAq
MSP430 Microcontroller Basics - Book (US): https://amzn.to/2OY8tDT
MSP430 Microcontroller Basics - Book (UK): https://amzn.to/2P1QoVf
GitHub companion code: https://github.com/fabytm/Embedded-Systems-Explained---PWM
Last video: https://youtu.be/xf1GyrtkaE8
Follow me on Instagram : https://www.instagram.com/thefabytm_yt
Like me on Facebook : http://www.facebook.com/TheFabytm
Secondary Channel : http://www.youtube.com/MoreTheFabytm
Follow me on Twitter : http://www.Twitter.com/TheFabytm
Try Amazon Prime with a free 30 day trial: https://amzn.to/2MG3A0T
Sign up for Airalo (international eSIM plans): https://www.airalo.com/?rfsn=4268870.6cf0a4
0:00 Intro & Embedded Systems Explained
1:16 What are Capture and Compare Modules
2:03 Timer Setup for PWM Output
3:09 Capture and Compare Module Setup for PWM Output
5:05 MSP430 PWM Example with Code Overview & Oscilloscope Waveform
7:33 Applications of PWM (Pulse Width Modulation)
My name is Fabi and I am an Engineer and Tech Enthusiast from Romania. On my YouTube channel I do thorough reviews of gadgets, showcase my programming projects and show you which cars I am driving.
This video is part of my Embedded Systems Explained series.
In today's video we'll be talking about the compare mode of the timer capture and compare modules, capable of outputting signals with a modifiable duty cycle, hence the name, pulse width modulation.
Capture and compare modules are auxilliary to timers, in architectures like the MSP430, each timer has up to 6 CCPs associated, while PIC microcontrollers have CCPs which can work with different timers. Either way, you have a set of registers governing the timer itself and one or more registers for settings regarding to the CCP.
So, with the CCP you first have to specify that it will work in compare mode and then the output mode. This means that once you set everything up, the capture and compare module will be capable of generating the PWM with no need for extra code. While you could also generate the signal through code when the interrupts are generated, this is not necessary.
The output mode defines what happens to the output signal when the timer reaches the value set in the timer's register and what happens to the output signal when the timer reaches the value set in the capture and compare module. As you can see from the screenshot I took from the user guide of the MSP430G2553 microcontroller, 4 output modes can be useful when trying to generate PWMs: Toggle/Reset, Set/Reset, Toggle/Set, Reset/Set. The output signal will have an edge when the timer reaches the value set in the timer's register and when the timer reaches the value set in the CCP register.
Видео How Pulse Width Modulation (PWM) Works + Example | Embedded Systems Explained канала TheFabytm
Learn how to setup microcontrollers to output pulse width modulated (PWM) signals and watch until the end for a real life example with an MSP430!
DSO150 hobby oscilloscope: https://amzn.to/36x7QgR
Siglent SDS1104X-E oscilloscope: https://amzn.to/3EvjSUH
Texas Instruments MSP430 LaunchPad (US): https://amzn.to/3KzlePN
Texas Instruments MSP430 LaunchPad (UK): https://amzn.to/2UipjAq
MSP430 Microcontroller Basics - Book (US): https://amzn.to/2OY8tDT
MSP430 Microcontroller Basics - Book (UK): https://amzn.to/2P1QoVf
GitHub companion code: https://github.com/fabytm/Embedded-Systems-Explained---PWM
Last video: https://youtu.be/xf1GyrtkaE8
Follow me on Instagram : https://www.instagram.com/thefabytm_yt
Like me on Facebook : http://www.facebook.com/TheFabytm
Secondary Channel : http://www.youtube.com/MoreTheFabytm
Follow me on Twitter : http://www.Twitter.com/TheFabytm
Try Amazon Prime with a free 30 day trial: https://amzn.to/2MG3A0T
Sign up for Airalo (international eSIM plans): https://www.airalo.com/?rfsn=4268870.6cf0a4
0:00 Intro & Embedded Systems Explained
1:16 What are Capture and Compare Modules
2:03 Timer Setup for PWM Output
3:09 Capture and Compare Module Setup for PWM Output
5:05 MSP430 PWM Example with Code Overview & Oscilloscope Waveform
7:33 Applications of PWM (Pulse Width Modulation)
My name is Fabi and I am an Engineer and Tech Enthusiast from Romania. On my YouTube channel I do thorough reviews of gadgets, showcase my programming projects and show you which cars I am driving.
This video is part of my Embedded Systems Explained series.
In today's video we'll be talking about the compare mode of the timer capture and compare modules, capable of outputting signals with a modifiable duty cycle, hence the name, pulse width modulation.
Capture and compare modules are auxilliary to timers, in architectures like the MSP430, each timer has up to 6 CCPs associated, while PIC microcontrollers have CCPs which can work with different timers. Either way, you have a set of registers governing the timer itself and one or more registers for settings regarding to the CCP.
So, with the CCP you first have to specify that it will work in compare mode and then the output mode. This means that once you set everything up, the capture and compare module will be capable of generating the PWM with no need for extra code. While you could also generate the signal through code when the interrupts are generated, this is not necessary.
The output mode defines what happens to the output signal when the timer reaches the value set in the timer's register and what happens to the output signal when the timer reaches the value set in the capture and compare module. As you can see from the screenshot I took from the user guide of the MSP430G2553 microcontroller, 4 output modes can be useful when trying to generate PWMs: Toggle/Reset, Set/Reset, Toggle/Set, Reset/Set. The output signal will have an edge when the timer reaches the value set in the timer's register and when the timer reaches the value set in the CCP register.
Видео How Pulse Width Modulation (PWM) Works + Example | Embedded Systems Explained канала TheFabytm
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
![How Low Power Modes Work + Current Measurements | Embedded Systems Explained](https://i.ytimg.com/vi/BOY1lrwynJY/default.jpg)
![All about In App Purchases : Why they suck and why people hate them!](https://i.ytimg.com/vi/DAzxDht43Hg/default.jpg)
![I'm Golden Barrett.50calMW3:Ep10:Tips&Tricks, maps, Create-a-class(Road To Golden, Golden Gun Show)](https://i.ytimg.com/vi/bPzdI7DhYqM/default.jpg)
![Battleforge Passage to Darkness Expert Part 2](https://i.ytimg.com/vi/J3SvEW_3LPY/default.jpg)
![Channel+MW3 updates(nostalgia mappack, FMG9s nerf), Your first FPS online game+what you liked at it](https://i.ytimg.com/vi/EwTsjGmjd50/default.jpg)
![The Would you rather Show 2:Go back or into the future?Sexy GF that never fucks or ugly but slutty?](https://i.ytimg.com/vi/lpP_7gyI6yo/default.jpg)
![I'm Golden Type95 MW3:Ep9:Tips&Tricks, maps, Create-a-class combo(Road To Golden, Golden Gun Show)](https://i.ytimg.com/vi/cw58AVMS6sg/default.jpg)
![I'm Golden Dragunov MW3:Ep8:Tips&Tricks, maps, Create-a-class combo(Road To Golden, Golden Gun Show)](https://i.ytimg.com/vi/goSAjgqVXus/default.jpg)
![Towing a car in Just Cause 2](https://i.ytimg.com/vi/xeuIycJarjA/default.jpg)
![Split Second Episode 3 Full HD gameplay](https://i.ytimg.com/vi/W0HNO8PbE50/default.jpg)
![The WYR Show 3:Zoom vision or hearing?Less sleep or More sleep and control dreams?Solo or MP games?](https://i.ytimg.com/vi/pA7EftGwHGk/default.jpg)
![MoH Warfighter:Lacks WOW factor!Not really good!First impressions video!Medal Of Honor Warfighter](https://i.ytimg.com/vi/fqXX5-0nPaE/default.jpg)
![Top 3 Games coming out in 2013 ! Games I'm looking forward to in 2013!](https://i.ytimg.com/vi/vMGKpFXF_JE/default.jpg)
![COD4:COD Marathon(all CODS in one day), Channel Update, How to play with me on XBL(commentary)](https://i.ytimg.com/vi/4n-oZDVjtng/default.jpg)
![Complexity of the World we live in! Technology, Internet, Automation, Simplicity!](https://i.ytimg.com/vi/fiN8EXXCYk8/default.jpg)
![Battleforge rPvE, 4 player map, difficulty 9 part 2](https://i.ytimg.com/vi/c_UDPO7XG0M/default.jpg)
![New Trent iCarrier IMP120D External Battery Pack - Full Review !](https://i.ytimg.com/vi/kRWmll1Q6Z8/default.jpg)
![BenQ ScreenBar Monitor Light Review - Exciting Sub $100 Accessory](https://i.ytimg.com/vi/zVltSQzcThc/default.jpg)
![Motivation 101 : How to get motivated and stay motivated!](https://i.ytimg.com/vi/DREnkv4HzmI/default.jpg)
![Holiday-Christmas Gaming Gift Guide 2012-Consoles, Handheld consoles, Xbox Kinect, PS Move, iOS](https://i.ytimg.com/vi/H9RY2bhQ23U/default.jpg)
![The WYR Show ep7:Screw a baby or a corpse?Sniper or Air Force pilot?Eat or be eaten by a whale?](https://i.ytimg.com/vi/BwctCe4NHGw/default.jpg)