Re: want to drive some LEDs from user-port



David Murray wrote:
everytime I ask something like this, somebody always knows a good website to point me to where it has already been done. I'm looking to drive some LEDs from the userport on a C64. I was sort of wanting to use a shift-
register so that I only used a couple of lines, leaving the rest open for other stuff. I can program it myself, just looking for some kind of schematic on how you'd connect it.. plus there seems to be hundreds of different shift-registers out there and I'm not sure which one would work best.
I don't have a project url to give you, but this is pretty easy

I'm assumgin 8 LEDs

Get 2 74ls95 or 1 ls595 ICs

I'm on a business trip and do not have access to my datasheets to see the 6526 pins, but the 6526 has a built in shift register. You can use it instead of normal IO.

Find the pin that outputs the data and the clock for the 6526.  Use them.

Then, put your LEDs and resistors on the outputs, but hook them up common anode to the pins. That will make the load less on the TTL IC, since TTL can sink more than it can source. The downside of this is that the LEDs will be inverse your byte, but you can either fix that in SW (eor $ff) or you can put a 7404/06 on the shift register outputs to invert them (which accomplishes the same thing in HW)

The neat part about using the 6526 shift register is there is no need to bit bang the output stream. Set up the rate (I'd use max), and then sta the byte you need into the shift register of the '26, and it will instantly be reflected in the outputs...

Jim

.


Loading