Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Converying binary to 7-segment (decimal)

Status
Not open for further replies.

zanes

New Member
Hi,

I've just built a 4 bit adder, which outputs up to a 5 bit binary number (to some LEDs). Now I've got the basic adder working, I want to output to 7 segment displays.

This is where I get stuck. Is it possible to drive several 7 segment displays from a 5 bit input to display 1-31 in decimal on the 7 segments, without using a microprocessor. My best guess so far is to use some kind of multiplexer after the binary outputs, but I don't think it would work.

Thanks,

Alex
 
Your best bet, honestly, is a PIC or Basic Stamp microcontroller. These are MUCH easier to use than a full microprocessor, and going this route will dramatically reduce your parts count versus discrete logic.
 
That's where I was thinking towards.... Any ideas on which PIC (which is what I meant, not microprocessor!) to go for. Perhaps a PICaxe? (I'm UK based)
 
You don't need anything fancy. The codespace for this sort of application is small, so you don't need to spend a lot of money. To keep things simple, you'll want 5 input pins for your binary data, 7 output pins for each of the seven segments, and two additional pins to select which 7-segment LED is currently displaying the data appearing on the 7 output pins--you'll very rapidly ( a few hundred times a second or so) switch between these to make it appear as if both digits are on all the time. So, you need at least 14 assignable I/O pins. Any of the low-end PIC14xxx or PIC16xxxx family with that many I/O lines will do.
 
zanes said:
That's where I was thinking towards.... Any ideas on which PIC (which is what I meant, not microprocessor!) to go for. Perhaps a PICaxe? (I'm UK based)
I recommend bypassing the novice/experimenter/third-party mcu options, and going directly to the real deal. It's only a bit more of a hump to get over, and in my case, it took me next to no time to realize that I was wasting my time and money on the intermediary step.

What you want to do is:
1) Download MPLAB from www.microchip.com
2) Download GC BASIC from http://gcbasic.sourceforge.net/
3) Order three free samples of 16F887 chips from www.microchip.com. These chips each have loads of I/O pins (if you want to go smaller, maybe check out the 16F88). Depending on what you're familiar with, make sure the samples you order are DIP packages (I think they list them as "PDIP"), with the I/P option. You'll know what I mean when you're ordering the samples.
4) Visit www.blueroomelectronics.com and order the Inchworm+ or the Junebug. You can save money by ordering the assemble-yourself kits, or save time by ordering pre-assembled kits. The best thing about either kit is that they have experimenter's tools included (like LEDs and push-buttons for testing and debugging your programs), but are also real-deal mcu programmers. You'll get what you need to satisfy the criteria of your application and the benefit of superior post-consumer support, at less than the cost of a cheap programmer or novice experimenter's option from another source.

Blueroomelectronics frequents this forum often, and I'm sure will gladly answer any questions you have about getting started with his products or just PIC programming in general.
 
Last edited:
Always happy to get a plug :)

To not use a microcontroller you need a pair of CD4511 ICs they are 0-9 decoders though.

Take a look at the Dragonfly schematics. It's a typical six digit seven segment display kit. I've even made a free TTF font for it.
**broken link removed**
 

Attachments

  • MyBlueRoom.zip
    7.6 KB · Views: 267
Pretty much decided on the microcontroller route, after I build a regulated 9V supply (can't use PP3s all my life)
 
Last edited:
Right, an update for anyone that's interested.
So I thought about using a PICaxe for a while, and forgot about the project for a bit. I've almost finished the 9V supply, and I'm about halfway to upgrading my adder to an adder/subtractor.
I bought a PIC book (The PIC microcontroller, Your Personal Introductory Course) which is Ok, it convinced me that Hank was right, so I've skipped over PIcaxe etc. I've bought a PICkit 2 (with demo board, which looks useless!) and a few PICs, hopefully I'll start experimenting soon (once the crystals arrive, which I forgot to order!) and the code should be fairly simple I hope!
 
Some of the pics have an internal oscillator and so don't need a crystal. If you have any of these you can start straight away.

Mike.
 
If you want an example of seven segment PIC software to drive several displays download my Dragonfly manual. The hookup to a PICkit2 is the same just ignore pin 6 on your PICkit2 (PGM)
 
I might have a look at it after I've had a go at it myself. I don't think my PICs (or at least the ones I will start with) have internal oscillators, I've got the PIC16F54 and 16F57 to play with initially.
 
zanes said:
Is it possible to drive several 7 segment displays from a 5 bit input to display 1-31 in decimal on the 7 segments, without using a microprocessor.
Attached is an old circuit from Fairchild that uses two devices per digit to convert serial binary to BCD. You would need to add a parallel to serial shift register to convert to the serial input needed by the circuit. May be more trouble then going to a micropressor design but it is possible to avoid a microprossor if you want.
Serial Binary to Parallel BCD.jpg
Another technique is to parallel load the data into a count-down binary counter which shares a clock with an count-up BCD counter. (See my thread at "Serial Binary to BCD Digital Display w/o uP" in the Electronic Projects Design/Ideas/Reviews forum)
 
zanes said:
I might have a look at it after I've had a go at it myself. I don't think my PICs (or at least the ones I will start with) have internal oscillators, I've got the PIC16F54 and 16F57 to play with initially.

Old PICs but still workable, they can be run with a simple RC oscillator.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top