8 Bit number to 3 seperate 7-segment LED displays

Good afternoon,

I was wondering if anyone can give me some ideas on how to take an 8- bit number and display it on 3 LED displays.

I would be extremely grateful if you could give me a push in the right direction.

many thanks,

Sean

Reply to
Sean Brown
Loading thread data ...

I will push you in the direction of a microcontroller. You'll have to be more specific though. How fast is the number changing? Do you want the number displayed to change as fast as the 8 bits change or is there a strobe signal? I assume you want to convert 8 bits to decimal, hence the 3 displays? It's not hard to do, but what's your background?

Reply to
a7yvm109gf5d1

Convert the number to an unsigned BCD number (with sign flag if appropriate)

Look up each digit (from left to right is easiest) and find the segment pattern for the digit. Unless you're at the rightmost digit, use blank instead of '0' until you hit the first non-zero digit. The results go into a 3-byte buffer. If the number is being updated very frequently you may wish to slow down the updates to at most a few per second.

Either scan the display (output one digit at a time, or Charlieplex it etc.) or output static drive (eg. 3 shift registers). Deal with the '-' sign (if present) either with another LED or a 4th digit or whatever, up to you. If you scan the display you'll need to keep the frequency high enough that flicker is acceptable. 1msec/digit is fine. You can use an ISR or whatever to do the scanning..

Enough of a push?

Best regards, Spehro Pefhany

--
"it\'s the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

On a sunny day (Tue, 8 Jan 2008 08:10:00 -0800 (PST)) it happened Sean Brown wrote in :

Software? binary -> bcd -> seven segment Processor?, Language? Hardware? binary -> bcd -> seven segment

In case of hardware the old 74HCXXXX series has some bcd to seven segment decoders.

74HC4511? You can use some presettable binary counter with BCD output perhaps to drive it.
Reply to
Jan Panteltje

decoders.

Brute force hardware:

binary + 2-bit counter-> segment output (via flash or EPROM) oscillator->counter-> decoder -> digit drive

You only need 8k bits of memory to do this.

To make it more general, use 4 digits and add the sign and another input to select signed/unsigned, or 16k bits.

Probably direct segment drive of a CA display from the memory is okay.

A 64K x 8 EPROM is $3.24 in single quantity; of course you need to be able to program it (and erase it if you make a mistake) or $1.42 in

10's if you want the kind that can't be erased.

Best regards, Spehro Pefhany

--
"it\'s the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

I used to know several methods of doing this in TTL hardware, all long forgotten thanks to microcontrollers. But the TI book on logic design in TTL that I learned some of them from is still around... I saw a copy in a local second hand bookshop the other day. 5 good UK pounds.

Reply to
Paul Burke

Sorry,

The number will be coming from an EPROM and won't change once it's been set. The 8 bits will be converted to decimal, so you're correct in your assumption.

If it was only 0-9, then I comprehend sending the 4 LSB's to the Display controller, but I'm confused on getting the same result with the higher numbers.

Thanks for your response.

Sean

Reply to
Sean Brown

Well there's obviously a lot more to the problem than you first let on! What's this "display controller"?

Reply to
a7yvm109gf5d1

I apologise for not being very clear.

By display controller, I mean the decoder which takes the BCD input: 0

- 9 and controls the 7-segment displays for each display.

Maybe if I just ask: How do i convert an 8 bit number into the 3 digit BCD equivalent. I would like to keep it through hardware if possible, but am open to other ideas.

Many thanks,

Sean

Reply to
Sean Brown

The bog-simplest in theory is just a 21-bit ROM, or a bank of 8-bit ROMS such that the truth table is:

00000000 00000001 ... 00001001 00001010 00001011 ... 00010011 00010100

And so on - I'm sure you get the idea.

Good Luck! Rich

Reply to
Rich Grise

Silly me...

That would be the most simple. I got my head too far into the clouds to see what was in front of me.

Thanks very much.

Reply to
Sean Brown

--
An old brute-force way to do it is to simultaneously load the binary
number into an 8 bit down-counter and clear three BCD counters, then
use the same clock to count the binary number down to zero while
up-counting the BCD counters.  Stop counting when the binary counter
gets to zero, and the BCD counters will have accumulated the BCD
equivalent of the original binary number.
Reply to
John Fields

Here's one way:

formatting link

Reply to
Richard Henry

You're more than welcome - it's nice when my answers actually work! :-)

Cheers! Rich

Reply to
Rich Grise

Can you still buy plain old ROMs any more? I checked digikey but the smallest EPROM they had was 1kx8 for $13, or some 2kx8 eeprom for $4.

They did have a 44 pin CPLD for $1 though.

Reply to
DJ Delorie

ST M27C512 $3.24 each. OTP version: $1.71 each (99 cents in 250)

Best regards, Spehro Pefhany

--
"it\'s the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

Yikes! I guess I've been out of the loop too long.

But, it's true, if you can make a 256 X 21 ROM in(on?) a CPLD, (or FPGA, or any of the other gate arrays) then you should have it practically done already. :-)

Of course, the 21 bits would be the seven segments for the three displays.

It'd take another couple of bits to do decimal points, but that would change the scope of the assignment, so don't bother. :-)

Cheers! Rich

Reply to
Rich Grise

Why don't you program the EPROM(s) to output BCD, instead of binary?

Reply to
Andy

formatting link

Reply to
GPG

Hello,

I have done this recently. (need a 74ls47, three transistors and a PIC)

I can give a schematics, a typon, etc...

tell me

regards

Vincent

--------------------------------- usenet is made of this

some if them want to use you some of them want to get used by you some of them want to abuse you some of them want to be abused

Reply to
vincent.thiernesse

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.