Email:   
Home
In This Issue
EasyPrint
Click here for the RSS feed's XML code. This is not a browser URL.
An introduction to serial communications (continued)

When the serial port is opened on Palm OS 1 or Palm OS 2, it sends a backspace character, a hex 08. When the port is closed, you sometimes get a hex 7F character. This may cause problems with other equipment that it's connected to. Palm OS 3 (on the Palm IIIs) does not send these spurious characters.

SerClearErr on Palm OS 1 resets the UART whenever it's called, so if you call it when there isn't any error, you'll glitch any characters being received right then. Only call it when SerReceive reports an error.

Finally, there is a problem with the way "Clear to Send" handshaking is implemented. As it is currently architected, it will never go low ("off" meaning "don't send any more characters"). This means the buffer must be emptied often enough that it never fills up.

The future
Palm has indicated they're going to rework the serial architecture. I don't know when that will happen ("Soon", they say), nor which future machines will change to that new architecture. Just be aware that there will be future changes.

Using SerialEcho
SerialEcho is a simple program that simply receives characters and transmits them back. You can use a terminal program (HyperTerm under Windows, for example, or Zterm on the Macintosh).

To use HyperTerm, start it from Windows' start menu, and configure its properties to use whatever serial port you desire, at 9600 baud and no handshaking. It's convenient to use the same port HotSync is using. Stop HotSync, start HyperTerm, then just drop the Palm device in its cradle and start SerialEcho. Whatever you type on HyperTerm will be sent back, so you'll see the characters you're typing. Pull the Palm device out (or turn it off) and the characters stop being sent back. Follow this same approach with Zterm if you're on the Macintosh. Zterm is shareware, so you'll probably have to download it if you're not already "hip" to it.

Conclusion
This is a simple introduction to serial communications and the Palm device serial port. Many books have been written and careers have been made just dealing with serial communications. I'll write more about it again in future columns.

Palm has a lot of useful information on their web site. See the resources list below for links to several of them. In particular, the white paper and FAQs are worth reading next.

Product availability and resources
Source code to SerialEcho is at my web site, located at http://www.ajw.com/PalmPower/ProgrammingPower/Dec98/SerialEcho.zip.

The Serial Hardware Development Kit which contains information about the cables and cradle, vendors for connectors, and so forth, is available at http://www.palm.com/devzone/hdk/dzhdkser.html.

The Serial port pin-out (Palm device serial connector) for the signals on each pin on the back of the Palm device is available at http://www.palm.com/devzone/hdk/images/signals.gif.

You can download Zterm from http://www.download.com or visit any of the InfoMac archives.

Serial Port FAQs
Visit the FAQ at http://www.palm.com/devzone/faqs/HHSerial.html#a111.

Palm OS Serial Manager (white paper) is available at http://www.palm.com/devzone/docs/serialma.html#40982.

Alan Weiner writes software for Palm devices. His email address is alan@ajw.com.




[ Prev ]

ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
-- Advertisement --

NO HASSLE PHOTO PRINTING, SHARING, AND STORAGE -- AS LOW AS $2.54 PER MONTH
Discover an easier way to share, print and manage your photos online! Get your own online photo album site for sharing photos, as well as easy-to-use editing tools to make sure your photos look their very best. You can even order high quality prints directly from your album — and have them delivered right to your door!

Best of all, you can also get login-free photo sharing at your personal domain name (if you have one), so your friends and family don't have to hassle with signing up or logging in just to view your pictures. It's the perfect solution for sharing, printing and storing all your favorite images!

And it's only from The Duck! Tap here to get started.

-- Advertisement --

Write for Computing Unplugged!
Share your experience and expertise with other handheld device users. There are new opportunities at ZATZ for contributing authors and editors.

Write about something you're an expert on and get your name in lights.

For Writers' Guidelines and to discuss topics, contact Staff Editor Steve Niles. This is your opportunity to shine in front of your peers, your clients, and friends.

Click for more info!

Copyright © 1998-2008, ZATZ Publishing. All rights reserved worldwide.
Editor's Login