Kaoss Guitar (Update 1) :: 18 Apr 2010

For a while, a friend and I have been planning to build a specialized MIDI controller into a guitar to control a Korg Kaoss Pad KP2. The idea came from the guitar used by Matt Bellamy of Muse (check out a video of it).

We ordered the electronics for the guitar from SparkFun Electronics and Digi-Key. When the project is over, I plan to add up the total cost and post a bill of materials. I suspect it will total to around $100.

Today we tested out the 4.3" touchpad from SparkFun using an Arduino. I have just finished setting up an ATmega328P on a breadboard and got a basic blink program running. The final product will be running on a plain AVR without the Arduino libraries/bootloader.

One problem I ran into using my FTDI programmer was the clock rate. A fresh ATmega328P comes running at 1 MHz, significantly lower than the default 16 MHz on Arduino-prepared ATmegas. As a result, I kept getting errors like this:

david@second:~$ avrdude -c ftdi -p atmega168 -P ft0
avrdude: BitBang OK 
avrdude: pin assign miso 1 sck 3 mosi 0 reset 4
avrdude: drain OK 

 ft245r:  bitclk 230400 -> ft baud 115200
avrdude: ft245r_program_enable: failed
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

Eventually I found AVRDUDE's -B option. It adjusts the clock rate that's fed into the SCK pin on the AVR. I found that a value of -B 76800 works well, but if you're running into this problem, I recommend starting with -B 1 and going up until it stops working. To be explicit, this is the command that I found works:

david@second:~$ avrdude -c ftdi -p atmega168 -P ft0 -B 76800