Saturday, November 29, 2008

It Works!

So the API isn't supported but still seems to work.  Found some interesting behavior that only about 8 bytes of data default are read from the buffer on each callback even if you are streaming a bunch of bytes on the serial port.  Seems that this can be fixed by setting the defaults or if you don't care about where it ends, just doing continual reads.

As for the Atmel program, Hyperterminal to the rescue! I now have a program that just copys back whatever is sent over the serial line.  I just modified the example uart program from winavr that writes to the LCD and to the uart (I don't have an LCD hooked up at the moment).  Java app seems to send data fine to the serial port and read it back, even if it is chopped up in 8 byte segments.

Going to work on sending a square wave and triangle wave and just streaming them from the Atmega 16 (based off of a button press? or maybe a command from the java program over the serial port) and graphing the streamed data from the MCU.  Not sure what type of data we will need to stream yet, but will probably write some utils to put 16 and 32 bit values on the line in addition to the 8 bits I am currently streaming.

Writing to the Serial Port

Decided to go with Java for this project (mostly because the tools I'm using are free).

First Roadblock - Apparently the Java support for javax.comm has been EOLed per this thread. I found a link to an older version of the jar file at Rick's Blog, but and it seems to work for Windows XP, but doubt that it will work in future versions of Windows. I found a good reference to get me started understanding how to use the API. Circuit Negma had good information on getting the javax comm libaries working.  If this doesn't work I'll probably either read more on the RxTx website or try to just write my own implementation for Windows. Another HOW TO Serial with RxTx.

It appears that if I am going to write my own implementation I would have to use JNI and write it in C or C++ for windows, here is a thread that describes the win 32 apis. Here is an example from the MSDN. Awesome implementation - http://www.codeproject.com/KB/system/serial.aspx. Another interseting link - http://www.fogma.co.uk/foggylog/archive/140.html.

Monday, November 24, 2008

Coding Environment for the Atmel MCUs

Getting my computer setup with development tools. I decided to go with Eclipse CDT and found a good resource to getting the AVR plugin's setup from the FriendlyARM Blog. I'm also using tortoise.svn with subclipse plugin as my SCM for this project. Hosting the source files on a MyBook World Edition hacked to run apache SSL and the svn mods. Should make it easy if I decide to share this project in the future.

Environment
tortoise SVN 1.5.5 - http://tortoisesvn.net/downloads
Maven 2.0.9 - http://maven.apache.org/download.html
Java 1.6.0_10 - http://java.sun.com/javase/downloads/index.jsp
Eclipse IDE for Java Dev - http://www.eclipse.org/downloads/
- SVN Plugin - http://subclipse.tigris.org/update_1.4.x
- CDT - http://download.eclipse.org/tools/cdt/releases/ganymede
- Maven - http://m2eclipse.sonatype.org/update
- AVR - http://avr-eclipse.sourceforge.net/updatesite

I have found that the CDT and avr plugins are so awesome.  They generate the makefiles and will actually auto discover the type and speed of the MCU and download the files directly to the MCU as well.  Great stuff!

First Post

Thinking about blogging for a while now and just read IK1ZYWs blog while looking for an example of driving an IR transmitter with an attiny before I head to the Jameco to pick up some parts. I thought it could be useful for others to read about my adventures and might help motivate me to stop slacking on my projects (with the added benefit of documenting my work).

Anyway, off to circuit design and I'll be back after my trip to Jameco.

~bigcmos