6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Jun 28, 2024 9:42 am

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: LED 7-Segment Control
PostPosted: Wed Nov 26, 2003 3:12 pm 
Offline

Joined: Tue Nov 25, 2003 7:41 pm
Posts: 6
Location: Kiedrich, Germany
I'm going to rebuild the SBC-1 on Darryl's page, and I want to connect twenty 7-Segment to the parralel I/O. But how can I connect 140 LEDs to a 16-Bit I/O-Controller? Please help!

c.ya

_________________
---===[HeLlRaIsA]===---


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Nov 26, 2003 4:01 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1696
Location: Sacramento, CA
Hi!

Glad to see someone new using my SBC's!

There are many different ways of decoding LED's. You could use Port A to drive the segments (a-g, dp) and decode 5 bits of port B to drive the common cathode (anode) of each digit. You could use a 74LS154's and a 74LS138 to build your decoder. I'm no expert when it comes to driving LEDs, but you may need a higher current driver than the 6522 (65C22) and/or 74LS138/154 can provide.

As an alternative with fewer parts, check out the MAX7219. It is an eight digit 7 segment LED driver that has a serial interface. It contains RAM to hold the digit data and therefore does NOT require continuous refresh from the CPU. (Write once and forget). It also takes care of the current limiting with just 1 resistor. By using 3 of these chips, you can drive a 24 digit LED display using just 5 bits of your VIA. You may be able to use the 65C22's serial shift register to reduce pins and ease the programming. That leaves other pins available for switches or other devices! This device offers a lot of features for the price!

Here is a link to the 7219 at Maxim:
http://dbserv.maxim-ic.com/quick_view2.cfm?pdf_num=1339

They are available from JDR for $6.99 each.

Good Luck!

Daryl


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Nov 26, 2003 4:16 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8460
Location: Southern California
Go to Maxim's website www.maxim-ic.com and look up their MAX6950, MAX6951, MAX6952,...MAX6959 (ten part numbers). These are LED display drivers you can interface on I2C and SPI serial interfaces taking as little as two pins on one of the VIAs on the SBC. Some of them have built-in fonts too, so you don't have to have the processor look up which segments to light up for various numbers and letters.

If you don't mind my saying so though, that's really the expensive way to go about the display job, in assembly time, power consumed, size, and dollars. You can get the intelligent character LCD modules with parallel interface for about $5 on the surplus market from places like Timeline Inc. http://www.timeline-inc.com/lcd.html , and interface them with as few as six VIA lines (which can be shared with other things too). Timeline has a 40-column, 2-line LCD for $7. Virtually all these LCDs interface the same way regardless of brand because they're all using the same controller ICs. Let me know if you need any help getting it going. I've done it many times.

Garth
engr@drecomm.com


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Nov 26, 2003 5:44 pm 
Offline

Joined: Tue Nov 18, 2003 8:41 pm
Posts: 250
I'm going to rebuild the SBC-1 on Darryl's page, and I want to connect
twenty 7-Segment to the parralel I/O. But how can I connect 140 LEDs
to a 16-Bit I/O-Controller?

One possible scheme is to use a big shift register to scan through
the digits. You could probably use the serial out to drive the
shift register, but it would take some care in the timing.
You could use octal registers salvaged from an old motherboard or
something for the shift register. You'd need some drivers to
handle the high currents involved.
The idea being that you bus the segments together and connect
the/a common for each digit to a bit of the register then select
the digits in sequence by clocking a "1" through the register


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Nov 27, 2003 10:04 pm 
Offline

Joined: Fri Jun 27, 2003 8:12 am
Posts: 618
Location: Meadowbrook
I would personally got the 164 route myself, the thign is that timing is NOT critical in the slightest by that method. I would connect the 7 segements to the d0-d6 outputs then use the d7 as a comma. or period. The 74164s can daisy chain their serial in and outs to form a gigantic chain. That way, you only need 3 signal lines of serial data, clock and strobe enable.

In the programming, you would set aside a RAM area for your digit data, then clock those out of the serial port while keeping the strobe enable low and simultaneously hitting with a clock pulse for eat bit shifted.

for debugging, you can go super slow and watch the action, like 1 bit per sond or something ridiculous. Then in real usage, you would have it going fast enough to be a super fast update.

The practical limit on this method is that if you have too many disaplys set out by this method, you run across the top clockiut speed of your port and of the timing of the 74164s.

_________________
"My biggest dream in life? Building black plywood Habitrails"


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Nov 30, 2003 7:34 pm 
Offline

Joined: Tue Sep 03, 2002 12:58 pm
Posts: 305
The problem with 164s is that you'll have to either blank all of the displays while you're updating, or add a latch to the output of each: shift the data in, then copy it to the latches in one go. The UCN5841 is a nice all-in-one solution. Shift register, latch, and darlington driver all in one.

140 LEDs is enough that I'd go for a multiplexed solution. Scan by segment, so you light segment A in all digits, then segment B, and so on. That needs 7 high power segment drivers, and 20 lower power digit drivers.

If each segment needs 5mA to light (a guess), you'll need to drive them with 35mA, since each is only on for 1/7th of the time. The segment drivers need to be capable of sinking (I'm assuming the displays are common-anode) 20 times that, which is 700mA. The digit drivers need to source 100mA. That's far beyond what TTL or CMOS can do. The digit drivers could be packaged darlington drivers, but the segment drivers would have to be big beefy transistors.

Then you need software to update it. And hope that it doesn't crash - you could damage the display if it gets stuck on one segment for too long.

So - that's 36 74-series chips (plus drivers, if the latches aren't capable of driving the LEDs), or 18 UCN5841s, or the complexity of multiplexing. Those Maxim chips look more and more attractive. An LCD looks even more attractive, but not as bright and shiny.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Nov 30, 2003 9:18 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8460
Location: Southern California
John's right, but you'll probably update fast enough that the shifting on the 164's won't be visible. But if you want that kind of thing for something else Tony, you can use the 595 instead of the 164, so you get the latching function and wait 'til the shifting is finished before sending the new data to the outputs. The 595 also has an output enable input and a reset input.

My first home-made computer which you can see at http://www.6502.org/users/garth/projects.php?project=3 used 8 7-segment-plus-decimal-point LEDs, fed by 8 74HC164's and 64 resistors. It was sure a lot more work to assemble and even to program than the LCDs in subsequent efforts like my current workbench computer which you can see at http://www.6502.org/users/garth/projects.php?project=1


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Dec 01, 2003 6:57 am 
Offline

Joined: Fri Jun 27, 2003 8:12 am
Posts: 618
Location: Meadowbrook
I may end up with the 595s, the 164s I dont mind. I seen that circuit at an old job for a series of 7 digit displays. I was plannign them for scores on redemption and pinball machine designs. the old Atari pinball machins (don't laugh, they actually DID make a couple pf pinball machines) used 7 segement LEDs matrixed. I think the circuit is much easier with a serial update of the 164s or 595s.

_________________
"My biggest dream in life? Building black plywood Habitrails"


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: