Changing the clock frequency of an Arduino Mega 2560

My basic question is whether it is possible to replace the ceramic resonator that determines the clock frequency of an Arduino Mega 2560 with a crystal of a different frequency? Also, if I did this, would the bootloader, the USB serial link etc still work, and if not, is there anything that I could do about this?

More specifically, I am trying to use USART 1 of an Arduino Mega 2560 to communicate with some old hardware that has a UART hard-wired to have a serial baud rate of 187.5kbaud. With the default Arduino clock frequency of 16MHz, none of the available Arduino USART baud rates are close enough to the required 187.5Kbaud. So I am wondering whether it would be possible to replace the 16MHz ceramic resonator on the Arduino board with a 14.7456MHz crystal? At this alternate frequency I could get the desired baud rate. There are two pads either side of the resonator on the Arduino board that look about the right distance apart for a crystal, but I can't tell whether the capacitors near this are wired appropriately for a crystal etc...

Any advice would be appreciated.

Martin

Well in theory it might work. The bootloader would have to be recompiled to work at the new frequency, something not able to be done inside the arduino IDE. A new board entry for the boards.txt file defining this new configuration is needed, but that is simple. Not sure how accurate the millis(), micros(), and delay() functions would be with your new frequency, so that would have to be looked into. But the hardware side is just a simple swap out and adding the padding caps, however smd desoldering/soldering in not for the inexperienced.

Lefty

retrolefty: Well in theory it might work. The bootloader would have to be recompiled to work at the new frequency, something not able to be done inside the arduino IDE. A new board entry for the boards.txt file defining this new configuration is needed, but that is simple. Not sure how accurate the millis(), micros(), and delay() functions would be with your new frequency, so that would have to be looked into. But the hardware side is just a simple swap out and adding the padding caps, however smd desoldering/soldering in not for the inexperienced.

Thanks for the reply. I actually don't mind if most of the Arduino functions stop working, because the only functions that I am using from the Arduino API are setup() and loop(). The rest of the code is written according to the register level documentation from Atmel, using custom ISRs for receiving and transmitting characters serially, and using loop() to process the results. However any adverse effects on the Arduino bootloader would be problematic, since I still need to be able to upload new programs to the Arduino.

How about installng a couple of socket pins for the crystal, and plug in 16 MHz for uploading sketches, and whatever you need for running the sketch?

CrossRoads: How about installng a couple of socket pins for the crystal, and plug in 16 MHz for uploading sketches, and whatever you need for running the sketch?

Thanks. I am in the process of ordering the parts for this. I'm not yet sure whether I'll do the above, or recompile the bootloader for the new frequency, but regardless, I'm getting crystals for both frequencies and providing socket pins for the crystal, so that I can experiment.

How it is going after replacing crystals? I have the same problem, I want to use baudrate 115200 and with the 16Mhz crystal, I get very high error.