New NANO-EVERY board from Arduino.

First off. Would it be wise to rename this Topic as WiFi Rev2 and NANO-EVERY ?

The current MegaAVR Core is v1.8.1
Apparently v1.8.2 will be Released soon.

The EVERY pins_arduino.h is wrong. You can replace with the file from the Beta.
Or wait until v1.8.2 appears.

The Arduino IDE uploads sketches ok (if slowly)
How can I upload non-Arduino code to the EVERY via the command line ?

I would expect to manually press a Reset button and use:

avrdude -c jtag2updi -p ATmega4809 -P com39 -e -D

Note that I use the same “avrdude.exe” that comes with the new “megaAVR Core” for m4809 chips.

There does not seem to be an avrdude command to Force reset using 1200bps open/close on port COM39

I suspect that the EVERY board will become very popular.
Especially since it could be cloned by the Chinese.

David.

Note that the Nano Every specifications currently show a clock frequency of 20MHz, but the board actually runs at 16MHz.
Fortunately, this can be easily changed by modifying the boards.txt file.

pert:
The Nano Every uses the internal PLL as a clock, rather than an external crystal. The maximum speed is 20 MHz, but, as you discovered, the board definition was configured by Arduino to run at 16 MHz.

I was told that you can change it to run at 20 MHz by simply changing:

nona4809.build.f_cpu=16000000L

to:

nona4809.build.f_cpu=20000000L

That seemed strange to me because the megaAVR 0-series datasheet says of the OSCCFG fuse in section 5.8.2.3:
You can see that the OSCCFG fuse is set to 0x01 right there in boards.txt:

nona4809.bootloader.OSCCFG=0x01

maybe there is some mechanism in the core code for adjusting it purely based on the value of F_CPU, but I haven't seen anything like that. My suspicion is that you also need to change that line to:

nona4809.bootloader.OSCCFG=0x02

to make it run at 20 MHz. After that, it appears you can just do a standard upload to set the fuses, rather than having to do a Burn Bootloader as we must on the standard AVR boards.

I haven't gotten a Nano Every yet so I haven't been able to try it out myself. Let me know how it works for you.

If you want to be able to change clock speed from the IDE append the following to the atmega4809 section of the boards.txt file:

menu.clock=Clock
nona4809.menu.clock.16internal=16MHz
nona4809.menu.clock.16internal.build.f_cpu=16000000L
nona4809.menu.clock.16internal.bootloader.OSCCFG=0x01
nona4809.menu.clock.20internal=20MHz
nona4809.menu.clock.20internal.build.f_cpu=20000000L
nona4809.menu.clock.20internal.bootloader.OSCCFG=0x02

Direct port manipulation is very different from other Arduino boards, so any code that depends on that may need to be modified.

I have seen some discussion indicating the program memory and dynamic memory are in the same address space, so it isn't necessary to use PROGMEM to put constants in program memory. This appears to be correct, as serial.print() statements without the F() parameter do not increase the amount of dynamic memory used.