magazine logo
Welcome to the official Attitude website - Europe's #1 C64 scene disk magazine
Switchless Warm/Cold Reset For The C64
by MtnBuffalo/Triad

Turning the Commodore 64 off and on every time it needs to be reset, may eventually cause the power switch to malfunction or even put unnecessary stress on the fragile chips.

Because of this, people have been installing reset switches for years using a momentary contact that grounds the input of specific chips (e.g. the board side of resistor R50 in older versions of the Commodore 64 and the anode side of diode CR5 on the short boards). This little trick will do a so-called Warm Reset which clears any BASIC program stored in memory and resets the computer back to the opening blue screen.

However, if a machine language program is running from disk, a simple Warm Reset will cause the screen to freeze, lock up the computer and the program will not be removed from memory.

To circumvent this problem, a Cold Reset is needed which clears the machine language program and resets the computer back to the opening blue screen. Thus, a Cold Reset works almost like flipping the power switch off and on.

The Hardware Solution By Ray Carlsen

To do a Cold Reset, Ray Carlsen (of CARLSEN ELECTRONICS... a leader in trailing-edge technology) discovered that if the /EXROM line of the PLA chip is held LOW (0V) for a little longer at reset time, the machine language program screen will clear and the computer will return to the blue start screen.

The machine code program will still be in memory, but it can be overwritten with new data. Ray has implemented a Cold Reset switch using a hardware based solution using a resistor, a diode, a capacitor and a transistor. The circuit is then connected to the /EXROM line and controlled by an external switch drilled into the case.

Ray's reset circuit is a very nice solution, but I was thinking that maybe it could be over-engineered a little... like with an ATmega 328 processor running at 16MHz! Well, lo and behold, this is exactly what can be achieved with an Arduino Pro Mini.


The device costs around 2-3 US$ (including shipping from China!) and has a size of only 33 x 18 mm. It has numerous digital and analogue connections which can be programmed as inputs or outputs. In other words, it is perfect for making a Switchless Warm or Cold Reset solution for the Commodore 64.

Using the device for doing a Warm Reset is not new and has been described by vimfuego on Lemon64. However, using it to do either a Warm or a Cold Reset, depending on the duration of a RESTORE key press, is not something I have seen before. So I had to make one!

Functionality Of The Switchless Reset Switch

The reset function should be activated by pressing the RESTORE switch, hereby making it switchless as no holes need to be drilled into the case of the machine! If the RESTORE button is held for 2-4 seconds, the machine will do a Warm Reset. If the RESTORE button is held for 4-10 seconds, it will do a Cold Reset. If the button is held for less than 2 seconds or longer than 10 seconds, nothing will happen.

Implementation

The Switchless Warm/Cold Reset device was implemented in a Commodore 64C (Assy 250469 Rev. 4). The location of the RESET line is a bit different on the newer short boards compared to the older breadbox versions. So care must be taken if a similar solution is implemented on one of these boards (now you've officially been warned!). In the C64C, a wire was tack soldered to the anode of diode CR5 (RESET line). A second wire was soldered to the /EXROM line from the PLA which is the largest chip on the board. Two wires were soldered to Ground and 5V and used for powering the Arduino. Finally, a wire was soldered to the RESTORE signal coming from the keyboard. It's the only button that has its own direct connection as the rest of the keyboard is configured as a matrix.

All five connections were then soldered to pins on the Arduino. The RESET and /EXROM wires were connected to two digital pins (Pin 3 and 4), the Ground wire was connected to ground and the 5V wire went to the Vcc pin. Finally, the RESTORE wire was connected to an analogue pin (Pin A0).

The RESTORE line usually has an 'idle' voltage of approximately 5V (HIGH) and drops to a few millivolts (LOW) when the key is held down.

Thus, all the Arduino should do is monitor when the RESTORE line goes from HIGH to LOW, measure the time it is held low (due to a key press) and stop the timing when it goes HIGH again (the key has been released). The duration of the key press will then initiate either a Warm Reset, a Cold Reset or do nothing.

Well, no one said it should be that easy, right? For some unknown reason, the C64C motherboard I was using yielded some strange voltage measurements on the RESTORE line (which I discovered way way later...). I kept getting 1.2V without the switch being pressed which would be a LOW if a digital input was used on the Arduino Pro mini board.

I therefore had to use an analogue input (Pin A0) to accommodate the lower idle RESTORE line voltage on my C64 motherboard. The analogue input simply converts the input voltage to an integer value between 0 and 1023. As long as the RESTORE line idle voltage is above approximately 0.5V, the functionality of the device is the same and only a few more lines of code were added to handle the analogue input.

The Arduino code is pretty much straight forward. A small debounce function was included to filter the initial transitions/noise of the analogue reading when the RESTORE key is being pressed. If the device is doing a Warm Reset, the RESET line of the motherboard is kept LOW for 200ms before going back to HIGH. If a Cold Reset is being performed, the RESET and /EXROM lines are both pulled LOW simultaneously. Both lines are then kept LOW for 200ms before the RESET line is set back to HIGH. To wipe the machine language program screen the /EXROM line is kept LOW for another 300ms before going back to HIGH and the computer resets just like Ray Carlsen promised! Easy peasy!

Testing It

I did Warm and Cold Resets of a bunch of games. It turned out that especially three games (Commando, Creatures 2 and Montezuma's Revenge) could not be reset using Warm Resets. Commando would just give me a black screen while the music would keep playing. Creatures 2 would fill the screen with rubbish characters and Montezuma's Revenge would simply reload and nothing else would happen.

Doing Cold Resets, all three games were cleared and the machine returned to the blue startup screen. Complete success!!

Known Issues

During testing, no issues arose while using JiffyDOS, Commodore 1541 Diskette drives or SD2IEC devices. However, after implementing the Switchless Warm/Cold Reset Mod, a few issues did surface. Game carts (EasyFlash games and some game carts) would not load. Using a 1541 Ultimate II would exhibit strange behavior with the Arduino installed. However, this particular cartridge has its own reset switch so there is no real need for an extra reset option.

Making Your Own

The reset solution is based on a 16Mhz 5V Arduino Pro Mini and tested on Assy 250469 and 250425 motherboards. It should also work on all other C64 versions as long as the wires are connected to the correct spots (RESTORE, RESET, /EXROM, Ground and 5V) which differs among board versions.

Ray Carlsen uses the RESET line of the inside leg of resistor R50 on all long boards (250407, 250425 and 250466). However, using that RESET line on 250425 boards (and presumably all other long boards) with the Arduino reset switch, only Warm Resets would be possible. To also enable Cold Resets, the RESET line of the User Port (pin 3) must be used.

Resetting an old 326298 board is a little more complicated and I really don't recommend fiddling with these rare boards.

The code for the Arduino Pro Mini based Switchless Warm/Cold Reset Solution can be freely downloaded from: www.triad.se/media/arduino.txt.

Feel free to use the code for making your own switchless reset devices and give kudos to TRIAD if you like it!

MTNBUFFALO/TRIAD

   Add/view comments on this article (comments: 0)

SCENE GROUPS
 
OPINION POLL
Do you believe we are
able to cope with
releasing "Attitude"
on a regular basis?

yes no

 YES: 283 (70.75%)
NO:117 (29.25%) 

NEWS COMMENTS

ART COMMENTS

STATISTICS
all visits:

visits today:


website started:
23/09/2004
 
Official Webpage
of Attitude
Copyright 2004-2018
 
DJ Gruby/TRIAD