Commodore 64 replacement PSU project - Page 1
Forum section: electronics / projects

author: Sigmoid
author_rank: Frequent Contributor
timestamp: August 01, 2013, 07:14:22 pm
content: I absolutely love vintage computers, particularly the good old C64... Now as any enthusiast will say, the weak link in these machines is the terrible factory PSU, which was seriously undersized for even a barebones computer, and can cause serious problems with new, demoscene-made peripherals that draw a significant amount of current.So since I found none of the available solutions quite good enough, I decided to design and build a replacement PSU. Yea I know it might not be the easiest project to start with. So first I'd like to ask for some insight in planning out the high-level, big black box design of the unit.The requirements are:Input voltage variable or switchable between 110V and 240V+5VDC at 3A with floating ground9VAC at 1A, floating ground, ground independent from the +5VDC rail, with a frequency selectable between 50 and 60Hz, independent of the mains supplyThe galvanic separation of the two voltage sources is paramount to safety of the design. Many existing designs omit this in order to reduce complexity, but what they achieve is a PSU that is as hazardous to the hardware as the old faulty ones they aim to replace.The 9VAC frequency doesn't need to be particularly precise, we're just emulating the mains frequency. The c64 uses it for driving a rudimentary real time clock, and considering the average uptime of these computers, it doesn't need to be super accurate (nor do I think it would be even with a perfect 60.000Hz wave).Now one of the approaches I'm thinking of is a switch mode power supply, with two independent secondary coils. There would be a separate rectifier and buck regulator for each, and an oscillator for getting the 9VAC sinewave.The other approach would be to get one voltage first, and then use a DC/DC converter to get the separate rail. This seems seriously unviable due to the wattage required. A 15W, or even 9W DC/DC converter is prohibitively expensive.How should I approach the problem?Any good web resources on building switchmode supplies, selecting a good controller, transformer, etc.?

author: Rerouter
author_rank: Super Contributor
timestamp: August 02, 2013, 02:19:57 am
content: small thought, why is a real time clock drawing 1A? or are there other things the 9V AC rail is driving? and does any of this expect a sine wave or would a square or triangle wave suffice?

author: FrankBuss
author_rank: Unknown
timestamp: August 02, 2013, 02:52:26 am
content: If you don't have hardware for the user port which needs the 9 VAC, then you could just use some wall adapters for 5V/9V/12V (12V depending on your C64 version for the SID). Nearly no program used the realtime clock, even the integrated BASIC implemented its own timing based on the interrupt function for the keyboard, but you might just solder a 555 timer to feed the TOD inputs of the CIAs. Selecting between 50 Hz / 60 Hz would be not useful, because there are other hardware changes required for changing from PAL to NTSC.

author: amyk
author_rank: Super Contributor
timestamp: August 02, 2013, 03:00:23 am
content: Quote from: Rerouter on August 02, 2013, 02:19:57 amI believe the SID (sound chip) needs it for its amplifier.

author: FrankBuss
author_rank: Unknown
timestamp: August 02, 2013, 03:09:38 am
content: No, the SID needs 9 V or 12 V DC (depending on the type).

author: Sigmoid
author_rank: Frequent Contributor
timestamp: August 02, 2013, 01:26:39 pm
content: Quote from: FrankBuss on August 02, 2013, 03:09:38 am...which is, in turn, transformed and rectified from the 9VAC input to my knowledge.The point is, the power input itself is being used for power by several components. The frequency itself is being utilized to drive a RTC - naturally the PAL and NTSC versions expect different frequencies, that's why I'd like to design it as a selectable frequency.

