Вы находитесь на странице: 1из 18

Version N 1.

0a

LaurTec
RS232 Terminal
Debugging Enbedded Systems

Author : Mauro Laurenti

email: info.laurtec@gmail.com ID: PJ11004-EN

Copyright 2010 Mauro Laurenti

1/18

License
Copyright (C) 2009 Author: Mauro Laurenti Web Page: www.LaurTec.com Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no FrontCover Texts, and no Back-Cover Texts.

Additional Terms
As stated in section 4 of the license, these additional terms are included and must be preserved: 1)

Disclaimer of Warranty

THERE IS NO WARRANTY FOR THE HARDWARE AND/OR SOFTWARE HEREWITH DESCRIBED, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE HARDWARE AND/OR SOFTWARE AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE HARDWARE AND/OR SOFTWARE IS WITH YOU. SHOULD THE THE HARDWARE AND/OR SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

2)

Limitation of Liability

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE HARDWARE AND/OR SOFTWARE AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE HARDWARE AND/OR SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE HARDWARE AND/OR SOFTWARE TO OPERATE WITH ANY OTHER HARDWARES AND/OR SOFTWARES), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

3)

Interpretation of Sections 1 and 2

If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Hardware and/or Software, unless a warranty or assumption of liability accompanies a copy of the Hardware and/or Software in return for a fee.

Copyright 2010 Mauro Laurenti

2/18

LaurTec
Indice

PJ11004-EN RS232 Terminal

Abstract....................................................................................................................................................4 Software Installation...............................................................................................................................5 System Requirements..............................................................................................................................6 Basic Interface.........................................................................................................................................7 Tabs Area.................................................................................................................................................8 Port Settings Tab..................................................................................................................................8 Write Settings Tab................................................................................................................................9 Read Settings Tab...............................................................................................................................11 Display Tab........................................................................................................................................13 Other features........................................................................................................................................15 Bibliography..........................................................................................................................................17 History....................................................................................................................................................18

3/18

LaurTec
Abstract

PJ11004-EN RS232 Terminal

RS232 protocol is a quite old standard, nevertheless is far from being obsoleted. Many embedded systems still rely on that protocol as easy and powerful tool for debugging and data exchange. The USB standard could not ignore the hegemony of its hold predecessor, hence, within the CDC class (Communication Device Class) defined in the USB standard, there is a portion of it dedicated on RS232 emulation. Many systems, even if are complying with USB standard are actually designed as RS232 communication port. Data exchange with such devices can still be performed using the old tools for RS232. One of the most used program is without any doubts Hyper-Terminal, designed by Microsoft and included with all the windows distributions...till Windows XP. Hyper-Terminal disappearance let other program such as TeraTerm, distributed for free, to take over. Even if it seams that there is no room any longer for RS232 free tools, whoever has used either Hyper-Terminal or TeraTerm, would have been glad heaving on hand more features...1 Transmitting and reading data in HEX format, sending multiple word packets, Data Parsing, auto send, data formatting are some of the features that come with RS232 Terminal, making it one of the most flexible tool for RS232 debugging...and all come for Free.

It's important to advice, making more justice, that both applications Hyper-Terminal and TeraTerm, while they are not the best tools for RS232 debugging they are quite handy in establishing other kind of connections using other protocols.

4/18

LaurTec
Software Installation

PJ11004-EN RS232 Terminal

No software installation is required. Just copy the .exe file within the folder you prefer. The first time you will execute the program you will be prompt to accept or refuse the license agreement as shown in Figure 1.

Figure 1: First Application run.

5/18

LaurTec
System Requirements

PJ11004-EN RS232 Terminal

RS232 Terminal has been designed using Visual Basic 2010 (.NET) so the .NET Framework is required to be installed, if not already installed. It is not required to install Visual Basic 2008 but just the redistributable library of .NET Framework, which can be downloaded for free on the Microsoft web page. Required .NET framework

4 Version

You can check if the .NET Framework is already installed on your machine, just checking the list of installed programs within the Configuration Panel. Another simple way to see if the right .NET Framework is already installed, it can be done just by running the RS232 Terminal application. If it does not boot you do not have the .NET Framework installed (easy and dirty test). Currently the RS232 Terminal has been tested on the following Operative Systems: Operative System Windows 7 Windows XP Hardware Requirements One RS232 Port available (either emulated or true) Microprocessor Rule of thumb, if you have resources to run XP you should be fine!

6/18

LaurTec
Basic Interface

PJ11004-EN RS232 Terminal

The RS232 Terminal interface is quite easy and intuitive. It is composed of two main areas, the setting Tabs and the Read/Write text area, as shown in Figure 2.

Figure 2: Interface overview.

7/18

LaurTec
Tabs Area

PJ11004-EN RS232 Terminal

RS232 Terminal has four Tabs, grouped by functionality: Port Settings, Write Settings, Read Settings and Display.

Port Settings Tab


Port Settings, as shown in Figure 3, does collect all the settings that can be used for the Serial Port of interest. All the fields except the field Port do have a constant list of values, which is independent from the machine on which you run the software. The field Port, has a different list depending the on PC you are running the application on; that field gets, in fact, populated on run time. If no port are found the field is empty.

Figure 3: Port Settings Tab

If the hardware configuration of your PC get changed while the RS232 Terminal is running, you can update the list simply running the command Refresh Port List from the menu Actions, without the need to close and open the application (as other programs require). To Open a Port, you can do it either from the Tool Bar or from the Actions menu. Once the Port gets Activated, the Port Settings Tab is disabled, since no parameters can be changed on the fly.

8/18

LaurTec
Write Settings Tab
Write Settings Tab is divided in groups as shown in Figure 4.

PJ11004-EN RS232 Terminal

Figure 4: Write Settings Tab.

Group Buffer This feature allows to change the PC buffer which is dedicated to the output data2. Group Data Format The data format radio buttons do allow to change the format of the data that is sent out. Depending on the format the Send Message text assume a capitalization or not. The ASCII format is used as it would be for a standard text writer. The Integer format does allow writing the data as an integer. Currently just one integer can be sent out within the range of 0-255. The Hexadecimal format is the most interesting for the embedded programmers since does allow to send data in the format the Microcontroller does speak. The message can be written in any manner, grouping byte per byte separated by a space 3 (AE 05 A3 B2), or writing it as a single

Note that this number could differ from the actual one, since the field does not consider the buffer that the RS232 device could have internally. That number specify the RAM, beside the device buffer, which is assigned to the Port connection. Any number of space are allowed between bytes. Spaces are not considered as byte and they are ignored. Incomplete byte at the end are ignored. Numbers smaller than 16 must be preceded by a 0.

9/18

LaurTec

PJ11004-EN RS232 Terminal

word (AE05A3B2). If your system has a 16 bits core, you might prefer, just because you are used on doing that, writing the word in group of 2 bytes (AE05 A3B2).

Group Send These options do allow clearing the send message any time the message is sent out, instead of doing it any time using the menu Actions option. The option Send as you type can be used just with the ASCII format. If the buffer is not cleared automatically, any time you press a key, all the text within the send message is sent out before the pressed key. If this is not the behavior you want you might probably want to select the automatic option to clean the TX buffer. Auto Send Enable This option is not frequently used, but when needed is doing the job of a second man. Any time you need to send a data and change some settings in the mean time, this is the feature you would want. If you are located some meters away from the PC that is transmitting data to the embedded system and you need to regularly ping your embedded system, this is the feature you want want. Since this feature it might be used while you are not closed to the PC, you can enable e beep, that advices you once the data is sent out. Last but not least you can decide the period at which the data is sent out. This group get enabled after the port connection has been established.

10/18

LaurTec
Read Settings Tab
The Read Settings Tab is shown in Figure 5.

PJ11004-EN RS232 Terminal

Figure 5: Read Settings Tab.

The Tab is divided in different groups, as follow:

Group Buffer It allows to set the input buffer. It can be handy in case you must receive high speed data and your PC is busy or has reduced resources. Enable Data Parser The data parser option is an handy features that allows to format the received data according to the embedded system. Many times data are sent in data packets of known length or/and with a known starting byte. In either case the received data can be parsed accordingly showing data in a tidy manner, making it easier to read. Each option, beside activating the Data Parsing, must be individually activated. In Figure 6 is shown an example on which the data Parsing option is set using a data packet length of 8 bytes. It's possible to see how the data get formatted inserting a carriage return any time 8 bytes are received. In Figure 7 is shown an example on which the same data is received without enabling the data parsing option.

11/18

LaurTec

PJ11004-EN RS232 Terminal

Figure 6: Example of Data Parsing with a fixed data packet set to 8 bytes.

Figure 7: Example without the Data Parsing enabled.

The Start byte must be written according to the format used to display the data (see Display Tab). For example if the hexadecimal format is used to display the data, the start byte must be written in hexadecimal, omitting the 0x.

12/18

LaurTec
Display Tab
The Display Tab is divided in different groups as shown in Figure 8.

PJ11004-EN RS232 Terminal

Figure 8: Display Tab

The meaning of each group is quite straightforward.

Group Output Enabling the check does show all the received data into the Read Messages box. Disabling it will not show any further data into the Read Message box. The Send Message box is independent from that feature. Group Data Format Data format is quite an handy feature that does let you adapt the text according the data format you are actually sending out. The data that will be shown on the Read Messages box will have the format according to the one selected in that group. The selected format is also the one that reflect the Start Byte chosen in case the parsing option is enabled. Group Data Formatting At first glance you might underestimate how important these features are. Any time you receive a byte you can choose what to insert before the one that will come next. Data formatting is a really handy feature since does let you format and save the data according to a 13/18

LaurTec

PJ11004-EN RS232 Terminal

second program that might parse the data. For instance if your device send temperature data over time it might be useful inserting the carriage return and having all the data in one column, in such a way that plotting it with excell it would be as easier as selecting the column.

14/18

LaurTec
Other features

PJ11004-EN RS232 Terminal

Any time you debug the RS232 port other features could be handy if available. RS232 Terminal does have it!

ASCII Table ready to be shown trough the Tool menu. Data Converter (HEX, Int, ASCII) it can be run trough the Tool menu Save/Open the log data for further analysis.

Beside that other little features that could be handy are:


RS232 Terminal Window can be adjusted in size. Send/Read Message box can be shrink, mowing the left border as desired.

15/18

LaurTec

PJ11004-EN RS232 Terminal

Index
A O Actions..............................................................8 Operative System..............................................6 ASCII......................................................9 e seg. P Auto Send Enable ..........................................10 Port Settings......................................................8 B Port Settings Tab..............................................8 beep.................................................................10 R C Read Messages box........................................13 CDC..................................................................4 Read Settings....................................................8 Communication Device Class..........................4 Read Settings Tab...........................................11 D Refresh Port List...............................................8 Display..............................................................8 RS232 emulation..............................................4 Display Tab.....................................................13 RS232 port......................................................15 E S Enable Data Parser..........................................11 Send as you type.............................................10 G Send Message box..........................................13 Group Buffer...............................................9, 11 Serial Port.........................................................8 Group Data Format.........................................13 Software Installation.........................................5 Group Data Format ..........................................9 Start byte.........................................................12 Group Data Formatting...................................13 T Group Output..................................................13 TeraTerm..........................................................4 Group Send.....................................................10 U H USB..................................................................4 Hardware Requirements...................................6 W Hyper-Terminal................................................4 Windows XP.....................................................4 L Write Settings...................................................8 license agreement.............................................5 Write Settings Tab............................................9 M . Microprocessor.................................................6 .NET Framework..............................................6

16/18

LaurTec
Bibliography

PJ11004-EN RS232 Terminal

[1] www.LaurTec.com : Electronic web page where you can find the most updated RS232 Terminal software and documentation.

17/18

LaurTec
History
Date dd.mm.yy 18.09.10 25.09.10 Version 1.0 1.0a Nome Mauro Laurenti Mauro Laurenti

PJ11004-EN RS232 Terminal

Description Original Version describing RS232 Terminal 1.0.0 Adjustment for the Software version 1.0.1

18/18

Вам также может понравиться