Main Site Documentation

Quadrature Oscillator on a Fez Cerberus



I would like to implement a quadrature oscillator on my cerberus using the PWM class. Creating two wavetrains is easy enough, but what’s not obvious to me is how to ensure they are a perfect 90 degrees phase shifted from each other!

Maybe there’s something obvious I’m missing but I’d really like to just do this with the Cerb and no external circuitry if possible.

Thank you in advance for any ideas or suggestions!



@ BigRunningBack -

If I understand you correctly, you want one wave to be something like 500 us low and 500 us high and you want the other pulse to be the exact opposite but synchronized? That may be possible in programming.

Micro Framework has the option to invert the pulse. I suppose you could make two identical pulses but just invert the second one.

If it is not implemented in the firmware, you may try to manually invert the pulse via the GHI Register Class. To use this method, you would need to get the user manual to the processor and see if it has the inversion option. If it does, you may be able to set up the pulses via register access.


@ BigRunningBack - define “perfect”. You could use an inverter chip, but the resultant signal would be a few nanoseconds from perfect.


@ Aron - Thank you for that info! That sounds exactly like what I was looking for. It’s a pure software solution! :slight_smile:

I didn’t want to hang an inverter on there since that would have some latency and also means more hardware. Doing it all in code is so much cleaner!