90 degree phase shift pwm signals arduino mega

Hi,

I'm trying to generate two PWM signals that are 90 degrees out of phase using Arduino Mega but get stuck. I know how to generate 180 degrees but I don't really know how to modify that design and achieve a 90 degree out of phase signal. Thank you!

I did check this link! But there seems to have an interrupt .h file that they didn't provide so I couldn't really run the code and see... :frowning:

You mean this ?

// GreyGnome Library provides Pin-Change Interrupts
#include <EnableInterrupt.h> 

The Interrupt library is only used for the push-button ISR's. I figured folks would know to grab it from the Internet. I'll modify the Article to explain that in the Code section. Apologies for any confusion.

Alternatively, you could call either Start_PSPWM routine from your own code to run the project. In fact, you can dump all button and direction interface wiring and just call one of the Start routines (Fwd or Rev) and the Stop routine when needed. No interrupts required at all for that use case. Then you can see the code run.

hth

Thanks, ZX80. You are spot on with your comments.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.