Use an Arduino UNO as an ISP for an AT Mega 32 16PU. How?

Hello,
I would like to be able to program an AT Mega 32 16 PU through an Arduino. So I want to use the Arduino UNO as an ISP. Unfortunately, all tutorials on the Internet did not work and now I do not know what to do.

I am looking for the connection between the Arduino UNO and the MicroController (Clock, MISO, MOSI, RESET).
Furthermore, I need the AT Mega 32 16PU as a board in the Arduino IDE to flash the Boodloader and Sketches.
Another question is whether I absolutely need an external Quartz to operate the MicroController in StandAlone and to flash it.
I hope someone can help me.

Programming ATmega32 should be same as for any other ATmega. HW - it is just 6 wires. Wiring is same as in examples for 328P ISP programming. The bootloader must be exactly for the chip and clock frequency . ATmega32 has internal oscillator so crystal is not needed. However, frequent mistake is to push fuse setting for external crystal, which bricks the chip. Then, external clock signal or crystal must be used for next operation.

Post your setup and some log.

Thanks for your answer!

The setup:

Arduino UNO --> AT Mega 32 16 PU

SS - PIN 10 --> RESET (PIN 9)
MISO - PIN 11 --> MISO (PIN 7 - PB6)
MOSI - PIN 12 --> MOSI (PIN 6 - PB5)
SCK - PIN 13 --> SCK (PIN 8 - PB7)

5V --> PIN 10 - VCC
GND --> PIN 11 - GND

But, how can I choose this MicroController in the Arduino IDE in Tools > Board.. with the right settings?
I tried to select the AT Mega board from MightyCore extension, but if I try to burn the bootloader this will fail.

avrdude: Version 6.3, compiled on Jan 17 2017 at 12:00:53
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Users\vincent_pc\AppData\Local\Arduino15\packages\MightyCore\hardware\avr\2.0.1/avrdude.conf"

         Using Port                    : COM4
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
         AVR Part                      : ATmega32
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom         4    10    64    0 no       1024    4      0  9000  9000 0xff 0xff
           flash         33     6    64    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  2000  2000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  2000  2000 0x00 0x00
           efuse          0     0     0    0 no          0    0      0     0     0 0x00 0x00
           lock           0     0     0    0 no          1    0      0  2000  2000 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           calibration    0     0     0    0 no          4    0      0     0     0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel STK500 Version 1.x firmware
         Hardware Version: 2
         Firmware Version: 1.18
         Topcard         : Unknown
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000 (retrying)

Fehler beim Brennen des Bootloaders.
Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

Mighty core has everything you need. Setup for connections looks correct.
From the log: stk500v1 - ok, 19200 - ok, ATmega32 - ok.
Problem is in all zero response. No answer from the target. The only advice is "Double check connections and try again."
Check your wires and whether the MCU has the clock.

Now I checked the pins again, but this did not work either. I tried to use the pins from ICSP header on my Arduino. Now I get this error:

avrdude: Device signature = 0x210000
avrdude: Expected signature for ATmega32 is 1E 95 02
         Double check chip, or use -F to override this check.

It is still receiving a garbage => connection problem. Post some photo from your setup.

The error-message is "normal", as before



Ou! :o

Did you read the datasheet?

It has 2 GND pins. Both must be connected. AVCC also. It is also good to have 0.1uF capacitors for decoupling on both sides and pull-up resistor 10k for RESET.
Wires are pretty long. Not clear for me how it is connected.

EDIT: I forgot clock. It has internal clock set by default. However, frequent mistake is to use unwanted fuse setting for external crystal which brick the MCU at first successful write. Then, for such situation, it is good to use modified ISP sketch with clock output (google for it) or use the crystal with 22pF caps to the GND.

now i added this parts to the breadborad (capacitors and the resistor) and used the ISP2 sketch from ArduinoISP/ArduinoISP.ino at master · adafruit/ArduinoISP · GitHub

this is my error:

avrdude: Version 6.3, compiled on Jan 17 2017 at 12:00:53
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Users\vincent_pc\AppData\Local\Arduino15\packages\MightyCore\hardware\avr\2.0.1/avrdude.conf"

         Using Port                    : COM4
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x03

avrdude done.  Thank you.

Error while burning bootloader.

Problem with wires.

...
         Using Programmer              : stk500v1
...

In the Arduino IDE click...

• Tools

• Programmer

• Arduino as ISP

Try again.


Its not working

VINCENT-E:
Its not working

That's unfortunate.

Again:

  • check your wires
  • show your actual HW setup
  • also SW setup
  • post the log include the command used

BTW: stk500v1 is correct - IDE v1.8.5; they changed it in 1.8.7 to arduino (but arduino goes with reset pulse)

If you have ISP sketch with clock output try to connect it to XTAL1 pin.

Here’s a photo of the setup/wiring I use for programming ATmega32 chips (for internal 8MHz clock.)
Note the power wiring to both sets of power pins, and extensive power bypassing…
(Pay no attention to the fact that the chip in there now is not an ATmega32!)

20181016_012927(1).jpg