Since I'm more confident with software than with hardware, I decided to use an Arduino platform to control the looper.
Debugging was done using a standard Duemilanove board, but the final product will embed a ATMega328P chip in Standalone Mode for cost effectiveness.
However, before updating a vanilla ATMega328P chip (you've bought it somewhere where it's cheap) with code written in the Arduino IDE, you have to burn the Arduino Bootloader to the chip first. I had some trouble doing this (using MacOS and my Duemilanove board as the programmer) but I found the solution eventually. Here's the summary of how it's done :
Configure the programmer
Open Arduino IDE, in the menu, choose File > Sketchbook > ArduinoISP
In the heartbeat()function, change the line :
delay(20)
to
delay(40)
In the menu, choose Tools > Programmer > Arduino as ISP
In the menu, choose Tools > Board > Arduino Duemilanove (or your own board)
Wire the Vanilla ATMega chip
Pin 01 >>> Arduino I/O 10
Pin 01 >>> 120 ohm reistor >>> +5v (*)
Pin 07 >>> +5v
Pin 08 >>> Ground
Pin 09 >>> 22pF capacitor >>> Ground
Pin 09 >>> 16MHz quartz >>> Pin 10
Pin 10 >>> 22pF capacitor >>> Ground
Pin 17 >>> Arduino I/O 11
Pin 18 >>> Arduino I/O 12
Pin 19 >>> Arduino I/O 13
Pin 20 >>> +5v
Pin 22 >>> Ground
(*) You have to wire a 120 ohm resistor between the RESET pin (pin 1) of your chip and the +5v source. You must be as close as this value as possible. I used 100 ohm + 15 ohm resistors in series, it worked fine.
 |
| Wiring in progress... |
 |
| Ready to burn ! |
Burn the bootloader !
In the menu, choose Tools > Burn Bootloader
Done, you now have a cheap-o Arduino compatible chip :)