Page 5 of 7

Re: [P] MECB Z80 CPU Card

Posted: Tue Apr 21, 2026 11:07 am
by epaell
Thanks David.

Hmm, interesting, that is actually the one I based my design on as it seemed like it was what RomWBW was expecting (though I changed the I/O ports to $90 and $91 and used a PLD just to simplify the addressing and to avoid wasting port addresses). Maybe I'll try to shift them to $60/$64 to see if it works - I may need to make some slight modification to allow that. Strangely, when I reset the keyboard controller manually (by writing the reset command to the command port) I see the correct response on its data port. I thought that was all that was needed for RomWBW to recognise that the PS/2 device was available but clearly something is still not right. Just a follow-up question ... you mentioned previously that you made a change to tms was it to add something like the following (in my case I had the same as below but with $90 and $91 instead of $60 and $64):

Code: Select all

#IF (TMSMODE == TMSMODE_MECB)
TMS_DATREG	.EQU	$80		; READ/WRITE DATA
TMS_CMDREG	.EQU	$81		; READ STATUS / WRITE REG SEL
TMS_KBDDATA	.EQU	$60		; KBD CTLR DATA PORT
TMS_KBDST	.EQU	$64		; KBD CTLR STATUS/CMD PORT
TMSKBD          .EQU    TMSKBD_KBD
		DEVECHO	"MECB"
#ENDIF

Re: [P] MECB Z80 CPU Card

Posted: Tue Apr 21, 2026 6:37 pm
by djrm
Hi Emil, here is the diff on the file tms.asm:

Code: Select all

;
#IF (TMSMODE == TMSMODE_MECB)
TMS_DATREG	.EQU	$80		; READ/WRITE DATA
TMS_CMDREG	.EQU	$81		; READ STATUS / WRITE REG SEL
;TMS_PPIA	   .EQU	$84		; PPI PORT A (Note keyboard not yet implemented)
;TMS_PPIB	   .EQU	$85		; PPI PORT B
;TMS_PPIC	   .EQU	$86		; PPI PORT C
;TMS_PPIX	   .EQU	$87		; PPI CONTROL PORT
;TMSKBD      .EQU  TMSKBD_PPK
TMS_KBDDATA	.EQU	$60		; KBD CTLR DATA PORT
TMS_KBDST	.EQU	$64		; KBD CTLR STATUS/CMD PORT
TMSKBD		.SET	TMSKBD_KBD	; PS2 KEYBOARD
;TMSKBD      .EQU  TMSKBD_NONE
		DEVECHO	"MECB"
#ENDIF
;
		DEVECHO	", IO="
		DEVECHO	TMS_DATREG

@@ -372,6 +387,9 @@ TMS_INIT:
#IF (TMSMODE == TMSMODE_NABU)
	PRTS("NABU$")
#ENDIF
#IF (TMSMODE == TMSMODE_MECB)
	PRTS("MECB$")
#ENDIF
;

this line looks different to what you have,

Code: Select all

TMSKBD		.SET	TMSKBD_KBD	; PS2 KEYBOARD
I forget the reason but whether you use SET or EQU matters, not sure if I did it right here or not.
hth David.

p.s Today Ive been playing with an esp32s3 board and configuring Fujinet to run on it, I'll get it working on an old PC first using the RS232 driver. Just about ready to try it now. I'm using an ESP32-S3-CAM module with an external max3232 serial to rs232 breakout board. its a bit odd, the protocol seems to use Rx,Tx,RI, and DTR (ive linked rts and cts, hopefully to keep the PC happy). I'll try it on the old Toshiba 3200 plasma portable. it has a floppy and NE2000 so I should be able to get the driver files on to its hard disk. D

Re: [P] MECB Z80 CPU Card

Posted: Thu Apr 23, 2026 1:01 am
by epaell
I tried swapping over to $60/$64 - that made no difference and also changed the .EQU to .SET without any notable change. I notice that I can send commands (a self test of the 8242 seems to come up OK ... though not always) and I can send the command to reset the keyboard (and the keyboard resets) but it never seems to send an ACK for the command. I checked on the oscilloscope and could see clock/data when sending commands but nothing ever seemed to come back. If I remove the 74LS06 so that the keyboard is powered up then I can see signals from the keyboard. It's like the output from the 74LS06 is preventing signals from the keyboard from being detected. I've not seen a set-up like this before so I'm assuming that the original design from the hackaday project is indeed correct.

