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.
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.
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.”
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.
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"
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.