peripheral

6 Articles

[Dhole], like the fox, isn’t the first to connect his computer to a Game Boy printer but he has done a remarkable job of documenting the process so well that anyone can follow. The operation is described well enough that it isn’t necessary to scrutinize his code, so don’t be put off if C and Rust are not your first choices. The whole thing is written like a story in three chapters.

The first chapter is about hacking a link cable between two Game Boys. First, he explains the necessity and process of setting the speed of his microcontroller, a NUCLEO-F411RE development board by STMicroelectronics. Once the rate is set, he builds a sniffer by observing the traffic on the cable and listens in on two Game Boys playing Tetris in competition mode. We can’t help but think that some 8-bit cheating would be possible if Tetris thought your opponent instantly had a screen overflowing with tetrominoes. Spying on a couple of Game Boys meant that no undue stress was put on the printer.

Chapter two built on the first chapter by using the protocol to understand how the printer expects to be spoken to. There is plenty of documentation about this already, and it is thoughtfully referenced. It becomes possible to convince a Game Boy that the connected microcontroller is a printer so it will oblige by sending an image. Since there isn’t a reason to wait for printing hardware, the transfer is nearly instantaneous. In the image above, you can see a picture of [Dhole] taken by a Game Boy camera.

The final chapter, now that all the protocols are understood, is also the climax where the computer and microcontroller convince the printer they are a Game Boy that wants to print an image. In the finale, we get another lesson about measuring controller frequency without an oscilloscope. If you are looking for the hack, there it is. There is a handful of success in the form of old receipts with superimposed grayscale images since virgin thermal printer paper by Nintendo costs as much as a used printer.

We feel it’s healthy to cultivate a general desire for more neat tools. That’s just one of the reasons we like [doublecloverleaf]’s retro PC mouse. It certainly meets the requirement, the first computer mouse was wooden, and the mouse he used as the guts for this is so retro it belongs in the dollar bin at the thrift store.

To begin with, [doublecloverleaf] took a picture of the footprint of his aged, but trustworthy laser mouse. Using the photo in SolidWorks he built a model of the circuit board, and with that digitized, a mouse that suited his aesthetics around it. The final model is available on GrabCAD.

Edit: Woops, looks like we accidentally slandered a great Slovenian community CNC project. Check out the comments for more info. Original text in italics.

Next came the CNC. It looks like he’s using one of those Chinese 3040 mills that are popular right now. The electronics are no good, but if you luck out you can get a decent set of mechanics out of one. He did a two side milling operation on a wood block, using four small holes to align the gcode before each step, and then milled the bottom out of aluminum. Lastly, he milled the buttons out of aluminum as well, and turned a knurled scroll wheel on his lathe.
The end result looks exceedingly high end, and it would be a hard first guess to assume the internals were equivalent to a $10 Amazon house brand mouse.

USB has become pretty “universal” nowadays, handling everything from high-speed data transfer to charging phones. There are even USB-powered lava lamps. This ubiquity doesn’t come without some costs, though. There have been many attacks on smartphones and computers which exploit the fact that USB is found pretty much everywhere, and if you want to avoid these attacks you can either give up using USB or do what [Jason] did and block the data lines on the USB port.

USB typically uses four wires: two for power and two for data. If you simply disconnect the data lines, though, the peripheral can’t negotiate with the host for more power and will limp along at 0.5 watts. However, [Jason] discovered that this negotiation takes place at a much lower data rate than normal data transfer, and was able to put a type of filter in between the host and the peripheral. The filter allows the low-frequency data transfer pass through but when a high-frequency data transfer occurs the filter blocks the communication.

[Jason] now has a device that can allow his peripherals to charge at the increased rate without having to worry about untrusted USB ports (at an airport or coffee shop, for example). This simple device could stop things like BadUSB from doing their dirty work, although whether or not it could stop something this nasty is still up in the air.

Like many of us, I’m sure, [Nick] doesn’t like digging around behind his computer case for a spare USB port and ended up buying a small USB hub for his desk. The hub worked perfectly, but then [Nick] realized an Ethernet port would be a nice addition. And a DC power supply. Then feature creep set in.

What [Nick] ended up building is a monstrosity of a desk hub with two 24V, 5V, 3.3V 50 Watt DC outputs on banana plugs, a five-port USB hub, four-port Ethernet switch, three mains sockets, 32 digital I/Os, UART, SPI, and I2C ports, a 24×4 LCD or displaying DC current usage and serial input, cooling fans, and a buzzer just or kicks.

The case is constructed out of 6mm laser cut acrylic, and the electronics are admittedly a bit messy. That said, this box does seem very useful and even plays the theme from Mario Brothers, as seen in the video below.

We’ve seen a ton of projects that interface hardware with the Raspberry Pi. But they usually depend on bit-banging. That means they toggle the pins in software to match a specific protocol. The thing is that the beefy Broadcom SoC that anchors the board has a lot of built-in peripherals that are just waiting to be used instead of bit banging. In this case, it’s the hardware SPI peripheral which can be accessed via the bcm2835 library for RPi.

One of the things that would have really complicated this process is the pin mapping between the Broadcom chip and the RPi GPIO header. Since not all pins are broken out, it was either luck or good design forethought that made all of the SPI0 pins from the chip available on the RPi breakout header. The library page (linked above) explains this well. But if you’re looking for more of a working example check out [EngineerByNight’s] project with adds an accelerometer using hardware SPI.

The CREATE USB Interface (CUI) was a project that came out of UC Santa Barbara around the same time the Arduino was being developed. It has a USB port, a PIC18F4550, and a prototyping area. It was designed to enable easy interfacing with the real would through many A/D inputs and general I/O ports. It supports both OSC and MIDI-over-USB natively. The biggest difference between the CUI and the Arduino is its USB support. The Arduino uses an FTDI chip to create a serial interface to its onboard AVR. The CUI’s PIC has native support for USB. That means you can have the CUI appear to be any USB HID device you want: keyboard, mouse, game controller, etc.

The Arduino has a friendly development environment and a large following though. CUI create [Dan Overholt] decided to add an ATmega168 to his board to get the best of both worlds, the CUIduino (scroll down). It can be programmed just like any other Arduino compatible device, but the having the CUI parent means your Arduino project can behave like a native USB HID gadget.