Editing BitWacker PIC and Other Microcontroller to Java Communications

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 3: Line 3:
 
*Name: BitWacker Java Communications
 
*Name: BitWacker Java Communications
 
*Purpose: A family of applications for communication with BitWacker or other serial connected applications.
 
*Purpose: A family of applications for communication with BitWacker or other serial connected applications.
*Status: some applications running, others in various states including ready for testing.  Downloads available.
+
*Status: some applications running, others in various states including ready for testing
 
*Technology: Java -- should run on many platforms, Windows 98 through Vista, Mac, Linux.
 
*Technology: Java -- should run on many platforms, Windows 98 through Vista, Mac, Linux.
*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.
  
 +
== Introduction and Request for Testers of the Software ==
  
This is one of a series of articles on Microcontroller Serial Communications, rooted at this site here:  [[Microcontroller Serial Communications Articles]]
+
Note: This code should be useful not only to BitWhacker users, but to any MicroController users who want RS232 or USB ( virtual RS232 ) communications to their microcontroller.
 
 
== Status ==
 
 
 
 
 
 
 
June 08 2008
 
*RS232Probe: ready for test, see download below.
 
*BitWacker: ready for test, see download below.
 
 
 
 
 
== Introduction, Download, and Request for Testers/Users of the Software ==
 
 
 
Note: This code should be useful not only to [[USB Bit Whacker]] users, but to any MicroController users who want RS232 or USB ( virtual RS232 ) communications to their microcontroller.
 
  
 
A new interesting device ( basically an advanced development board with firmware ) is the BitWacker:
 
A new interesting device ( basically an advanced development board with firmware ) is the BitWacker:
Line 33: Line 21:
 
particular applications of the BitWhacker.  The more specialized applications actually turn the BitWacker/PC into entirely new applications.  See below.
 
particular applications of the BitWhacker.  The more specialized applications actually turn the BitWacker/PC into entirely new applications.  See below.
  
We now have some beta level code ( June 04 08 ) and we are looking for testers.  The tester should:
+
We now have some alpha-beta level code ( March 19 08 ) and we are looking for testers.  The tester should:
  
 
* Have a BitWhacker and cables to connect to a PC. ( or other microcontroller with serial comm ability rs232 or usb )
 
* Have a BitWhacker and cables to connect to a PC. ( or other microcontroller with serial comm ability rs232 or usb )
Line 42: Line 30:
 
The contents of this page should change fairly frequently for the next few weeks, check back if you are just lurking.
 
The contents of this page should change fairly frequently for the next few weeks, check back if you are just lurking.
  
