Hack A PS/2 Keyboard Onto Your Pi Zero

Hacking for the Raspberry Pi Zero is a tricky proposition. Whatever you do, you’re working with a nominal five dollar board, so your hacks can’t be too highfalutin. For instance, a decent PS/2 to USB adapter will cost you as much as the Zero did, if not more. But if you just need to drive your Pi Zero from your old Model M (we hear you!) you’ve got to do it on the cheap.

So when prolific Pi hacker [mincepi] set out to build a PS/2 adapter, some corners were cut. PS/2 is a clocked data protocol, but the good news is that the clock doesn’t start and stop all the time as in I2C or SPI. This means that if you poll the data line at just the right frequency, at least in principle you’ll be able to ignore the clock.

ps2-schematic_border

So that’s what [mincepi] did. As you can see in the schematic and the banner image, there’s nothing to it. Two resistors provide the pullup voltage for the clock and data lines. And here’s a gem: a green LED with a drop voltage of about 2 V converts the 5 V data line down to something that the Pi Zero’s 3.3 V won’t get fried with. Cute, and very much in keeping with the spirit of the hack. You might be tempted to scrounge up a 3.3 V zener diode from somewhere just to be on the safe side, but remember, it’s a five dollar computer you’re protecting.

The last piece is a custom kernel module for the Pi that polls the PS/2 data line at just the right frequency. If you’re not a Linux person and “compiling a kernel module” sounds scary, [mincepi] has even put together a nice guide for the Raspbian distribution that he’s using. It should work with minor tweaks for any other distro.

We said [mincepi] is a prolific Pi hacker and here’s the proof: we’ve covered his quick-and-dirty VGA output hack and a scheme to get analog sound input into the Pi Zero just in the last couple of weeks. Hack on!

PS/2 Keyboard For Raspberry Pi

A lot of people can bake a cake. Sort of. Most of us can bake a cake if we have a cake mix. Making a cake from scratch is a different proposition. Sure, you know it is possible, but in real life, most of us just get a box of cake mix. The Raspberry Pi isn’t a cake (or even a pie), but you could make the same observation about it. You know the Raspberry Pi is just an ARM computer, you could program it without running an available operating system, but realistically you won’t. This is what makes it fun to watch those that are taking on this challenge.

[Deater] is writing his own Pi operating system and he faced a daunting problem: keyboard input. Usually, you plug a USB keyboard into the Pi (or a hub connected to the Pi). But this only works because of the Linux USB stack and drivers exist. That’s a lot of code to get working just to get simple keyboard input working for testing and debugging. That’s why [Deater] created a PS/2 keyboard interface for the Pi.

Even if you aren’t writing your own OS, you might find it useful to use a PS/2 keyboard to free up a USB port, or maybe you want to connect that beautiful Model-M keyboard without a USB adapter. The PS/2 keyboard uses a relatively simple clock and data protocol that is well-understood. The only real issue is converting the 5V PS/2 signals to 3.3V for the Pi (and vice versa, of course).

Continue reading “PS/2 Keyboard For Raspberry Pi”

PS/2 Synth Will Knock You Off Your Broom

Here’s a hack centered around something a lot of people have sitting around: a PS/2 keyboard. [serdef] turned a Harry Potter-edition PS/2 into a combination synth keyboard and drum machine and has a nice write-up about it on Hackaday.io.

For communication, he tore up a PS/2 to USB cable to get a female mini DIN connector and wired it to the Nano. He’s using a Dreamblaster S1 synth module to generate sounds, and that sits on a synth shield along with the Nano. The synth can be powered from either the USB or a 9-volt.

Keymapping is done with the Teensy PS/2 keyboard library. [serdef] reused a bunch of code from his bicycle drummer project which also employed the Dreamblaster S1. [serdef] is continually adding features to this project, like a pot for resonance control which lets him shape the waveform like an analog synth. He has posted some handy PS/2 integration code, his synth code, and a KiCad schematic. Demo videos are waiting for you across the link.  Continue reading “PS/2 Synth Will Knock You Off Your Broom”

Portable PS2, Courtesy Of Cross Plane

