Showing posts with label amstrad. Show all posts
Showing posts with label amstrad. Show all posts

Monday, August 26, 2024

Getting a Gotek working on a PCW9512

I acquired a PCW9512 motherboard a year or so ago and I really wanted to get it up and going so I can build a little case for it and turn it into a proper CP/M plus hack machine.

The challenge? Getting a Gotek working on the PCW9512. There are some .. issues.

Specifically - the flash floppy support needs some extra options and board modifications to support the drive detection that the PCW boot block / CP/M loader wants.

The PCW8256/PCW8512 and earlier CP/M versions only support booting from the 180k single side 3" drive. However the later models have a different floppy drive controller and support booting from the 3" 180k drives or 3.5" 720k double sided drive. So, it does some drive detection based on drive behaviour to guess what's going on. For more information take a read of https://www.seasip.info/Unix/Joyce/hardware.pdf.

The drive detection requires emulating the specific drive motor behaviours that FlashFloppy by default is not done. There are workarounds available - have a look at https://github.com/keirf/flashfloppy/wiki/Host-Platforms#amstrad-pcw. The "supported" modification is written in https://github.com/keirf/flashfloppy/wiki/Hardware-Mods#motor-signal.

Unfortunately my spare Gotek is one of the smaller footprint microcontroller ones which doesn't support it - see https://github.com/keirf/FlashFloppy/issues/557 for more information.

So off to the external logic modification at https://fabriziodivittorio.blogspot.com/2018/05/installazione-gotek-su-amstrad-pcw-9512.html - which after a bit of thinking, I realised I didn't need it. I just needed the M0 jumper! If I wanted to support two drives then I would need to do the modification, but for one drive I just need that jumper.

So here's the jumper config on my little sordan.ie floppy pinout conversion board. Note that Drive 0 -> A: is set, and the Side jumper is set to the top. I haven't got a B: drive jumper set.


And then the jumpers on the Gotek - only the M0 jumper.

I then needed a 720k DSK image of the PCW9512 compatible CP/M. I finally found one - I'll go set up some links on my website to the relevant images soon - and then plugged it in. The system seemed to boot fine - the tracks seeked like it was booting.

But, I couldn't see anything! So, off to build a video buffer and keyboard attachment. Luckily I have a full PCW8256 setup, a spare PCW8512 keyboard and a PCW9512+ keyboard.

First up - over to the PCW wiki to look at the PCW-IO schematic - https://www.habisoft.com/pcwwiki/doku.php?id=en:hardware:perifericos:pcw-io

It's just some buffer gates and a pull-up / pull-down resistor on the SYNC input from the mainboard so you can select PAL and NTSC at boot. (Yes, I did test it. It does actually select PAL or NTSC.)

Yes, you need a pull up / pull-down resistor.

Then I built my own MVP version - starting with the schematic and some wiring notes.


And then the veroboard prototype!


.. it wouldn't be complete without a picture of the bottom side wiring.


I later added a keyboard adapter - another 4 pin connector next to the keyboard connector (at the top of that image, with the red/black/grey/purple wiring) to a 4 pin DIN socket. Nothing fancy.

Anyway, that's enough to get it to boot and work, as seen here.


This isn't the prettiest PCW9512 setup, but it's mine, and it takes much less space - and much less power - than the rest of the full PCWs I have here. Although I must point out that the monochrome white and monochrome green screens are quite lovely to use.

In any case - it works fine, and I'm completely happy with it. Now I need to build a little plastic box to put it all in, add a DC converter so I can feed it "stuff" and have a nice regulated 5v supply, and then start on the IDE interface.

Friday, July 26, 2024

Fixing a dead Amstrad PCW9512+, Part 2

In my previous post I yanked enough of the PCW9512+ apart and debugged why the power supply just plainly wasn't working.

Now it's time to see if the rest of the board was working.

The first thing to do is test the power supply without having the 9512+ logic board (and the CRT side) powered up. The switch mode supply may not be happy with a load, so an initial failure isn't necessarily fatal.

