Wednesday, 10 December 2008

Blink like a Pro ( Arduino Pro Mini )

I have seen a couple of youtube videos posted showing the most basic Arduino test program, BLINK, and thought these were pretty lame, well not really worth the effort of posting to youtube anyway.

But here I am with an update of my success getting the very same code working on the Arduino Pro Mini.

Before ordering Pro Mini I had a hunt around to see what was needed in order to program it, as unlike the Diecimila board it does not have the USB to Serial connection components. I found a link that contained a diagram that used the older Arduino NG board as the programmer for the Pro mini. So figured I would not need to buy a programmer, or the USB to Serial connector. For some reason I neglected to bookmark this little gem of a link. It took a few days to find again.

I was a little frustrated by this and set about the task of working out the best option for programming the Pro Mini. A propper programmer like this will let me program a chip without the bootloader, not an immediate requirement, but possibly useful in the future when I have a better understanding of what is going on. The other options were the Arduino Serial USB Board, or the FTDI Breakout Board.

While hunting around for this I rediscovered the link showing how to use the Diecimila to program another board. Still not sure I found the correct one as the one I followed showed the Arduino Stamp, similar but not exactly the same.

After some hesitation I decided to have a crack at soldering the pins to the board and program it from the Diecimila.

So that is the current state of development, I removed the ATMega168 chip from the Diecimila board, wired it up to the Pro Mini board, in in a similar fashion shown in the link above. From the Arduino Development environment I selected the Arduino Pro Mini (8MHz) as the target, it is now blinking away quite happily.

I am not sure how long this setup for programming the Mini will last. When I need update both chips regularly, I am sure I will get sick ripping the chip out of the Diecimila each time I need to update the Mini.

I have taken a couple of pics but they did not come out very well, will try again in daylight hopefully that will be better.

I have had a bit of a go at implementing the send and receive through the transmitter/receiver using just the Diecimila board, without success, I think the main issue is the chip only supports the UART Serial connection via the rx/tx pins 0 and 1. I tried to implement this using the SoftwareSerial library, but this has a few limitations as there is no input buffer, so the read() method will only return if being called when the data is actually received. After reading about this and a few other limitations I figured I would just be making life more difficult for myself proceeding down this path.