Download [http://home.comcast.net/~russ_hensel/OC/MCSerialComm/bin08-06-04/MCSerialCommDist.zip] Contains RS232Probe and BitWacker Applications.  See [[RS232/USB Probe]] for the installation.
+
For more information and a copy of the software contact [[russ_hensel]]
  
For more information contact [[russ_hensel]]
+
== Status ==
  
 +
March 22 2008
 +
* Still looking for testers, do you guys actually like Hyperterminal?
 +
 +
March 19 2008
 +
*RS232Probe: ready for early test.
 +
*BitWacker: ready for early test.
 +
 +
March 12 2008
 +
*RS232Probe:  Runs, not too bad, not robust against error and not all features running.
 +
*BitWacker Command GUI: Got my BitWacker and tested.  First bunch of API runs, now based on character processing, would like to allow decimal hex and binary input and input validation of fields, not there yet
 +
*Testers wanted:  I would like to see if someone can simply get it installed and run on their computer.  Contact me [[russ_hensel]].
  
 
== Application Variations ==
 
== Application Variations ==
Line 51: Line 50:
 
=== First Application: The [[RS232/USB Probe]] ===  
 
=== First Application: The [[RS232/USB Probe]] ===  
  
Much like a terminal emulator but with some special features to test embedded devices.  Store multiple commands and issue with press of button.  Implement various handshaking/flow control.  [[RS232/USB Probe]] This is the basic application that works with the widest range of microcontrollers.  Install and try it first, if you cannot get it to run you will not be able to get the others to run either.  Installing it does most of the install for all the other applications.
+
Much like a terminal emulator but with some special features to test embedded devices.  Store multiple commands and issue with press of button.  Implement various handshaking/flow control.  [[RS232/USB Probe]]
  
 
=== Second Application: [[BitWacker Command GUI]] ===  
 
=== Second Application: [[BitWacker Command GUI]] ===  
Line 61: Line 60:
 
For low speed logging, up to say 1 measurement per second.  Nice graphical output ( using PtPlot )
 
For low speed logging, up to say 1 measurement per second.  Nice graphical output ( using PtPlot )
  
=== Fourth Application: Low Speed Logic Analyzer ===
+
=== Fourth Application: Low Speed Logic Analizer ===
  
 
For low speed logic ( want to track my various heating zones ), say down to 1 measurement per hour.  Nice graphical output ( using PtPlot )  Really an adaptation of the Graphical Data Logger but with provisions to prevent the various graphs from overlapping thus obsucring the graphs.
 
For low speed logic ( want to track my various heating zones ), say down to 1 measurement per hour.  Nice graphical output ( using PtPlot )  Really an adaptation of the Graphical Data Logger but with provisions to prevent the various graphs from overlapping thus obsucring the graphs.
  
=== Fifth Application: [[Smart Battery Charger with Graphical Data Logger]] ===
+
=== Fifth Application: Smart Battery Charger with Graphical Data Logger ===
 
 
Basically a peak detecting charger for NiCad and Nickle metal hydride batteries.  After fast charge drops back to trickle charging.  Charging logic is all on the PC, so can be very smart with a nice GUI.  Will require an add-on board with a microcontroller ( BitWacker would be fine ) and a few op amps and transistors.  I have an old version of this which I am using as a starting place for the project.
 
  
=== Your Application: Whatever you want ===
+
Basically a peak detecting charger for NiCad and Nickle metal hydride batteries.  After fast charge drops back to trickle charging.  Charging logic is all on the PC, so can be very smart with a nice GUI.  Will require an add-on board.  I have an old version of this based on different hardware which may be used as a starting place for the project.
  
Use the source code of the above applications to build your own to control whatever you want.  [[Making Your Own Microcontroller Serial Communications Application]]
 
  
 
== More Information: ==
 
== More Information: ==
Line 142: Line 138:
 
|-valign="top"
 
|-valign="top"
 
|Log4j
 
|Log4j
|need to look up the url ([https://en.wikipedia.org/wiki/Log4j Apache Log4j] ?)
+
|need to look up the url
 
<!--------------------------------
 
<!--------------------------------
 
|-valign="top"
 
|-valign="top"
Line 163: Line 159:
 
== Installation Directions For all the Applications ( This is a first cut, more details will follow ) ==
 
== Installation Directions For all the Applications ( This is a first cut, more details will follow ) ==
  
* Configure [https://en.wikipedia.org/wiki/Java_Development_Kit Java JDK] or Java Runtime Environment as it suits you.  I am using version 1_4 to stay compatible with older machines.  You can find it round about [http://www.oracle.com/technetwork/java/javase/downloads/ NetBeans with JDK].  /* Was: [http://java.sun.com/j2se/1.4.2/download.html Download Java 2 Platform, Standard Edition, v 1.4.2 (J2SE)] */
+
* Configure Java JDK or Java Runtime Environment as it suits you.  I am using version 1_4 to stay compatible with older machines.  You can find it round about [http://java.sun.com/j2se/1.4.2/download.html Download Java 2 Platform, Standard Edition, v 1.4.2 (J2SE)]
 
 
* Download and install the JavaComm API for your platform. Sun no longer supports this for windows; ( I will change to some other support soon ) I found it at [ http://wind.lcs.mit.edu/download/ Software Download and Install] Install can be a problem because a bad installation often fails without any messages.  Here are installation directions: [http://www.xpl4java.org/xPL4Java/javacomm.html Javacomm -- Serial and Parallel port access for Java and xPL]
 
 
 
* Download zip file.  [http://home.comcast.net/~russ_hensel/OC/MCSerialComm/bin08-06-04/MCSerialCommDist.zip] Unzip to an installation directory ( c:\RS232Etc for example but in any case avoid directory names with embedded blanks and if you stick to c:\RS232Etc fewer modifications will be required to the bat file. )  Do not un-jar the jar file(s) ( unless you just want to mess around )  Source code will be provided in RS232Etc.jar when it it a bit more stable.  Note that renaming the .jar file to .zip will allow you to extract the files with most zip utilities that do not directly support jar files.
 
  
* There is a file called RS32Probe.properties ( for the RS232Probe application or BitWacker.properties for the BitWacker applicaiont etc ). ( we do it Edit RS32Probe.properties ( or the BitWacker.properties ... ) for your configuration, directions are in the file.
+
* Download and install the java comm API for your platform. Sun is no longer support this ( I will change to some other support soon ) I found it at [[ where]] This can be a problem because a bad installation often fails without any messages.
  
* There is a file named OriginalRunRS32Probe.bat ( and similar files for the other applications )  ( in c:\RS232Etc if you followed my suggestion for installation ), make a copy and name it RunRS32Probe.bat. Edit the RunRS32Probe.bat file for your configuration ( see directions in bat file )We do the rename procedure to protect your version of the bat file against future updates. ( in the future we may just have you save the files in a safe place, this would be easier for me )
+
* Download RS232Etc.zip. I will provide a location soon, for testers email me [[russ_hensel]] Unzip to an installation directory ( c:\RS232Etc for example but in any case avoid directory names with embedded blanks ) Do not un-jar the jar file(s) ( unless you just want to mess around )  Source code will be provided in RS232Etc.jar when it it a bit more stableNote that renaming the .jar file to .zip will allow you to extract the files with most zip utilities that do not directly support jar files.
  
* See Start Up section for each application to continue and start the application.  If you have problems I will help you, email me with some details of the problem, include screen shots or detailed discription of error messages.
+
The next few steps are just for the BitWacker GUI, similiar files are included for the other applications.
  
 +
*Edit BitWacker.properties for your configuration. ( see section below on BitWacker.properties and directions in the file )
  
=== Reinstallation ===
+
*Edit the  BitWacker.bat file for your configuration ( see directions in bat file ).  You may want to do this in a copy of the file so that you always have the original bat file ( or maybe we will give you two copies).
  
Save your *.bat files and *.properties file in a safe place and download and unzip a new version.  Look at the new *.bat files and *.properties and see if yours need updating before replacing them.
+
*Double click the bat file to run the program, begin debugging the installation.
  
 
== Coding Standards ==
 
== Coding Standards ==
Line 196: Line 189:
 
Lots of comments, tell intent, do no repeat what can be read from the code.
 
Lots of comments, tell intent, do no repeat what can be read from the code.
  
Limit scope but you need not be a fanatic.
+
Limit scope but you need not be a fanitic.
  
Meaningful variable, method, and class names, no Hungarian notation, but prefix for scope may be useful.
+
Meaningfull variable, method, and class names, no hungarian notation, but prefix for scope may be useful.
  
 
Access instance variables through getters and setters.  Exception: GUI elements.
 
Access instance variables through getters and setters.  Exception: GUI elements.
 
I still use some deprecated techniques.  Not a high priority to fix, and I still want to run with old versions of Java.
 
 
Normally exceptions that can be expected should be managed by the application, eating them sometimes ( bad user input ) logging them other times ( hardware problems ).  Normally the console should not show exceptions thrown all the back to main.
 
  
 
== Example Property File ==  
 
== Example Property File ==  
Line 316: Line 305:
  
 
End Example Property File
 
End Example Property File
 
[[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)