It’s not exactly a portable, but [Downing]’s PS2 advance puts all the power of a Playstation 2 in the palm of your hands, all while being more popular that the Vita.

For the audio and video, the project uses a Cross Plane, a project from a slightly unsuccessful Kickstarter [Downing] pulled the plug on last month. When the handheld is plugged in to the Cross Plane, all the audio, video, and controller wires are transferred through a pair of cables, with the possible addition of wireless transmission should [Downing] ever want to revisit this project.

In deciding on what to use for a case, [Downing] had bought a few AG cases from Polycase but found the ergonomics severely lacking. Putting two of the case backs together, he found the resulting structure was actually very comfortable, and with a few simple modifications to add some holes for acorn nuts,

It’s a great looking project that really highlights [Downing]’s talents as a console modder. He’s also thrown his hat into the Hackaday Trinket contest by engraving the Jolly Wrencher into the back of his project, which unfortunately isn’t seen in the video below.

Continue reading “Portable PS2, Courtesy Of Cross Plane”

Handheld Console Build-off

gc

The above pic isn’t a new Wii U controller from Nintendo – it’s the product of the 2013 Portable Build-Off Challenge over at the Made By Bacteria forums. Every year the Bacman forums hold a contest to build the best portabalized console, and like every year this year’s entries are top-notch.

One of the more interesting projects this year is a handheld PlayStation 2 put together by [Gman]. It uses a PS2 Slim motherboard and a dualshock 2 controller along with a 4-inch screen to stuff an entire PS2 into a convenient handheld gaming device. [Gman] ditched the CD drive and opted to play games off the USB drive, a clever substitution that really reduces the size and power consumption.

In our humble opinion, the best looking console mod is the one shown above by [Bungle]. It’s a portable GameCube stuffed inside a handmade case with a WiiKey Fusion that allows games to be played off an SD card. It’s an amazing build, and we can only hope [Bungle] will make a few molds of his case.

The entire contest has an incredible display of console modding expertise, and is well worth a look.

An Arcade Controller For The Original PlayStation

I love it when you hit those switches

[Kevin] just finished a project for someone who lives in his apartment complex. This resident loves the game Pop ‘n Music – a Guitar Hero sort of game for the original Playstation and PS2 that uses nine colored buttons instead of five buttons along a fingerboard. His original idea was to wire up a few arcade buttons to a Playstation controller but this plan fell through, forcing [Kevin] to figure out the PSX bus all by his lonesome.

The initial code began with simply bit-banging the PSX controller interface with an AVR. This had a few problems, namely speed, forcing [Kevin] to move onto assembly programming to squeeze every last bit of performance out of a microcontroller.

The assembly route failed as well, dropping some transactions  Looking at the problem again, [Kevin] realized the PSX controller bus looked a little like an SPI bus. There were a few changes required – reversing the order of the bits, and using the MISO line to drive a transistor – but this method worked almost perfectly on the first try.

Now, [Kevin]’s building mate has a custom Playstation controller for his favorite game. Of course all the code is up on github for all your PSX controller emulation needs, but be sure to check out this completely unrelated Pop ‘N Music video from someone who desperately needs a piano.

Fun With LED Matrix And Mouse

fun-with-LED-matrix-and-mouse

[Brad] just acquired a 32×32 RGB LED matrix and he jumped right into the deep end with his first project. To try out his skills on the device he used an Arduino to drive a slew of pixels with bouncing-ball physics.

The demo starts off with a hail storm of multi-colored falling pixels. In the center of the storm is the cursor, which he controls with a PS2 mouse. That happens to be a ball mouse which makes sense as we don’t remember having seen any optical mice as of late that weren’t USB. The PS2 protocol is easy to read using a microcontroller; more about that in [Brad’s] project write up.

By holding down the left mouse button he can draw persistent pixels on the screen. The falling balls then interact by bouncing off of the obstacles. The image above shows a frame on three sides of the screen which has trapped the pixels near the bottom. He can also erase pixels, which has the effect of draining the trapped balls like a hole in a bucket of water. Neat!

Bouncing ball physics are fun to experiment with. Here’s one being driven by an analog computer.

Continue reading “Fun With LED Matrix And Mouse”