Programming Atmega32

Greetings all,

I am new here so please go easy. I am trying to upload a sketch (blink) onto my new atmega32 microcontroller. I have followed the wikihow (https://www.instructables.com/Programming-ATMEGA32-or-Any-Other-AVR-Using-Arduin/) on how to do this and it has worked for me in the past (roughly 3 years ago). I am trying to go it again, but I keep getting a chip signature issue. I uploaded the bootloader with no issues, but when I try upload a sketch it gives me the following issue:

Sketch uses 1008 bytes (3%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
avrdude: Expected signature for ATmega32 is 1E 95 02
         Double check chip, or use -F to override this check.
Failed uploading: uploading error: exit status 1

I have double checked my wiring and have even soldered the chip onto a board with the 16MHz crystal and associated 22nF capacitors. I am using the MightyCore software to get the Atmega32 into the arduino IDE. I am using an arduino running the arduinoISP to talk to the atmega32.

Any help would be brilliant,

Cheers

Hi there, a good first step might be to enable verbose upload, to see what other information you can get about the problem.

Now that I think back, I do remember ordering a batch of ATMEGA32A from a well known Chinese website in mid 2020, which instead turned out to be ATMEGA16A. The chips themselves were physically labeled as 32A, however signature reported was instead for 16A. After changing the board to ATMEGA16A, they did appear to work normally, however I would never trust them.

Depending on where you sourced your chips, it may be something worth investigating.

I'll try this, though I did buy the chips recently from my local Jaycar here in Australia, so i'm assuming theyre genuine.

I'll also check this out. Thanks for the help

Ok, I have enabled verbose upload and found the signature for my chip. Attached is the error message:

Sketch uses 1008 bytes (3%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
"C:\Users\61499\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\61499\AppData\Local\Arduino15\packages\MightyCore\hardware\avr\2.0.3/avrdude.conf" -v -V -patmega32 -carduino -PCOM5 -b115200 -D "-Uflash:w:C:\Users\61499\AppData\Local\Temp\arduino-sketch-9975C77962AEED61CD25D49FD187002E/sketch_sep21a.ino.hex:i"

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

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

         Using Port                    : COM5
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
         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 : Arduino
         Description     : Arduino
         Hardware Version: 3
         Firmware Version: 4.4
         Vtarget         : 0.3 V
         Varef           : 0.3 V
         Oscillator      : 28.800 kHz
         SCK period      : 3.3 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

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

avrdude done.  Thank you.

Failed uploading: uploading error: exit status 1

I will have a look at what chips use this signature and act from there.

Thanks for the help

Did you disconnect that isp connection and add some sort of connection to the m32 serial port instead? Once you’ve loaded the bootloader, “upload” will want to use the serial port. (Unless you have the bootloader set to “no bootloader”)

The 0f signature is atmega328p, so somehow you’re talking to the original arduino and not the m32.

You can also try using “upload using programmer.”

1 Like

Don't know if this will be useful, but have seen this a number of times with Chinese chip sales...

The first is a video on the same type of problem with a 328pu, which apparently has a different chip id. This guy about put me to sleep, but it might be worth the time.

Seems like some of these low cost chips may have been from some type of manufacturing that has a unique id or a variants ID, such as with the 328u types. Youtube video.

There are a number of hits on this with your micro, but they seem to indicate the same type of issue.

The SAM4S Series datasheet
Quote:

8.1.3.7 Unique Identifier
Each device integrates its own 128-bit unique identifier. These bits are factory-configured and cannot be changed by the user. The ERASE pin has no effect on the unique identifier.

Good luck

:smiley_cat:

I think @westfw has got it. If you're trying to upload through your Arduino UNO to your atmega32, you'll need to use "Upload using Programmer"

programmer

To use the normal upload button, you would need to get rid of the UNO and connect the ATMega32 to the computer through some sort of USB serial adapter.

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