6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 16, 2024 4:59 pm

All times are UTC




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Wed Dec 31, 2014 11:03 pm 
Offline
User avatar

Joined: Wed Feb 13, 2013 1:38 pm
Posts: 589
Location: Michigan, USA
I'm thinking about building an Elektor Junior computer but I have a question about the display circuit. The displays are common cathode and the 74LS145 and the ULN2003 both have sinking outputs. It seems to me that the display circuit may actually use more current when a display segment is turned "off" compared to when it's turned "on". Is this correct?

Cheerful regards, Mike, K8LH

Attachment:
Elektor Junior Display.png
Elektor Junior Display.png [ 50.44 KiB | Viewed 1725 times ]


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 01, 2015 2:53 am 
Offline
User avatar

Joined: Thu Jun 23, 2011 2:12 am
Posts: 229
Location: Rancho Cucamonga, California
Yup, I think you're right: when the 74145 selects a display and the ULN2003's outputs are all off, current flows from the seven pull-up resistors through the LEDs through the 74145 to ground. When the 74145 selects a display and the ULN2003's outputs are all on, the current flows from the pull-ups through the ULN2003 to ground (the anodes and cathodes of the selected display are roughly at the same voltage so no current flows through the 74145 when the LEDs of a selected display are off).

Assuming that the ULN2003 output transistors have roughly the same characteristics as the ones in 74145, there is probably slightly more current going through the display circuit when the LEDs are off, because when they are on, the LEDs have a tiny amount of resistance (not much!).

I don't think it matters, though.

===Jac


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 01, 2015 5:52 pm 
Offline
User avatar

Joined: Wed Feb 13, 2013 1:38 pm
Posts: 589
Location: Michigan, USA
Thanks for the reply, Jac. Happy new year!

I wonder if anyone on the Forum has a Junior and would be willing to measure the voltage accross one of the segment current limiting resistors for an unlit segment?

Anyway, I think I may rework the display driver scheme.

Cheerful regards, mike


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 01, 2015 6:10 pm 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1949
Location: Sacramento, CA, USA
They may have had a really good reason for designing it the way they did ... or not. The ability to serve 42 segments and 21 keys on an 11-bit I/O bus may require a few trade-offs (I am describing the design correctly, right?)

I don't have enough skill to easily see a more efficient solution, but there's no doubt that one may exist. It would require quite a bit of trial and error for me to make a determination, but I may (likely) have less hardware engineering talent than you. I'm certainly no Woz (or Willegal, or Wilson), but I know enough about the subject to be able to admire them from a safe distance.

Good luck,

Mike B.


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 01, 2015 7:22 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
Michael wrote:
Anyway, I think I may rework the display driver scheme.
That's fine, just be clear on what you hope to gain. You may wish to attempt an alternative design simply to gain experience. But the current consumption issue has little practical consequence. That's because even conventional circuits for driving LEDs are quite inefficient, due to the resistors that make up the difference between +5 and the much lower LED forward voltage (1.5V approx). It's true you could eliminate the current consumption for LED segments which aren't illuminated but the improvement won't be terribly great. It'll depend how many segments are active at a time (out of the seven which are dealt with per time slice).

Maybe you anticipate operation from batteries. In that case, switching to LCD makes far more sense, as the current requirement is essentially zero (assuming no backlight). It's possible to buy dumb LCDs that connect in much the same way as LED displays. Let us know what your goals are.

Also remember there's more involved than just hardware. If you modify the wiring then you'll probably also have to modify the code that scans the switches and LEDs. In this case that code is complicated somewhat by the fact that PA6 - PA0 must be switched to input mode for scanning keys and switched to output mode for driving the LED digits.

cheers,
Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Last edited by Dr Jefyll on Thu Jan 01, 2015 7:31 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 01, 2015 7:29 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8541
Location: Southern California
Dr Jefyll wrote:
Maybe you anticipate operation from batteries. In that case, switching to LCD makes far more sense, as the current requirement is essentially zero (assuming no backlight). It's possible to buy dumb LCDs that connect in much the same way as LED displays. Let us know what your goals are.

Yes. From the displays page of the 6502 primer:
    For one product, I used the National Semiconductor (now TI, unfortunately) MM5453, a 40-pin IC that's an LCD driver for 4½-digit 7-segment-plus-decimal-point watch-sized raw (non-intelligent) LCD. IIRC, I drove it with the 6522's shift register output. It takes care of the strobing and prevents plating problems that could arise from a net DC current you might get if you were to try to strobe it yourself and didn't get it balanced. It does not form the characters itself, so you tell it exactly what segments to turn on, and you can make any characters the LCD segments allow.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 01, 2015 8:11 pm 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
