billcat:
I am thankful that more information on this subject has been presented here, but I can honestly say I still am unclear as to the answer of my previous question......
billcat:
...If I am dead set on using a 20Mhz crystal on a breadboarded Arduino, and not being required to account for this in any way every time I load a sketch...is this even possible?
I can speculate that it was answered by Coding Badly in reply #48, but can not say for sure.
Without re-reading all 4 pages, I think I responded earlier it should be possible if you change the boards.txt file, eg. to add:
##############################################################
uno20mhz.name=Arduino Uno @ 20 MHz
uno20mhz.upload.protocol=arduino
uno20mhz.upload.maximum_size=32256
uno20mhz.upload.speed=144000
uno20mhz.bootloader.low_fuses=0xff
uno20mhz.bootloader.high_fuses=0xde
uno20mhz.bootloader.extended_fuses=0x05
uno20mhz.bootloader.path=optiboot
uno20mhz.bootloader.file=optiboot_atmega328.hex
uno20mhz.bootloader.unlock_bits=0x3F
uno20mhz.bootloader.lock_bits=0x0F
uno20mhz.build.mcu=atmega328p
uno20mhz.build.f_cpu=20000000L
uno20mhz.build.core=arduino
uno20mhz.build.variant=standard
I have done this myself as part of testing VGA output. In fact I had it running using this method at 20 MHz, 24 MHz and 25 Mhz.
Serial output looks OK (in other words the baud rate is correctly calculated). A timing test shows that delay(500) seems to take a bit longer (533 mS). A test running at 25 MHz also gives a longer delay than expected (640 mS). However this is the inverse of what you would expect, right? A delay would be shorter if the code hadn't compensated. I'm not sure why delay is out in this way but I suspect rounding errors in the calculations for the timer interval.
Caveat: This only works on Windows, the Mac doesn't like the non-standard baud rates. I can't comment on Linux.
So I don't know why we are on page 4 of this thread. It looks like reply #5 described the changes required.
It would be more realistic to ask myself is Arduino worth all this pain?
The Arduino is fine. It is targetted at beginners. However you are not planning to use one, right? You are planning on a breadboarded Atmega328 setup with a non-standard crystal. Of course this is harder than buying an Arduino board and experimenting with it. Having said that, though, I have one working right here blinking an LED for the timing test. I posted a photo of it in reply #38.
How about actually assembling something like that and letting the fun begin? Asking on a forum if something will work, when you can find out for yourself, is surely not as satisfying?