So it mostly looked like this whilst I was testing it - with that EHT anode cap moved out of the way (just in case - it shouldn't have been powered!)


And honestly? The power supply just worked fine. The caps I tested were fine. All the rails tested fine. I'd have to test them under load to calibrate them, but before doing that I should verify that the 9512+ board and CRT hardware works fine.

So after a bunch of cleaning up, it was ready to put aside and test the mainboard. Testing the mainboard only required 5v - 12v is required for the earlier 3" drives but this drive doesn't require it, and the 28v rail is only used for the 9512+ daisywheel printer. I needed neither, so I just hooked up the 5v rail for testing.

.. and again, the mainboard tested fine. Here it is with the disassembled floppy drive for testing.



The board initialised and showed video/sync on the output side. Ok, great. It needed 800mA at 5v to power up, and it would peak above 1A to load from floppy disk. So pay attention to your power supply!

Next up the floppy drive. It had something in it.



I don't know how or why a sunglasses lens showed up in here, but ... well now I am its proud owner. So I removed that and plugged it all back in.

The motherboard and drive worked enough to fail booting a non-boot disk - and beeped loudly whilst doing so. That tells me the hardware is starting up fine and running the boot ROM code, but it's not reading from the drive.

And well, the drive was dead. The floppy drive rubber band was toast.


.. I could figure out the belt width (~2mm) and thickness but I couldn't figure out the size. The drive is a Citizen UODC-45A and I couldn't find any service manual / documentation on this drive at all.

But luckily someone had! And the belt he ordered from DataServe Retro is for a cassette deck - flat, 71mm diameter, 2.8mm wide, 0.6mm thick! And to make life easier, here's the link to the belt in question.
 
I recommend watching the video to get an idea of how to get the belt correctly around the capstan to line up the belt between the small motor and the large drive shaft. It's quite a squeeze.

First up was cleaning up the old bits.

First, the motor spindle.


Finding all the fun bits of the belt stuck in the drive - I had to shake it multiple times to get it all out.


And here's some on the drive spindle itself. In fact, after doing all of this I found more stuck UNDER the spindle which kept the drive from reliably spinning at the right RPM, resulting in loads failing! (Phew, I wasn't looking forward to having to calibrate it.)



In any case, once I had assembled the unit and stuck in a disk, it made the right kinds of seeking noises and .. well, I guess it had booted.

And .. well, it started booting fine. But the keyboard didn't work, and the display was way too bright and over-sized. Let's tackle the keyboard... oh it's just cracked solder joints. Easy.


And now the picture!

Now the important part - this is now under load, so I need to double and triple check the power supply calibration. If it's getting > 12v then this'll happen. So before you go and try re-calibrate your monitor, check the power rails.

And yup - it was dumping 14.5v into the monitor B+ rail. Things look MUCH better after calibrating this back to 12v.


No obvious calibration needed!

And finally, running a basic RAM test.


So, it boots fine, RAM tests fine, copies disks fine. I haven't yet dumped CP/M software on here to use - I think I'll make up a disk full of CP/M games.

The next post will cover MAKING a 720k CP/M boot disk for this thing - more of a pain in the rear than I'd like, even with a suitable MS-DOS 80386 IBM PC clone available.

Friday, July 12, 2024

fixing a dead Amstrad PCW9512+

I'm on a bit of a "i wish I had a PCW as a kid" kick. So yeah, I have a working out of the box PCW8256 that has been upgraded to a PCW8512 (but with only one floppy drive for now. Stay tuned.) I got lucky; that one was in the US and didn't need any modification to work here. (And, amusingly, although it's setup for US power - and shipped with locAscript instead of locOscript, it's still configured for 50Hz UK and 256 line display!)

But yes, finding PCW's in the US - well, any Amstrad really - is super difficult. So when I saw a PCW9512+ for sale by someone in Florida, I jumped at it.

... unfortunately although the seller was listed in Florida, it came from Cairo! So would it survive the trip? who knows. It was sold as "didn't power on", the internal photos didn't show any evidence that the tube was cracked, so .. maybe I'd get lucky.

Coming from Cairo meant that it would be wired for 240v power, and indeed it was. So, up on the bench it went. And yes, it was very dead. So, I pulled out the boards and started testing the switch mode power supply.

