But i can't figure it out if millis(), micros() and delay() will work without any modifications.
As long you create a new 'board' entry in the arduino boards.txt file showing the 20Mhz Fclock value the time based functions should work fine as they use the Fclock value defined in that board selection to setup the proper timing value for timer0. Same with the hardware serial baud rate calculations used in serial.begin function.
in my code i use a lot micros and millis, so my main interest is on these two functions. I also communicate with a touch shield slide (i intend to put this one on 20MHz for faster GUI) so I'm glad that serial communication is fixed for 20MHz
basically all i need is to inset a new board definition? No need for a new bootloader?
I'm trying to make my UNO run at 20MHz. I've made some research and i made a modified optiboot (see attachament)
I used a clone Duemilanove bare board and put in a 25.0 MHz crystal. It works just fine.
I did have to add an entry in my "boards.txt" file and define "build.f_cpu=25000000UL" so that delays, tone and such were correct.
I didn't change Optiboot at all and it worked fine. To do it right, I think a special Optiboot with F_CPU set to 25 MHz (or 20 in your case) would be better, but it's probably not necessary since my board works just fine with the "stock" 16 MHz bootloader.
One thing I do, however, is set the low fuse from 0xFF to 0xF7 (changes "low power crystal" to "full swing crystal"). I prefer a nice solid oscillator, and the extra 1 milliamp it draws means nothing.
I would add Preserve EEPROM memory through the Chip Erase cycle; [EESAVE=0] to the fuses...
atmega328_20MHz_isp: HFUSE = D6
2. You probably should bump the brown-out detector to 4.3V[/b][/color] 3. As long as I was rebuilding the bootloader, I would use a higher baud rate... [u]http://zygomorphic.com/arduino-tiny/?page_id=249[/u] 4. Eyeballing, I can't find any problems with the makefile. [/quote] I agree with all of your suggestions except for the B.O.D. setting. I once tried the 4.3V setting and the board would not reliably power up (the USB supply was a touch below 5.0v). Setting the BOD to 2.7 worked 100% stable. I especially had problems at 4.3V when trying to use my AVRISPMKII. The ISP doesn't normally supply VCC on the ISP port, so I hacked mine with a 1N4001 to send USB power to the ISP port. Of course, 5.0 - 0.7 of the diode = 4.3v! The board won't program with BOD set to 4.3.
interesting facts. i just can't wait to test them. maybe i will also try 24mhz for the 328 chip
can 2650 be overclocked to 20mhz, the data sheet says 16mhz max ?
I have great news, I've manage to test Duemilanove (moddet to a Uno) with the attached bootloaders at 20MHz and also at 24MHz
and is working FINE.
the results are presented below and i also attache the bootloaders, changes to boars.txt and the test sketch.
No it doesn't get hot at all. I test it now for 4 hours in a row and i found out that serial, adc conversion and eeprom read/write works well.
No trouble so far. I've change one other board and put it to the test.