Let us assume; we like to monitor on a scope the timing of 4 stages while an MCU code is running. But one I/O pin only is free for this task.
As we know, an I/O pin (as of ATmega8) is controlled by 2 internal bits (in two I/O registers; DDRx and PORTx). An I/O pin could have, therefore, 4 different states which could be made to output four different voltages. The two obvious outputs are Vcc and 0V.
On my next post, I will present a possible solution which I applied lately.
Have fun,
Cheers,
Kerim