Sunday, August 23, 2009

Hello World Arduino GUI



Status :

Basic GUI in AHK to talk to MCU - done
String manipulation to give user visual feedback on chip state - pending

Biggest headache was talking to the serial port in Windows. Sure, there are 1000's of GUI programs out there, but what happens when you want to write a program where you can push a button and get data out? Now you need a lite solution. Luckily, the dons on the AHK forum have cooked something up that calls the buildComDCB DLL from M$. It's not a 'lite' solution, but...

Now I'm faced with a quandary - how do I process data - it was a snap in Perl, but AHK's emphasis is not on data manipulation, so it doesn't give you 'lite' methods :(

Friday, August 21, 2009

Leave Well Alone



I had given up on my USB/serial at home after my outfit's MCU dev board and the MSP430 failed to be installed properly. Learnt later that both used direct USB and I was always pointing windows to the virtual COM port drivers. I try half heartedly to plug in my Arduino today and - pleasant happenings - it works without me having to do a thing. There are some things you have to give M$ credit for. BTW, writing to the COM port from Autohotkey or anywhere (including MS-DOS command prompt) is the last link in my chain. There seems to be a ray of hope thanks to this post which I intend to scrutinize minutely :

Seial (COM) Port Console Script

Thursday, August 20, 2009

Arduino Trumps All

Gave up on my own outfit's microcontroller after the code they have on the website failed to compile on their own assembler. Tough one. Arduino is super easy to use. Great job by the azzuri on this one. The IAR rep who called me to follow up on my download of the kickstart version was also amazed.

One disappointment was that, despite running off a 16 MHz clock, the Arduino cannot put out a pulse narrower than 4 us on one of its output ports. Might need something fancier than digitalWrite to accomplish that.

Sunday, June 21, 2009

RTFM Works

Last gasp accomplishment for the day - Friday. The inhouse software guru spoke - it's just RTFM. Use Zterm on the Mac to connect to the radio. Before that, open up the manual for Roving Networks' radio that Sparkfun is using. I keep claiming to want to be in RF, how come I never did that? Hmmm..

Anyhow, in this case, the Mac never did pair with the modem - needed default passkey, not no passkey. So, Igoe should really have said to RTFM.

What I have noticed with Zterm is this - you can power up the modem and use Zterm to talk to the modem in command mode - as long as TX/RX are not connected to the AVR. If they are, no hope.

Then, if you have connected TX/RX to the AVR and are running the monski pong sensor reader program, you can't get the sensor values - no matter how many /r's you send - which is exactly what the Processing sketch does. Why? If I run the Processing monski_pong_handshake sketch, stuff works fine. And then, once the sketch is up and running, I can interrupt it and go into Zterm and continue reading sensor values using Zterm. What's going on??

Whoops, and just like that, after my friend returns, stuff behaves. I can go into CMD mode arbitrarily, and even read sensor data through Zterm. The trick seems to be to wait a few seconds after powering up the Arduino setup. After that, the Mac has paired with the device and made the serial port available. Of course, once the Mac has seen the device, the serial port is always available. But, if you try connecting to it 5 seconds after you power up the bluetooth modem, you're out of luck.

Friday, June 19, 2009

Wireless Monski Pong

Alright Mr. Igoe, this is the first one that doesn't work.

When I power up the setup, the LED near the RTS pin blinks (keeps) about 2x a second.

If the MAC has already paired with the device once, then, if you run the program in processing, the LED near the CTS pin goes solid on.

Then, if you stop the program, (it does draw the screen BTW, but no action), the LED near CTS goes off, and the one near RTS starts blinking at 1 Hz.

Very hard to debug this one on the MAC - how to you know what's showing up on the serial port?

A general question about the Arduino board - are the RX/TX pins on the header connected to the same ones that go to the serial-USB adapter chip?

So Much for Mac's Users Friendliness

I still remember a show on TV 20 years ago touting the Mac's user friendliness with a PC example - "abort,retry, fail?". Here's what I got from the Mac Mini today when I tried to run Arduino :

uncaught exception in main method:
java.lang.UnsatisfiedLinkError: /Useres/xx/arduino-0015/Arduio
15.app/Contents/Resources/java/librxtxSerial.jnilib: no suitable image
found. Did find:
/Users/xx/arduino-0015/Arduino15.app/Contents/Resources/java/librxtxSerial.jnilib:
no matching architecture in universal wrapper

Leaves me helpless.