Getting “avrdude: initialization failed, rc=-1″ with ATmega328 after pulled it from Arduino?

I’ve spent the entire day solving this issue :) While all ATtiny85 were responsive and happy, both ATmega328 refused to work with avrdude throwing the error below while working perfectly with Arduino.

avrdude_1

The problem was that Arduino uses a 16Mhz external crystal as chip’s clock, and chip is pre-programmed to use it. Just add a 16 Mhz crystal with two 22 pF capacitors as at picture below:

ATmega_crystal

And microcontroller will respond to avrdude:

avrdude_2

As far as I know, microcontrollers can be instructed to use internal clock instead of external crystal, but I am yet to find out how to do this.

In general, while crystal takes extra 2 pins off AVR, it enables microcontroller to run at a better (and more precise) frequency. In my small projects I plan to use ATtiny mostly with internal clock since it only has 8 pins. With ATmega, I probably will use a crystal more often, but I pulled it from Arduino and started all this AVR programming hobby because I wanted as much compact solutions as possible, with no to minimal extra stuff, so I still prefer more pins to a faster clock.

Nice remark on password complexity

pwgen, my favorite Linux tool to generate random passwords that can be memorized:

-s, –secure
Generate completely random, hard-to-memorize passwords. These should only be used for machine passwords, since otherwise it’s almost guaranteed that users will simply write the password on a piece of paper taped to the monitor…

I like to see how alternative thinking in Information Security community is emerging. Good that we started to realize people are not robots, and commands and programming will never work here. This is basic risk management, to consider ‘human elements’ in any program. And while I am sure there are people who will disagree and bring up some very good and solid arguments, I don’t understand why in world of Information Security, one of the most modern and fast-evolving professions, we are still trying to rely on ideas that are decades old, and never really worked since…