Jump to content

PS/2 Direction for the Commander X16


Recommended Posts

On 1/6/2022 at 5:29 PM, Stefan said:

@Wavicle, do you see any problem supporting both keyboard and mouse with the ATTINY + I2C solution?

Why not an ESP32 ; then you have Wifi, i2c and a well tested PS/2 interface all in for a few quid. Then move the sound samples out of VERA (which doesn't have the memory) into an ESP32 (which does) and use that to generate audio (and you might as well put the standard waveforms there as well).  Some sort of standard API so you could replace it if necessary.

The i2c interface can be used for expansion as well.

Link to comment
Share on other sites

On 1/6/2022 at 8:59 AM, rje said:

At work, we periodically have to assess whether what we're doing is worth the effort we're putting into it.
I understand that sometimes, business is driving the work, and there's nothing we can do about it.
But it never hurts to let business know the issues and how much trouble they will cause.

 

I hear that USB is more expensive than PS/2, which is cheap.  But... I'm starting to wonder if PS/2 is not really cheap, but rather pushes time and expense and complexity back to the board.

 

Fail fast is a good engineering principle. It takes a bit of discipline to let go of the urge to follow a sunk a cost. We do this where I work also; I've watched features that I was very fond and poured weeks into get dropped. A bitter pill, yes, but I understood the business justification. I'm less good at it with my own hobby projects because I do not have firm dates I'm managing work for; I suspect it's something similar here. The first X16 video is coming up on 3 years old, I think?

I think the problem may be that it was originally envisioned that the 6502 keyboard handler would be interrupt driven and for some reason that plan was abandoned. I don't know why and I'm not a 6522/VIA expert (not even a novice for that matter). It looks to me from the datasheet that there is no easy way to configure a negative edge sensitive interrupt trigger on a single IO wire. There are some peripheral interrupt/handshake pins that appear to be for this purpose (CA1, CA2, CB1, and CB2) and maybe things could be improved by moving the PS/2 clock to one of those pins and having the whole thing interrupt driven, but we'd still need something that would allow the 6502 to pull the clock low manually to inhibit traffic (I think that would just mean adding a transistor). I don't know how interrupt cause is detected and routed to the appropriate handler routine so I'm not sure what the overhead of such an interrupt would be since we'd be expecting several of them to come in over a few milliseconds.

I doubt going to a USB solution would make things less complex. The keyboard and mouse on the X8 are USB and have a simple controller implemented in the FPGA. In the X16 case, it would be one more thing offloaded to VERA.

I think moving the PS/2 keyboard handling to a microcontroller is the right thing to do in this case.

  • Thanks 1
Link to comment
Share on other sites

On 1/6/2022 at 9:29 AM, Stefan said:

My guess is that the community is not interested in the keyboard solution per se. We just want it to become functional so that we can get on with what really interests us, eventually owning and using a X16.

I agree that the team should choose a proven design that is easy to implement.

@Wavicle, do you see any problem supporting both keyboard and mouse with the ATTINY + I2C solution?

I have no idea what the report rate of the mouse is, but my gut tells me that handling two serial interfaces with a peak clock of 20kHz should not be a problem even if both interfaces were saturated. The I2C clock runs substantially faster, but is mostly handled in hardware so missing a bit there is not a concern. It seems pretty solid.

Link to comment
Share on other sites

On 1/6/2022 at 11:58 AM, paulscottrobson said:

Why not an ESP32 ; then you have Wifi, i2c and a well tested PS/2 interface all in for a few quid. Then move the sound samples out of VERA (which doesn't have the memory) into an ESP32 (which does) and use that to generate audio (and you might as well put the standard waveforms there as well).  Some sort of standard API so you could replace it if necessary.

The i2c interface can be used for expansion as well.

I think the biggest reason is aesthetic: the ESP32 looks nothing like an 80's era computer component. I have no idea if additional FCC testing beyond what the ESP32 already has would be needed. I think everyone would love the ability to transfer files to the X16 via WiFi (I prototyped such a card-based solution over the summer on a breadboard 6502; can't recall if I posted it here or not).

Link to comment
Share on other sites

On 1/6/2022 at 8:15 PM, Wavicle said:

I think the biggest reason is aesthetic: the ESP32 looks nothing like an 80's era computer component. I have no idea if additional FCC testing beyond what the ESP32 already has would be needed. I think everyone would love the ability to transfer files to the X16 via WiFi (I prototyped such a card-based solution over the summer on a breadboard 6502; can't recall if I posted it here or not).