author: ElectroIrradiator
author_rank: Frequent Contributor
timestamp: August 02, 2013, 02:22:39 pm
content: 1) Find two separate transformers with suitable secondary voltages for the jobs below.2) Use one transformer to generate +5V at whichever current required.3) Use the second transformer to generate +9-10V DC, regulated.4) Research and build a simple, switchable digital oscillator for 50 and 60 Hz operation, generating a suitable square wave with a 50/50% duty cycle.5) Look up some of the H-bridge driver ICs floating about. Use one of them to drive four power MOSFETs with your square wave oscillator, generating a 9/10V square wave at whatever load current you need (1A is easy).6) Experiment with running the connections from the bridge output through an RC filter to take the worst of the square wave edges. Should be possible to find component values, which work well at both 50 and 60 Hz, considering the 1A load current.If the input in the C= 64 has a bridge rectifier, due to expecting a connection from a mains transformer, then there shouldn't be a problem with driving it with a 'rounded' square wave signal in place of a proper sine wave. The clock function should also work on a non-perfect square wave.You will loose a bit of voltage amplitude across the resistor in the RC filter, which is why I didn't suggest using a fixed 9V voltage to drive the H bridge. Might want to consider some form of peak output voltage feedback to the DC regulator, to make the output amplitude independent of load current and RC filter values used.

author: Rerouter
author_rank: Super Contributor
timestamp: August 02, 2013, 02:24:38 pm
content: plain rectification is simple, can you foresee any issues with simply selecting between 9 and 12V, as that could just be a resistor reducing the gain of the isolated supply?you have 2 choices for isolation, 1 would be to have an isolated winding on your transformer, the other would be to use some form of fly-back and use a optocoupler fed by a zener to regulate the pre-modulated voltage, likely 15V in this case,you have an op amp oscillator spitting out a 50 or 60Hz square wave at a fixed amplitude, for a basic relaxation oscillator you will need a second op amp acting as a virtual ground for it at half the supply rail voltage,then have 2 more op amps, each driving a push pull pnp - npn pair, in standard non inverting configuration fed with the timing signal, with one inverted from the other, easily done with an npn transistor, so when one is pushing the other is pulling, and etc, causing your +- 9 or 12V while only using one voltage rail,

author: ElectroIrradiator
author_rank: Frequent Contributor
timestamp: August 02, 2013, 02:54:51 pm
content: Just checked the C= 64 schematic. If you *just* wish to power the machine itself, then the H-bridge driver I suggest absolutely *can* share a common rail with the +5V supply. This would alternatively drive the two '9Vac' outputs positive to ~ +9V compared to the common ground rail, which should be fine if both 'phases' are equipped with a suitable current limiting resistor. You probably won't even need a capacitor between the 'phases', as there are already filter caps in the relevant locations within the machine.Two potential sticky points:You may want to run the H-bridge from more than +9V DC. Not only do you want to compensate for the voltage drop across the resistors, but also for the fact that a 'peak' voltage of +9V may not quite be high enough, compared to the normal unregulated PSU voltages seen in the C= 64 when run on 9Vac.Secondly, then there may for all I know exist expansion modules for the user port, which actually do require a proper 9Vac sinewave to function.

author: Unknown
author_rank: Unknown
timestamp: August 02, 2013, 03:15:44 pm
content: I'm not familiar with the C64, but note that in general 9 VAC means 9 Vrms, or ~12.7 Vpeak. So you would at least need a +/- 13 V supply for the H-bridge.

author: ElectroIrradiator
author_rank: Frequent Contributor
timestamp: August 02, 2013, 03:29:57 pm
content: Quote from: alm on August 02, 2013, 03:15:44 pmTrue, but if you drive a rectifier bridge with something very close to a square wave, then the rectifier efficiency is very, very good. Meaning if you did use the 9Vrms peak value for your square wave, then the actual unregulated DC value across the filter caps would be higher than normally encountered. +9 is probably too low, though, considering diode voltage drops and whatnot.Just had a second glance at the schematic. It looks like in a pinch you may not even need a symmetric waveform at all. A single phase 0V -> +9V PWM signal on the PSU connector, pin 6, should do the trick. Put a 1A fuse in series with the current limiting resistor (should probably do that for the full bridge driver as well, if the bridge shares a ground rail with the +5V supply).Pin 6 drives all the important bits, like the power switch, the timekeeper signal conditioner and the voltage doubler for the +12V rail. The only thing missing from pin 6 is the fuse. Doing this may get the internal +5V regulator to drop out of regulation though, so the dual phase solution is probably preferable.

