3pi Oscillator swap feasibility & practicability

I recently bought a “3pi Robot + USB Programmer Combo” from pololu.
I am REALLY interested in using the 3pi as an Arduino UNO. (less the UNO’s programming method)
Is it feasible to swap the oscillator for a 16MHz version?
If so, what else might I need to do to get the 3pi 's ATmega368 to work as an Arduino UNO?

Hello,

We already support programming the 3pi from the Arduino environment without replacing the oscillator, but with a few limitations. Is there something specific you want to do that would not work with the 20 MHz oscillator on the 3pi?

- Kevin

I want to program it with other libraries and use the Arduino programming language more easily
Basically I could get more out of my robot if it was running at 16MHz as compared to 20MHz

if i desoldered the 20MHz oscillator and replaced it w/ a 16Hz one, would all I need to do is change in boards.txt from this…

##############################################################

orangutan328p.name=Pololu 3pi robot w/ ATmega328p via Programmer
orangutan328p.upload.using=avrispv2
orangutan328p.upload.maximum_size=32768
orangutan328p.build.mcu=atmega328p
orangutan328p.build.f_cpu=20000000L
orangutan328p.build.core=arduino

to this?

##############################################################

orangutan328p.name=Pololu 3pi robot w/ ATmega328p via Programmer
orangutan328p.upload.using=avrispv2
orangutan328p.upload.maximum_size=32768
orangutan328p.build.mcu=atmega328p
orangutan328p.build.f_cpu=16000000L //<<< edited here
orangutan328p.build.core=arduino

You understand that performance at 20 MHz will generally be higher than at 16 MHz, right? A 20 MHz clock does not make the 3pi fundamentally harder to program with the Arduino environment; it only causes problems if you want to use a library that specifically relies on your microcontroller running at 16 MHz for timing.

In many cases, our Arduino libraries for the 3pi and Orangutan controllers (which I linked to in my previous post) provide replacements for built-in Arduino functions that do not work correctly at 20 MHz. For example, Arduino’s delayMicroseconds() function is designed to work at 16 MHz, but you can use our delay() function to do the same thing on a 3pi.

Note that, on the other hand, replacing the 3pi’s resonator with a 16 MHz one would cause the 3pi Arduino libraries to behave incorrectly, as they assume that the 3pi is running at 20 MHz.

Do you have a specific example of a library you want to use that assumes a 16 MHz clock frequency and will not work correctly at 20 MHz?

- Kevin

Not yet…
I really don’t care about the performance… Its just a huge pain dealing with a mcu running @ 20MHz

I I’m still learning how to use arduino and It would mean 2-3weeks of extra learning b4 i could use a 20MHz Microcontroller… (I learn slowly due to a learning disability)

What I am trying to say is that using the 3pi running at 20 MHz with Arduino should not be “a huge pain”, and you should not have to learn anything new to work with it. The clock frequency should make absolutely no difference to you unless you try to use a library that depends on the exact frequency to do some precise timing. Until you run into such a situation, you should not worry about the clock frequency; if it does come up, you can explain the specific problem here and we can try to help you work around it.

- Kevin