Android serial debugging

1,392 views
Skip to first unread message

Nicholas FitzRoy-Dale

unread,
Mar 19, 2009, 6:24:26 AM3/19/09
to android-...@googlegroups.com
Hi,

Following on from this thread:

http://groups.google.com/group/android-platform/browse_thread/thread/f03730e25cc3fe55?fwc=1

I made a serial cable for the ADP1 and thought it would be good to
record how publicly. Thanks to the posters on that thread for
indicating that it is possible.

The major problem is the proprietary "ExtUSB" connector. ExtUSB
connectors are available from http://www.podgizmo.com or http://www.sparkfun.com
. The pinout is:

_____________
| A B C D E |
\1 2 3 4 5 6|

A: GND
B: NC
C: +DATA
D: -DATA
E: +5v

1: +Mic
2: +Right
3: Switch / Rx / CABLE_IN2
4: GND / Tx / CABLE_IN1
5: GND
6: +Left

I.E. this is the same diagram as the one at http://www.tracyandmatt.co.uk/blogs/index.php/2006/09/10/htc_hermes_usb_connector_pin_config
, with Rx and Tx labelled. Pins A-E are USB, and pins 1-6 are headset
(if pin 4 is connected to pin A) or serial (otherwise). These pins are
referred to as CABLE_IN1 and CABLE_IN2 in the Linux source code (arch/
arm/mach_msm/htc_headset.c)

This isn't standard RS232, so don't hook it directly to an RS232 port!
It looks like serial is at cmos ttl levels (~2.8 volts) so you will
need to make sure you are communicating at that level. Sparkfun also
sells an adjustable-voltage ttl-serial converter which worked for me.

The port runs at 115200bps, 8N1.

It should be straightforward to make a dual USB / serial cable, but I
haven't done this yet.

Hope somebody else can make use of this. :)

Nicholas FitzRoy-Dale


macpod

unread,
Mar 21, 2009, 12:38:47 PM3/21/09
to android-platform
On Mar 19, 6:24 am, Nicholas FitzRoy-Dale
<nicholas.fitzroy.d...@gmail.com> wrote:
> Hi,
>
> Following on from this thread:
>
> http://groups.google.com/group/android-platform/browse_thread/thread/...
>
> I made aserialcable for the ADP1 and thought it would be good to  
> record how publicly. Thanks to the posters on that thread for  
> indicating that it is possible.
>
> The major problem is the proprietary "ExtUSB" connector. ExtUSB  
> connectors are available fromhttp://www.podgizmo.comorhttp://www.sparkfun.com
> . The pinout is:
>
> _____________
> | A B C D E |
> \1 2 3 4 5 6|
>
> A: GND
> B: NC
> C: +DATA
> D: -DATA
> E: +5v
>
> 1: +Mic
> 2: +Right
> 3: Switch / Rx / CABLE_IN2
> 4: GND / Tx / CABLE_IN1
> 5: GND
> 6: +Left
>
> I.E. this is the same diagram as the one athttp://www.tracyandmatt.co.uk/blogs/index.php/2006/09/10/htc_hermes_u...
> , with Rx and Tx labelled. Pins A-E are USB, and pins 1-6 are headset  
> (if pin 4 is connected to pin A) orserial(otherwise). These pins are  
> referred to as CABLE_IN1 and CABLE_IN2 in the Linux source code (arch/
> arm/mach_msm/htc_headset.c)
>
> This isn't standard RS232, so don't hook it directly to an RS232 port!  
> It looks likeserialis at cmos ttl levels (~2.8 volts) so you will  
> need to make sure you are communicating at that level. Sparkfun also  
> sells an adjustable-voltage ttl-serialconverter which worked for me.
>
> The port runs at 115200bps, 8N1.
>
> It should be straightforward to make a dual USB /serialcable, but I  
> haven't done this yet.
>
> Hope somebody else can make use of this. :)
>
> Nicholas FitzRoy-Dale

Good afternoon Nicholas,

Thanks for posting this. I was sitting down to solder my own and was
searching this group to get that referenced post.. yours was a
pleasant surprise! I used a cp2102 and have been taking pictures for a
pictorial.. I'll throw it up on instructables.com when I am done. If
there is interest here, I'll post a link.. just let me know.

Something I have observed... are you sure you don't have the rx/tx
flipped about? Mine works, but I think I had to flip them.. It is a
little confusing to convert from the podgizmo chart to the other one
however so I could be mistaken.

For the ttl-serial converter you got from sparkfun (http://
www.sparkfun.com/commerce/product_info.php?products_id=449) what
extusb pin are you using to feed vcc 2.8v?

Nicholas FitzRoy-Dale

unread,
Mar 22, 2009, 2:30:23 AM3/22/09
to android-...@googlegroups.com

On 22/03/2009, at 3:38 AM, macpod wrote:
> Good afternoon Nicholas,
>
> Thanks for posting this. I was sitting down to solder my own and was
> searching this group to get that referenced post.. yours was a
> pleasant surprise!

Hi there,

Yep, there doesn't seem to be much out there! Glad you found this
helpful.

> I used a cp2102 and have been taking pictures for a
> pictorial.. I'll throw it up on instructables.com when I am done. If
> there is interest here, I'll post a link.. just let me know.

Sounds good to me.

> Something I have observed... are you sure you don't have the rx/tx
> flipped about? Mine works, but I think I had to flip them.. It is a
> little confusing to convert from the podgizmo chart to the other one
> however so I could be mistaken.

Hmm, I think you might be right. There is a post in the comments
section of that product page about "uart dyslexia" and I can
empathise. :)

> For the ttl-serial converter you got from sparkfun (http://
> www.sparkfun.com/commerce/product_info.php?products_id=449) what
> extusb pin are you using to feed vcc 2.8v?

I couldn't find a pin that supplied +2.8v so I used my own power
supply. I've decided the easiest thing to do is use the +5v supplied
from the host computer combined with an lm317 circuit to drop the
voltage to 2.8v. Seems to work. Possibly I don't need to be this
paranoid, but I don't want to risk my phone! If you come up with
something neater, though, I'd be keen to hear about it.

Nicholas

Reply all
Reply to author
Forward
0 new messages