author: Sigmoid
author_rank: Frequent Contributor
timestamp: August 02, 2013, 07:23:10 pm
content: Hey thanks for the thoughts!Yes it is theoretically possible to share a ground between the two inputs, but it is somewhat dangerous.For one, the power switch on the computer only switches +5VDC, and due to the design counting on independent grounds, if you turn it off with a common ground supply, unintended currents will flow, and may damage ICs.For the other, if there is any failure or contact error - in the supply, the cable, the computer - that disables one power line but not the other, unintended currents will flow, and may damage ICs.

author: ElectroIrradiator
author_rank: Frequent Contributor
timestamp: August 02, 2013, 08:52:50 pm
content: Quote from: Sigmoid on August 02, 2013, 07:23:10 pmYou are welcome. Please note that:*) My first suggestion was for making a *floating* AC supply, as requested. Maybe that got lost in the commotion?*) According to the schematic I am looking at, then the power switch *does* interrupt both power supplies. Meaning the +5V from the external PSU, *and* the 9Vac circuits are broken at once.*) The PSU circuit looks dramatically like they ran out of (thermal) room in the external PSU, and decided to move some of the regulators into the main chassis. OK, they get the mains frequency counter in the deal, I guess.*) The two ground rails are already permanently tied together on the mainboard, as the rectifier for the 9Vac has its ground terminal connected to that of the +5V supply. They are not floating with respect to each other internally.There is nothing going on here that I can spot, except for 3x linear regulators running in parallel, one of them outside in the external PSU case, The three regulators are supplying different parts of the circuit. If there are sequencing issues between the different power rails, then just turning the machine on and off will kill it. I cannot see any way to guarantee which power rail comes up or goes down first.*) Due to the way the +12V supply works, then - unlike on the VIC-20 - you absolutely cannot just use an external DC supply in place of the AC transformer. In fact trying to do that looks slightly dangerous, as you'd end up with the SID chip missing one of its positive power rails. This has nothing to do with floating grounds or anything similar, though.Oh. You will kill components in the mainboard PSU, if you use a proper 9V transformer and you *don't* float both terminals. Maybe that is where the confusion stems from? IE. using a transformer and trying to share one connection with the +5V supply would be Bad(TM). But again, this situation is different than having the H-bridge sharing a ground connection with the same +5V rail.

author: marshallh
author_rank: Unknown
timestamp: August 03, 2013, 01:25:54 am
content: Commodore seem to really skimp on their power supplies. I had an Amiga 1200 with busted power supply, completely worthless, had to jury rig a replacement with an AT suplpy

author: Mech
author_rank: Newbie
timestamp: August 23, 2013, 05:57:09 pm
content: Hi everyone,Commodore made some pretty bad psu's, especially the c64 and some amiga ones. The big box amiga psu's(A2000,3000,4000) were pretty good.The best ways i found to beef up the good old c64 with better power supply are these:Use a c128 power supply and change the square din for a round din connector and use it on the c64 directly. The c128 psu is heavy duty and was often sold with the 512K reu's(ram expansion units) since the stock c64 psu couldn't handle the extra REU load.OR:Build your own psu, this is what i have done in the past:combine one of these boards(+5v,5A) which is plenty with a 9VAC transformer from mpja Granted,not such a elegant roll your own solution,but why reinvent the wheel:http://www.ebay.com/itm/25W-DC-5V-5A-Regulated-Switching-Power-Supply-/170620769059and this:http://www.mpja.com/18V-2A-Center-Tapped-9-0-9-Transformer/productinfo/7843%20TR/Combine them together in a old AT/ATX psu case and it makes for a reliable setup for the good old C64.If 120/240vac operation is important,just use a transformer with dual primaries and add a switch to the case(some old at/atx psu's had 120/240 switches already) to change input voltage. the 5v switching psu can handle 120/240 already.Some people have managed to build psu's with pwm sine wave to simulate the 9vac side but i have not seen the results or any reports on how this works.As for the amiga 1200, the Amiga 500 psu is heavy duty and will power the 1200 fine. the 500 PSu us rated 4.5 amps which is a good bit more than the stock anemic A1200 psu. the 500 power supply works on the 600,1200 as is with no mods.I built a limit production run of some 7amp amiga replacement power supplies that were very compact a few years ago:http://www.a4000t.com/psu/1.jpgthey sold out quickly. Sadly the base psu these were made from are quite expensive now,so no more production runs.If any of you out there need that pesky 5 pin square din the c128,amiga and Commodore plus4 uses, i do have some of these in stock here:http://a4000t.com/store/index.php?main_page=advanced_search_result&search_in_description=1&keyword=5+pin+dinThanks,Mike