Ah, interesting regarding the RS232 version of the Fujinet device - if I get a chance I might try that just to get a feel for what it all does and how it all fits together. I've got an old 486DX machine with a SD FLASH HD and Gotek floppy interface (so I can simply place floppy images on a USB stick - floppies are getting to hard to find and too expensive ... though they are kind of nostalgic).

Re: [P] MECB Z80 CPU Card

Posted: Thu Apr 23, 2026 7:03 am
by djrm
Tricky problem, You could try a slower CPU or adjusting the wait state settings in ROMWBW, maybe a dodgy chip somewhere or even a wiring error. Here is a photo showing the chips I'm using. Im not sure if rthe small capacitors are needed or not, do you have them?
IMG_20260423_075204446.jpg
I may have a different brand controller IC somewhere, I could test with it too.
Are you using the keyboard pins, not the mouse ones? I could crack open the LA and make a trace of it being accessed if it would help.
I posted a photo of the Fujinet interface in the FN Discord dev/msdos section yesterday, still exploring what it can do.
There is a test program for keyboard in the romwbw src folder, it may help someow.
Best regards, David.

Re: [P] MECB Z80 CPU Card

Posted: Thu Apr 23, 2026 8:05 am
by epaell
Hi David,

I did reduce the CPU speed down a few days ago (as I thought that might be another possibility) - sadly no effect. I grabbed a bunch of code out of RomWBW for the PS/2 keyboard so that I could test it in isolation and play with the command order / delays / and additional debug outputs - that's how I could work out that the device self-test appeared to work and that the keyboard reset seemed to send out the command but the ACK was never received. Wiring error (or in this case track placement) is definitely a possibility (LOL, it wouldn't be my first time - in fact it would be extraordinary if I didn't have a few errors with a v0.1 board). Having said that, this is about as simple a board as possible. I've checked the power pins and clock ... I'm fairly convinced that the data bus and chip selection is working otherwise the self-test wouldn't work i.e. it would misinterpret the command or wrong response would be received ... and I think the connection to the keyboard seems to be correct (at least the outgoing side) because the reset command wouldn't get received (I can see the LEDs on the keyboard flash when I do that - and it only does that when I have it connected to one of the PS/2 ports ... so I'm fairly certain I have the keyboard connected to the right one). I do have the capacitors installed ... though I note that your 8242 is a different manufacturer and your board has a 7406 instead of the 74LS06 that I have in mine. I think I have the same 8242 as yours "in the mail" and also some 74LS06's from a more reputable supplier - I'll try test with those when they arrive. It's always a bit of a "luck of the draw" when it comes to ordering ICs from eBay :-( In the meantime, I'll check that bit of wiring around the keyboard PS/2 socket a bit more carefully - I feel relatively certain that there is something in that part of the board that is causing the issue.

Great work on getting the Fujinet interface connected (I just saw your post on the discord) - that's awesome! Really love that plasma display too! :-)

Cheers,

Emil.

Re: [P] MECB Z80 CPU Card

Posted: Thu May 07, 2026 10:41 pm
by epaell
OK, so after way too much debugging of hardware and software I couldn't find a thing wrong with the board itself. I received a bunch of more trust-worthy 74LS06's a week back and they had no effect - sigh.

Last night I received the 8242 that was similar to yours, plugged that in ... and everything automagically started working!
KB.jpg
For the first time my MECB system is completely self-contained i.e. keyboard, display and storage - a pretty satisfying feeling (despite the frustration this "simple" board has caused me). Anyway, now I realise I need to get a bus expander because I'm all out of slots and I still need somewhere to plug the front panel I/O board :-)

