Building a V1 Kerberos

20 views
Skip to first unread message

Howard Laffling

unread,
Jun 5, 2026, 2:56:07 PMJun 5
to kerberos-midi
Hi,

I'm trying to build a V1 Kerberos. I've got an assembled PCB, which at the moment just has the FPGA, Flash, SRAM, 24MHz oscillator. 3V3 regulator,  level translator, reset button and LEDs.

The FPGA source code doesn't seem to be correct though. The open collector/drain IRQ, NMI, EXROM and GAME outputs are push-pull. This is easy enough to fix, and I think the EMC filter, which I've got bypassed, masks this. However, the bus state machine isn't correct, and the operation doesn't match the comments in the VHDL - the SO2 rising edge isn't detected correctly, both falling and rising edges start the state machine. This is another easy fix, and I've got some life - I can turn the LEDs on and off by poking the appropriate addresses with the correct values. I've had to disable driving the EXROM or GAME outputs low though, which I believe map in the Flash or ROM intro C64 address space, as these prevent the C64 booting.

My Flash is bank, or actually probably programmed with something unrelated. How is the menu-1.1bin programmed into the Flash ? Does anything else need to be in the Flash ? I have tried running Easyprog, but it can't find the Flash or RAM. I can run menu-1.1.prg, but I'm not sure that helps.

It seems that V1 Kerberos cartridges have been built and work, but I can't see how they work if they've got the FPGA configured with what's on GitHub. I've built the original source and get the same JED file.

Any help, insight or assistance would be appreciated.

Thanks.

Frank Buss

unread,
Jun 5, 2026, 6:30:50 PMJun 5
to kerberos-midi
Setting an output to Z disables the output driver: https://github.com/FrankBuss/kerberos/blob/master/cpld/kerberos/vhdl/main.vhd#L525 it wouldn't work at all if it would pull IRQ etc. to high. I flashed each cartridge by loading the menu.prg from a SD2IEC and then flashing the menu over MIDI, which is also a burn-in test for the MIDI interface. But you are right, the comment is wrong, the state machine is reset on both edges. I think I needed it because of the weird concept of the C64 that the CPU uses the bus when S02 it is high, and the VIC when it is low.

Howard Laffling

unread,
Jun 6, 2026, 7:22:36 AMJun 6
to kerberos-midi
Thanks for responding.

Your website domain seems to be down at the moment ?

Yes, IRQ and NMI are OK, but EXROM and GAME are not, they're set to '1' at times, which is not correct for open drain/collector, which these signals are. They should be 'Z' for high and '0' for low. As I said, I think the resistance of the EMC filter masks this. They're only driven from the cartridge port, and only go to the PLA, with 5V pull ups in the C64, so using push-pull output will work.

I think using either edge of S02 is wrong and doesn't work, certainly on my old breadbin C64. I think it can sometimes work, but not always work, since there's 2 modes of operation, with or without a 180o phase shift in S02 relative to the state machine. Which mode depends on the timing of reset relative to S02, which I doubt there's any guarantee on, since reset is another shared open drain/collector signal, and driven by an asynchronous 556 timer. If the S02 is used to determine whether the VIC or CPU is using the bus, then the phase of S02 is critical, otherwise the VIC and CPU will always contend instead of never contending. Using either edge gives a 50% change of it working, or not working after reset.

Flashing over MIDI requires something at the other end to drive the MIDI, which I don't think I have. What is required at the other end ? Does the EXROM link need to be open ? What is this link for ? I know it disables the EXROM connection, but why is this needed and when is it used ?

Is it not possible to flash it solely from the C64 end like an EasyFlash ? Technically, this would seem to be possible from a hardware perspective, and I assume this is what the flashing via MIDI actually does, it transfers the data to be flashed via MIDI to the C64 and the C64 writes it to the flash. Is it not possible to simply read the data from the SD2IEC ?

Is it possible to use the Kerberos without the Flash programmed, running the software from an SD2EIC drive ?

At the moment the Kerberos hardware tests all fail though. I think if I allow the Flash and RAM to be mapped into the C64 space, then the C64 won't boot. so this isn't surprising.

Frank Buss

unread,
Jun 6, 2026, 8:02:38 AMJun 6
to kerberos-midi
You are right, better to use Z for EXROM and GAME as well. But doesn't matter if only one cartridge is used, since only the cartridge drives these signals low, and the EMC filter also doesn't mask anything, because the 5V is the same 5V used for the pullup resistors on the C64.

Thanks for reporting, the website is up again. I use the PC app for flashing, running it with the "debugging" command line option and then flashing the flash-dump.bin, as explained at the end here: https://frank-buss.de/kerberos/build-old.html

The EXROM jumper can be closed. It only exists if someone flashed a non-working menu version to de-brick it.

Yes, flashing from EasyFlash should be possible. Not sure if the driver is right now to flash the first half of the flash as well, I think I wrote it in a way that it uses only the second half of the flash, which is reserverd for EasyFlash.