author: jaycee
author_rank: Regular Contributor
timestamp: August 28, 2013, 07:43:46 pm
content: The 9VAC is used in several places in the C64. Omitting it will not work.The most important place it is used is to produce a "CAN +5V" supply which is then used to power the VIC chip and it's clock circuitry.It is also used capacitively coupled to the +5V supply to form a +12V supply used by the SID chip.It is also used to produce a "9V UNREG" line which powers the cassette motor and the RF modulator.Attached is the relevant part of the schematic.It's probably not worth the effort of designing an SMPS. You could easily get a 2x9V AC 30VA transformer (a toroid would be nice and small), and just make a linear supply. The main reason the Commodore ones used to fail was because they were potted, which kept all of the heat contained. Simply don't do that, use a decent heatsink on your 5V regulator, and you're good to go.

author: rbk17c
author_rank: Newbie
timestamp: August 31, 2013, 11:59:19 am
content: I would like just one input, 12 - 19v using some old PC supply or some such...The 5 volt is 'easy', using something like a lm2576.and another for '9 volt DC' (well 9V plus some head room)The ~9V.... Do I read the schematic right? Can I get away with one input (pin7) +9v DC permanently,and the other (pin6 ) a 0v/9v, 50/60hz power signal?That way I only need to control ONE P-ch, and one N-ch (pull down for C90) not a full H-bridge.The 'full H-bridge' would most likely not really work, unless you take steps to isolate it from ground?- of cause, totally ignoring anything connected to the USER port, using ~9V (like modems?) ...Please point out any oversights:)/holger

author: neil555
author_rank: Contributor
timestamp: July 06, 2016, 01:34:03 pm
content: This may be a really silly question but is it possible to use the can +5v output for all the chips thatused the +5v from the psu, if so then you could run the whole machine from the 9vac input?I've got a really trashed 64 motherboard so i'm going to try this, hopefully i wont see anymagic smoke!

author: Ian.M
author_rank: Super Contributor
timestamp: July 06, 2016, 03:16:26 pm
content: Looking at that schematic, a 10V 60Hz antiphase square wave, referenced to the same ground as the +5V supply should be quite satisfactory. It would need a circuit to detect current on the 5V rail and cut the 60Hz waveform if the 5V rail is unloaded, to prevent the CAN +5V rail being powered with the C64 power switch in the off position.I'd start with a 19V laptop or netbook PSU and a couple of 5A buck converter modules (with current limit for overload protection) off EBAY. Feed the one generating 5V via a low value resistor as a current shunt and use the voltage drop (with low pass filtering) to trigger one channel of a dual comparator when the 5V rail is loaded, Generate the 60Hz with a CMOS 555 and use the other channel of the comparator to create the complimentary waveform (alternatively use an AVR or PIC if crystal controlled 60Hz is desirable).Parallel the two sections of a Toshiba TB6612FNG dual MOSFET H-Bridge (readilly available as a populated breakout board) for a better surge rating, and drive it from the complimentary signals, with the current sense comparator output connected to the STBY pin to inhibit it if the C64 isn't drawing any 5V power. Adjust the buck converter powering the TB6612FNG for 9.0V on the C64's unreg 9V rail.The H-bridge needs 5V for its control electronics - this can come from the 5V rail buck converter, just make sure it isn't enough to trigger the load current comparator.Ebay buck modules being what they are, I'd add a miniature 12V fan on the approximately 10V rail feeding the H-bridge to keep everything cool, and a pair of TL431 crowbar circuits for the 10V and 5V rails to shut it down hard by shorting the input 19V and blowing the fuse if the output rails loose regulation.

