Step 1: Building the Circuit
It looks a little confusing at first but its really not. The PIC12F629 is the most basic microcontroller I know of and is in this circuit to demonstrate the multiplexing ability.
It is not critical which decade output the segments are on, the Q's can go to the closest segment pin. (I like Q0 to go to G so its dual line at start up) The most important part is the two resistors and cap in the middle, they make an auto reset so the decade starts at Q0 at startup. I've included a labeled segment display.
Step 2: Programing
Programming the circuit can get hairy. CHR1 and CHR2 are the anode return pins and SEGAVD is the pin hooked to the decade clock. The best structure is a loop with if statements that turn on a segment for a given number set:
If num1<>1 and num1<>7 and num1<>0 or num1>9 or num1<0 then set CHR1 Low
Will turn the G segment on before the first clock pulse.
DLY was 1ms for approximately 50 Hz refresh rate
Step 3: Future Uses
Step 4: Specs and Troubleshooting
Refresh Rate: depends on MCU and counter but could be 200+ Hz
The first picture is 39 the number I wanted but if it fails to reset its segments light differently on start up and it then displays NA. This is also caused when only the MCU loses power (like if it’s loose in its socket)
If one segment is lit when others are then it’s on the Q5-9 pin. This pin is on from Q5 to Q9 and will cause double light.
If the display is freaking out, and pulsing all segments then an input (CP0 CP1 or MR) is improperly tied to ground
Any program errors you can email me for assistance