Shifting the phase of an Arduino PWM

This is a fairly simple question. Is it possible to use additional circuitry, connected to an Arduino PWM pin, to shift it's phase? As far as I can tell, the Arduino PWM pins can be configured for frequency and duty cycle, but I do not believe that phase can be controlled...at least, not out of the box.

I had an Arduino kit, however I'm taking it back today (too expensive, with a ton of parts that I don't need). If I need to use something other than an Arduino to support phase shifted PWM, then I'm open to that.

• What type of frequency do you want to shift the phase of, and relative to what? An external circuit can be possible, but depending on the timing different techniques come into play. Is it possible you could accomplish a shift by commanding a single shorter or longer frame period in software? Note that the actual functional element of an "arduino" is a microcontroller costing a few dollars; the rest is convenient packaging, programming interface and accessories. – Chris Stratton Aug 4 '14 at 16:21
• Also want to point out that as long as we are potentially talking about an external phase shift circuit this belongs here and not the Arduino site. – Chris Stratton Aug 4 '14 at 16:23
• As others here have said, if you want more precise control of the timing functions on your microcontroller then you must step outside the arduino library and configure it yourself. Read the datasheet section about timer/counters. – sherrellbc Aug 4 '14 at 17:25
• How much phase shift do you need and how accurate does it have to be? – EM Fields Aug 4 '14 at 19:18
• I need 180 degrees...it does not have to be super accurate, as far as I understand. – jrista Aug 4 '14 at 19:24

• Thanks, I hadn't looked at the datasheet before. If it's possible to shift the phase of the Arduino PWM, then that will work. I'm able to pick up the Arduino Uno R3 for about $19, so it isn't that expensive for the convenience of a handy package that can adapt arduino shields and all that. – jrista Aug 4 '14 at 17:29 • BTW, since this answers the question Arduino-style, I'm ok if you guys want to move this to the Arduino forum. I forgot about that one, but this probably belongs there. – jrista Aug 4 '14 at 17:30 • You can pick up an ATmega328P for about$3, so don't feel compelled to turn this into an Arduino question. Especially since you can't do all this with the Arduino libraries regardless. – Ignacio Vazquez-Abrams Aug 4 '14 at 17:31