I still have no idea what was going on with the 8242 I had - it's weird that it seemed to be partially working. Regardless, now that I know the board works I'll make some V1.0 boards for the PS/2 interface (I had to make some minor changes to enable the default romWBW ports to work but I've made it now so that it is more flexible ... and also adding an optional header to make debugging a bit easier).

Re: [P] MECB Z80 CPU Card

Posted: Fri May 08, 2026 9:00 pm
by djrm
Hi Emil, I'm very happy for you now your keyboard is working.
I wonder if the keyboard controller you have has some dodgy firmware in it, or perhaps not even keyboard firmware.
IIt may be possible to read the firmware from the controller and compare it to - whatever.
One possibility which came to mind was that perhaps you have an XT and not AT controller - if such a thing exists.
Ive just had a look through my parts draw and the second keyboard chip is also a VIA VT82C42N part.
At least its working now for you, David.

ps
This week Ive been finishing some PCBs, An xtide and an xtide lite for upgrading PCs with compact flash or IDE hard disks. I can now boot my T3200SX from CF / Hard disk / Floppy / Serial at will . Other boards built are Serial and Language(memory) cards for the Apple II computers Im working on. (getting the correct memory ICs helped after a wait caused by me ordering the wrong ones.) Also I bought two lots of 4116 rams, one lot had 8 / 10 good. The second batch were all duff and got hot - money back arrived same day. One of the Apples has a Z80 card in it - Havnt got any life out of this yet though, it just hangs when I load the s/w.

Re: [P] MECB Z80 CPU Card

Posted: Fri May 08, 2026 9:59 pm
by epaell
Hi David,

I had wondered about the firmware and whether that was the issue - perhaps something I'll look into if it is possible to read out (though given that there is no window on this old device I assume it has a PROM and so can't be changed again). When I was going through my debugging stage I did notice that the VIA version of the 82C42 did have an AT and XT mode. I thought I checked my non-VIA device and it seemed like it was running in an AT-like mode (although now I can't remember if I was just checking whether the wiring was correct for that set up ... I believe there is also a command to query the current set up - that might be a better test regardless of what I think I've set it up for ... in case older devices only support XT mode).

I've upgraded my old PC to run with CF and USB-based floppy a while back (though just with commercially available adapters as they are 486-based) ... which is what made me eager to get at least the CF side of things running on the MECB. It's so much more convenient than old spinning disks (and much quieter). I didn't realise that XT's could support IDE - but that would definitely make life easier!

Apple II's are fun too - it's actually what got me into retro-computing again during COVID i.e. I purchased a non-working Apple II plus off e-bay (I never owned one when I was younger - we could never afford one) but had fond memories of it because we had plenty at school) and made it a project to get it running again (it had quite a bit broken including a problematic PSU, a couple of TTL devices, lots of 4116's on board and on the language card, some damage on the 80-column card, and the keyboard was flaky). I did finally get it up and running (my suspicion was that someone plugged in the ribbon cable from the language card the wrong way and it sent +12V and -5V into all the wrong places - I'm really not a fan of 4116's and had the same problem as yourself trying to source new working ones :-( ). Are the serial / language cards your own design?

I have an Apple IIe and IIc now as well (the IIe has a super serial card and Z80 card running in it). I've also been playing with some more modern adaptations in these including the ESP32 soft card, a Raspberry Pi based Mouse card and a similar VGA output (which is really nice because the composite output is horrendous and I'm struggling to find any modern devices that work well with it). I'd be keen to try Fujinet on one of these as well at some point but have a few too many things all going on at once (I checked the IIc and it seems it does have the correct ROM version to support the Smartport so that is at least a good start, the IIe would need an extra card). Let me know if there is anything I can help with in regards to getting the Z80 card running (I'm not sure if it is similar to my one).

Cheers,

Emil.

Re: [P] MECB Z80 CPU Card

Posted: Fri May 08, 2026 10:59 pm
by epaell
I just checked the other 8242 I received (from the same supplier as the VIA one) and it was the same as the first one I had (i.e. non-VIA) and it behaves in the same way i.e. doesn't work. I modified my test software to send the command to query the keyboard type (after the self test which returns OK on all the devices) and it times out on both of the non-VIA devices but returns a valid response on the VIA device. So clearly something incompatible with the firmware on those non-VIA versions.

Re: [P] MECB Z80 CPU Card

Posted: Sat May 09, 2026 1:11 pm
by djrm
Thanks for the offer of help Emil, Today I buckled down and tested and the TTL chips - all good, then tested the Z80 in my RC2014 - its dead.
A quick test of the Z80 card in the Apple II semd a bit different but still nothing on the screen. In the other Apple II it booted into CP/M using the 80 column card - a result!

Here is a list of the boards Ive been building over the last few weeks:

PS2 Keyboard replacement:
https://github.com/markadev/AppleII-Keyboard
Simple plug in breadboard replacement for keybooard/controller
(code modified to use arduino pro mini)

Serial card:
https://github.com/btb/ssc
(modified rom patch to work properley)

Language card:
https://github.com/btb/LanguageCard

xt-cf-lite
https://github.com/skiselev/xt-cf-lite-v4
(Through hole version - except cf holder)
modified to take 28c256 eeprom with larger code space

xt-ide
https://github.com/glitchwrks/xt_ide
wip ...

A2Pico2Lite various Apple II functions on simple board
https://github.com/oliverschmidt/a2pico

24 pin OneRom to replace broken Apple 2316 ROM
https://onerom.org

If you would like an blank boards let me know and I'll post them to you.
Best regards, David.