[P] MECB Mass Storage and/or Keyboard Interface Card

User avatar
Editor
Posts: 249
Joined: Fri Nov 17, 2023 10:36 pm
Contact:

[P] MECB Mass Storage and/or Keyboard Interface Card

Post by Editor »

A topic for discussing a potential MECB Compact Flash (CF) or SD based mass storage Card, perhaps also combined with a PS/2 Keyboard interface.

This was brought about by recent discussion on CF interfacing, and also noting that some mass storage and a keyboard interface appear to be the 2 missing incredients for potentially looking at porting an OS (like Flex), across to a MECB 6809 + TMS992x VDP + Motorola IO Card based system.

So far, CF Card interfacing looks very straight-forward, via CF's native 8-bit bus support. Currently, I'm also leaning towards using a pre-existing CF to IDE adapter, to avoid the need for any fine SMT soldering (as all CF sockets appear to be SMT).

In addition, with the space left over, on a standard sized MECB Card, adding a PS/2 interface for direct Keyboard support (instead of just serial terminal support), would provide all that is needed for a standalone system (using a VDP Card for the display output).

With the preference to stick with retro parts, I'm looking to next test a breadboard prototype based on some TTL, which is currently looking like about 5 IC's required.
User avatar
bugeyedcreepy
Posts: 72
Joined: Sun Nov 19, 2023 10:21 am

Re: [P] MECB Mass Storage and/or Keyboard Interface Card

Post by bugeyedcreepy »

Editor wrote: Mon May 27, 2024 12:09 am A topic for discussing a potential MECB Compact Flash (CF) or SD based mass storage Card, perhaps also combined with a PS/2 Keyboard interface.
Ooh, YES!! :D :D :D
Editor wrote: Mon May 27, 2024 12:09 am This was brought about by recent discussion on CF interfacing, and also noting that some mass storage and a keyboard interface appear to be the 2 missing incredients for potentially looking at porting an OS (like Flex), across to a MECB 6809 + TMS992x VDP + Motorola IO Card based system.

So far, CF Card interfacing looks very straight-forward, via CF's native 8-bit bus support. Currently, I'm also leaning towards using a pre-existing CF to IDE adapter, to avoid the need for any fine SMT soldering (as all CF sockets appear to be SMT).
I'd drop in what I've done so far, but I'll be honest, it'd likely need to be drop kicked out the back door to make way for a clean start - I'd be happy to customise a design to suit my project if it didn't work for my application anyhow - but in all likelihood, it'll turn out better than what I came up with... :roll:

in fact, I can already change my concept, imagining my recovered cf slots on a daughterboard with an IDE interface to allow for remote locating via ribbon cable!! If I had an additional +12v supply, then would that mean I could also use any ide drive compatible with 8-bit mode? (inquiring minds and all that...)
Editor wrote: Mon May 27, 2024 12:09 am In addition, with the space left over, on a standard sized MECB Card, adding a PS/2 interface for direct Keyboard support (instead of just serial terminal support), would provide all that is needed for a standalone system (using a VDP Card for the display output).
wtb +1 internal connector on any ps/2 keyboard interface if there's one in the works...!! :P
User avatar
Editor
Posts: 249
Joined: Fri Nov 17, 2023 10:36 pm
Contact:

Re: [P] MECB Mass Storage and/or Keyboard Interface Card

Post by Editor »

So, I’ve been spending a bit of time thinking through a retro design for PS/2 keyboard interfacing.

I’d got to the stage of thinking through a design using TTL logic level chips, either 5 or 6 chips. Then I started looking at the driver software that would be needed to input the PS/2 key scan codes and translate them to ASCII character codes etc.

Then I had an epiphany…

It occurred to me that back in the day we typically either used serial terminals, or, we used a parallel interfaced QWERTY keyboard, where we received a parallel ASCII code, together with a strobe signal (which triggered a keyboard input interrupt).