Will have to look into the S02 issue, but I tested it on a lot of C64 versions, breadbin, C64C and even C128, which was some work to get it to work there. And works on a few hundred sold and no complain so far (except a handful which didn't work, probably because of C64 hardware modifications, and because of multi-cart problems).

Howard Laffling

unread,
Jun 6, 2026, 8:06:00 AMJun 6
to kerberos-midi
Looking at the VHDL further, all the actions in the state machine, I think are qualified on the state of S02, and I think the state machine goes all the way through in less than 12 off 24MHz clock cycles, so less than 1/2 an S02 period, so starting on either SO2 edge may work OK, it will just go around the state machine loop unnecessarily and do nothing  if SO2 is 0 (falling edge). I need to do some further testing to see exactly what works and doesn't. I've got 1 assembled prototype.

Frank Buss

unread,
Jun 6, 2026, 8:16:05 AMJun 6
to kerberos-midi
Yes, it should work, I think did some fine tuning with the fast clock which was needed for the C128 and for the trick to replace the KERNEL ROM. There is also a testbench, which you can run in Xilinx, I just tried it, you can e.g. see that the data bus is not driven (Z) when S02 is low.
Screenshot_20260606_141224.png

Howard Laffling

unread,
Jun 6, 2026, 8:20:20 AMJun 6
to kerberos-midi
So, if I've got blank or more likely non-blank Flash, then this is the same as a non-working menu / bricked, so I need to open the EXROM jumper. I think this is the original state, as I hadn't fitted the jumper initially.

It's the hardware (USB to MIDI) on the PC end that I don't have. I don't know much about MIDI, and I've no MIDI devices. I was pointed towards the Kerberos by someone else, who's interested in using MIDI with the C64. It looked an interesting project, with similar functionality to EasyFlash, so the PCB I've made can support either in theory.

Frank Buss

unread,
Jun 6, 2026, 8:38:08 AMJun 6
to kerberos-midi
Yeah, if it is open, you get the full RAM, if it is closed and no menu system flashed, you get just the 8k less RAM, because it didn't detect the cartridge auto start ID, but the C64 BASIC ROM is not smart enough to use the RAM under $8000 if EXROM is asserted. 

Haven't used EasyFlash in a while, but I tested it once, and I wrote a driver for it with its concept for custom flash drivers:
https://github.com/FrankBuss/kerberos/blob/master/skoe-easyflash/EasySDK/eapi/eapi-sst39vf1681.s
This should be the pre-compiled version with my driver:
https://github.com/FrankBuss/kerberos/tree/master/skoe-easyflash/EasyProg
Might work to flash the flash-dump.bin then, or might need some address adjustments if it flashes only the EasyFlash half, but should be easy to fix.

Easiest probably to buy a MIDI USB cable, and use the standard app at https://frank-buss.de/kerberos/ Works on Mac and Windows, but some MIDI adapters cause problems, next Kerberos version will have USB.

Frank Buss

unread,
Jun 6, 2026, 8:44:19 AMJun 6
to kerberos-midi
I guess you could also write your own custom PRG which has the menu.bin as payload and just flashes it with the concept from the EasyProg driver with the Ultimax mode and flash command writes. Nowadays this is probably a one shot task with Claude Code :-)

On Saturday, June 6, 2026 at 2:20:20 PM UTC+2 hjlaf...@sky.com wrote:

Howard Laffling

unread,
Jun 6, 2026, 9:47:26 AMJun 6
to kerberos-midi
Software isn't really my thing - my expertise are IC and hardware design, which I've done professionally for over 30 years.  I'm guessing Claude Code is some AI thing. I might have a look at this, but buying a USB to MIDI cable looks to be the easiest way forward. Can you recommend a USB to MIDI cable that works ? I'll probably get something from Amazon, delivered by them.

I've programmed the FPGA with the original JED file and the C64 boots with or without the EXROM link. I think there are some issues with not having the MIDI bits fitted, and some FPGA inputs floating e.g. MIDI IRQ, and I don't have the R17 pull up fitted. That's easy enough to sort, and it looks like I need the MIDI bits fitted for programming anyway. With EXROM link open, all the Kerberos hardware tests fail. With it fitted, the Flash ID and EXROM tests pass, but the others fail. Is this expected ? I also see interference on the screen, suggesting some timing issues somewhere, possibly contention with the VIC. EasyFlash start gives the menu screen with corrupted characters , and seems to hang - character ROM contention ? It's possible there's a hardware fault, so I'll do some checking. If the Flash ID is OK, then I guess programming the Flash via MIDI would be expected to work, once the MIDI bits are fitted ?

Frank Buss

unread,
Jun 6, 2026, 10:27:56 AMJun 6
to kerberos-midi
The MIDI tests fail without the 68B50. Also important to buy an 68B50, there are also 6850 chips, but they are not specced for 4 MHz. And right, the EXROM test is expected to fail without the jumper. It tests if it can be set from the control registers:
https://github.com/FrankBuss/kerberos/blob/master/c64/src/main_menu.c#L858
(test could be improved, if the RAM has the same content as the ROM, it would also fail)
R17 should be populated, I think the 6850 IRQ is strictly open collector, won't work without it, because it is not directly connected to the C64, because it gets routed either the the C64 IRQ or NMI, depending on which MIDI interface it emulates.

The SRAM test should succeed, this is maybe a hardware problem then.

This MIDI interface is known to work, but looks like not in stock anymore:
https://www.protovision.games/shop/product_info.php?products_id=263
Should be this one:
https://www.ebay.de/itm/358481937120
Some other cheaper ones work as well, but often they don't have any manufacturer label.
Reply all
Reply to author
Forward
0 new messages