mbed and 7 segment led

11 Jun 2010

I am new to mbed and electronics, but if I want to make clock using 4 digit 7 segment led, can I do it with mbed? what should i need beside 4 digit 7 segment led? I hope someone will help me.

sorry if my question is too stupid....

20 Jul 2010

Hi,

For 4 digits you would need (4*7=28) 28 digital IO lines, the mbed has up to 25. To get around this you could use a driver IC (e.g. CMOS 4543) which will increase cost & chip count, or you could multiplex the outputs reducing the IO to around 9 lines.

If the LEDs are small the mbed could prob drive the outputs directly (a bit naughty) or you can use a transistor on each line. Either way you should use a resistor to limit the current to the LEDs or else they will blow!

Hope this gets you started.

20 Jul 2010

If you're building a (normal!) clock, the most significant digit will only ever be blank, 1, or  2 (if you want to support 24 hour format time).

With that limitation, you could drive the LEDs directly since you would need fewer outputs -

12 hour only: 1 line to drive the "1" or leave it blank, plus (3*7) for the other three digits. = 22

24 hour format: 3 lines to drive the upper part of a "1", the lower part of a "1" and the remaining segments required to form a "2", plus (3*7) for the other three digits = 24.

Of course, you probably also want some way to set your clock using push buttons, you might want to add an alarm, etc. So in the long run, you would be better off multiplexing the segments and usng external transistors as the other posters have suggested.

21 Jul 2010

I was just looking into this subject for a timer project. I need the keep more IO lines free for switches & relay control, so I am looking at Maxim's MAX7219 display driver chip. It will drive up to 8 digits and will run smaller displays directly - google the data sheet & I think you will be impressed. Also look at the MAX6951; similar functions with a 3V supply. The Maxim chips use the SPI interface, which isn't quite as straightforwad as other serial buses, but there are plenty of examples on this site with code, so its probably easier to learn about SPI than multiplexing the display.

If you don't like the look of that chip, the 'classic' approach to reducing the IO pins for a display is an 8 bit shift register such as a 74HC595 or the higher power TPIC6B595, which should directly drive your display.

21 Jul 2010

If you like what that MAX7219 chip does but you don't know anything about the SPI buss, this is a good introduction, start at page 4: http://pdfserv.maxim-ic.com/en/an/AN3637.pdf. It made sense even to a beginner like me :)

06 Oct 2011

Old thread ninja!

Actually, the MAX7219 isn't SPI compatible, it's 3 wire serial. The sister chip MAX7221 can handle SPI.

I'll post a sample program using the MAX7219 some time soon. I had trouble myself finding relevant info on it, but I think I have it sorted now.