Take the 2-minute tour ×
Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. It's 100% free, no registration required.

I bought a Gertboard a while ago, and one of the features it has on-board is an ATMega328 (DIP). However, since the Gertboard is designed for use with the Raspberry Pi, it only operates at 3.3v, so the clock speed is limited to ~12MHz.

Programming it via the Raspberry Pi is quite cumbersome though. Instead, I'd like to transfer the chip to an Arduino Uno board so I can upload sketches from my desktop PC. I would then transfer it back to the Gertboard for normal operation.

The problem is that my Uno operates at the more typical 5v / 16MHz.

Is it safe to attempt this? Do I need to make any configuration changes in the IDE to tell it to account for a different clock speed?

share|improve this question
    
avrdude over SSH not working out for you? –  Ignacio Vazquez-Abrams Mar 17 at 11:30
    
@IgnacioVazquez-Abrams I'm just exploring options really. I don't mind working on the command line if I have to, but I much prefer a GUI for code entry. –  Peter R. Bloomfield Mar 17 at 11:46
2  
Samba to share the directory, and make to invoke ino to build. Messy, but it should do. –  Ignacio Vazquez-Abrams Mar 17 at 11:47
    
I've not seen a single ATmega328 not work at 16MHz at 3.3V before. –  Cybergibbons Mar 17 at 12:10
    
Sure, but that's not the question here. –  Ignacio Vazquez-Abrams Mar 17 at 12:14

1 Answer 1

up vote 8 down vote accepted

The clock speed selected will affect both delay*() and millis()/micros() as well as the functions in <util/delay.h>, therefore you must use the target system's correct clock speed if you are using any of these functions. This can be easily done by editing boards.txt and copying an existing entry for the Uno and changing the value of the f_cpu parameter to match the target system (in this case, 12000000).

The difference in voltage does not matter, since the chip can run at either voltage and no connection is being made between the 5V system and the 3.3V system.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.