Wednesday, April 24, 2024

On "repairing this commodore 1551 drive" and "don't plug in the head cable backwards"

I bought a "dead" 1551 drive a few months ago. It's a european model, only 220v, and they said "it smoked when it was on". Well, i figured it was dead but I figured maybe not dead dead.

So, step one was removing the .. huge ass transformer.

I stripped off the regulators and hooked it up to a pair of bench supplies to feed 5v and 12v with a current limit.

(And yes, by this stage I had done a bunch of debugging already, so i had taken out the ROM, PLA and RAM and socketed the PLA / RAM.)

I unplugged the drive head cable and measured it - the heads measured just fine. So, I left them off whilst I debugged everything else.

Then I fired it up - the drive spun, a bunch of CPU pins were blinking on the oscilloscope, but nothing quite worked. The drive constantly spinning is a sign that even the early boot code isn't running.

So I then wanted to know if the CPU worked. The problem? All the pins kinda looked fine. Except A15.

It looked very sus. Like ok, NMOS has some fun rise times, but the other pins weren't this fun.

I decided to socket everything so I could pull the RAM and address decode gate array out. I thought about the 42 pin drive gate array IC but I figured if that was fried I was in for an unfun time.

The next thing was to figure out how to test that the CPU kinda worked. I figured I could write a little program to toggle the activity LED quickly and see it on my scope. I started with the disassembly here - - to see how the LED is blinked. The 6510T CPU has an 8 bit IO port (versus the 6 bit IO port on the 6510 CPU).

The program looked roughly like this:

.org $ff00
SEI ; disable interrupts
CLD ; clear flags
LDA #$6F ; IO direction bits
STA $00 ; program IO direction bits
LDA #$60 ; turn on LED
STA $01 ; program IO port
LDA #$68 ; turn off LED
STA $01 ; program IO port
JMP loop

.org $fffa
.byte $00, $ff, $00, $ff, $00, $ff

This didn't work. So, I got a new CPU. A15 on that CPU was much better.

Then this did work. The LED was blinking at a few hundred kilohertz. Ok, but the original ROM? Nothing. My guess is the ROM is also busted, so I programmed another 27128 EPROM with the right image and inserted it into the drive.

Everything worked! So, time to plug in the head cable OH CRAP I PLUGGED IT IN BACKWARDS. Bang, I blew the head coils. Crap.

Anyway, the rest of the drive seemed fine. Stepper motor, drive motor control. Now, the challenge - it's a mitsumi drive. I went on ebay to find a replacement drive - lots of "untested" 1541's everywhere. But I did find a "tested, guaranteed works" SX-64 drive. However, it's an Alps drive. They're supposed to be more reliable, but .. well, it arrived a few days later.

The main physical difference between the two is the connector. The thing I remember is that the write current is slightly different and some 1541 drives have a jumper to change said current.

Luckily there's a 1541 service manual and it has the Alps drive pinout for the 1541, which is surprisingly exactly what I need for the 1551:

So I followed this guide, verified at each step that it worked, and connected it all up.

And yes, I put superglue in the key hole for the head connector so I didn't plug it in backwards.

And .. well, it works!

Well, kinda. I had the commodore 16 drop into the monitor after HEADER (which formats a blank disk) completed. I've also had some issues with commands hanging and not running on the drive. So, there may be some other issues lurking.

I also want to figure out a suitable mod for the write head current change.

But hey, I guess I do have a working Alps drive in my 1551.

And yes I did tear the head apart to see how it's put together... :-)

Wednesday, September 20, 2023

Reinstalling AmigaOS 3.1.4 on my Amiga 2000 or "oh crap it didn't boot"

This post is about AmigaOS 3.1.4 on my Amiga 2000. AmigaOS 3.1 from Amiga works fine. However, there are a few interestingly subtle differences between 3.1 and 3.1.4 that are worth knowing about, and they stem from both OS and ROM changes that you need to be aware of.

Let's start with why I reinstalled it.

I did it a few months ago and didn't notice that I had only allocated a 10 megabyte OS partition. Oops. So, I figured I'd install it again before I started doing more work on it, and I remembered the hilarity from last time. This time, though, I took more photos to demonstrate it.