In both cases, we were simply directly receiving ASCII characters, either via an ACIA serial or a PIA parallel interface.

Our 8-bit CPUs weren’t having to deal with the additional workload of interpreting multiple key-down and key-release scan codes, and then translating these to ASCII for our keyboard input!

With this recollection / realisation, it occurred to me that I was heading down the wrong path!

To replicate the keyboard interfacing that we did “back in the day”, we should really just have a Serial or Parallel ASCII keyboard interface.
e.g. I often had used a MM5740 Keyboard Encoder IC back then, for our 8-bit processors to just directly receive ASCII keyboard characters!

Therefore, to interface a more modern PS/2 Keyboard (replicating the keyboard interfacing that we did in the early days), we really should be using an adapter than translates the PS/2 Keyboard to either a simple serial or parallel ASCII character code interface.

So, I thought I’d pass on this epiphany, for feedback.
User avatar
lenzjo
Posts: 32
Joined: Mon May 06, 2024 11:30 am

Re: [P] MECB Mass Storage and/or Keyboard Interface Card

Post by lenzjo »

Editor wrote: Tue May 28, 2024 7:29 am
Our 8-bit CPUs weren’t having to deal with the additional workload of interpreting multiple key-down and key-release scan codes, and then translating these to ASCII for our keyboard input!

Therefore, to interface a more modern PS/2 Keyboard (replicating the keyboard interfacing that we did in the early days), we really should be using an adapter than translates the PS/2 Keyboard to either a simple serial or parallel ASCII character code interface.
I'm using an ATtiny 26 to decode the PS/2 to a parallel output with handshaking. It's not my design it's from here. I thought about using discrete TTL after seeing Ben Eater's version. But then he had look-up tables to translate the key presses to ascii. Didn't really like that, and so started looking around for a better solution and found Darryl's answer to it. I'm not proud, why re-invent the wheel especially as I haven't the time to learn AVR assembly when 6809 is already giving me a headache ;)

I was thinking to hook it up to a 6522 for the handshaking and it can generate an interrupt for each key press. This will be part of a "system i/o" card which will also tentatively have an SCC2691 ACIA as it can go to 6Mhz. The 6522 has a couple of timers so it can also replace the 6840.
User avatar
lenzjo
Posts: 32
Joined: Mon May 06, 2024 11:30 am

Re: [P] MECB Mass Storage and/or Keyboard Interface Card

Post by lenzjo »

Editor wrote: Mon May 27, 2024 12:09 am So far, CF Card interfacing looks very straight-forward, via CF's native 8-bit bus support. Currently, I'm also leaning towards using a pre-existing CF to IDE adapter, to avoid the need for any fine SMT soldering (as all CF sockets appear to be SMT).
Looking around, I found and ordered this one from ebay. My thinking was maybe have an extender card on the end of the MECB back plane. The card has a couple of 40pin plugs/sockets for the drives and a male and female din 41612 connector at each end. Another option would be to incorporate the IDE slots onto the backplane or even have a regular MECB card with the IDE socket on it that could connect via ribbon cable to a free standing IDE card.
User avatar
Editor
Posts: 249
Joined: Fri Nov 17, 2023 10:36 pm
Contact:

Re: [P] MECB Mass Storage and/or Keyboard Interface Card

Post by Editor »

lenzjo wrote: Wed May 29, 2024 12:02 pm I'm using an ATtiny 26 to decode the PS/2 to a parallel output with handshaking. It's not my design it's from here. I thought about using discrete TTL after seeing Ben Eater's version. But then he had look-up tables to translate the key presses to ascii. Didn't really like that, and so started looking around for a better solution and found Darryl's answer to it. I'm not proud, why re-invent the wheel especially as I haven't the time to learn AVR assembly when 6809 is already giving me a headache ;)
It sounds like we've gone down the almost the same design thinking path! I don't mind writing the 6809 code, but it was more the revelation that this function (PS/2 down/up scan codes to ASCII translation), doesn't really belong on out "retro true" recreations!

