How-To: C64 Arduino based Restore Key/Four Kernal Switcher/Hard Reset

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi everyone welcome back to Adrian's Commodore basement okay that was a joke I know lately it seems like I've been doing a lot of Commodore videos it just seems like that's what I've been focusing on lately when it comes to my projects but believe me as you can see here I have Cape Rose and I have all sorts of other cool machines that I will get to on the channel but right now yeah I'm in a rut of Commodore stuff and I'm just finding it so fun so today's video I'm going to be working on a Commodore 64 or so we're jumping around a lot so with this Commodore 64 I'm currently building this machine up it's essentially an amalgamation of lots of different c64 parts and it's gonna turn into my sort of go to Brown breadbin machine I have various machines that I use periodically and I like this one it has a really nice condition case and the keyboard is in good shape so I'm just doing the final touches to make this thing perfect for me let's dig into what that is first though I want to introduce you to my creamy dreamy Commodore 64 now I had this on my Twitter and you may have seen it there but it's essentially a Commodore 64 mounted in a vic-20 case with a 64 C keyboard I love this particular combination and if you can believe it the 64 motherboard just screws right into this case as if it was designed for it which is actually just the fact that the breadbin 64 is an evolution of the vic-20 case and the standoffs are in exactly the same position the only issue you have with these cases with a vic-20 case in the 64 motherboard is the cartridge slot has a little bit of a lip so you cannot plug a 64 cartridge in but all the other openings are in the correct position where you can plug everything without issue the final step of preparation of the beige 64 that I was just showing you is already done to this machine so I want to demonstrate what I've done here and then I'll show you how to do it on the beige one so when I turn this computer on you're gonna know something interesting the power LED won't come on immediately the screen will flash which is normal but there'll be a slight delay and there it is but the computer still boots up normally it just took maybe a little bit longer than normal so like I mentioned before when you're running the stock kernel ROM which is what this is disk i/o is really slow now if we load a program off this sdie see right here and I'm gonna load portal you'll see it's gonna take quite a while all right so if finish loading and loading took this many seconds now if I run the program works fine there's the game portal excellent does a little bit of additional decompression at this point but it is completely loaded from the SDI EC this is a modified jiffy das kernel ROM it says jiffy dass here but it has the rainbow which is a amalgamation of jiffy das and dolphin das but essentially has the jiffy das disc routines for fast loading off of disk drives with the great roms or the SD IEC so if we load the same game portal that took that long to load that is the difference in speed it's absolutely shocking how much faster it is look at that so typically when you have jiffy dots you have to remove the kernel rom and you install a little circuit board that has a new prom and then there's a little toggle switch where you drill a hole inside your case and that allows you to switch between the two ROM so you turn the computer off you flip the switch one way you get standard stock rom you switch it the other way you get jiffy dose the reason for that is some games are actually incompatible with jiffy dots you try to load them off the disk drive and it will just hang or crash so you really do need to put that toggle switch in now my problem is I don't like drilling holes in cases and there's something else personally I like to have reset functionality in my c64 s as well and that requires a separate hole where you have a little button you push and then you have to build up a little circuit that does a hard reset rate Carlson has a good diagram of how you can do that but again that's two holes drilled and I don't like doing that so are there are some jiffy dos roms with the adapters that you can find online that use the restore key to basically hold this down when you turn the computer on to select which ROM you're gonna use I think if you hold it you get the stock rom and you can turn the computer on without holding it you get the jiffy dos ROM now that's all well and good I just don't have one of those adapters but what I do have is a bunch of these this is an Arduino microcontroller just when I got off eBay I think you can find these for a little bit under $2 now and what I did is I wrote some code that runs on this that allows me to not only perform hardware resets on the commodore 64 also to select between one of four different kernel rom images and that is all done by using the restore key and it uses the power LED to tell you what it's doing so let me demonstrate exactly how this works right now the computer is off and when I you'll notice the power LED comes on and it blinks once that's telling me that currently the computer is using ROM image 1 which I have currently burned as the stock rom here we are running the game hero and if I want to reset to get out of this all I need to do is hold down the restore key until the light blinks and then when I let go the computer will do a hard reset now to select between the different roms you push restore and you hold it and it will blink once but instead of letting go you wait till blinks again like - and if I let go now what it does is it resets the computer and switches the ROM and like I said earlier I have four different roms and if you just keep holding down restore it will cycle through one through four and then you let go to pick which ROM you want so I'm gonna move from Row 2 which is this one to ROM 4 so we got two three and four and I let go and now I'm at Jaffe das which is a modification of jiffy das when you switch between ROM images it then stores the ROM you have selected into the EEPROM built into the microcontroller so when you turn the computer off and you turn it back on it will automatically resume back to the ROM you were using before if I want to go back to the stock rom I will go from four to two one her flash there's one I let go and I'll be back at the stock rom so all of that is possible with this little Arduino board we're gonna need to a few things and let's get right to it here's the bread bin I want to do the modification - let's open it up so this particular board is a 250 425 I like this particular layout of the c64 it's kind of one of the later bread bins I have obviously outfitted this with lots of heat sinks because I like to do that to prolong the life of my computer The Vic 2 gets really hot so that gets a large heatsink I stole off a video card the SID also gets pretty hot so I put a chunky heatsink on that and then the other ones the PLA and the processor these get little he thinks as well of course a prerequisite for doing this modification is you have to be able to remove the kernel ROM the kernel ROM on all c64 is marked 901 two to seven it's the center chip on these 324 pins on your c64 this chip may not be in a socket and if that's the case you're gonna have to remove it and install a socket I'll put a link in the description for one of my other videos on my technique for removing a chip let's remove this chip from here it's just sitting in the socket all right now right off the bat I noticed that this socket is an original single wipe piece of crap' socket so hopefully this doesn't cause any issues you will need to remove the board from the case and then desolder that metal shield it's behind the motherboard that's because you'll need to add a couple extra pins here and there to connect the wires to also if you're going to be installing a socket you'll need that as well so let's look at all the parts we're gonna need to do this modification of course we're gonna start with the Arduino microcontroller it's not really important which one you get but I'll put a link to these ones which are very inexpensive and I like them because they're so small so you start with that we're gonna need two sockets we're gonna need a 28 pin socket and we're gonna need a 24 pin socket please know that these need to be the rolled pin type so you see how the holes are round on these and the pins are round it will not work with the other type of socket the flat type because the way we're going to be making the adapter with these two sockets you'll see shortly that it has to be this type you'll need a red LED to replace the factory LED and the reason for that is the factory LED it's a really old and super dim one it will work but it will be so dim you'll hardly be able to see it so I recommend just getting a modern LED replacement for the LED we're gonna use a 460 ohm resistor to bring it down from 5 volts we're gonna need some wires these have DuPont connectors on each end and I think these are about 12 inches or 30 centimeters long these are also available from eBay very inexpensive and we're gonna need some pin headers this is for soldering on to the Arduino these are the angled type so these don't stick straight up I like these just because they're lower profile we're gonna be connecting these wires with these DuPont connectors to the pins and if you use the type that sticks straight up the wire will stick up and just take up a lot of space in the case we're gonna need some zip ties just to kind of keep things neat you will need an EEPROM I use a 27 C 256 this is enough to hold the 4 kernel images and then of course you need an EEPROM programmer to program the EEPROM I'm using the TL 866 mini Pro these are very inexpensive available from eBay I'll put a link to all this stuff in the description of course you'll need to program the Arduino as well so you'll need a computer to do that plus something to plug into it there's a million videos on YouTube of how to do that it depends on which are doing you're using so I'm not going to get into the specifics of that well let's start by building the adapter so these are the two adapters 24 pin and 28 pin essentially the kernel ROM on the c64 is a 23 64 now there are no eproms at least that I know of that I can buy to program to just drop in replacement so if you notice I have these lined up a lot of the pins are actually quite similar between these obviously there's four extra pins here at the top but you notice a seven and a seven match up in fact all of the pins on this side one through twelve and three through fourteen completely matched so if I take this socket which is the twenty eight pin and I plug it into the 24 then it'll carry all of the signals that the chip that EEPROM needs right up from the motherboard it becomes more complicated on the other side though and if you notice pin 18 is a 11 but on the EEPROM this is a chip enable pin and a 12 is also similarly funky where a 12 has moved up here and on this one it's a 11 it was that one that was moved up from the chip enable also the VCC pin it's just 24 would be going right into a 13 and we need that address line to be going to the Arduino so the good thing about these types of sockets is we can cut these pins so you see there's a little fat part there at the top that's a perfect spot for us to solder a little wire to if we need to jump a pin say from this bottom connector up to somewhere else on the top and then where we don't want the signal to go from the motherboard which is this bottom one up to the top we could just cut these little legs now normally when you push these together I only have them just lightly fit together then the pins actually go quite deep into the socket you would likely end up with contact between the cut leg the bottom of this fat part and the socket so what you do is I push this in partially about that much and then I solder these pins right into the socket and that keeps them from accidentally making contact and leaves enough room for the wires this'll make sense once we kind of wire this up but the way we do this is we would just need to cut this pin 20 because we don't want seee talking to a 11 and then we run a jumper wire from the bottom here on that pin which would be a 11 up to the correct pin on this socket so it would go from here to about there and we just do that for these few wires that need to change around and then we have a working adapter so you see the X's that I've marked here these are all pins that I need to cut on this socket and I'm just gonna cut these off I'm going to cut them off like that so see how it's missing now just the fat part is there so that was this pin as you can see there matches this so the first thing I'm going to do is I'm going to work on the power so VCC is on pin 24 on the 24 pin socket and it needs to go to these two pins on here and what I like to use for this it's going to be hard to see are the little trimmings from when I cut resistors and I basically I'm gonna stick this into pin 24 like that and I'm going to solder that in and then I can just form that around and actually connect it and then I just formed the lead so it's touching that pin and we're gonna solder that on all right and then I have another little lead just sort of resting on there it's probably gonna fought fly off as soon as I try to solder this so there we go so right at this point the VCC is all connected up so at this point we've done VCC there's really just a 11 and a 12 that we need to worry about I'm gonna use this super thin wire here to go between a 11 which is this pin right there and a 11 on the bottom socket so I like this wire it's sort of bodge wire but it's it's pretty it's flexible but it's malleable so if I wrap it around a pin it shouldn't move shouldn't move as it flies right off sometimes it helps just to press something on there while you're soldering just to make sure it doesn't jump and move while you are doing the work there we go so that's a 11 on that pin and that's going to this pin right here which is the other a 11 on the top socket so I'm just gonna bend this wire into place okay there we are okay so I just soldered a pin onto there that's the a 12 pin on the bottom socket and that goes up here to this pin on the EPROM so that's over here on the other side so I'm just gonna kind of bend this and form it into shape let's take a look at what I just did that's a good solder joint so let's just bend this wire here I just had a thought before you attach these wires probably good idea to go through and solder all these pins on it's because the wires get in the way and I need to sort her around them so luckily they're malleable so I'm just I'm gonna have to do that but so to do this you need an angled tip on your soldering iron you kind of gotta push the socket together so it's not not all the way in but just enough that it's touching and then you go through and you solder basically I'll show you close up it's gonna be hard to get this on camera but you see I did that one pin there so it's actually soldered into the socket even though it's not pushing it all the way it's now making good contact and you got to go through and do this on all the pins so I just did another pin but I'm really struggling to do it on camera so I'm gonna need to take it off I'll do the rest of these off-camera but if you're having trouble soldering this you just got to do trial and error okay we're not quite done so right now I have all the pins soldered on that side and on this side I have all the pins that are soldered that are cuts and the last thing we have to solder is I need to connect the ground to this floating pin right here this is the CEO or chip enable pin so I've cut a little length of wire and let's just connect this up all right so since I'm filming I'm just really struggling getting the wire to stay so I put a little piece of tape there to help so I'm gonna loop that down so it's not in this opening and I'll show you why in a second all right so it's not the best but it will do okay so we're nearly done with the socket I just need to connect wires that are gonna go to the Arduino so we're gonna use ground VCC a 14 and a 13 and I use this DuPont wire and I just cut the end off and we're gonna be running this through the socket and soldering directly to the pins so this socket goes into the motherboard with a notch facing up so I like to run these wires right through the middle of the two sockets like this and then we're gonna loop around and we're gonna connect to the wires directly to this and then I can pull it tight and use a zip tie in the center to kind of hold these wires steady okay I really struggled to do that on camera I kind of made a mess of it but those two wires are soldered on there so now we're gonna move on to the power wires and you can obviously solder them into a different spot there's power right there and there's ground over here so just you know hook it hook it up to the two of the wires poke it up to the two pins that'll be the easiest for you okay so I've soldered the black and the white wire so so the white wire which is five volts I'm getting off this pin right here and a member of that paint and that paint are coming together and then the black wire four I'm getting from there and then I have the wires just sort of come out at the bottom and I'm gonna put a zip tie right in the middle here to hold them down alright so there's the zip tie that's how I do it I sort of tuck it in under there it doesn't interfere with the chip or the socket when it's in the middle like that so I would recommend you do it that way as well I recommend you check your work with a multimeter at this point so that's how you make the adapter socket I've made a few of these already it's a little bit fiddly and I gotta say it's really hard to do with the camera I'm much faster when I do it without the camera in the way but you do these and you'll get it down to do one of these yourself it's really not that difficult you just have to kind of think logically by looking at these two pictures to see which pins you got to connect up together let's turn our attention to the Arduino so essentially this printout here shows which eye opens I'm going to be using and that's basically three through eight so you need six pins for that and then the program that you got to connect to here and then we're also going to power from those pins and that's another six so you just cut these little angled pieces and connect them up to the board line them up in the correct spot and then I'm gonna or soldering those on and my trick is you solder one pin only you melt it again and then you can reposition the pins cuz right now like this right now these top ones are started on quite crooked so you put your fingernail on the black plastic part and you melt the one blob like that and now when we look see nice and flat and correct angle as well now I can do the rest of the pins all right while we're at it we're gonna work on the LED when you use these DuPont connectors as well so I'll just cut them off just like I did the other ones on LEDs the shorter leg is the negative or goes to ground so I will be connecting the LED to one of those and I'm gonna use the brown wire here for ground just just so I can remember more easily later okay so the LED is connected I'll just trim the lead to be exactly the same length as the other one and I put the LED on the positive lead it's always a good idea to put heat shrink on there to cover up these leads so we're gonna use this much heat shrink okay one power LED ready for the case alright so let's back to go back to the sixty-four so the power LED you're not gonna need now you will need a little bits of plastic that are on here I'll show you that in a second you gotta take them off the original one you can leave this plugged into the case if you so desire but I take it off now taking a look at this code snippet again we have three things we got to connect to the c64 motherboard we have to connect the pin eight on the Arduino to the restore key line we have to connect pin 3 to the X ROM line and pin seven to the reset line now where you find those it's probably going to vary slightly from one 64 to another so you may have to look online maybe ray Carlton's website if you look at his information on how to set up the hard reset circuit it'll tell you where to connect it to each board type but on this particular artwork here the 254 to 5 the X ROM line is right here it comes off the PLA chip and I have actually put a little pin header on there already up here by the user port that's the reset line it's the third pin over and I've looked on a couple different types of c64 and there's always a hole there so you can just stick a pin header through there and that's all be connecting the reset line so this is the keyboard connector and this pin right here it's the third up so there's a pin of a blank and that's the next pin that's the restore key now it has a dedicated line because of the way it connects directly to the non-maskable interrupt line on the processor so it's easy to find where it goes on the board it's not like these other ones which are matrix so just tone that out so on this board the reset line which comes from that pin can be found on this edge of our 41 and also on the left side here of C 38 now on some of my board C 38 goes between this pin and there's a pin under the middle and that leaves this one open so in that case I can just put a pin header right there okay so at this point all we have left to do is program the EEPROM and program the Arduino the way our program Arduino is I do a little FTDI board from China it's pretty simple with these you just connect these pins straight through and I will connect up the power make sure you have this set for 5 volts now this has never been used so they always load this with like a little blink program which is why it's blinking alright so load up my code into your arduino ide make sure you have the serial port set right in the type of arduino and we're gonna simply just click upload see it uploading here and it says done let's program the EEPROM now ok so if the mini pro plugged into the computer and the EEPROM is ready on the machine here I have my c64 for colonel file right here I have this setup for the write a prom here it's a Hitachi 27 C 256 G let's open the kernel file load this into memory there it is let's put the chip into the programmer will do a quick blank check because I'm not sure if this is definitely blank and it is and program alright all that's left is to put all the parts together so let's take the EEP and install it into the socket all right so the EEPROM is in there let's try to clean that thermal compound out of those sockets sprays little IPA a little bit of crap in there should be fine it's non conductive all right so this just pushes down and into the socket next up we're going to start connecting our Arduino to things I made the white and the black wires the ground and VCC our power LED connects you connect one wire to ground so that's the brown wire in my case and then if we check the little list here power led is pin four to pin four then we take the two address lines and I don't remember which is which there's a 13 and a 14 it doesn't really matter if you have them backwards it's just the roms will be out of order when you switch those go to pins five and six like that and now we have three more pins to connect and I have floor wire so we'll just peel one of them away it's according to my sheet pin seven is the reset line so that goes up to here pin three is X ROM and that connects to this pin header right there and the last one is the restore key which is very essential for the operation of this thing and if you remember on my computer I have this little female there so female female isn't gonna work so I'm gonna need to find a little pin to stick between these all right everything's connected and it looks horrible but we'll be able to clean this up in a second I just want to test this out okay everything is connected I have the keyboard here so we can test the restore monitors on Arduino is ready to go turn the power on we've got NTSC so the power LED is working but we're not getting anything on the screen let me hit the restore key and see if it flashes the LED it does so the Arduino is working restore key is working but we're not getting anything on the monitor okay so I'm pretty sure the problem I'm having right now is the socket if you recall I pointed out that the socket that was on this machine is a really crappy one that Commodore used and I've had problems in the past where those would not accept the round pins that I used on this adapter I can test that out with the multimeter and then if I find that that's the problem I'm going to need to replace that socket so with the three ROM chips pretty much all of the signals to go to each pin are the same between each socket except for the chip enable pin which is pin 20 I should be able to tone out continuity like for instance this pin right here is data line three and data line three will be available on all of these so if I touch here and here so we're getting continuity and let me check here getting continuity so I'm just gonna go through so data line four has no continuity so I bet you if I push down hard on the socket yep see it started working and that's part of the problem is watch this this this is pushed in really hard on the board but I can just lift it right out like that it's that easy to take out of the board the problem is these sockets they're just not good at accepting anything but the flat IC pins so it's time to change that socket out so I came out really easily my strategy with when I remove sockets is to desolder as much of the solder on the bottom as I cam first then I cut the socket in half with some snips and that essentially allows me to work on getting each half out without needing to fiddle around with the entire socket all at once luckily it came right out this time I didn't have to do any hot air that's first actually for me normally getting sockets out is a huge pain I'll of course be installing a new rolled round pin socket because these are just so much more durable and better actually than the regular ones and that goes right in so this will make good contact with my adapter so the new socket was a great fit when I pushed my adapter into it ahead of really firm in a deep connection and went all the way in so there should be no more problems with bad contacts okay let's power this up oh yes there we go so if I hold the restore key down so see the power LEDs over here hold down restore but one flash two flashes I let go there we are so let's just do the final cleanup I like to mount the Arduino right on the RF modulator so I put a little bit of this double-sided 3m tape right there basically stick that right there you know I hang off the edge so that the pins aren't going to contact the RF modulator but that just sort of keeps it out of the way so here's a close-up of the stack in the kernel socket and yeah it's a little high but because the breadbin has a lot of room inside there's no problem with using this and people will complain I don't cover the UV windows but there's really no reason to you need a very specific wavelength of light to erase an EEPROM even sunlight doesn't do it so there's no worry of this getting erased over time and you I mean even if it did I could just write a new one so there's no real issue there it does always worry me that see these types of connections aren't very firm so I'll usually take a little bit of tape and just tape around that just to make sure it stays connected and then let's just tidy these wires up a little bit once I've been inch the shape that they ran for a little while they basically stay but we'll just use and we'll use this zip tie what I like about having the Arduino right here is it's very easy to reprogram it you just pull these wires off and then you can plug your programming tool right into these pins and you can add or change the code anytime you feel like it the final step is replacing the power LED with the new one now I had this out earlier but I put it back in just so I can show you how to take it out you might wonder how to do it but it's actually not that hard so let me show you what to do when you look at the back side there's gonna be a little retaining ring that you have to lift up no I don't have this on fully but there's the ring it's this little plastic piece here you might have to pick at it or use a small screwdriver but it's pushed over the plastic that's right there so you just pull it up and once you lift it up then you can actually push the LED so I'm pushing it from this side through and into the case see like that so now the LED is out and that little retaining ring is still on the LED this little plastic trim piece then pushes up out the front of the computer there it is well you need to do is take the LED the original one and slide that retaining ring off so there's the LED so there are the two parts we need and then we take this little black piece and we have to push it through the front of the case again that's the trim piece and then we're gonna push the new LED through this hole I've got it clicks into place so now we're gonna slide that little retaining ring back over this now helps to hold the little trim piece on the other side we need to slide this over it essentially prevents the LED from being pushed inside the case so while that ring is on there it holds the LED firm let me flip it over and show you how it looks so the new LED it's firmly there and if I push on it it doesn't go back into the case because that retaining ring kind of holds it all in there I want to turn the power switch on we have a nice bright red LED now it's actually much brighter than the original and not not enough true civ and horrible bright so I like it alright so that's it this video was really long I hope you found something useful in it and I'm very curious if you do end up building one of these boards for yourself using the Arduino and my code I would love to hear your feedback I'm very open to feedback when it comes to the code on the Arduino and both the way I made the adaptor if you have some tips and tricks on how to do it more easily or better I would love to hear from you you can look on the about page for my channel to find my email address if you want to talk to me outside of the comment system otherwise put your comments and questions in the comment section below I hope you found this video interesting and somewhat useful and if you liked it give me a thumbs up and if you didn't you know what to do thumbs down of course you can subscribe for more videos and we'll see you next time thank you very much bye okay let's see where we are right now so on this side all of the pins are soldered in hey Google pause [Music]
Info
Channel: Adrian's Digital Basement
Views: 69,005
Rating: undefined out of 5
Keywords: Commodore, DIY, Retro computer, vintage computer, C64, Commodore 64, Arduino
Id: GPq5xnJRw2w
Channel Id: undefined
Length: 34min 30sec (2070 seconds)
Published: Sat Apr 27 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.