Click here to Skip to main content
6,822,613 members and growing! (18,851 online)
Email Password   helpLost your password?
Platforms, Frameworks & Libraries » Mobile Development » CodeProject Tools     Intermediate License: The BSD License

Termie: A Simple RS232 Terminal

By milkplus

Termie opens a serial port and allows you to communicate with it in a chat-like interface.
C#, Windows, Dev
Posted:15 Feb 2008
Updated:13 Oct 2008
Views:62,405
Bookmarked:102 times
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
31 votes for this article.
Popularity: 6.35 Rating: 4.25 out of 5
3 votes, 10.0%
1
1 vote, 3.3%
2

3
4 votes, 13.3%
4
22 votes, 73.3%
5
Termie.jpg

Introduction

Termie opens a serial port and logs data received to a window. It is useful for embedded software development. It can also send data so it is actually a RS232 terminal with a chat-like interface.

An embedded system is a special-purpose computer such as a Wii, MP3 player, or cell phone. To develop for such a system, you need a development "kit" which allows you to download software and debug. Communication between your PC and the embedded system is often a serial cable (RS-232).

In my case, I get output from the embedded system (a game console) via an RS-232 cable. So if I want to see my printfs, I need a program that will display anything that comes in the COM port on my PC.

Background

Termie is an open source clone of Termite from ITB CompuPhase.

What I liked about Termite is that it is simple and fast. Hyperterminal is clunky. I wanted something similar to Termite that was open source. Writing it in C# turned out to be easy; a weekend project. Once done, I can add new features as needed and get great suggestions here!

Settings

Settings are stored in an INI file in the application startup folder:

Termie2.jpg

Features

  • Multiple select, select all, and copy to the clipboard
  • Hex Output (not in Termite)
  • Output filter (not in Termite)
  • Partial line output (so you can see "..." one dot at a time)
  • Click status to close/open with current port settings
  • Toggle Scrolling button
  • Send File button
  • Color coded lines (green=received, blue=sent)
  • Send escape sequences (\n, \x7f)
  • Send history

Using the Code

System.IO.Ports has a SerialPort class that does everything we want. I wrapped it in a singleton class with delegates for status and data events.

History

  • February-2008: Original submission
  • March-2008: Added clipboard, output filter, hex output, monospace font, and all settings
  • May-2008: Added read thread, partial output, color coding, and "send file"
  • October-2008: Fixed thread bug, added history and escape sequences to send (\n, \x7f), and upgraded project files to Visual C# 2008 Express

License

This article, along with any associated source code and files, is licensed under The BSD License

About the Author

milkplus


Member
David McClurg is a game programmer from Oregon, USA. He is currently interested in C#, xna for zune, and steering behaviors. When not coding, David enjoys tennis, kayaking, and botany.
Occupation: Software Developer
Company: Buzz Monkey Software
Location: United States United States

Other popular Mobile Development articles:

  • Writing Your Own GPS Applications: Part 2
    In part two of the series, the author of "GPS.NET" teaches developers how to write GPS applications suitable for the real world by mastering GPS precision concepts. Source code includes a working NMEA interpreter and sample high-precision application in C# and VB.NET.
  • Writing Your Own GPS Applications: Part I
    What is it that GPS applications need to be good enough to use for in-car navigation? Also, how does the process of interpreting GPS data actually work? In this three-part series, I will cover both topics and give you the skills you need to write a commercial-grade GPS application.
  • Learn How to Find GPS Location on Any SmartPhone, and Then Make it Relevant
    A step by step tutorial for getting GPS from any SmartPhone, even without GPS built in, and then making location useful.
  • Windows Mobile, iPhone, Android - Marketplace Comparison
    Detailed comparison between Windows Mobile Marketplace, Apple's iPhone AppStore and Android Market from developer point of view.
  • iPhone UI in Windows Mobile
    It's an interface that works with transparency effects. As a sample I used an interface just like the iPhone one. In this tutorial I am explaining how simple is working with transparency on Windows Mobile.
Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 25 of 42 (Total in Forum: 42) (Refresh)FirstPrevNext
GeneralNon-standard Baud Rates PinmemberCamCoder6613:29 23 Oct '09  
GeneralRe: Non-standard Baud Rates PinmemberCamCoder6613:32 23 Oct '09  
GeneralRe: Non-standard Baud Rates Pinmembermilkplus13:48 23 Oct '09  
GeneralMoving cursor to the right one position (right arrow) PinmemberFernando Vargas8:01 22 Sep '09  
Questioncool~ Pinmembernube015:44 12 Sep '09  
GeneralThanks for your greate work PinmemberPBalaKumar17:16 2 Aug '09  
GeneralHEX output. Pinmembernathanteepee20:32 24 Jul '09  
General\xa5 sends hex 3f Pinmembercodeblue5556:12 30 Jun '09  
GeneralThanks! PinmemberBillDF12:33 27 Mar '09  
Generalbin code Pinmemberraq1237:09 29 Jan '09  
GeneralRe: bin code Pinmembermilkplus7:24 29 Jan '09  
GeneralRe: bin code Pinmemberraq1237:57 29 Jan '09  
GeneralRe: bin code Pinmembermwb11007:12 17 Jun '09  
GeneralUsing Termie to send a file to a microprocessor PinmemberGary_12320:45 28 Jan '09  
GeneralRe: Using Termie to send a file to a microprocessor Pinmembermilkplus7:32 29 Jan '09  
GeneralMy vote of 2 Pinmemberbrettratner17:49 22 Dec '08  
GeneralOnly ascii characters up to 127dec are supported. All bytes above 127 are converted to the ? character. PinmemberMyEvilTwin12:59 4 Nov '08  
GeneralRe: Only ascii characters up to 127dec are supported. All bytes above 127 are converted to the ? character. Pinmembermilkplus7:33 29 Jan '09  
GeneralTermie.. Good little program.. PinmemberDan Sherack12:04 12 Oct '08  
GeneralRe: Termie.. Good little program.. Pinmembermilkplus13:56 13 Oct '08  
GeneralRe: Termie.. Good little program.. PinmemberDan Sherack18:14 28 Oct '08  
GeneralHistory Pinmembereb093:37 16 Sep '08  
GeneralRe: History Pinmembermilkplus14:16 13 Oct '08  
QuestionProblem exiting termie when serial port is sending lots of data PinmemberMyEvilTwin17:19 27 Aug '08  
AnswerRe: Problem exiting termie when serial port is sending lots of data Pinmembermilkplus10:55 23 Sep '08  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads.

PermaLink | Privacy | Terms of Use
Last Updated: 13 Oct 2008
Editor: Deeksha Shenoy
Copyright 2008 by milkplus
Everything else Copyright © CodeProject, 1999-2010
Web17 | Advertise on the Code Project