In the previous “Hacking Linksys NSLU2″ post, I described adding a serial connector. However, connecting the serial port directly to a RS232 port via a conversion wire only will probably be a disaster. If you are lucky, it wouldn’t work; but if you are unlucky, you might burnt out the port or the slug processor.
The serial interface of the slug is 3.3Volts level i.e. 0V represents logic 0, and 3.3V represents logic 1. To be of any use, it needs to be “voltage translated” to RS232 level. The RS232 specification calls for +/- 3V to 15V loaded (connection made). Negative voltage level represents logic 0, while positive voltage represents logic 1. Unconnected, the open circuit voltage can go up to maximum of +/- 25V.
Typically, it’s easiest to use a ready-made RS232 converter module. These cost a few tens of dollars (depending on where you bought them), and is made using a RS232 integrated circuit part. It is perfectly fine to use one of these. If you are so inclined, you could also salvage a converter board from an old equipment.
However, I worked in the electronic industry for many years as circuit designer, and I learnt a cool trick. It is actually perfectly workable to violate the RS232 specification, and still have the serial communication working between a low voltage device and a PC. Even with signalling at 3.3V logic level, the serial port of a typical PC will be able to communicate properly!
Now, I realized this violation of RS232 specification might be problematic if the serial port is a functional part of the device. As a crude example, if you are making an serial mouse, you wouldn’t want to use this trick. The serial port is a functional part of a serial mouse, and even a small rate of failures could be detrimental to the end user. However, if you are making an equipment where the serial port is used for diagnostic only (never seen by the end user), this trick might be perfectly acceptable.
Thus, hacking the slug using this trick is perfectly ok. I am the only person affected by any potential problem, and I know about fixing it.
One important caveat: you still need a circuit in between the slug serial port and the PC.
- this circuit will protect the slug from damage, due to the high voltages coming from the PC
- the circuit will also invert the signal polarity
The RS232 signal is normally inverted by a RS232 module. Inside the serial port of most processor, the UART will do a second inversion (either by hardware or software), and restores the correct polarity. Therefore, in using this trick, the circuit which replaces a standard RS232 module would also need to invert the polarity.
So, what is this trick? A simple transistors circuit.
An additional benefit of this trick is that you can use the 3.3V power from the slug to drive the circuit, and no additional power supply is needed. The 3.3V power is even supplied by pin 1 of the slug’s serial connector, so you don’t have to make additional wirings.
I won’t go into explaining how this simple circuit works. If you are familiar with electronics circuits, you could figure it out easily. And if you are not, it wouldn’t matter too much.
Ok, with all the ramblings above, the following is my own implementation of the circuit. I have plenty of discarded printed circuit boards (PCB) for equipment I made. I find a PCB containing the circuit and cut out the relevant portion.

I then attached a 4-pole wire which already has the appropriate EH-type header.



Next, I need a wire which has another header at one end, and a proper RS232 connector at the other end.

Next post, I will describe mounting the serial interface module into the slug’s casing.


Post a Comment