Possible to have extra pins mimic timer outputs?


I'm wondering if it is possible, during a timer interrupt service, to attach "slave" pins to the OCnA and OCnB timer outputs, such that I could have an extra pin doing whatever OCnA is doing (or the opposite) and an extra pin doing whatever OCnB is doing (or the opposite). I need OCnA and OCnB to behave differently, but I need two of each of them (and inverted)! Thoughts?

For more background, I am trying to adapt something like this: http://interface.khm.de/index.php/lab/experiments/arduino-dds-sinewave-generator/ ...to do this: http://arduino.cc/forum/index.php/topic,116089.0.html

I'm thinking I can vary the phase between OCnA and OCnB slightly to acheive the delay that I need to avoid short circuiting, and then if I can duplicate them, I can control all 4 switches.


Lots of options -

1) do it in hardware - use some sort of a buffer - op-amp, transistor etc between one output pin and however many devices you want to drive from that pin 2) Use the output compare interrupt service routine to toggle more than one pin, this is what the servo library does for example.

Duane B


Thank you Duane! I definitely would prefer to do it using method 2. I’m pretty new at this, would you mind pointing me towards an example? Meanwhile I’ll look into the servo library to see if I can figure it out from there.