Sign In

Phase Shift Of 120 In Program Using Output Compare Instruction


Hardware: DsPIC33EP256MC202 Microcontroller Software: C Programming Using Xc16 Compiler And MPLAB X IDE Software

I am working on the above mention microcontroller to build a program for three phase three level inerter but I do not getting the idea for how I can get the pwm pulses for inverter using output compare with 120 phase shift



#include "gioref.h"
#include <outcompare.h>
#include <xc.h>
#include <libpic30.h>
#include <math.h>
#include <stdio.h>
#include <ports.h>
void Delay_us();
int a,b,c ;
int main()
    PLLFBD=46; // M=48
    CLKDIVbits.PLLPOST=0; // N2=2


R Avinash Gupta
2016-05-07 13:41:41
Are you able to generate single sine wave? I think you should first generate single sine wave output with desired frequency successfully. Have it checked by an oscilloscope. Then only move to generating 3 sine waves with phase shift.

Post a reply to

Think you can help ? Then post your thoughts that might help . You will earn a lot of reputation in the technical community.

If your program is in multiple files, then ZIP the entire folder and attach below

Images and Screenshots

These helps other better understand your suggestion.