Click here to Skip to main content
15,513,441 members
Articles / Programming Languages / C#
Article
Posted 15 Feb 2008

Tagged as

Stats

392.8K views
28.1K downloads
153 bookmarked

Termie: A Simple RS232 Terminal

Rate me:
Please Sign up or sign in to vote.
4.83/5 (46 votes)
13 Oct 2008BSD2 min read
Termie opens a serial port and allows you to communicate with it in a chat-like interface.
Termie/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:

Termie/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


Written By
Software Developer Buzz Monkey Software
United States United States
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.

Comments and Discussions

 
GeneralTermie.. Good little program.. Pin
Dan Sherack12-Oct-08 12:04
Dan Sherack12-Oct-08 12:04 
GeneralRe: Termie.. Good little program.. Pin
milkplus13-Oct-08 13:56
milkplus13-Oct-08 13:56 
GeneralRe: Termie.. Good little program.. Pin
Dan Sherack28-Oct-08 18:14
Dan Sherack28-Oct-08 18:14 
GeneralHistory Pin
eb0916-Sep-08 3:37
eb0916-Sep-08 3:37 
GeneralRe: History Pin
milkplus13-Oct-08 14:16
milkplus13-Oct-08 14:16 
QuestionProblem exiting termie when serial port is sending lots of data Pin
MyEvilTwin27-Aug-08 17:19
MyEvilTwin27-Aug-08 17:19 
AnswerRe: Problem exiting termie when serial port is sending lots of data Pin
milkplus23-Sep-08 10:55
milkplus23-Sep-08 10:55 
GeneralRe: Problem exiting termie when serial port is sending lots of data Pin
milkplus13-Oct-08 14:17
milkplus13-Oct-08 14:17 
I updated the zip file. The hang should be fixed.
GeneralThanks! Pin
gerippe4-Aug-08 7:28
gerippe4-Aug-08 7:28 
GeneralPerfect! Pin
Drew Loika14-Jul-08 16:23
Drew Loika14-Jul-08 16:23 
Generalinteresting.. but Pin
william h johnson iii27-May-08 8:54
william h johnson iii27-May-08 8:54 
GeneralRe: interesting.. but Pin
milkplus27-May-08 9:38
milkplus27-May-08 9:38 
GeneralRe: interesting.. but Pin
william h johnson iii27-May-08 10:08
william h johnson iii27-May-08 10:08 
Generalnice guy and good solution Pin
belcooo16-May-08 18:23
belcooo16-May-08 18:23 
GeneralRe: nice guy and good solution Pin
milkplus21-May-08 14:39
milkplus21-May-08 14:39 
GeneralThanks Pin
syd kahn12-May-08 7:32
syd kahn12-May-08 7:32 
QuestionHow do I install the program? Pin
Yomero7-Mar-08 16:36
Yomero7-Mar-08 16:36 
AnswerRe: How do I install the program? Pin
milkplus15-May-08 7:17
milkplus15-May-08 7:17 
GeneralNice. Pin
thompsons23-Feb-08 8:49
thompsons23-Feb-08 8:49 
GeneralRe: Nice. Pin
milkplus25-Feb-08 7:37
milkplus25-Feb-08 7:37 
GeneralSystem.IO.Ports Pin
faulty17-Feb-08 3:17
faulty17-Feb-08 3:17 
GeneralRe: System.IO.Ports Pin
milkplus19-Feb-08 9:18
milkplus19-Feb-08 9:18 
GeneralDelegate vs. IObserver interface Pin
unitrunker15-Feb-08 12:20
unitrunker15-Feb-08 12:20 
GeneralRe: Delegate vs. IObserver interface Pin
milkplus19-Feb-08 9:19
milkplus19-Feb-08 9:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

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