|
|
|
|
|
|
|
|
|
|
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.
Alan Weiner writes software for Palm devices. His email address is alan@ajw.com.
[ Prev ]
|
|
|
|
|
|
-- 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! |
|
|
|
|
|
|
|
|