Arduino ISP for an ATMega32PB

Hi,

I'm trying to use an Arduino Uno as a programmer to be able to flash code onto another ATMega32PB (on a separate board). I'm having issues transferring the code.

I verified that the ATMega32PB is getting 5V power and GND from the Arduino uno. In addition, I'm able to reset the Arduino from the RESET switch (LED on the Arduino Uno flashes again).
I made sure to select the target board as ATMega32PB (downloaded from a minicore Library) and I selected "Arduino as ISP."

The Arduino cannot detect the ATMega32PB. Does anyone have any suggestions?

What code are you using, what board is involved, if custom post a schematic. Links to the technical information an libraries would help.

Hi,

Hi @nnh2rice

You must upload this code to the board you are using as a programmer (the Arduino Uno in this case), not to the target board.

I'll provide instructions for the full process:

A. Prepare "Arduino as ISP" programmer

I will refer to the board which will used as an "Arduino as ISP" as the "programmer board" from here on. The board you are burning the bootloader to will be referred to as the "target board".

  1. Disconnect the USB cable of the Arduino boards from your computer.
  2. Make the following connections between the pins on the "programmer board" and the "target board".
    Programmer Target
    CIPO (AKA "MISO") CIPO
    VCC 5V (VCC on 3.3 V boards)
    SCK SCK
    COPI (AKA "MOSI") COPI
    10 RESET
    GND GND
    The documentation for the boards you are using will identify the location of these pins. If you are using an official Arduino board, check the pinout diagram on the documentation page for the board.
  3. Connect the "programmer board" to your computer with a USB cable.
  4. Select File > Examples > 11.ArduinoISP > Arduino ISP from the Arduino IDE menus.
  5. Select Tools > Board > Arduino AVR Boards > Arduino Uno from the Arduino IDE menus.
  6. Select the port of your "programmer board" from Arduino IDE's Tools > Port menu.
  7. Select Sketch > Upload from the Arduino IDE menus.
  8. Wait for the upload to finish.

You are now ready to burn the bootloader using your "Arduino as ISP" programmer.

B. Burn Bootloader

In addition to typically flashing a bootloader binary to the target board as the name implies, a "Burn Bootloader" operation also sets the configuration fuses on the target board according to the board configuration you have selected in the Arduino IDE menus. So you should perform a "Burn Bootloader" operation once (and again after making any relevant board configuration change) even if you don't need the bootloader itself (in fact, MiniCore even has a Tools > Bootloader > No bootloader" option, and if you have that option selected, a boot section will not be reserved, but the "Burn Bootloader" operation will still perform the important fuse setting).

Instructions for burning the bootloader:


It is not possible to do this via "Arduino Web Editor". You will need to use Arduino IDE or Arduino CLI.


  1. Select the "target board" from the Tools > Board menu, and any other custom Tools menus (e.g., Tools > Processor).
  2. Select Tools > Programmer > Arduino as ISP from the Arduino IDE menus.
  3. Select Tools > Burn Bootloader from the Arduino IDE menus.
  4. Wait for the process to finish successfully.

You will now be able to use Sketch > Upload Using Programmer to upload any sketch to the ATmega328PB board via the "Arduino as ISP" programmer.

Just to confirm, when we burn the bootloader, do we stay on the same Arduino file in which the Arduino ISP firmware was flashed onto the Arduino Uno or do we open up a new file?

It doesn't matter which sketch you have open in Arduino IDE at the time you perform the "Burn Bootloader" operation. That operation completely ignores the current sketch. It flashes a separate precompiled binary bootloader file independent from the sketch.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.