I made my own interface card!

Modding and Technical Issues

Moderator: Moderators

User avatar
Schlowski
NoMess!
Posts: 892
Joined: Tue Jun 08, 2004 12:20 pm

Post by Schlowski »

lol, now we can call him VicGyver (spelling?)
vic user
VicGyver
Posts: 1401
Joined: Thu Mar 25, 2004 9:40 am

Post by vic user »

sounds good to me!

chris
6502dude
megacart
Posts: 1581
Joined: Wed Dec 01, 2004 9:53 am

Post by 6502dude »

vic user wrote:do you still have the programs for your projects?

chris
Unfortunately, most programs I wrote for Vic-20 hardware projects that I did in the 1980s were cassette based and they have been lost or damaged over the years. :(

I few things I burned to eproms, but I have erased and reused most of these.

User port control routines are usually pretty short anyway and easy to write.
Image Mega-Cart: the ultimate cartridge for your Commodore Vic-20
vic user
VicGyver
Posts: 1401
Joined: Thu Mar 25, 2004 9:40 am

Post by vic user »

User port control routines are usually pretty short anyway and easy to write.
it looks like you just have to deal with two memory locations, which is nice.

tonight i hope to set up on my breadboard a LED circuit using a transistor as the switch.

if it works ok, then off to use an i/o line from the vic to feed that base current, and hope the LED comes on!

chris
6502dude
megacart
Posts: 1581
Joined: Wed Dec 01, 2004 9:53 am

Post by 6502dude »

Dont forget current limiting resistor from user port to base of transistor and a current limiting resistor for the LED.

If you have MOC3020 chip handy you can connect this to user port and switch 120vac loads up to 100ma. This is a really cheap way use computer control of 60watt lamp without clunky relays. :idea:

Connect a triac to output of MOC3020 and you can handle AC loads of several amps.

If you are not used to working with AC line voltage ........ be careful :P
Image Mega-Cart: the ultimate cartridge for your Commodore Vic-20
vic user
VicGyver
Posts: 1401
Joined: Thu Mar 25, 2004 9:40 am

Post by vic user »

9 volts DC and low current is about all i can handle i think.
Dont forget current limiting resistor from user port to base of transistor and a current limiting resistor for the LED.
resistors are my friends, as far as i have been told in many books, but my best friend is ground :)

chris
User avatar
Jeff-20
Denial Founder
Posts: 5761
Joined: Wed Dec 31, 1969 6:00 pm

Post by Jeff-20 »

(still laughing from the McGyver pic -- perfect timing).
High Scores, Links, and Jeff's Basic Games page.
vic user
VicGyver
Posts: 1401
Joined: Thu Mar 25, 2004 9:40 am

Post by vic user »

Does this look right to be able to turn on/off the LED from an I/O line on the vic?



+ 5 volts------------------------resistor----------LED-----collector

I/O line--------------------------resistor----------base

emitter----------------GND

here is a better representation:

http://web.ncf.ca/ex809/circuit.bmp

thanks in advance for any replies.

chris
6502dude
megacart
Posts: 1581
Joined: Wed Dec 01, 2004 9:53 am

Post by 6502dude »

Nice picture.

This should work fine.

Suggested resistor values are 330 or 470 ohm for led resistor and 1K ohm for I/O line to base.
Image Mega-Cart: the ultimate cartridge for your Commodore Vic-20
vic user
VicGyver
Posts: 1401
Joined: Thu Mar 25, 2004 9:40 am

Post by vic user »

thanks for the resistor advice!

oh man, this is going to be neat if it works!

chris
vic user
VicGyver
Posts: 1401
Joined: Thu Mar 25, 2004 9:40 am

Post by vic user »

well i hooked up the circuit last night, and the transistor works, but i am going to have to get a multimeter tonight.

i can get the LED to light up, no matter which I/O line i use to plug into the base, and can even get it to light up just by holding the wire with my fingers!

i then replaced the +5 volts line with an I/O line to power the circuit, and although the LED was faint, i did get a closed circuit.

poking the particular I/O line did not seem to affect the power level either.

i picked I/O line 8 (PB7?) so its decimal value is 32, yet no effect.


chris
User avatar
Schema
factor
Posts: 1430
Joined: Tue Mar 23, 2004 7:07 am
Website: http://www.jammingsignal.com
Location: Toronto, Ontario

Post by Schema »

Did you set the user port to "all outputs" first?
vic user
VicGyver
Posts: 1401
Joined: Thu Mar 25, 2004 9:40 am

Post by vic user »

i set only the last I/O line to output, (decimal 32) and also did try to set them all to output (decimal 255), but no dice.

the multimeter should figure out what the heck is going on or not on :)

chris
vic user
VicGyver
Posts: 1401
Joined: Thu Mar 25, 2004 9:40 am

Post by vic user »

i feel so silly. :oops:

once i used the proper value for 2^7 i got it to work :oops:

although i can turn on/off an LED just using an I/O line for power, i can see why using a transistor makes sense.

i am now having fun getting two LED's to blink at different rates etc..

i should have bought more transistors :)

chris

p.s. i want to thank everyone who has helped me get to this point. i am having a huge blast interfacing the breadboard to the vic!
vic user
VicGyver
Posts: 1401
Joined: Thu Mar 25, 2004 9:40 am

Post by vic user »

i'll be picking up more transistors tomorrow during lunch break, but right now i have 4 LED's hooked up and wrote a little program that takes a random value from 0 to 255 and pokes the value into a sound register as well as to the I/O ports, (then a random delay loop) so I get a crazy sound and light show :)

one thing i noticed, is how much faster the program is when i poked a variable having the value 37136, rather than using 37136 directly, for example.

chris
Post Reply