Multiplexing with a 4017

picaxester

Senior Member
Heres an idea for driving 10 seven segment displays or 80 LEDs with a 4017 and a PICAXE 18X.
It uses the the serial output pin to clock the 4017 which drives the vertical LED columns
while the 8 outputs on the PICAXE drive the horizontal LED rows.
Q1 and the diodes are there to turn off the LEDs when the 18X clocks the 4017 so it doesn't
light the next column with previous data. To bad the 4017 doesn't have an output enable.



Code:
do until pin0 = 1		'MAKE SURE THE 4017 STARTS AT THE FIRST OUTPUT
poke $05, %00001000		'CLOCK THE 4017
poke $05, %00000000
loop

b11 = 32			'PUT SOME VALUES INTO THE VARIABLES
b12 = 64
b13 = 128

do				'OUTPUT THE VALUES
poke $05, %00001000		'CLOCK THE 4017 AND TURN LEDS OFF
pins = b11			'PUT VALUES ONTO THE PINS
poke $05, %00000000		'TURN ON LEDS

poke $05, %00001000
pins = b12
poke $05, %00000000

poke $05, %00001000
pins = b13
poke $05, %00000000
loop
ps. I hope that pic isn't to big for everyone.


eric
 

wilf_nv

Senior Member
mux LEDs with a 4017

You can avoid hardware blanking of the columns by blanking the row data just before clocking the 4017 and then load the new row data.
 

picaxester

Senior Member
I was thinking about that, but the extra code might make the LEDs flicker more when running up to 10 columns. Maybe not. I've only ran 4 columns so far.

It would be nice to get rid of all those transistors :)
You'd probable want to invert the row data and LEDs though.
 

andrew_qld

Senior Member
I like your thinking with this. And if you wanted to blank the display you could use the 4th output to go nowhere. Nice utilization of 08M' outputs.

Then again you only get 3 outputs for 2 inputs.

I mucked around with using an 08M to drive 4017's for a 10-Pair cable tester and tried 4017's in several other projects. Apart from the cable tester project I ended up ditching the 4017's and either using a 74HC154 (16 outputs for 4 or 5 inputs) or Microchip MCP23017 (16 outputs for 2 i2C inputs- obviously you need an 18x for this).

Most of the other projects I played with needed 16 or more outputs and the 4017's just needed too many control pins for the amount of outputs when you use more than one.. Plus you wither needed to sacrifice one output or cut the power to the 4017 if you wanted to chain them.

But your circuit is a nice one for the 08M :)
 
Top