First - start by discharging all the AC side capacitors and EHT side capacitors - and the tube, just in case! - and then start checking components from the AC line input all the way to the big switching coil. If you're lucky, it'll be something stupid like the fuse. If you're unlucky, the coil is open or the switching transistor is dead. (Or in the case of the PCW, a big honking integrated switchmode controller hybrid IC which is unobtanium in 2024.)

Here's what I started on:


This covers the AC input, EMI filtering, switching and AC -> DC rectification. The output of that rectification from 240v AC RMS is around 330v DC peak. So be careful, that stuff will definitely kill you dead!

Basic continuity tests of each of those components in circuit didn't show anything obviously wrong. But since there's a rectifier there, it's not always obvious that something's bad. So it's best to lift the parts out to test. So I did that, and .. oh look. R5001 is very, very dead.


I spoke with Jaz (https://mstdn.social/@coregaze) about it a bit to figure out why it's there. They pointed out it's very likely a damper resistor to stop any ringing that may happen between the filter coil on the left side, the capacitors in the circuit around it and the diodes switching on and off. It likely would get hot in normal use, so the fun question was - did it die because the whole unit was just running for too long in a hot room, or is something else dead / shorted and the power supply was being over-taxed?

In any case I wanted to test the rest of the power supply with that fixed, but I didn't (yet) want to light up the monitor circuitry. If there's a problem with the monitor circuitry - eg a shorted power transistor or hybrid IC - I didn't want to risk further power supply damage. So, back to the circuit diagram I go to see how the monitor side is powered up.

On the power supply side, there is a separate 12v DC supply to the monitor, called B+:



And on the monitor side, there's a few places it branches off of that B+ net:


Ok, so off to the layout diagram!



Now, see the track there with W2? That goes off to the horizontal deflection circuitry and flyback input to feed the tube EHT.  The rest of that W2 track/net is all of the other monitor circuitry. So how's it hook up into the Q5003/VR5002/C5026 net? The actual 12v monitor B+ line?

The answer - a solder blob! Here's how it looks after I was Very Intentional about cleaning around it after desoldering it.


So, with that blob removed, the 12v B+ output from the power supply doesn't feed the B+ input into the monitor, so none of the CRT related hardware is energised!

Well then! Off to test the rest of the power supply circuitry I go!

(Stay tuned for part 2.) 


Saturday, January 16, 2010

Hardware hackery: Adding IO to an Amstrad CPC


One of the benefits to hacking on the old Commodore 64 is that the user port exposes quite a few bidirectional IO pins which can be easily programmed from BASIC. The Amstrad CPC doesn't really have these in the same fashion. Well, ok, it does - if you count the joystick pins as "input" and the printer port pins as "output". But having a fully programmable IO controller is helpful.

So I breadboarded a basic IO board a couple months ago using an 8255 PIO and some TTL logic to handle address decoding. This worked fine on the Amstrad CPC464 but it didn't work on the CPC6128. A bit of digging into the method used for address decoding showed what I did wrong.


The Amstrad CPC base peripheral IO list can be found here. The peripheral IO is decoded by the high 8 bits of the address bus - each peripheral attaches an address line (and /IORQ) to the relevant chip /CS line. The expansion peripheral line is A10, and the "selection" decoding lines are A9 and A8. So, A10 needs to be low, and A8+A9 let you either address multiple peripherals or the registers inside the peripheral itself.

This was easy - a bit of logic to say /CS = low IFF /IORQ is low and A10 is high.

This is fine on an unexpanded CPC464 but the CPC6128 floppy disk controller decodes A10 low, A8 low AND A7 low. A7 is the "FDD peripheral expansion" line. So my 8255 PPI board was being accessed the same time that the FDD controller was. This caused all kinds of random lights to blink and the system to get highly confused.

The logic now is /CS = low IFF /IORQ is low, A10 is high and A7 is high.

Strictly speaking, I should ensure that A7-A4 are 1110 - ie, A4 is low, the rest are high.

According to the CPC464 manual, when A10 is low, A4 low is "user", A5 low is "RS232" (for the Amstrad/PACE RS232 adaptor), A6 low is "future", and A7 low is "disk".