Well .... this board seems to have more microcontrollers than Digikey these days.

Link to comment
Share on other sites

On 1/6/2022 at 8:00 PM, Wavicle said:

I think moving the PS/2 keyboard handling to a microcontroller is the right thing to do in this case.

Yes.

I don't know for the current design, but AFAIK the Vic20 and C64 do not use NMI - it appears to be connected to RESTORE. An NMI would not be suitable for keyboard polling per se perhaps, there may be some hardware accesses that it would mess up, but you could make it an IRQ with a pull up transistor or something. There are pretty stable i2c libraries and ps/2 setups for AVR chips, so it shouldn't be difficult to make what is effectively an i2c keyboard.

Edited by paulscottrobson
Link to comment
Share on other sites

On 1/7/2022 at 2:17 AM, paulscottrobson said:

Well .... this board seems to have more microcontrollers than Digikey these days.

Hmm, off the top of my head, I can only think of the ATTiny and what looks like an STM32 on VERA. The ATTiny handles the ATX power sequencing and potentially the PS/2 keyboard and mouse. I'm not certain about the STM32 on VERA, but I think it is used for programming the FPGA's SPI flash so it isn't strictly necessary. Is there anything else?

Link to comment
Share on other sites

On 1/7/2022 at 12:45 PM, Wavicle said:

Hmm, off the top of my head, I can only think of the ATTiny and what looks like an STM32 on VERA. The ATTiny handles the ATX power sequencing and potentially the PS/2 keyboard and mouse. I'm not certain about the STM32 on VERA, but I think it is used for programming the FPGA's SPI flash so it isn't strictly necessary. Is there anything else?

Which of the chips do you reckon is an STM32?

X16v3.jpg.795b9c4100e43f24c2a2dc51579ef494.jpg

Link to comment
Share on other sites

On 1/6/2022 at 11:29 AM, Stefan said:

My guess is that the community is not interested in the keyboard solution per se. We just want it to become functional so that we can get on with what really interests us, eventually owning and using a X16.

I agree that the team should choose a proven design that is easy to implement.

@Wavicle, do you see any problem supporting both keyboard and mouse with the ATTINY + I2C solution?

More or less true for me, with the one exception being that I'd like the ability to send messages to the mouse so that Intellimouse mode support is possible, even if not via the Kernal.

Link to comment
Share on other sites

  • Administrators

In Facebook group Lorin Milsap posted some info. Lorin is part of the extended X16 team but not in the core development team. In Facebook group Lorin has badges of Admin, Group expert and Founding member.

In Facebook group Lorin Milsap said:

Consider this as a semi official response.

As stated by others earlier yes there are 2 hurdles. The first is parts availability. This is highly affected by Covid and global supply chain issues. I won’t cover specifics, but many of the parts in short supply are the common logic chips.

The second issue is the PS/2 keyboard code. There is an updated routine which supposedly works, but none of the design team who has real hardware has had an opportunity to test the new code. Keep in mind by real hardware I mean complete machines that meet the current design criteria, not past revision boards. This actually circles back to the supply chain issues (yes it’s that bad). To my knowledge only 2 fully functional current boards exist, possibly a third, and no I do not even have one.

Quoted from here: https://www.facebook.com/groups/CommanderX16/posts/1087788681972225/

  • Like 2
  • Thanks 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

Please review our Terms of Use