0

My Arduino Nano Every runs at 16Mhz (but the 4809 can support internal 20Mhz).
I know it may be possible to alter the boards.txt file and set it to build for 20Mhz. However, I can't find the boards.txt for these new boards (MegaAVR). Where is the boards.txt located?

timemage
5,6391 gold badge14 silver badges25 bronze badges
asked Aug 11, 2021 at 21:02

2 Answers 2

2

In addition to set the

nona4809.build.f_cpu=20000000L

you will have to set the corresponding fuse byte to

nona4809.bootloader.OSCCFG=0x02

this enables the 20 MHz clock.

answered Nov 4, 2021 at 12:48
0

I found the boards.txt file at: ~/.arduino15/packages/arduino/hardware/megaavr/1.8.7

The Nano Every portion of the boards.txt looks like the following:

##############################################################
nona4809.name=Arduino Nano Every
nona4809.vid.0=0x2341
nona4809.pid.0=0x0058
nona4809.upload.tool=avrdude
nona4809.upload.protocol=jtag2updi
nona4809.upload.maximum_size=49152
nona4809.upload.maximum_data_size=6144
nona4809.upload.speed=115200
nona4809.upload.use_1200bps_touch=true
nona4809.upload.extra_params=-P{serial.port}
nona4809.build.mcu=atmega4809
nona4809.build.f_cpu=16000000L
nona4809.build.board=AVR_NANO_EVERY
nona4809.build.core=arduino
nona4809.build.variant=nona4809
nona4809.build.text_section_start=.text=0x0
nona4809.build.extra_flags={build.328emulation} -DMILLIS_USE_TIMERB3 -DNO_EXTERNAL_I2C_PULLUP
#nona4809.build.extra_flags=-B{runtime.tools.atpack.path}/gcc/dev/{build.mcu}
nona4809.bootloader.tool=avrdude
nona4809.bootloader.file=atmega4809_uart_bl.hex
nona4809.bootloader.SYSCFG0=0xC9
nona4809.bootloader.BOOTEND=0x00
nona4809.bootloader.OSCCFG=0x01
nona4809.fuses.file=fuses_4809.bin
menu.mode=Registers emulation
nona4809.menu.mode.on=ATMEGA328
nona4809.menu.mode.on.build.328emulation=-DAVR_NANO_4809_328MODE
nona4809.menu.mode.off=None (ATMEGA4809)
nona4809.menu.mode.off.build.328emulation=
##############################################################

If you change the following line from:

nona4809.build.f_cpu=16000000L

to:

nona4809.build.f_cpu=20000000L

Then go in and turn on verbose when you build in the Arduino IDE you will see that avrdude will pass in the following when it builds your sketch:

DF_CPU=20000000L 

Will this push the CPU to 20Mhz? Not sure, but at least you know where this is now.

UPDATE

FYI - Do not set your board to 20Mhz. Especially if you have Serial Communication going on. I have software serial set up to communicate with an attached bluetooth device and when you set the CPU to 20Mhz other things are not set properly and the Serial communication fails.

answered Aug 11, 2021 at 21:02
3
  • 1
    If the intention is to run the Nano Every at 20 MHz, you're probably better off using MCUdude MegaCoreX. Commented Aug 11, 2021 at 21:23
  • @timemage Very good point. I'm doing some different things. Using Nano Every board as a prototype. Then, I'm building the HEX file in a Arduino IDE & exporting it. I then upload it to a raw 40-pin ATMega4089 using Atmel-ICE programmer & Microchip studio. My 4089 runs on the 20Mhz internal crystal & I was trying to see if I could get Arduino IDE to generate a HEX that is using 20Mhz. Thanks again for the link Commented Aug 11, 2021 at 21:26
  • why not upload directly to ATmega? Commented Aug 12, 2021 at 16:44

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.