Coding Badly: hmmm... methinks you have something else going on
That's what I suspect but I cannot figure out what.
Are you compiling the sketches against F_CPU set to 1MHz?
That part seems to be working. I've tried simple
delay and beep Sketches (e.g. blink an LED every second then count the blinks in one minute) and they seem to work well. As expected, the uncalibrated internal oscillator is a bit off (~3% fast).
Or are you just compiling based on an Duemilanove w/ATmega32 (@16 MHz) and putting it into a chip running at 1MHz?
This is the entry in boards.txt I'm using...
rdbare328a1MHz.name=Bare / Breadboard ATmega328 @ 1MHz
rdbare328a1MHz.upload.using=pololu
rdbare328a1MHz.upload.maximum_size=32768
rdbare328a1MHz.build.mcu=atmega328p
rdbare328a1MHz.build.f_cpu=1000000L
rdbare328a1MHz.build.core=arduino
I left out the bootloader entries because I'm not using a bootloader.
I'm betting dollars to donuts that you're doing the latter
I'll take that bet! But I do suspect the problem lies with me.
For what it's worth, I built an Excel spreadsheet to calculate the ocr and prescaler values. The frequencies are all within 2% so it doesn't appear to be a problem with the math.
Unfortunately, I don't think I'll have time to work on it for a few days and possibly for a week. I'll report back when I can...