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.
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.
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.
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.
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!)