Dr Jefyll wrote:
.... But the current consumption issue has little practical consequence. That's because even conventional circuits for driving LEDs are quite inefficient, due to the resistors that make up the difference between +5 and the much lower LED forward voltage (1.5V approx)...
cheers,
Jeff

There are all sorts of forward voltages for LEDs nowadays...
Let's say you have a LED that has a current rating of 20mA and forward voltage of 3.3V. If one were driving the LED directly from an FPGA pin, where the voltage is 3.3V and the current is set to 20mA or lower, is a resistor still needed?

_________________
65Org16:https://github.com/ElEctric-EyE/verilog-6502


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 01, 2015 8:26 pm 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1949
Location: Sacramento, CA, USA
ElEctric_EyE wrote:
There are all sorts of forward voltages for LEDs nowadays...
Let's say you have a LED that has a current rating of 20mA and forward voltage of 3.3V. If one were driving the LED directly from an FPGA pin, where the voltage is 3.3V and the current is set to 20mA or lower, is a resistor still needed?

Interesting thought. I wonder if the forward voltage is somehow built into the diode junction, or if there's a resistor hiding somewhere.
Regarding the FPGA pin, how exactly is the current "set", from a hardware perspective? Is there a resistor hiding somewhere?

Mike B.


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 01, 2015 8:32 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
ElEctric_EyE wrote:
There are all sorts of forward voltages for LEDs nowadays...
Let's say you have a LED that has a current rating of 20mA and forward voltage of 3.3V.
barrym95838 wrote:
... or if there's a resistor hiding somewhere
You're right, LED rated forward voltages do vary, sometimes according to color (eg red vs green). But 3.3V seems like an extreme deviation from the norm. The LED in question may well be two LEDs wired in series inside one package. This helps raise overall efficiency when the supply far exceeds the forward voltage od a single LED.

ElEctric_EyE wrote:
If one were driving the LED directly from an FPGA pin, where the voltage is 3.3V and the current is set to 20mA or lower, is a resistor still needed?
You could probably go that route and get away with it. But I suspect the so-called "20 mA" setting for the FPGA output pin pertains to a limit on rise and fall times -- IOW, the spec is tailored to have meaning under transient conditions. But the LED is a steady-state load, and in that regard I'd hesitate to read too much into the spec.

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Last edited by Dr Jefyll on Thu Jan 01, 2015 8:37 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 01, 2015 8:37 pm 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
barrym95838 wrote:
...Regarding the FPGA pin, how exactly is the current "set", from a hardware perspective?...

Mike B.

It's a text file with a .ucf extension that identifies a Constraints file for Xilinx ISE within the Project folder.
It has pins assignments, I/O standards, slew rates, and drive currents.
An example:
Code:
# Synchronous Ram Signals #
NET "SRAddr[0]" LOC = P26 |IOSTANDARD = LVCMOS33 |SLEW = SLOW |DRIVE = 12;  //USER I/O...

_________________
65Org16:https://github.com/ElEctric-EyE/verilog-6502


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 01, 2015 9:00 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8541
Location: Southern California
LED voltage rises as the wavelength shortens. Red has the lowest voltage at somewhere around 1.7V. Blue is somewhere around 3.3V. (These are from memory, and pretty rough.) They have a sharply rising curve, meaning it takes a very small change in voltage to make for a 10:1 difference in current; so like a zener diode, you have to control the current somehow, which is why there's typically a resistor in series. Modern LEDs are far more efficient than what we had 35 years ago, and 20mA, if continuous, is often much too bright for comfortable indoor viewing. The only time I put anywhere near that much current through LEDs in our aircraft product designs was for annunciators that had to be visible through a dead-front panel during the day. In the case of a display where it's strobed and the duty cycle is low, taking the average current should be accurate enough; ie, that if 3mA continuous gives good brightness and there's a 1/8 duty cycle, 3mA*8=24mA will be close enough.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Fri Jan 02, 2015 12:42 am 
Offline
User avatar

Joined: Wed Feb 13, 2013 1:38 pm
Posts: 589
Location: Michigan, USA
Thanks for all the suggestions, guys.

