pkoning2 / lk201emu

Emulate DEC LK201 keyboard using a standard PC USB keyboard
BSD 2-Clause "Simplified" License
46 stars 7 forks source link

No reason the PS/2 emulator couldn't be implemented on an Arduino Pro Micro? #8

Open ej0rge opened 3 years ago

ej0rge commented 3 years ago

Hey, i am excited about this project. I have a VT220 and a working LK201 (and VT1200 and LK401) but i loathe the key feel of these old membrane keyboards. I've got boards inbound from jlcpcb.

I've got no heartburn about ordering an Itsy Bitsy 5v from adafruit, but i have a thing for building things Small, no real fear of light duty hot air smt work, and half a dozen Arduino Pro Micro 5v clone boards in a drawer.

The Itsy Bitsy is cheaper than a Genuino Pro Micro, but 3x the cost of a chinese clone Pro Micro.

I sort of know my way around kicad and while I'm a terrible coder i can manage to make small changes without getting completely lost. It looks like at worst i might have to use different pins for the PS/2 interface if i compiled for the APM.

After looking through the schematic I am pretty sure i could lay out a board with an smt max232 equivalent and smt capacitors and resistor on a board no wider than the APM and fit a buzzer under there too, with the mini-din 6 on one end and rj22 (or just a JST-XH for a custom cable) on the other. And design a very small 3d printed enclosure, maybe with a cable clamp for telephone station cable with an RJ22 plug crimped on the end. I have a crimper and ends, pretty sure.

I would consider this a fun project.

Am i missing anything?

pkoning2 commented 3 years ago

Hi, thanks for the feedback.

The only real requirement is that you have an Arduino, and it should have 5V I/O, with enough pins to drive the signals used in the design. I did my original debugging with a Metro prototyping board. If you don't use an Itsy Bitsy then you probably need to adjust the board. If the pinouts differ then that may need to change as well, and if that means different pin numbers the "pin assignment" defines at the top of the source file would need adjustment.

If necessary you can leave out the buzzer, though of course that means no key click and no "bell". If your board doesn't have a built-in LED, then either you can omit the WAIT LED, or wire up an LED to some available pin and change the WAITLED define to match.

The changes you proposed all sound fine. I'd like to see your finished work, it sounds nice.

ej0rge commented 3 years ago

Yes the pins of the two modules are substantially different, and the PS/2 port will have to be assigned to different pins when the firmware is built.

I think I'll keep the buzzer but might use a different part. I haven't dug into the code but it looks like you are using a pwm pin to drive it through the unused output pin on the 232 driver. Clever. That same pin is still broken out on the arduino pro mini.

pkoning2 commented 3 years ago

Yes, the idea of driving a buzzer through an RS-232 driver was lifted from another LK201 adapter design. The PWM is to get the variable loudness. And the RC filter actually makes that work; unfiltered the different width pulses sound different in character but not really in loudness.