author: FrankBuss
author_rank: Unknown
timestamp: July 06, 2016, 09:54:16 pm
content: Quote from: Ian.M on July 06, 2016, 03:16:26 pmDepends on what you want to connect at the user port, because the 9V AC is available at this port, too, and some peripherals used it for transformers, which might be a bad idea with square wave.

author: Ian.M
author_rank: Super Contributor
timestamp: July 06, 2016, 10:58:39 pm
content: One might get away with an inverter style 'modified' sinewave from the H-bridge. There'd be some complexity with either a MCU or monostables and flipflops to generate the correct control signals. Otherwise, it has got a PWM control pin so it would be possible to use a PIC or AVR to generate a PWMed real sine wave using a lookup table, and you'd then need some heavy filtering on the H-bridge outputs.This is all getting rather fugly though and a combination of a 5V output SMPSU module, and a 9V 3A toroidial transformer, with manual input voltage switching is probably a better choice.

author: ZeroStatic
author_rank: Contributor
timestamp: July 06, 2016, 11:17:14 pm
content: I'd probably go with 2 little SMPS modules, A 5V one and a 12V one for the 9AC generation, a L298N motor driver module for making the AC component (well square wave signals anyway) and a simple PIC or AVR to generate the 50-60Hz signal to feed the L298 module. A 555 circuit would do if the 50/60Hz is not as critical for your design.Should be able to get all these parts off ebay suppliers.

author: zappedy
author_rank: Regular Contributor
timestamp: September 27, 2016, 04:55:08 pm
content: Quote from: Ian.M on July 06, 2016, 10:58:39 pmI'm thinking about rigging up this very solution.PSU newbie question: isn't it bad that the 5V SMPSU and the 9V transformer won't share the same ground? Couldn't the 5V eventually drift away to +1000V in relation to the 9V ground, thus frying things?

author: Ian.M
author_rank: Super Contributor
timestamp: September 27, 2016, 05:13:39 pm
content: Quote from: zappedy on September 27, 2016, 04:55:08 pmNo. The C64 links the grounds internally The reason you mustn't link them in the PSU is the 9V supply's use of one pole of the C64 power switch and that its common ground with the 5V supply after its bridge rectifier.However if the SMPSU's 0V rail isn't grounded you can get problems due to the leakage currents in switching supplies for all ungrounded interconnected equipment e.g. your TV being used as a moniter + all its associated multimedia kit, so use a 3 pin mains plug and ground the 0V rail.

author: Alex Eisenhut
author_rank: Super Contributor
timestamp: September 27, 2016, 11:49:10 pm
content: It's a good idea to make your own as the original power brick was a marginal design and is just waiting to fail and take some C64 chips with it.The usual failure mode of the common black brick is to put unregulated +8V on the 5VDC line causing harm to mostly RAM chips and whatever else will pop.In any case it is ugly, heavy, and hot.Here's one I madeIt is also ugly, heavy, and hot. But much more reliable, and really not as hot.You *could* keep the old brick for the 9VAC and just slap a 5VDC switcher nearby and splice it into the original cable.

author: Alex Eisenhut
author_rank: Super Contributor
timestamp: October 03, 2016, 02:57:04 am
content: I'm gonna try this soon, the question is how reliable the power supply will be, even if the 5V side is no longer used.