P503i External Keypad Interface

The P503i imode Java phone has a serial port interface, which is used to talk to the proprietary external keypad for the device. We wondered if we could emulate this keypad to send serial data to the phone.

We took an external keypad, cut the connector, and hooked up a logic analyzer. There are just three wires in the connector. Two of them seem to have serial data, the third does not seem to be used. The black is data and the yellow is ground, in the keypad connector we opened up.

This code drives a parallel port on an embedded linux board. I grabbed the waveforms of the key presses for digits 0-9 on a logic analyzer, and put them into the software. Presumably other character codes could be sent as well, if you look at the source code you see each keypress looks like about 4 bytes at roughly 300 baud, and only the last byte seems to vary, the others are constant.

This gives a throughput of about 8 characters (keypresses) per second to the phone.

My original intent was to use the external serial keypad input as a source of data to a Java Iappli application running in the phone. However, sadly, it turns out that the Java firmware in the phone implements very bad support for the external keypad. External keypad commands do not appear to be visible to the Java applet under most circumstances. When you enter a keypress on the external keypad, the phone beeps as if accepting a command, but the applet does not get a processEvent() or keyPressed call.

The only place the external keypress commands appear in a Java applet is inside of a Panel textbox input area when the component has been selected for input. Numeric or alpha keypresses do appear, but none of the cursor buttons work, so you can't even have the external app perform a "submit". It may be that the ComponentListener.BUTTON_PRESSED or TEXT_CHANGED method might get called, but it doesn't appear to be. So there is apparently really no way to get automatic background data into the Java app transparently via this interface.

On the other hand, all the external keyboard command do work in the phone's firmware i-mode browser, so you can have an external device perform a "submit" by cursoring down to a form field, entering data, and pressing "submit". This is a terrible hack though.

This is code to emulate the P503i external keypad interface. parport.c


hqm at ai . mit . edu