This article describes a 2-Digit Counter using a Microchip PIC12F629.
It shows what can be done with an 8-pin chip having just 5 output lines and one input line.
The chip drives two7-segment displays and this would normally require 7 lines to drive the segments plus another one or two lines to select the displays.
We have shown how a single line can be used to drive two different segments by using the tri-state of an output.
Each output of the chip has three states: HIGH, LOW and FLOATING (high impedance). The high impedance state occurs when the line is in the input state and any line can be changed from output to input at any time during the running of the program.