Electronic – arduino – Can ATmega88 be run at 3.3V with internal clock

arduinoatmegaavri2craspberry pi

I want to use a few ATmega88s with Arduino bootloaders to act as I2C stepper drivers and temperature controllers that will interface with a Raspberry Pi. The thing is just that it seems the RPi interfaces with 3.3V so I therefore need to run the ATmega at 3.3V instead of 5V as to not damage the RPi without the need for a level shifter or will I be fine at 5V so long as the ATmegas act as slaves (I read something like that but I do not know if I it is the case)?

If I still need to use 3.3V would I be able to do so using the internal clock or will I have to use an external clock? Also, will I still be able to flash the bootloader on the ATmegas using an existing Arduino at the lower voltage (I have a feeling that it might interfere with communication speed but I am not sure if this is the case). If needed I could probably run the ATmega at 5V initially just to flash the bootloader but I am also not sure if that will work.

I know I am probably making life difficult for myself not using level shifters etc. but I want to use the bare minimum components for this project. Also, if the 3.3V affects communication, will it have an effect on my I2C interface?

Best Answer

Yes, you can use internal clock with Mega88 + Arduino.

To achieve this, you need to burn the bootloader differently:

  1. Download the 8MHz Bootloader
  2. if using AVRDUDE to flash the bootloader, change the fuse settings like below:

    # fuses for 8MHz internal RC Oscillator
    avrdude -e -U lock:w:0x3f:m -U lfuse:w:0xd4:m -U hfuse:w:0xca:m
    
  3. Change settings in your arduino environment (preferences.txt)

    change      build.f_cpu=16000000L   
    to          build.f_cpu=8000000L
    
  4. Edit the makefile:

    In <arduino>/lib/targets/arduino edit makefile
    change    F_CPU = 16000000
    to        F_CPU = 8000000