Search PalmPower's 487 Palm-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only 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.


« Previous  ·  1  ·  2  ·  3  ·  4
Other articles you might like
Home > Phones and PDAs > Palm and Treo > Programming (24 articles)
   How PDA software is born
   Program with Simplicity
   Kinectivity 2.0 brings enterprise application developers new tools
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Other PalmPower Articles
Palm gets up to date with new Tungsten family of handhelds
Create handwritten email with riteMail
Presenter-to-Go puts PowerPoint presentations on your Palm OS handheld
Looking for the cutting edge
Gain remote access to databases and PLCs
PalmSource Open House showcases what's new in the Palm community
Analysis: handheld market share
More from the ZATZ journals
Computing Unplugged: The iPad defenders have spoken
David Gewirtz Online: CNN commentary and analysis
DominoPower: Application development, William Shatner, and the origin of the universe
OutlookPower: More about disappearing text
-- Advertisement --

ONLINE GROUP CALENDAR - FOR UP TO 100 OF YOUR CLOSEST FRIENDS
Stay organized and in control with 24/7 access to all of your important events, projects and files --whether you're at work, at home or on the road.

You can share your calendar, projects and files so everyone in your office is up to date. Plus, search your entire group to find times when everyone is available to meet, manage company resources and much more.

Organize your entire team for as low as $9.95 per year (and yes, that's where the decimal place is supposed to be!)

Tap here to get started right away.

-- Advertisement --

Sent Items Organizer
When you need to file your sent email into their proper folders based on keywords or who it's to. It's also perfect for shared mailboxes.

It also adds a "Send And File" toolbar button while you're composing (similar to the way Lotus Notes used to work) for quick and easy filing.

Find out more!

ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login