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 1: | Line 1: | ||
− | + | == Introduction and Request for Testers of the Software == | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | == Introduction | ||
− | |||
− | |||
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 28: | Line 5: | ||
From the site: ''The UBW board is a small board that contains a Microchip PIC USB-capable microcontroller, headers to bring out all of the PICs signal lines (to a breadboard for example), only costs about $15-$20 to build and is powered from the USB connection.'' | From the site: ''The UBW board is a small board that contains a Microchip PIC USB-capable microcontroller, headers to bring out all of the PICs signal lines (to a breadboard for example), only costs about $15-$20 to build and is powered from the USB connection.'' | ||
− | There seem to be a fair number of additional projects based on this device. Google " | + | There seem to be a fair number of additional projects based on this device. Google "Bit Wacker". |
− | The developer has supported the PC end of the communications with a program in Liberty Basic. The project based here is to provide communications to the | + | The developer has supported the PC end of the communications with a program in Liberty Basic. The project based here is to provide communications to the Bitwacker and similiar microcontrollers using a family of JAVA applications. The applications range from fairly general ones suitable for many microcontrollers to very specialized ones for |
− | particular applications of the | + | particular applications of the BitWacker. The more specialized applications actually turn the BitWacker/PC into entirely new applications. See below. |
− | + | This code should be useful not only to BitWacker users, but to any MicroController users who want RS232 or USB ( virtual RS232 ) communications to their microcontroller. | |
− | * Have a | + | We now have some alpha level code ( March 19 08 ) and we are looking for testers. The tester should: |
+ | |||
+ | * Have a BitWacker and cables to connect to a PC. | ||
* PC running XP or Win 98 ( other versions may work, but you would be more on your own ) | * PC running XP or Win 98 ( other versions may work, but you would be more on your own ) | ||
− | * Some experience with JAVA | + | * Some experience with JAVA ( if you have a lot that is ok but please do not bash us on code quality for awhile ). |
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. | ||
− | + | For more information and a copy of the software contact [[russ_hensel]] | |
− | + | == Status == | |
+ | 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]]. | ||
+ | |||
+ | March 22 2008 | ||
+ | * Still looking for tester, do you guys actually like Hyperterminal? | ||
== Application Variations == | == Application Variations == | ||
Line 51: | Line 40: | ||
=== 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]] | + | 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 50: | ||
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 | + | === 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: | + | === 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. I have an old version of this based on different hardware which may be used as a starting place for the project. | |
− | |||
== More Information: == | == More Information: == | ||
Line 82: | Line 68: | ||
− | * Java ( which version? was jdk1.6.0_03 seems not to be compatible with windows 98, do we care? Have reverted to 1.4 something or other ) Current testing on XP only. | + | * Java ( which version? was jdk1.6.0_03 seems not to be compatible with windows 98, do we care? Have reverted to 1.4 something or other ) |
+ | Current testing on XP only. | ||
* Communication using java comm: RS232 emulation over USB. Not ideal, hard to install, some platform differences, like the naming of comm ports. In the Java world there does not seem to be a better alternative. | * Communication using java comm: RS232 emulation over USB. Not ideal, hard to install, some platform differences, like the naming of comm ports. In the Java world there does not seem to be a better alternative. | ||
Line 96: | Line 83: | ||
* Control parameters of application through a property ( text ) file. Perhaps later add parameter control to GUI. This file is where port properties are specified. You can also specify parameters that cause the application to search through all available ports looking for the desired device. | * Control parameters of application through a property ( text ) file. Perhaps later add parameter control to GUI. This file is where port properties are specified. You can also specify parameters that cause the application to search through all available ports looking for the desired device. | ||
− | * Include program debugging through log4j framework ( it has be suggested that a newer framework might be used, this may happen but not for the first pass ). | + | * Include program debugging through log4j framework ( it has be suggested that a newer framework might be used, this may happen but |
+ | not for the first pass ). | ||
* In the lower level API get away from text for arguments ( Port “A” “B”... ) and move to numerical arguments, this makes abstraction of the hardware easier and allows for easier looping through ports and bits. Also provide a fairly easy way to think about the hardware in the more traditional text model. | * In the lower level API get away from text for arguments ( Port “A” “B”... ) and move to numerical arguments, this makes abstraction of the hardware easier and allows for easier looping through ports and bits. Also provide a fairly easy way to think about the hardware in the more traditional text model. | ||
Line 108: | Line 96: | ||
* Some sort of macro record and play back facility, these can be saved to a file and replayed from there. | * Some sort of macro record and play back facility, these can be saved to a file and replayed from there. | ||
− | * Command protocol: is parameter controlled, so can be varied typically command is printable characters followed by a standard termination character ( typically cr or lf ) waits for a microcontroller response ( a sting of printable characters ), a standard termination character ( typically cr or lf ), or times out, or reaches a maximum length. Records the reason for the end of the response. | + | * Command protocol: |
+ | is parameter controlled, so can be varied | ||
+ | typically command is printable characters followed by a standard termination character ( typically cr or lf ) | ||
+ | waits for a microcontroller response ( a sting of printable characters ), a standard termination character ( typically cr or lf ), or times out, or reaches a maximum length. Records the reason for the end of the response. | ||
* For some general notes on microcontroller communications see: [[RS232]]. | * For some general notes on microcontroller communications see: [[RS232]]. | ||
Line 142: | Line 133: | ||
|-valign="top" | |-valign="top" | ||
|Log4j | |Log4j | ||
− | |need to look up the url | + | |need to look up the url |
<!-------------------------------- | <!-------------------------------- | ||
|-valign="top" | |-valign="top" | ||
Line 163: | Line 154: | ||
== 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 | + | * 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 | + | * 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. |
− | * | + | * 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 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. |
− | + | 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 ) |
+ | *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). | ||
− | + | *Double click the bat file to run the program, begin debugging the installation. | |
− | |||
− | |||
== Coding Standards == | == Coding Standards == | ||
Line 196: | Line 184: | ||
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 | + | Limit scope but you need not be a fanitic. |
− | + | 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. | ||
− | |||
− | |||
− | |||
− | |||
== Example Property File == | == Example Property File == | ||
Line 316: | Line 300: | ||
End Example Property File | End Example Property File | ||
− | |||
− |