First up, the Amiga 2000. It has the 3.1 ROM from Amiga Forever. I think it doesn't include workbench.library and icons.library in the ROM due to size restrictions. So, you need to have that installed onto your boot media. AmigaOS 3.1.4 does that for you. If you use 3.1 ROMs with earlier installs of AmigaOS then you need to grab those libraries and put them in your SYS: folder yourself.

So, yes I bought some.

Then, the install disk. I have a TF536 in here and 8MB of Zorro-II RAM, hence the large amount of RAM.

Anyway, I started off by re-partitioning the drive using the HDToolBox program. It's supplied on the installation disk. Now, the 3.1.4 ROM includes a scsi.device that works with Amiga 600 style IDE, so I don't need any extra stuff to use the CF adapter on the TF536.

Oops. My boot partition is too small. Let's delete and reinitialise this.

Ok, that's better. Let's save and reboot.

Next - we reboot and reinitialise the disks with a fast format. Here's workbench:

Easy. Now, we run the installer. And, we select "Intermediary" install - or it won't correctly the detect the machine I am installing on, and thus won't install the right version of libraries that are no longer on the 3.1.4 ROM.

And now we begin.

Now after a bunch of disk swaps, it'll ask which version of hardware you have.

The first time I did this on the Amiga 2000 I did the Novice install and it asked for my Amiga 600 disks. Well, obviously I didn't have an Amiga 600.  But when I bought the disks I didn't have the modules disks either! I had to sleuth around on the internet to find them. So now I have them for my Amiga 500/1000, 1200 and 2000.

Anyway, it goes and installs the extra bits and pieces.

Finally it's done and I am told that I have a 32 bit CPU (which I do) and I need to do some extra work after reboot (which I will.)

I reboot, and here we are, basic install done. I'm warned again that I should go and install the CPU support stuff.

That's it for now. Next time (if I remember) I'll take photos of installing the CPU support toolkit, the network interface driver and then run AmigaTestKit and SysInfo to show it all together. Then after that it'll be reinstalling the network stack, and then on to music editing stuff.

Tuesday, January 24, 2023

resistance is not futile, or "why does my amiga 1000 keyboard not work?"

I gave my amiga 1000 keyboard cable to a friend so she could complete her Amiga 1000 setup. I then ordered some replacement RJ12 cables (4 wires!) to get mine working.

But they didn't.

Let's talk about why.

Firstly - yes, the cable is a RJ12 4P4C rollover cable. Ie, if you hold both connectors up next to each other and aligned the same way, the left hand pins are numbered "1-2-3-4" and the right hand connector is "4-3-2-1". Don't get this backwards or you'll end up reversing the power to the keyboard and damage stuff. It seems most phone cables are 4-wire RJ-12 and rollover pinout, but it's good to double check.

This is different to the early Macintosh keyboard - the RJ12 cable there is straight through. "1-2-3-4" goes to "1-2-3-4".

But it didn't work. I pulled apart the keyboard and started debugging it ... way too hard. The TL;DR is this. When I powered the keyboard from a 5v dedicated supply it was pulling 5v at around 125mA.

The cable I was using, straight from the bag:

The pinout is fine, but each leg has a 40 ohm resistance. There's no way to get 125mA out of 5v at 80 ohm resistance (+5v and GND, 40 ohms each.) The voltage on the keyboard side was closer to 2v.

The one I build/crimped until it worked:

18 ohms now, and can supply ~ 250mA. It was happy with this.

So if you're looking to replace a keyboard cable with an RJ11/RJ12 from Amazon or some other store, double check the pinout, double check that there's 4 wires in the cable, and double-check the series resistance!

Monday, January 16, 2023

I got lucky with an Acorn Electron

 Ah, the Acorn Electron.

Wait, no. I never had one as a kid, I had access to a couple of BBC micros in my primary school for playing a pirate / math educational game that I have since not found online, and I've never really wanted one. Until a close friend's birthday - at which point I got them one.

And then we fell down a rabbit hole together.

So, I bought a dead Electron motherboard. Here you go.

And the ULA - quite a bit of damaged tracks there.

