What happens when you press Upload

  1. Compile: the IDE turns your sketch into machine code for the ATmega328P and saves it as a .hex file (Intel HEX format).
  2. Reset: the computer toggles the DTR line of the serial port. On Arduino Uno and Quasar Basic a small capacitor turns that pulse into a reset of the microcontroller.
  3. Bootloader: after a reset, a small program called Optiboot listens on the serial port for about a second, at 115200 baud.
  4. Write and verify: the computer talks to the bootloader with the STK500 protocol, writes the program in 128-byte pages, reads it back to check it, then starts it.

Only the first step needs the compiler. Everything else can be done by any program that can open a serial port, including a web page.

Method 1: from the browser

Chrome and Edge on computers support Web Serial, which lets a web page use a USB serial port after you allow it. The Quasar web console uses it to upload programs with nothing to install:

  1. Connect Quasar Basic or an Arduino Uno with the USB cable.
  2. Open the console and choose the Upload tab.
  3. Pick the console firmware, one of the example programs (Blink, SOS, fade, traffic light, button, servo, sensor plot) or your own .hex file.
  4. Press Upload to the board and choose the board's port.

The page resets the board, checks that the chip is an ATmega328P, writes the program, verifies it and then stays connected as a serial monitor. It only works over USB, not over Bluetooth.

Export a .hex from the Arduino IDE

To upload your own sketch without the IDE, first compile it once: in the IDE choose Arduino Uno, then use Sketch → Export Compiled Binary. You'll find the files in a folder inside the sketch. Use the one without "with_bootloader" in its name: the other also contains the bootloader and is meant for a programmer.

Method 2: avrdude

avrdude is the program the Arduino IDE itself uses for uploads. With a .hex file, one line is enough:

avrdude -p atmega328p -c arduino -P COM3 -b 115200 -U flash:w:blink.hex:i
  • -c arduino: the protocol of the Uno bootloader;
  • -P COM3: the port (on Linux something like /dev/ttyUSB0 or /dev/ttyACM0, on macOS /dev/cu.usbserial-…);
  • -U flash:w:blink.hex:i: write the file to flash memory, in Intel HEX format.

Method 3: arduino-cli

arduino-cli is the official command-line version of the Arduino tools: it compiles and uploads, so you don't even need a .hex.

arduino-cli core install arduino:avr
arduino-cli compile --fqbn arduino:avr:uno MySketch
arduino-cli upload -p COM3 --fqbn arduino:avr:uno MySketch

It's ideal for scripts, automatic builds and editors other than the Arduino IDE.

Common problems

  • The board doesn't answer ("not in sync" in avrdude): wrong port, a USB cable that only charges, or a board with a different bootloader. If the automatic reset doesn't work, press the board's reset button right as the upload starts.
  • Port busy: another program (the IDE's serial monitor, a terminal) has the port open. Close it.
  • Arduino Nano clones: many use the old bootloader at 57600 baud; in avrdude use -b 57600. The Quasar console only supports Optiboot at 115200 (Uno and Quasar Basic).
  • Something connected to D0/D1: modules on the serial pins can disturb the upload. Disconnect them.
  • Program too big: the Uno has 32,256 bytes available for programs.

Frequently asked questions

Yes, with Chrome or Edge on a computer and the USB cable, thanks to Web Serial. The Quasar web console uploads its firmware, a set of examples or your own .hex file to Quasar Basic and Arduino Uno.

The one without “with_bootloader”. The other also contains the bootloader and is meant to be written with an external programmer.

No. Uploading through the bootloader only replaces your program; the bootloader stays in its protected area.

Not with the standard bootloader: the upload needs the automatic reset, which comes from the USB serial port. Use the USB cable.