dspic33fj12GP202 based sinusoidal pulse width modulation generation
dspic33fj12GP202 microcontroller based sinusoidal pulse width modulation generation. Hi Everyone, I hope you are fine and doing well. In this article you will learn how to generate sinusoidal pulse width modulation using dspic33fj12GP202 microcontroller. I have found many people searching on internet regarding how to generate SPWM using DSpic microcontroller. So I will explain here how to generate SPWM using built in PWM module of dspic33fj12GP202 microcontroller. SPWM generation is very important in power electronics projects. I have already posted many project related to power electronics inverters. you may also like to check them.
- SPWM generation using pic16f877a microcontroller
- single phase pure sine wave inverter using pic microcontroller
- Modified sine wave inverter using pic16f877a
- solar inverter
- three phase sine wave inverter using Arduino
- Single phase sine wave inverter using Arduino
So in this project, we will create sinusoidal pulse width modulation using dspic33fj12GP202. Mostly pure sine wave inverters available in market use dspic microcontrollers due to its high performance and high speed calculation power. I have used dspic33fj12GP202 in this tutorial. But same logic can be applied to any DsPIC series of microcontrollers. Let’s start with the introduction of dspic33fj12GP202 features which are used for SPWM generation.
Output compare module of dspic33fj12GP202 in PWM mode for sinusoidal pulse width modulation generation
Output compare module of dspic33fj12GP202 microcontroller is used in PWM mode to generate SPWM. This module use two sixteen bit timers that is Timer 2 and Timer 3. OCM compares the set value of timer register with OCM registers OCxR and OCxRS. When both values becomes equal to each other, state of output pin changes. It happens only once in one period of PWM. dspic33fj12GP202 contains 2 output compare modules. So we can can generate only two PWM with the help of this DsPIC microcontroller. Output compare control registers for dspic33fj12GP202 microcontroller is given.
Above register details shows how to use dspic33fj12GP202 output compare as a PWM. It can use either TIMER2 or TIMER3 as a time setting which can be configured through OCTSEL bit of OCxCON register as shown above. So I have used output compare module as a PWM to generate sinusoidal pulse width modulation. PRy register is used to set period or frequency of PWM.
JLCPCB – Prototype 10 PCBs for $2 (For Any Color)
China’s Largest PCB Prototype Enterprise, 600,000+ Customers & 10,000+ Online Orders Daily
How to Get PCB Cash Coupon from JLCPCB: https://bit.ly/2GMCH9w