Yes, the ULA is supposedly dead, like a lot of these Electron PCBs. My goal was to strip the PCB of components and make a replica rev4 board. However, first up, i wanted to see if i could repair it.

So, I took off the ULA and fixed up the busted pins. Some copper tape and solder did the trick. One pin was completely missing, and that was quite a challenge to get right.

Then I socketed the 6502 CPU and BASIC/OS ROM. The 6502 was already socketed but the soldering job was pretty bad. I tossed the nice machined socket because it was soldered in bad and I didn't want to clean up all the bad solder from on top of the pins, and I instead just whacked a cheap socket down to test.

Then I powered it up.

Oops. Guess I have a working Acorn Electron. Well, I don't have a case, power supply or keyboard. Guess I'm going to have to make a keyboard for it.

Sunday, December 11, 2022

Who's the /BOSS on the Amiga 2000 ?

 I slipped and bought a TF536 to put into my Amiga 2000. TL;DR is it's now running, but it took a bit of fiddling to get there. When I was last getting it going I noticed it didn't like any Zorro-II RAM in there, so I simply disabled it (it wouldn't do much) and left it alone. The storage card I'm using (a GVP SCSI job) doesn't do DMA to Zorro-II RAM - it does DMA to/from a 64k IO/RAM window which then the driver memcpy()'s out.

Whacking it in with the CPU riser I got from booted up fine as long as no other RAM cards were installed.

If I installed my storage card or any zorro-II RAM cards it just hung. Not fun.

So then I thought, wait a sec. It's going into the CPU expansion slot, not the CPU socket. And there's this thing called /BOSS which accelerator cards in the CPU expansion slot should assert if they want the DMA and some other signals routed to them rather than the main CPU socket.

So, I grabbed a different one.

This one has a jumper for /BOSS to keep it enabled, and also has the FC0..FC2 pins (indicating the CPU state) also routed.

I plugged this in and bam.

(note I didn't leave the 2MB RAM enabled on the storage card after this test; until I'm ready to screw around with programming stuff that explicitly wants to test Zorro-II/Zorro-III space RAM, I'll leave it off.)

I also tested it with an 8MB Zorro-II RAM expansion (the ZoRAM card that's available on the internet) and it also works fine.

Anyway TL;DR is - don't forget to ensure your accelerator card installation on an Amiga 2000 has /BOSS asserted, or a bunch of DMA/Zorro-II lines won't get routed to the CPU expansion slot and things won't work right.

Tuesday, December 6, 2022

damnit i slipped and (mostly) built an amiga 500

EDIT - the original article has an image of the PCB with the floppy power connector mounted the WRONG WAY. 

This is the INCORRECT WAY. Do NOT do it this way!

TL;DR - I'm half way through building an Amiga 500+ replica. The goal:

  • New PCB
  • New clear case
  • Actual floppy drive!
  • TF534 Accelerator, yes I am interested in FPU stuff for reasons and yes I'm sad about the 4MB of RAM but I'll make do - terriblefire does a great job designing/building/debugging these accelerators and I'm glad they exist!
  • ECS Denise, also for reasons
  • 2MB chip RAM and some slow RAM too because again why not
  • 3.x ROMs
The challenges!

  • I need a keyboard for it, but my "donor" machines, like my "donor radios", all now work. Hilarious.
  • The Amiga 500+ board wasn't well documented for assembly, until I looked. Closer.
  • Well, the 8375 Agnus I acquired is a PAL one, so I guess I'm building a PAL Amiga 500+. (Which is fine as you can switch it in software after boot, but STILL.)
  • Oh yeah, floppy drives. Ugh.
Ok, so the PCB. I picked it up from . There's a link with the component list, and I got them all with some hunting around. I wish I had a "dead-ish" donor Amiga 500 of suitable vintage to grab parts from, but again, all my machines now work. Ha.

Here's it assembled. Well, mostly.

I still have some connectors and the RTC to add. Yes, it's a 2.x workbench ROM. Yes, it boots to ROM fine.

Now, what do I do about the jumpers? The instructions don't have the Amiga 500+ rev8 PCB jumper descriptions. Ok, they're in the service manuals. And yeah I can read the schematic, but I wanted to be lazy.

Ok, so I started to look at it. I definitely wanted the 1MB/2MB option. I wanted the expansion RAM to show up in chip RAM to start with. Ok, ok. But, guess what. The PCB has them already kinda done.

Here, look closely.

JP3 is already done for us. (For 1MB/2MB I need to have them horizontally jumpered, not vertically.)

And for JP2:

It turns out the two bottom pins are already joined. I'd have to cut the track to start using the expansion RAM slot as slow RAM (in $C00000) or if/when I fit a Gary Adapter / RAM expansion add-on.

Finally, the case is here and the TF534 is installed and boots up to ROM fine.

I'll finish the installation once the sockets arrive - and yes I may go and borrow my rev5 amiga 500 keyboard and Gotek floppy drive emulator until I get suitable replacements. Or, maybe just design an Amiga 500 keyboard drop-in replacement with cheap cherry MX style switches. Why not.

Sunday, September 25, 2022

Installing a kickstart ROM adapter in my Amiga 1000, or "Nothing works, and nothing makes sense"

The Amiga 1000 is a slick looking machine. It however loads its ROM from floppy disk. The Wikipedia Article on the Amiga 1000 explains why.

I wanted to put a Kickstart 1.3 ROM in my Amiga 1000. There are adapters out there you can build and install. I chose one, followed the instructions, and it didn't work.

After a whole lot of digging I finally got it working and now I'm documenting what hilarity I found.

I started with this one from the amiga community. The PCB manufacturing files are available on PCBWAY as a shared project. So, I got the board made, did the board mods on my Amiga 1000, and set it up. No bueno.

Let's go over the mods first before I explain why it didn't work.

First up, the Amiga 1000 has a pair of small ROMs (lower and upper 8 bits of the data bus) to bootstrap the ROM image from floppy disk, throw it into the write once memory store and then kick it appropriately to take over the ROM memory address range. The ROM address range is $F80000 -> $FFFFFF - a 512KiB region. But, this ROM isn't that big at all.

The schematic calls out what's going on pretty clearly. This is for the early revision Amiga 1000, with the U5N / U5P ROMs populated.

The /OE lines (pin 22) go to /ROM01 on the PALs, which (among other things) enables the ROMs only when the write-once memory store isn't active and we're in the ROM region.

But look at the other bits going on.

First, pin 1 is going to +5 volts, instead of A16. Pin 27 is going to A15 instead of .. the processor R/W pin? Weird. Anyway, let's look at these ROMs.

First confusing thing here - the ROMs addressing starts from A0 to A14. The 68000 bus however doesn't have an A0 - it's A1 to A23, and then there's upper/lower byte select lines. So, this ROM A0 is the CPU bus A1, the ROM A1 is CPU bus A2, etc.

Pin 1 is NC - it'd be ROM A15 on a 64k x 8 ROM. Ie, Amiga/68000 A16. And pin 27 is ROM 14, Amiga/68000 A15. That makes sense.

What's happening with the OTHER /CS line though?

On U5N/U2N, the /CS2 lines in the schematic to go W2 and W5. The intention looks to be whether A16 or A17 acts as a chip select line to enable either the lower or upper set of ROMs. If you wanted 32KiB ROMs then you'd want A16 to be the /CS2 control. If you wanted 64KiB ROMs then you'd want A17 to be the /CS2 control.

In theory, if everything is wired up fine, this means you can fit 256KiB of ROMs by fitting four 64KiB ROMs and jumpering things appropriately. You'd want:

  • W2 to be CPU A16
  • W1 to be CPU A15
  • W3 to be CPU A14
  • W4 to be CPU A17
  • W5 to go via the 74LS04 to invert A17 as the /CS2 line, so either the U5N/U5P is enabled, or the U2N/U2P is enabled.
However, this just plainly didn't match what's on my board. After trying a couple times to do the whole mod, I started to question whether the PCB matched the schematic. Hint, it ... didn't.

Here's what the PCB layout looks like, front:

and back:

You can see where you need to cut W1, W2, W3, W4 (and W5, but I didn't) to turn it into a selectable jumper set.

So, I buzzed out both the ROM board and the Amiga 1000 board to see what was going on. And what I found was ... pretty amusing. I removed all four jumpers and:

  • 68000 D0..D15 are OK
  • 68000 A1..A15 are OK
  • 68000 A16, A17 - not OK!
  • 68000 A18 - OK!
The A18 line made it to the ROM board via one of the wires soldered to the write-once RAM board. The ROM /CS line was soldered to the write-once RAM board as well.

Then I went digging on the ROM board. Let's use ROM numbering now, starting at A0 (cause that's how my notes went.) A0 to A8, A9, A10, A11, A13 used the "even" ROM address lines. A15 used pin 1 on the odd side. A16 on the kickstart ROM mapped to /CS2 on the odd side. A17 on the kickstart ROM mapped to the 4 pin connector and over to the write-once memory board. Same with the ROM /CS line.

So, I had some culprits.
  • /CS2 maps to ROM A16 which is Amiga/68000 A17. Ok, so maybe I can play with that on the Amiga side using W4, right?
  • Where the heck was Amiga/68000 A16 being routed?
  • ROM A15 on odd pin 1 should be controlled by W2, either being Amiga/68000 A16, or +5v, right?
Ok, so then I started buzzing the jumpers and finding out where they went. I then made my first discovery - the trace to ROM /CS2 ? It was tied to CPU A16. No matter what. So, I couldn't flip W4 to the alternate configuration - that shorted ROM /CS2 and CPU A16 to CPU A17. Which means I could not use the /CS2 pin on the ROM adapter, I had to run a separate wire to connect it to CPU A17 and have it end up on the right ROM pin!

Ok, so. I did that. I routed ROM A16 to the middle pin of W4 and ROM A17 to the right hand pin of W4. The rest of the jumpers mirrored the original configuration of the Amiga 1000.

.. but then, nothing. Ok. I went looking at what else could be missing. Then I found the fun reason - the kickstart adapter PCB didn't at all hook up the /BYTE control line to anything. It was just floating. This is problematic for things like DiagROM or the flash based ROM replacements which expect /BYTE to be set correctly for word access. So, I soldered a wire to +5v so it would be tied high and enable word mode.

Success! The ROM booted to a green screen! Ew.

So, in went the Amiga DiagROM. And DiagROM booted! And gave me a lovely screen of horizontal bars! Now, they're supposed to hint at which data line could be busted, but they were all light green and I was told by the author that it may also be not finding enough chip RAM. He suggested a 5V UART directly attached to the UART TX pin on Paula, and that's what I did.

And he was right - it was only detecting 64k of chip RAM.

I was very confused. I slept on it. The next day I fired up the DiagROM again but with some fast RAM attached, so DiagROM would actually start all the way. Then I used the memory editor to edit regions of chip RAM to see how it behaved. The RAM behaved .. fine? Until I looked a bit closer.

The first 64KiB of chip RAM was mirrored in the second.

The third 64KiB of chip RAM was mirrored in the fourth.


That told me A16 was stuck. But, it couldn't be the whole of A16, or the ROM code wouldn't get very far. No, it was something to do with RAM. Or, to be clear, the address decoding of chip RAM. I had a late night idea that day- what if the bit wasn't stuck, but it .. wasn't being routed?

So I buzzed the chip RAM address bus, here:

These go up to the write-once memory board, so I buzzed A16 on pin 10 of that chip and ... bam. Nothing. No connection to CPU A16.

Then I buzzed the jumpers. And I found the last thing that super surprised me.

The left hand side of W4, that was connected to the CPU A16 and /CS2 line? That pin goes to the RAM A16 line.

And so does the W2 jumper. The left hand side of W2 is RAM A16. The middle is ROM A16. The right is +5v.

So, the PCB routing seems hella wrong there.

So, after removing two pins from my adapter, routing /CS and A17 directly out as wires for A16 and A17, and hooking them up as shown, DiagROM started and all chip RAM was found. When I flipped out the Diag ROM for a Kickstart 1.3 ROM, it also worked fine.

As you can see, the jumper positions are basically where they were for an unmodified board, except that I'm manually grabbing the Amiga/68000 A16/A17 lines and running them to the ROM adapter (and those pins are removed from both odd/even connectors!)

Well, that was fun. "Fun". I have a second Amiga 1000 here, I may choose a different path for its upgrades.