168’s on the table

I ordered a batch of Atmega 168’s from RS-online and finally I have the same chip as the book Make: AVR Programming by Elliot Williams is referring to through the book.

Initially I tried to make the Atmega328 work in the same manner as described for the 168, but I found that setting up the 328 to be a standalone chip loaded through an Arduino as ISP requires a crystal and two capasitors. I don’t know why, but this is the solution I have read about several places online, also without any good reasoning. The 328 should be perfectly able to run by itself without the crystals.

Anyway the 168 works fine, easier setup without the crystal and caps.

I have a LED-strip from RadioShack that I had to make my own code for to make it work with the 328 on a breadboard. For some reason, the timing of the signals from an Arduino and the 328 on a breadboard (with 16MHz crystal) isn’t the same, so the LED-strip wouldnt light up. By writing some assembly code (do nothing, do nothing, do nothing), I managed to time the 328 to do an almost-good enough job. The LED-strip requires signals of about 70ns (nanoseconds).

Soon I will try out the original code for the Arduino to see if I can make it run the LED-strip.