Although I enjoy microcontroller programming, and have quite a few lying around, I also don't believe in re-inventing the wheel. Especially if it takes your focus away from the core project at hand. I also rationalised, by noting that a "modern" PS/2 Keyboard already has a microcontroller in it, so effectively we are just translating with another microcontroller, so that the "real" Retro Keyboard input starts at the ASCII parallel (or serial) input port!

I landed on a similar, but AVR based, Go4Retro PS/2 Encoder
lenzjo wrote: Wed May 29, 2024 12:02 pm I was thinking to hook it up to a 6522 for the handshaking and it can generate an interrupt for each key press. This will be part of a "system i/o" card which will also tentatively have an SCC2691 ACIA as it can go to 6Mhz. The 6522 has a couple of timers so it can also replace the 6840.
Yes. I was then also at the same point of deciding how best to implement the interrupt driven support. First thinking I'd design a simple TTL based interrupt latch and tri-state buffer to read in and clear the interrupt latch.
Then, I decided that for the PCB real estate used, I may as well just use a DIL40 parallel I/O chip (i.e. PIA, on the basis of a Parallel ASCII keyboard input, like I used in the old days with a MM5740 Keyboard Encoder).

However, where I ended up was thinking along the lines of a MC6821 PIA (noting that we don't need a VIA / timer for a keyboard interface).
This approach also means we can insert a currently in production WDC W65C21N PIA, which is actually good for up to 14MHz, is plug-in compatible with the MC6821 PIA, and therefore well matched for both the 6809 CPU Card and the 6502 CPU Card (with a faster WDC W65C02 CPU).

Where I'm currently at (as of last night), is thinking that if I have a dual 8 port PIA, on a PS/2 + CF Card, do I interface the CF through port B, or does that just give no real advantage? The jury is still out on this, as I look into further.

On a related note, I intentionaly didn't use the 6522 VIA on my initial Motorola I/O Card, fundamentally because it was intended to be a true Motorola based I/O Card, hence the 6821, 6840, and 6850. My intention was to eventualy make a similar WDC / MOS based I/O Card which instead features a 6522 VIA and a 6551 ACIA.
User avatar
Editor
Posts: 249
Joined: Fri Nov 17, 2023 10:36 pm
Contact:

Re: [P] MECB Mass Storage and/or Keyboard Interface Card

Post by Editor »

lenzjo wrote: Wed May 29, 2024 12:21 pm Looking around, I found and ordered this one from ebay. My thinking was maybe have an extender card on the end of the MECB back plane. The card has a couple of 40pin plugs/sockets for the drives and a male and female din 41612 connector at each end. Another option would be to incorporate the IDE slots onto the backplane or even have a regular MECB card with the IDE socket on it that could connect via ribbon cable to a free standing IDE card.
Again, we seem to be heading down trhe same track (I imagine if we were put into 2 seperate rooms, we'd come out with almost the same design. LOL).

I have exactly the same CF - IDE Adapter Card! I bought a box of 10 a couple of years ago, for a retro PC project, so I currently have 9 of them from my storage (now in my parts drawers). Photo below (ignore the header strip I currently have plugged in).
CF-IDE-Adpater.jpeg
I was planning on having a 40 pin IDE connector on a combined CF / Keyboard MECB Card, allowing either the CF Adapter to plug directly into the Card (with the CF protruding beyond the card edge), alternatively allowing for a 40 pin IDE cable to route it to a case mounted CF Adapter (when there is eventually a case of some form).
User avatar
lenzjo
Posts: 32
Joined: Mon May 06, 2024 11:30 am

Re: [P] MECB Mass Storage and/or Keyboard Interface Card

Post by lenzjo »

Editor wrote: Wed May 29, 2024 7:58 pm However, where I ended up was thinking along the lines of a MC6821 PIA (noting that we don't need a VIA / timer for a keyboard interface).
This approach also means we can insert a currently in production WDC W65C21N PIA, which is actually good for up to 14MHz, is plug-in compatible with the MC6821 PIA, and therefore well matched for both the 6809 CPU Card and the 6502 CPU Card (with a faster WDC W65C02 CPU).
Hah! I didn't realize that the 6821 and 6521 were pin compatible! The speed was the main reason why I was thinking of the 6522. I want the basic system I/O to be as fast as possible so it can be used with any processor. I'm still not fully settled on the SCC2691 as it can go only to 6Mhz, I've seen faster but then we're leaving the land of dip packages.
Editor wrote: Wed May 29, 2024 7:58 pm On a related note, I intentionaly didn't use the 6522 VIA on my initial Motorola I/O Card, fundamentally because it was intended to be a true Motorola based I/O Card, hence the 6821, 6840, and 6850. My intention was to eventualy make a similar WDC / MOS based I/O Card which instead features a 6522 VIA and a 6551 ACIA.
My rational is different, I don't care much who makes the chips as long as they do what I want them to do ;) I had thought about using an 8255 but it's a 1 Mhz chip. The 6551 would be great for the role ACIA except that the WDC version has a "feature" - it doesn't use the Transmit Data Register Empty bit, so you have to use a delay loop or the Transmit interrupt. Plus the fact it has only a 1 byte buffer.
User avatar
Editor
Posts: 249
Joined: Fri Nov 17, 2023 10:36 pm
Contact:

Re: [P] MECB Mass Storage and/or Keyboard Interface Card

Post by Editor »

lenzjo wrote: Thu May 30, 2024 9:22 am My rational is different, I don't care much who makes the chips as long as they do what I want them to do ;) I had thought about using an 8255 but it's a 1 Mhz chip. The 6551 would be great for the role ACIA except that the WDC version has a "feature" - it doesn't use the Transmit Data Register Empty bit, so you have to use a delay loop or the Transmit interrupt. Plus the fact it has only a 1 byte buffer.
Understood. I was coming from my original Motorola allegiance, and driven by my desire to initially replicate / modernise one of my ASSIST09 based MC6809 Wire-wrap designs, that I'd found in my storage (see my earlier videos).

My original board (and the original published ASSIST09 listing), was designed around the MC6850 ACIA and MC6840 PTM. Although I was tempted to drop-in a 6522 VIA instead, nostalgia and retro Motorola adherance, won me over.

I know, it's a personal preference thing. But, I also just temporarily parked the VIA, thinking that I'd later do a WDC based I/O card. One of the neat advantages of going down the MECB easy "mix & match Cards" path.

As regards the WDC W65C51N ACIA, yes, I had read about the hardware bug. Interestingly, aside from needing the external baud-rate divider, I'm quite happy with the MC68B50 ACIA for my current serial interfacing needs, so I haven't really explored this area any further at this stage.

You'll also note I've focussed more on a Parallel keyboard interface. Again this is a personal choice, mainly because my "early days" experience with direct keyboard interfacing was either parallel (via a parallel ASCII MM5740 Keyboard Encoder), or through a direct matrix keyboard implementation.
Aside from Serial Terminal use, of course. :)
User avatar
bugeyedcreepy
Posts: 72
Joined: Sun Nov 19, 2023 10:21 am

Re: [P] MECB Mass Storage and/or Keyboard Interface Card

Post by bugeyedcreepy »

Editor wrote: Tue May 28, 2024 7:29 am Therefore, to interface a more modern PS/2 Keyboard (replicating the keyboard interfacing that we did in the early days), we really should be using an adapter than translates the PS/2 Keyboard to either a simple serial or parallel ASCII character code interface.

So, I thought I’d pass on this epiphany, for feedback.
I so wish I could contribute... :( Sounds like an Awesome method of skirting overhead and achieving simplicity!
Post Reply