Creating an iPod Touch/iPhone serial cable

This is a tutorial on how to create a serial cable for use with your iPod Touch or iPhone (usable for iBoot tinkering, iPhonelinux/OpeniBoot debugging etc). To communicate with the UART of your iPod, you will need a device which can operate at serial TTL levels.

FTDI USB solution

FTDI creates chips which support either 3.3V or 5V serial TTL level communication.  This is probably the most simple (and relatively inexpensive) option, and a must if your computer doesn't even have a serial port anymore. You can either buy a cable featuring one of these chips directly from the FTDI store (around  sixteen british pounds), or grab a conversion board from  Sparkfun or eBay. All of these converters can be conveniently plugged into a USB port, and drivers are available for Win/Linux/Max.  Of course you will still need the iPod dock connector and a few tiny bits to connect it to your FTDI cable/board (make sure you have a converter which supports 3.3V TTL).

Serial port (RS232) solution

If your computer still has a serial port (many recent motherboards do not, being largely replaced by USB) and you're feeling adventurous, you can use this instead of the FTDI solution. A computer's serial port however, uses RS232 standard levels (as opposed to TTL) - this means there may be voltages up to 15V present on the serial lines, enough to smoke your iPod. To convert this down to levels suitable for your iPod, you will need a RS232 to TTL level converter, ie. the MAX3232. Note that the MAX232 might also work, depending on whether the iPod is 5.5V tolerant (the extra 3 in MAX3232 indicates it's a model which supports 3.3V). I haven't seen anyone report either succes or failure, so get a 3232 to be on the safe side.

Components

You'll need at least the following parts for the cable:

  • A DB9 'serial' connector
  • MAX3232 or compatible clone
  • Five 0.1μF capacitors
  • iPod dock connector - available at Sparkfun, Ridax or Qables
  • 470KΩ resistor
  • LM1117T-3.3 voltage regulator (requires two 10μF capacitors) together with a 5V - 10V DC power source (wall adapter/batteries) - or any other 3.3V power source
  • A soldering iron, tin and some wire to connect everything together

The MAX3232 seems a little harder to obtain than it's bigger brother, if you really cannot easily get it then you can sample it from Maxim (but please, do not abuse). You can also omit four of the 0.1μF capacitors if you can get your hands on a MAX3233 (which is also alot more expensive).

Warning - the iPod dock connector has a quite small pitch. It's however not impossible to solder, especially if you clip off all unneeded pins. In case of doubt you should consider getting a PodBreakout instead. (Another warning here: the podbreakout pinout might not match the pinout as I provide it in this tutorial. Please tell me if you know.)

Also, if you're only interested in using the serial port while the actual iPod/iPhone OS is up and running, you can omit the 3.3V power source, and instead draw power from pin 18 of the iPod dock connector (fig. 1) - it's not enabled until the OS loads, thus not usable if talking to iBoot is your goal.

If you're taking the FTDI route all you really need is the dock connector and the resistor.

Building

Having gathered all components, it's time to heat up your iron (or even better, dig up your breadboard as well). The serial protocol requires three wires on each end - TxD, RxD and GND. Additionally you will have to connect the resistor from pin 21 (accessory detect) to ground (pin 1)  on the iPod dock connector end - the iPod uses specific resistance values to identify the accessory connected. The 470KΩ resistor will enable the UART.

The following image provides an overview of the iPod dock connector pins, looking at it from behind (that's where you'll be soldering).

Fig 1. - iPod dock connector serial pinout

Solder wires to pin 1, 12 and 13 of the dock connector (so you can easily plug them into your breadboard) and add the resistor. Proceed by soldering three wires to the DB9 connector (see fig. 2). Now you're able to hook up both the iPod and DB9 connector to your breadboard, it's time to add the MAX3232. Use the schematic below (as well as the MAX3232 datasheet) as a reference. The VCC and GND pins of the MAX3232 are shown separately, as well as the LM1117-3.3 voltage converter (Vin should be +4.75V to +10V, Vout will then be the 3.3V you need for the MAX3232).

Fig. 2 - Full schematic

Fig. 2 - Full schematic

Testing

Once you're sure you've got everything right, first enable iBoot UART debugging using iRecovery if you haven't done so yet. Connect the iPod via USB and launch a shell using iRecovery -s and enter setenv debug-uarts 1 followed by saveenv.

Now you may connect the iPod to your serial dock connector (if it's off, it should turn on due to the accessory detect resistor). Fire up your preferred terminal program (Putty, Minicom, etc). Disable parity and flow control, and set the speed to 115200 baud, 8 data bits. Now restart the iPod and enter recovery mode, and if everything went well you should get the iBoot shell on your serial connection. Congratulations.

2 Responses to “Creating an iPod Touch/iPhone serial cable”

  1. Martijn Says:

    Hi,

    Dank voor het artikel over de serial port / iPod Touch.
    Weet je of dit nog steeds werkt met OS 3.0 ?

    Ik vermoed dat er wat veranderd is, aangezien OS 3.0 nu een API heeft voor allerlei accessoires (niet alleen speaker docks en Nike sensors).

    Ik probeer het serial protocol voor de iPhone External Accessory APIs van OS 3.0 te ontrafelen.
    Als ik pin 21 met een 470K weerstand naar ground trek, zegt m'n iPhone "This accesory is not made to work with iPhone".
    Wellicht is er een nieuwe waarde voor nieuwere/OS 3.0-compatible accesories?

    Ik hoop dat je wat meer info voor me hebt...!

    groetjes,
    Martijn

  2. Martin O'Brien Grant Says:

    This, and the ipt RedSnow dongle tut are easily the two most detailed and easy to follow guides i have found on this subject matter, even trawling through various blogs and chatting through IRC channels etc didn't get much luck

    Thanks for taking the time to perform a write-up

Leave a Reply