In real life I'm a university lecturer. I was recently 'asked' to supervise some power electronics labs on behalf of an absent colleague. The students are required to build a class D audio amplifier using a dsPIC & Microchip's 'dsPICDEM MC1H 3 phase high voltage power module'

In essence, they need to read an analogue input & generate PWM outputs.

I thought it might be interesting to try this with a Teensy 3.1, it looks as though Paul has almost done this for me already - the 'PassThrough' example for the audio card comes very close to what I want!

However, rather than one PWM output per channel, I need two. We use two phases of the power module as a H bridge to drive a speaker. So I'd also like to generate a phase correct PWM output for the 'other' side of the bridge. Ideally, I'd like to manipulate this too so that a guard band can be produced to avoid simultaneous conduction in the upper & lower limbs of the bridge.

I'm aware that a phase correct PWM library exists for the Arduino but I don't expect this to work with Teensy.

I don't really have time to figure this out for myself so if anyone has a quick fix I'm all ears!

Cheers

Ian