Of course an LCD is a great idea but I'd like to stick to the Junior / KIM-1 style front panel for now.

I always wanted a KIM-1 and the Junior seems to be a similar but simpler design so I'd like to try that first. I don't like the display circuit though so I'll probably switch to common anode displays (like the KIM-1), add PNP source drivers, keep the ULN2003 sinking driver, and modify the LED segment table in the Junior monitor ROM. Hopefully any Junior software I come across will use the display routines in the monitor rather than directly driving the displays via the 6532.

Cheerful regards, Mike, K8LH


Top
 Profile  
Reply with quote  
PostPosted: Fri Jan 02, 2015 12:08 pm 
Offline
User avatar

Joined: Fri Oct 31, 2003 10:00 pm
Posts: 200
Michael wrote:
Thanks for all the suggestions, guys.

Of course an LCD is a great idea but I'd like to stick to the Junior / KIM-1 style front panel for now.

I always wanted a KIM-1 and the Junior seems to be a similar but simpler design so I'd like to try that first. I don't like the display circuit though so I'll probably switch to common anode displays (like the KIM-1), add PNP source drivers, keep the ULN2003 sinking driver, and modify the LED segment table in the Junior monitor ROM. Hopefully any Junior software I come across will use the display routines in the monitor rather than directly driving the displays via the 6532.

Cheerful regards, Mike, K8LH

Hi,

I should not worry about the Junior display circuit. Hundreds of Juniors were built and I never heard of a problem with the display.
Switching to common anode displays will make it KIM-1 compatible, this is the most significant change from KIM-1 to Junior in the design and a source of incompatible KIM-1 software problems.

Doing a KIM-1 clone is not that difficult, Ruud Baltissen made a design based on 6532's which Vince Briel made into a 100% KIM-1 clone.

I did dump a lot of Junior EPROMS and have most of the docs online.


Top
 Profile  
Reply with quote  
PostPosted: Fri Jan 02, 2015 5:41 pm 
Offline
User avatar

Joined: Wed Feb 13, 2013 1:38 pm
Posts: 589
Location: Michigan, USA
Hi Hans,

Thank you for the insights. Designing and building a KIM-1 compatible is definitely on my "to do" list.

So far my Junior design includes;

() a PIC microcontroller (reset, clock, RAM loader, programmable "soft decoder" memory mapping)...
() a 65C02 cpu...
() a 64K SRAM chip...
() one or two 6532 RIOT chips...
() a 74LS145, a ULN2003, and six PNP transistors for the front panel...
() a 74LS32, or more likely an 8-pin PIC with CLC (configurable logic cell), for NMI single-step operation...

My research suggests that I can turn my Junior design into a KIM-1 by adding one or two additional chips. The "soft decoder" in the PIC provides programmable memory mapping with single 'page' resolution. That means I can duplicate the memory map for almost any classic computer and assign a chip select line for the $17XX I/O page. It's also quite easy to map the unused KIM-1 $14, $15, and $16 pages back into RAM memory or allocate them for additional I/O chip selects. One additional chip handles sub-page decoding of $1700..$173F and $1740..$17FF for two 6532 chip selects and inverts the A4 and A7 address lines to the 6532s to make them look like the 6530s in the original KIM-1.

Cheerful regards, Mike, K8LH


Attachments:
Junior Layout.png
Junior Layout.png [ 53.58 KiB | Viewed 1603 times ]
Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 13, 2015 11:53 pm 
Offline
User avatar

Joined: Thu Jun 23, 2011 2:12 am
Posts: 229
Location: Rancho Cucamonga, California
Michael wrote:
I always wanted a KIM-1 and the Junior seems to be a similar but simpler design so I'd like to try that first. I don't like the display circuit though so I'll probably switch to common anode displays (like the KIM-1), add PNP source drivers, keep the ULN2003 sinking driver, and modify the LED segment table in the Junior monitor ROM. Hopefully any Junior software I come across will use the display routines in the monitor rather than directly driving the displays via the 6532.


I wouldn't count on software being "nice" and going through the ROM routines to display stuff. Instead, if you're redesigning the hardware anyway, I would add some glue logic and a few jumpers to make the displays work in the Kim-1 way or in the Junior way. Or you could use the power of the microcontroller to do the translation "on the fly".

You may also want to use a 128KB memory chip (e.g. AS6C1008-55PCN) instead of 64K (62512) chip, they're easier to find.

===Jac


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 20 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: