Editing RS232/USB Probe

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
(by the author: ) This is a really old program.  I am not sure where the code is or much else about it.  I now work in Python and a much more useful program is [[Python SmartTerminal]]
 
 
 
=== Summary  ===
 
=== Summary  ===
  
 
*Name: RS232/USB Probe  
 
*Name: RS232/USB Probe  
*Status: still developing, but is working Download available see [[]]  -- after a period of inactivity some development Jan 09.
+
*Status: still developing, but is working  
 
*Technology: Java -- should run on many platforms, Windows 98 through Vista  
 
*Technology: Java -- should run on many platforms, Windows 98 through Vista  
 
*Author: russ_hensel ( where you can find an email address to reach me )
 
*Author: russ_hensel ( where you can find an email address to reach me )
 
*License: not fully determined, but open source and object code.
 
*License: not fully determined, but open source and object code.
 
This is one of a series of articles on Microcontroller Serial Communications, rooted at this site here:  [[Microcontroller Serial Communications Articles]]
 
  
 
Purpose:
 
Purpose:
  
The project is a specialized terminal emulator designed to talk to a microcontroller or similar device, either to control them or to try to deduce what its control protocol is.
+
The project is a specialized terminal emulator designed to talk to microcontrolles and similar devices either to control them or to try to deduce what there control protocol is.
  
Several areas are provided for input to the device.  This is typed as strings, but escape sequences also allow special characters including any ASCII character entered by its hex code.  Data is sent by pressing the send button.  Each send area has its own recieve area just to the right of it.  Also all data both sent and recieved is logged to the bottom window.  Other events in the software are also posted to the logging area.  The application has several send areas so that you can easily reissue earlier commands and easily keep frequently used commands ready to use.
+
Several areas are provided for input to the device.  This is typed as strings, but escape sequences also allow special characters including any ASCII character entered by its hex code.  Data is sent by pressing the send button.  Several areas are provided so that you can easily reissue earlier commands.
  
 
A complete log of activity is provided both to the screen and to a log file.
 
A complete log of activity is provided both to the screen and to a log file.
 
Q: ''(Does this require a [[USB Bit Whacker]] between the PC and the device under test (DUT), or does it also work fine with direct RS-232 connection between the PC and the device under test?)'' A: No BitWacker is required for this application, it works with any serial device ( which can be the device under test ), but works best with devices that wait for a command, then they issue a response.  If you have a device to test that does not have a serial port then using a BitWacker or other microcontroller as an intermediary can be a useful approach.
 
  
 
=== Early Mock Up of Screen ===
 
=== Early Mock Up of Screen ===
Line 25: Line 19:
 
[[Image:RS232ProbeMain.png | Screen Shot ]]
 
[[Image:RS232ProbeMain.png | Screen Shot ]]
  
The screen has been enhanced, to see the current version, try the software.
+
=== Download ===
 
 
=== Some Features ===
 
 
 
*Should work on any computer/os that supports Java.  Currently using an older version of Java so that it will run on old Windows 98 computers.
 
 
 
*Works with RS232 and USB ( virtual RS232 ).  This includes USB to RS232 converters.
 
 
 
*Communication parameters set through a property ( text ) file.  Name of property file can be specified at the command line, or may be changed once the application is running.
 
 
 
*Consists of several "mini terminals" sharing a common loging area.  This make issuing, reissuing commands and seeing old responses easy.
 
 
 
*Log data is written to a log file ( which can be specified in the property file ) as well as the screen.
 
 
 
*After sending a command it listens for a response untill either a end of response character is recieved, a maximum length, or a maximum anount of time. ( all of these are specified for each mini terminal ).
 
 
 
*Can be set to "probe" for the right communications port by sending a command to the port and looking at the response.
 
 
 
*Non printable and other ascii codes can be entered.
 
 
 
*User comments may be added to the log data.
 
 
 
*Provides a framework of code for other applications like the BitWacker [[Command GUI]] or the [[Graphical Data Logger]]
 
 
 
== Download and Installation Directions ==
 
  
moved to [[BitWacker PIC and Other Microcontroller to Java Communications]]
+
Coming soon, for early adopters email me [[russ_hensel]]
  
== Use Details ==
+
=== Use Details ===
  
 
Some Use Details
 
Some Use Details
  
=== Start Up ===
 
Before running the program make sure the property file ( RS232Probe.properties ) has the values you want to use.  This file is documented internally.  Make sure you save a backup somewhere of the original file ( there is a backup in the installed files ).  Double click the batch file to launch the program.  Startup information will appear in the Java console ( the dos window associated with the program, and in the program log area, and in the log file. )
 
 
Features implemented in the property file and batch file ( see these files for more information ).
 
 
*The batch file ( perhaps named RunRS232Probe.bat ) can specify the name of the property file to use.  Otherwise the property file defaults to RS232Probe.properties.
 
 
*The com port, baud rate and other communications parameters can be set in the property file.  The virtual com ports under usb drivers ingore the baud rate and other properties, but they must be set to legal rs232 values.
 
 
*You may leave out the desired com port and have the application probe all available ports looking for a specified response.  Typically this is done by opening the port, sending the version command, and looking for a valid response from the microcontroller.
 
 
*You may specify a special command ( a string ) to be sent to the microcontroller after a port is succesfully opened to connect to it.
 
 
*You should specify the name of your logging file.
 
 
*There are other values in the property file that may be present but are used by related applications, but ignored by the RS232Probe.
 
 
=== Running ===
 
 
Fill in one of the blanks under Data ( the column by defaults contains SendMe ) and press the <Send> button.  The device response ( if any ) will appear in the corresponding Received Data field.  You can edit the data and send it again or just send it again.  The panel on the bottom shows the activity of the application >> precedes sent data, and << received data.  The rows are repeated so that you can easily switch between string sent.  
 
Fill in one of the blanks under Data ( the column by defaults contains SendMe ) and press the <Send> button.  The device response ( if any ) will appear in the corresponding Received Data field.  You can edit the data and send it again or just send it again.  The panel on the bottom shows the activity of the application >> precedes sent data, and << received data.  The rows are repeated so that you can easily switch between string sent.  
  
Line 85: Line 37:
 
These are specified by entering data in some of the gui fields and can be different for different data that you send.
 
These are specified by entering data in some of the gui fields and can be different for different data that you send.
  
The initial values in the GUI give you some idea ( I hope ) on how to use them.  Here are some details on all the Graphical User Elements.
+
Here is some detail on all the Graphical User Elements.
  
  
Line 100: Line 52:
 
|-valign="top"
 
|-valign="top"
 
|''Field:'' Data  
 
|''Field:'' Data  
|Input: The data you want to send. This field uses special character translation so you can send any ASCII character(s).  See Special Character Translation below.
+
|Input: The data you want to send. This field uses special character translation so you can send any ASCII character(s).
  
 
<!---------------------------->
 
<!---------------------------->
 
|-valign="top"
 
|-valign="top"
|''Field:'' Waits
+
|Waits ''Field''
 
|Input:  A time in some arbitrary units that the probe will wait for a return from the BitWacker.  Data usually comes back pretty fast.  Try starting with 50.  If the termination reason is maximum wait exceeded, the time has run out and you may have an error condition or need to increase the time.
 
|Input:  A time in some arbitrary units that the probe will wait for a return from the BitWacker.  Data usually comes back pretty fast.  Try starting with 50.  If the termination reason is maximum wait exceeded, the time has run out and you may have an error condition or need to increase the time.
 
<!---------------------------->
 
<!---------------------------->
Line 119: Line 71:
 
|-valign="top"
 
|-valign="top"
 
|''Field:'' Response  
 
|''Field:'' Response  
|Output:  Whatever the microcontrolller returns for data.  Cut off at the first occurrence of the termination character if any.
+
|Output:  Whatever the bitwacker returns for data.  Cut off at the first occurrence of the termination character if any.
  
 
<!---------------------------->
 
<!---------------------------->
Line 125: Line 77:
 
|''Field:'' Termination Reason   
 
|''Field:'' Termination Reason   
 
|Output:  The reason why the received data was terminated.  Normally it is an error if the reason is anything other than Termination Character received.
 
|Output:  The reason why the received data was terminated.  Normally it is an error if the reason is anything other than Termination Character received.
 +
 
<!---------------------------->
 
<!---------------------------->
 
|-valign="top"
 
|-valign="top"
Line 130: Line 83:
 
|
 
|
 
Output: Lots of information about events in the probe are logged here ( and to the log file )  This is normally set up information and then when data is sent it is preceded by >> and when it is received it is preceded by <<.  You cannot type in here, but can highlight text and copy it.
 
Output: Lots of information about events in the probe are logged here ( and to the log file )  This is normally set up information and then when data is sent it is preceded by >> and when it is received it is preceded by <<.  You cannot type in here, but can highlight text and copy it.
 +
 
<!---------------------------->
 
<!---------------------------->
 
|-valign="top"
 
|-valign="top"
 
|''Field:'' Comment   
 
|''Field:'' Comment   
 
|
 
|
If you enter a comment here you can log it to the log area by pressing the <Log Comment> button.  This data is just for the log and is not sent to the microcontrolller.
+
If you enter a comment here you can log it to the log area by pressing the <button> button.  This data is just for the log and is not sent to the bitwacker.
 
<!---------------------------->
 
<!---------------------------->
 
|-valign="top"
 
|-valign="top"
 
|''Button:'' Comment  
 
|''Button:'' Comment  
|Send the data in the comment field to the log area, none of this is sent to the microcontroller.
+
|Send the data in the comment field to the log area, none of this is sent to the bitwacker.
 
<!---------------------------->
 
<!---------------------------->
 
|-valign="top"
 
|-valign="top"
Line 152: Line 106:
 
|Checks the recieve buffer for data from the bitwacker that came in after the end of the last recieve.  Log it, but otherwise throw it away.
 
|Checks the recieve buffer for data from the bitwacker that came in after the end of the last recieve.  Log it, but otherwise throw it away.
 
Sets up for clean communication on the next send, but lets you see that there was some unprocessed data.
 
Sets up for clean communication on the next send, but lets you see that there was some unprocessed data.
<!---------------------------->
 
|-valign="top"
 
|''Menu:'' File -> Open Property File
 
|New -- think it works Opens a dialog for you to choose a new property file ( or the same one, but with edited values { or not if you just want to reinitilize ] ) and reinitilize the application with different ( or the same ) parameters.  If you want you can open the property file in an editor, edit values, save ther file ( and possibly keep it open, or not ) and then reload the same file with the new parameters.
 
<!---------------------------->
 
|-valign="top"
 
|''Menu:'' File -> Open Comm Parms
 
|Stubb -- does not work, may not ever work.  Lets you choose communications parameters on the fly without messing with the property file.
 
<!----------------------------
 
|-valign="top"
 
|
 
|
 
<!----------------------------
 
|-valign="top"
 
|
 
|
 
<!----------------------------
 
|-valign="top"
 
|
 
|
 
<!----------------------------
 
|-valign="top"
 
|
 
|
 
<!---------------------------->
 
 
|}
 
 
Each time the application initializes it either starts with an empty log file or appends to the old one, I need to find out which, what would you like it to do?  Append seems the right choice to me.
 
 
Logging on start up:
 
 
Typically something like ( this is using the opening using a "probe":
 
 
:Reading property file C:\Russ\Java\RS232Etc\MrMoose.properties<br>
 
:Stream File = C:\Russ\Java\RS232Etc\MrMoose.properties<br>
 
:COM3 Opened Now Probing Response UBW FW D Version<br>
 
:<<v<br>
 
:COM6 Opened Now Probing Response UBW FW D Version<br>
 
:<<<br>
 
:COM7 Opened Now Probing Response UBW FW D Version<br>
 
:<<<br>
 
:COM10 Opened Now Probing Response UBW FW D Version<br>
 
:<<<br>
 
:COM12 Opened Now Probing Response UBW FW D Version<br>
 
:<<<br>
 
:COM13 Opened Now Probing Response UBW FW D Version<br>
 
:<<<br>
 
:Parms.initPort() failed<br>
 
:RS232 Probe initilization complete.<br>
 
 
Data transmitted to the microcontroller is preceeded with >>, data recieved is preceeded with << ( no data recieved in the above example ).
 
 
 
There is also a bunch of logging to the java console, some of it is the same as to the log area and file, other logging may be different, particurlarlly for execptions that the application does not do a good job of managing.  Take a look at this if the application seems to behaving oddly.  There is more information on the scanning of com ports, something like:
 
 
 
:Reading property file C:\Russ\Java\RS232Etc\MrMoose.properties
 
:openOutputStream for rs232probe2.txt
 
:Looking for port: COM15
 
:Found port: COM3
 
:Found port: COM6
 
:Found port: COM7
 
:Found port: COM10
 
:Found port: COM12
 
:Found port: COM13
 
:Found port: LPT1
 
:Found port: LPT2
 
:Port not found: COM15
 
:Parms.initPort() failed
 
 
In this case it is scanning for port 15, but it is not active so initialization fails.
 
 
=== Special Character Translation ===
 
 
This feature allows you to put non printable characters in the strings you send.  Typically every command needs to be ended with one of these characters, most often a carriage return.
 
 
{| class="wikitable"
 
|-valign="top"
 
! Special Char. As typed in GUI
 
! Char Sent
 
! Comment
 
 
<!---------------------------->
 
|-valign="top"
 
|~r or ~R
 
|Cr = 0x0D
 
|Carriage return, the normal end to a transmit to the microcontroller
 
<!---------------------------->
 
|-valign="top"
 
|~t or ~T
 
|tab = 0x09
 
| Also know as horizontal tab.
 
<!---------------------------->
 
|-valign="top"
 
|~n or ~N
 
|new line = 0x0a
 
| Also know as line feed
 
<!---------------------------->
 
|-valign="top"
 
|~xx 
 
|The character corresponding to xx in hex.
 
|xx must be exactly 2 valid hex digits ( 0 to F )
 
<!----------------------------
 
|-valign="top"
 
|
 
|
 
|
 
 
<!----------------------------
 
<!----------------------------
 
|-valign="top"
 
|-valign="top"
|
 
 
|
 
|
 
|
 
|
Line 269: Line 114:
 
|
 
|
 
|
 
|
|
 
<!---------------------------->
 
 
 
<!---------------------------->
 
 
|}
 
 
=== Enhancements ===
 
 
The following are under consideration but may or may not ever happen, your comments will be some of the input for the decision.
 
 
 
{| class="wikitable"
 
|-valign="top"
 
! Enhancement
 
! Comment
 
  
<!---------------------------->
 
|-valign="top"
 
|Save property file under old or new name.  Preserve comments from the original file ( may require editing to be consisten with the new values )
 
|This lets you start with a property file, run with it, tweak the values ( assuming we have an interface to do it, which we are planning ) and then save the the resulting values in the old or a new property file.
 
<!---------------------------->
 
|-valign="top"
 
|Add property file support for intial values in all the send fields.
 
|A pre-set up the fields for common values used by a microprocessor.
 
<!---------------------------->
 
|-valign="top"
 
|Log file playback.
 
|Play back the same commands as used in a previous session.  The log file could be manually edited prior to playback.
 
<!---------------------------->
 
|-valign="top"
 
|Continuous recieve option.
 
|Add a thread in the background to recieve and log data continuously ( presumabley this would be turned off for each transmit and then turned back on after the response was recieved ).
 
<!---------------------------->
 
|-valign="top"
 
|Implement always clear pending.
 
|This would check for, clear and log any pending data prior to any transmit.
 
<!---------------------------->
 
|-valign="top"
 
|
 
|
 
<!---------------------------->
 
|-valign="top"
 
|
 
|
 
 
<!---------------------------->
 
<!---------------------------->
  
 
|}
 
|}
 
 
[[RS232Probe Enhancements and Bugs]]  a list for all the related applications, will absorbe the list above soon.
 
 
[[category:Serial Communications]][[category:Microcontroller]][[category:PIC]]
 

Please note that all contributions to OpenCircuits may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see OpenCircuits:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)