Hacking in a reset switch

Modding and Technical Issues

Moderator: Moderators

User avatar
ral-clan
plays wooden flutes
Posts: 3702
Joined: Thu Jan 26, 2006 2:01 pm
Location: Canada

Hacking in a reset switch

Post by ral-clan »

I want to add a reset button to my VIC-20.

Is it only a matter of putting in a momentary contact button that will take a RESET line off one of the ports and bridge it to GROUND?

I noticed there is a RESET pin on both the USER and Cartridge ports. Does it matter which I use?

Anything to be warned about before I try it?
User avatar
saundby
Vic 20 Enthusiast
Posts: 166
Joined: Wed Feb 22, 2006 11:55 pm
Website: http://saundby.com/
Location: Gold Country, CA

Reset switch

Post by saundby »

I don't recommend putting a reset switch directly on the RESET lines at the expansion connectors. The problem is that switch bounce can give multiple pulses, some of which will possibly be too short to cause a correct reset of the 6502.

A better way to do it is to use the RESET circuit that's built into the VIC. You can do this by connecting a switch between pins 1 and 2 of the 555 timer in the VIC (it'll be the only 8-pin IC you see inside.) You can also connect one end of the switch to a logic ground and the other to only pin 2 of the 555 if you want to reduce the number of connections you make to the IC. You can also put the tie point for the switch to the side of a capacitor or a 1 megaohm resistor that ties to pin 2 of the 555.

Note that the link field pointer and end of program pointer for BASIC will be reset as well when you do a reset. So even though your program will still be in RAM the computer won't have pointers set to see it. You can find the pointers at 4097, 4098 (link pointer) and 45, 46 (end of program) on an unexpanded VIC. You will have to know what values to POKE, so PEEK before you run something that will hang.

If you want to know more about recovering your BASIC program after a RESET, say so and I'll give all the bloody details.

-Mark G.
User avatar
ral-clan
plays wooden flutes
Posts: 3702
Joined: Thu Jan 26, 2006 2:01 pm
Location: Canada

Re: Reset switch

Post by ral-clan »

saundby wrote:A better way to do it is to use the RESET circuit that's built into the VIC. You can do this by connecting a switch between pins 1 and 2 of the 555 timer in the VIC (it'll be the only 8-pin IC you see inside.) You can also connect one end of the switch to a logic ground and the other to only pin 2 of the 555 if you want to reduce the number of connections you make to the IC. You can also put the tie point for the switch to the side of a capacitor or a 1 megaohm resistor that ties to pin 2 of the 555.
Okay, thanks. I basically want to be able to do a hard reset in order to run some cartridge ROMs that have occassional problems with a soft reset, so it sounds like your solution would be better....
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 »

Oops - I used the one on the user port :oops: Never gave me any trouble though.
6502dude
megacart
Posts: 1581
Joined: Wed Dec 01, 2004 9:53 am

Post by 6502dude »

Maxim has a nice little 3 terminal reset device that will provide a simple solution with minimal part count.

http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2787

There is an application note on the web page.

Some manufacturers will provide free samples :)
Image Mega-Cart: the ultimate cartridge for your Commodore Vic-20
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Yeah, I've been using an user port and/or IEC reset button for 20 years with various C64 and VIC, and although you may have to push the button for a while, I haven't observed any permanent damage. However, I know you should not have it pushed too long, as it could cause damage.
Anders Carlsson

Image Image Image Image Image
User avatar
ral-clan
plays wooden flutes
Posts: 3702
Joined: Thu Jan 26, 2006 2:01 pm
Location: Canada

Post by ral-clan »

carlsson wrote:Yeah, I've been using an user port and/or IEC reset button for 20 years with various C64 and VIC, and although you may have to push the button for a while, I haven't observed any permanent damage. However, I know you should not have it pushed too long, as it could cause damage.
Oh really? I didn't know that you could actually damage your hardware by pressing it for too long! :o
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

So I've heard at least. Probably due to loading some circuit too long. I don't know how long is too long though - maybe 20-30 seconds or more.
Anders Carlsson

Image Image Image Image Image
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Re: Reset switch

Post by Boray »

saundby wrote:A better way to do it is to use the RESET circuit that's built into the VIC.
Is it a better way to make changes to the vic-20 itself??? I don't think so! I've used a couple of different reset buttons, on the serial port and on the expansion port. No problems ever...
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
saundby
Vic 20 Enthusiast
Posts: 166
Joined: Wed Feb 22, 2006 11:55 pm
Website: http://saundby.com/
Location: Gold Country, CA

Re: Reset switch

Post by saundby »

