logo Home Contact Resume Writing Technical projects Scout restoration Vintage computing

Book 3

My third book is released! Learn what you'll need to know in order to become an embedded engineer.

Book 2

Check out my second book; learn practical stuff about building robots and control systems around Linux PCs and the Atmel AVR.

Book 1

My first book gives you all the intro you need on developing 32-bit embedded systems on a hobbyist budget.

The debug serial port, J1, is an essential route into the Kuro box, since it is the default console for kernel messages and bootloader communications, and it is the easiest device to use for kernel bring-up and debug. For inscrutable reasons, Buffalo neither documents nor fully implements this port.

The pinout of J1 is as follows (the pads are drilled for a standard 100 mil SIL header, which is rather a relief as most of the other connectors in the appliance are on 2mm pitch):

1TxD (data out of the box)
2RxD (data into the box)
33.3V power out of the box

As is fairly standard with debug ports on embedded boards, the serial port is NOT at RS-232C levels; it is driven at the CPU's I/O ring voltage (3.3V) and it is inverted relative to RS-232C. This means that you need a charge-pump type inverting serial transceiver IC in order to interface it to a normal PC. In turn, this usually means breadboarding something quick and dirty.

However, there is an easier route, which also gives you a one-stop solution to the problem of having a legacy-free PC. Most USB-to-serial converters consist of a microcontroller that does the USB interface, and a separate, off-the-shelf transceiver chip doing the level translation. As a rule the I/O voltage in these devices is 3.3V, which is conveniently compatible with the MPC8241's I/O ring.

I chose to use a PalmConnect USB adapter, originally intended to adapt a Palm III or m100 cradle to USB. Here is a scan of the component side of the PCB of this adapter:

PalmConnect adapter PCB, before modification

If you have a different adapter, you'll certainly see a different layout and different micro, but it is likely that the transceiver part is something very similar to the Analog Devices ADM3311 used in the Palm adapter, if not the exact same device.

The first step you should take after opening your serial adapter is to check that it uses 3.3V logic levels internally. (If it uses 5V internally, the current-limiting resistors and 5V-tolerant I/Os in the Kuro Box will protect it, but you might not see any output on the PC side). To determine the internal logic voltage, simply plug the adapter into a USB port, wait for it to be recognized by the host PC, then use a multimeter or oscilloscope to probe the supply pins on the transceiver chip - pins 23 (GND) and 2 (Vcc) in the case of the ADM3311.

Now you need to desolder that transceiver chip. The method I use is to put a bead of solder down all the pins on one side, then get an Exacto blade under the chip to lever up that side while keeping the entire bead melted with my iron. Repeat on the other side. You'll very rapidly seesaw the chip off the board this way; just be careful not to break any traces. Practice on some junked appliance if necessary. Here's the board after desoldering the transceiver:

PalmConnect adapter PCB, after removing serial driver IC

Now you need to determine where to feed the Kuro Box signals. To do this, you must establish which gates in the transceiver handle RxD and TxD, and connect to the "other" side of those gates. This involves tracing back pins from the DB9 to pads of the IC you just desoldered, then referring to the datasheet for the transceiver chip to work out where the other side of that gate lies.

Pin 3 of the DB9 is TxD, and in the example above runs to pin 22 (T1OUT) of the transceiver. The corresponding input pin (T1IN) on the transceiver is pin 7, so we run a wire from pin 2 (RxD) of the Kuro Box's J1 to pin 7 of the space where the transceiver used to be. Remember that we're effectively implementing a nullmodem here, which is why we route TxD to RxD and vice versa.

Similarly, pin 2 of the DB9 is RxD, and in the example above runs to pin 19 (R1IN) of the ADM3311. The corresponding output pin (R1OUT) is 10, so we run a wire from pin 1 (TxD) of the Kuro Box debug port to pad 10 of the transceiver's space.

Finally, we connect pin 4 (GND) of the Kuro Box debug port to any convenient ground point on the USB-to-serial adapter. The 3.3V supply line from the Kuro box isn't needed, so don't connect it to anything.

Here's a suggested way of routing the cable: Connect it to the solder side of the Kuro mainboard, use regular 50 mil ribbon cable, and route the cable out of the fan exhaust hole. Obviously, do not route it through the fan itself! There is a gap between the fan and rear bezel; it is ample space for the cable to exit without touching the fan blades:

Kuro Box suggested serial cable routing

Here is a close-up of the patched PalmConnect board. Tweezers are necessary when installing these patch wires. Also observe that I kept the converter chip; it's taped inside the plastic housing (you can see it as a black lump in the picture):

Hacked PalmConnect adapter connected to Kuro Box

Note that I left the DB9 on the board, even though it isn't connected to anything any more. The reason for this is that I have jammed the board back into its original housing and tightly wound it in insulation tape to keep the halves together. The DB9 acts as a strain relief and friction grip for the ribbon cable:

Hacked PalmConnect adapter, reassembled

There is one further thing you need to do: As described above, the interface will let you see kernel messages, but it will not let you type anything in. There is a series resistor on the receive line, which Buffalo left off the PCB for some reason. Here's a photo of the J1 area on the component side of the Kuro PCB, showing where you need to install the resistor; it's space R76 in the photo:

Kuro Box R76

Buffalo used a 10K resistor in the other serial line (R75), so that's what I used for R76, and it works very well. The package size is 0603; you should be able to salvage one off a junked appliance or PC peripheral if you don't keep reels of SMD parts in your lab.

Now you're up and running, connect your terminal program to the USB adapter at 57600bps, 8 data bits, no parity, 1 stop bit, with no flow control. You should see all the kernel messages while the unit is booting or shutting down (and also on events such as USB hotplug). There is a getty process running on that port, so you can log in locally. The port can also be used for general-purpose communications; it is accessible as /dev/ttyS0. and all original content herein is © Copyright 2005 by Lewin A.R.W. Edwards. "" is a trademark protected under U.S. and international law. Infringement or attempted dilution of the intellectual property rights held by Lewin A.R.W. Edwards will be prosecuted to the fullest possible extent.