Tuesday, September 20, 2011

Programming Arduino Bootloader on Mega8 using an Arduino

While building a couple of arduinos, I found out that I had a few Mega8 chips left. I thought I might use them as Arduino and wanted to program them with arduino firmware. Tried researching about arduino as ISP and burning the boot-loader using arduino GUI but it was for Mega328. The process miserably failed because the device signatures didn't match. Anyways, came up with a combination of arduino isp and avrdude for rescue. First convert a working arduino into AVRISP programmer and then use it to program a blank AVR.

For this I used

Prerequsites:

  1. Ubuntu 10.04LTS machine or VM
  2. Install arduino gui from arduino.cc. I downloaded arduino v22 so I installed it in ~/arduino-0022
  3. Download and unzip Mega-ISP sketch from http://code.google.com/p/mega-isp/downloads/list. I downloaded version .04 (latest at the time of writing)
  4. A fully functional arduino board setup will be required. This will act as the ISP programmer.
  5. Target arduino board with blank ATMega8 chip.


Here is the procedure:

  1.  Wire up the arduino boards using the instructions at: http://arduino.cc/en/Tutorial/ArduinoISP. If you have a non standard pinout arduino clone, connect following pins of source to target
    Source Arduino PinTarget Arduino Pin
    1313
    1212
    1111
    10RST
    +5v+5v
    gndgnd
  2.  Install avrdude on the operating system:
sudo apt-get install avrdude

3. Load your Programmer Arduino baord with Mega-ISP sketch. Make sure that sketch is written properly to the board.

4. copy ATMegaboot from arduino installation (in my case ~/arduino-0022)
cp ~/arduino-0022/hardware/arduino/bootloaders/atmega8/ATmegaBOOT.hex ./

5. Copy and paste the following code on your linux shell prompt. This will create a file flash.sh and will make it executable:
echo '#!/bin/bash
cmd="`which avrdude`"
chip="atmega8"
options="avrdude -p $chip -c avrisp -P /dev/ttyUSB0 -b 19200"

# Erase chip write lock and fuses
$cmd $options -e -U lock:w:0x3f:m -U lfuse:w:0xdf:m -U hfuse:w:0xca:m

# Upload bootloader code
$cmd $options -D -U flash:w:ATmegaBOOT.hex:i

# Lock boot section
$cmd $options -U lock:w:0x0f:m
' > flash.sh; chmod u+x flash.sh


6. Check your wiring again and execute
./flash.sh

7. If things go well you will see successful avrdude messages and your Mega8 will be programmed with arduino boot. This procedure can be used to flash other hex files as well.

I have built a small ISP pcb that I plug my arduino into if I need ISP capabilities to program other AVRs, just use the right AVR device with avrdude options.

Saturday, August 06, 2011

Arduino Clone Review: Diavolino

Few days back I got a chance to build one Diavolino for one of my colleague. Evil Mad Science lab being local, he picked up a kit of Diavolino. Diavolino is offered by "Evil Mad Science".

Layout: The board outline matches the authentic (original) Arduino designs. I see that the designer has used standard components. The footprints of power connector, resistor, xtal, caps are standard whereas the reset switch footprint is less common. The silk-screen layout is pretty good and looks pretty artistic. The track layout is not professional; I talked to the scientist regarding the layout. She mentioned that she feels that use of GEDA auto-router on this (non-experimental) board is accepted by GEDA community. I feel that a commercially available board should not be a victim of a personal experiment. I totally don't agree with the traces on the board.

Schematic: The schematic and number of components used is much simpler that the previously reviewed (RBBB & BBB) designs. The board can be powered up using a barrel connector (not supplied with kit).

Overall: I like the form-factor and aesthetics of this board. I personally have built two of these units (at the time of writing). I would build it again if I have no better alternatives available. This is the lowest cost locally available board at the time of writing.

I don't have access to other Arduinos available in the market so I might not be able to comment on them but I might come up with my own design.

I would like to invite RFC (Request for Comments) on what conveniences end user would want on on their perfect Arduino kit / PCB if they had a choice? Please comment freely!

Thursday, July 28, 2011

Arduino Clone Review: BBB

Next up for review is another Arduino clone from Modern Device designed by Paul Badger. In my earlier review, I reviewed RBBB from Modern Device. The PCB I received was not a white solder-mask as pictured on the site. The PCB revision being reviewed is "c"

Layout: The size of the PCB was good. The PCB outline is straight rather than odd original design. This keeps the manufacturing costs low. This PCB is also of a poor design with arbitrary angled tracks and acid traps. Tiny vias still exist in this design that could have been avoided. The track width are pushed hard even where 12 mil tracks could have been used. Despite of space, a non standard (not common) power connector is used. The 15uh inductor could have been made optional. To bridge the inductor it takes a big blob of solder due to solder mask being present. A ground-plane is present on the analog area of the PCB which is a plus. The header layout is not compatible with the standard Arduino expansion boards (shields).

Schematic: The schematic could be simplified a bit. Power options provided are good. Two diodes are provided for protection of the LDO and other components on the board. It could mean that this design was done for students. Good building instructions.

Overall: A board with a poor layout. There are more cons to this board than pros. I would not spend my time building another one of this board.

Wednesday, July 27, 2011

Arduino Clone Review: RBBB

I have built several versions / clones of arduino. In this post I'm reviewing the first one I built in 2009, the "RBBB". This board is offered by Modern Device and has been designed by Paul Badger. I exchanged emails with the author, it seems that the author had used some archaic PCB software on Apple platform. The PCB revision I'm reviewing is Rev "C".


Layout: The first thing I noted was a very unprofessional PCB layout with acute and badly angled tracks. Some of the vias are so small that could have drove the overall PCB costs high. The power connector size is not standard the author has used small power connector. Both R1 & R2 are narrow packages, they are probably meant for 1/8 watt resistors. The 1/4 watt resistors barely fit on those positions. Vertial resistor footprints could have been used to save space. I like the use of standard push button for reset. These tactile buttons are low cost and are freely available.

Schematic: The schematic is simple and I'm glad the USB/Communication hardware (FTDI - expensive chip) is decoupled with the board. In this bare Arduino PCB, I think that the power LED should have been avoided. If there was enough space for an LED, why not connect the LED to pin 13? At least blink and PWM experiment could have been feasible without connecting any extra hardware. The Power circuit could have been simplified and could be improved.

Overall: I like the small sized PCB and unusual white solder mask. The PCB was priced economically and was electrically sound. Good soldering instructions. If I was a serious Arduino builder, I would stay away from this design. If I was a novice in a hurry and space crunch, I would build this otherwise not.

In my next post I will review next Arduino Clone.