Boray wrote:
saundby wrote:A better way to do it is to use the RESET circuit that's built into the VIC.
Is it a better way to make changes to the vic-20 itself??? I don't think so! I've used a couple of different reset buttons, on the serial port and on the expansion port. No problems ever...
If you like, you can do it with one of the expansion ports, and put a simple debounce circuit on the switch. But, to be honest, a bit of soldering on a 555 is not much of a risk to your Vic, it's a pretty robust chip. If you don't want to solder, you can use a pair of micro-clips. Find a ground for one side of the switch, and clip the other to the resistor or cap on the same side that ties to the 555 pin 2. Next time I have a Vic open I'll shoot a pic and post it of where you can tie in.

If you use a continuity checker to find the other tie points, make sure it's 5V or less.

I suppose it would shock you that I drill a hole in the Vic-20 case for the switch, too? :P
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Re: Reset switch

Post by Boray »

saundby wrote: I suppose it would shock you that I drill a hole in the Vic-20 case for the switch, too? :P
Oh yes, and so unnecesary and so much extra work...
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
saundby
Vic 20 Enthusiast
Posts: 166
Joined: Wed Feb 22, 2006 11:55 pm
Website: http://saundby.com/
Location: Gold Country, CA

Post by saundby »

Boray, I'm not sure why you're so down on my way of doing things but here's some explanation that may help you:

The reason you want a debounced switch is that if you get a signal that's less than two 6502 clock cycles long the Read/Write and SYNC signals will be hosed. It's easy to get signals off many switches that'll give the kind of garbage on a release that will cause this. Normally the solution would be "push it again" but for some switches this just leads to more glitches and more frustration.

Also, switches change across their lifetime. A switch that starts out good can get wear and oxidation on the contacts that will cause more switch noise as it ages.

So, it seems to me, if you're going to bother to put a switch on why not do it right? Either add a bone-dead simple debounce circuit to it or better yet connect it to the circuit that the Vic already has. Why do I consider this better than going with a connector?

Because those connectors are important for other things. Why should I add the additional resistance of another pair of connectors to the chain through which I'm doing I/O as well as the extra capacitance of the longer lines? And if I'm going to avoid that by soldering to the tops of the fingers, why not solder someplace else in the Vic that's going to get me better results and is not significantly more risky to use a soldering iron?

The reason I recommend doing the things I do when other things "mostly seem to work" is that there are times when those things don't work and they don't bother to explain themselves. Things just start "acting strange" or "just die." I don't know about you, but I don't want to go through that with _my_ Vic.

And when someone bothers to ask about doing an electronics mod rather than just jumping in it's usually because they're equally concerned about the reliability of their system. When I answer I try to take into account that concern as well as trying to keep things simple enough for hobby work.

If your switch works for you, Boray, I'm glad of it. But be aware I've known plenty of people "back when" who took Vics with 25 less years of wear and tear on their hardware who slapped switches into them, then went back to using the power switch because their reset switch wasn't reliable. In my view doing resets with the power switch is a heck of a lot more wear and tear than a bit of soldering. So I don't see the risks of a little solder as being all that great at all.

-Mark G.
6502dude
megacart
Posts: 1581
Joined: Wed Dec 01, 2004 9:53 am

Post by 6502dude »

I favour the reset placed in Vic-20 chassis route.

This is what used to do in the mid 80's.

However I like the DS1813 version.

BTW, reset from a switch, without proper debounce circuit, is a pretty horrible thing to look at on a scope.

A simple resisitor / capacitor / switch arrangements will work.

But again then, wood screws can be installed with a hammer. Neither is the best solution, sometimes it will get the job done, and results will vary. :lol: :lol:
Image Mega-Cart: the ultimate cartridge for your Commodore Vic-20
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

Mark, You are of course allowed to do whatever you like with your vic-20 and also to recommend others of doing it. I just think it's much simpler to buy a din plug and a button and plug it into a serial port (which you usually have one free anyway).

Btw, I think your point of not adding load/resistance is a little strange. Wouldn't your cable do exactly the same? My old reset-button that I'm not using any more (because there is a reset button on Schema's disk util cart) is not longer than the din plug itself.

/Anders
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
saundby
Vic 20 Enthusiast
Posts: 166
Joined: Wed Feb 22, 2006 11:55 pm
Website: http://saundby.com/
Location: Gold Country, CA

Post by saundby »

If you connect up as I recommended, then the resistor isn't really necessary--but it doesn't hurt, either. You'll want to make sure the value of the resistor is low enough that you'll reliably get a low signal on the 555. A better solution is to insulate things where there's a chance of shorts. A favorite method of mine is to paint the connections with a couple of coats of clear nail polish if you don't have heat shrink tubing on hand.

If you're running the switch leads straight to the /RESET and ground lines at one of the ports then it's worthwhile to include a resistor, since there's an increased chance of problems with other lines, and the inline resistor will help debounce the switch a bit if you combine it with a capacitor in parallel across the switch.

At any rate, just about anything beats a bent paper clip... ;)

-Mark G.
Post Reply