Can't upload to ATmega32A using USBAsp

I've built a custom PCB for a project, first used the ATmega1284 controller, this works perfectly. I can program it through the ISP header using USBAsp, and MightyCore. Not using a bootloader.

Then I built more of the same PCB, replacing the ATmega1284 by the ATmega32A; the two have the same pinout - just some minor differences in UART that I don't use in this project.

Now trying to upload to this new board (I actually made four of them; all the same problem; visual inspection shows no solder bridges or so) I get this error for all of them:

avrdude: error: program enable: target doesn't answer. 1

Makes me wonder, are there any other differences between the processors? Other than the processor itself those boards are identical. I re-checked the USBAsp programmer with the existing ATmega1284 boards and that part is working fine. I noticed the MightyCore does not have a separate option for the ATmega32A, so assume those are the same. When selecting ATmega32 and trying to upload to an ATmega1284 board I get the expected signature error.

The error that I get implies connection error to me; that can always happen with a PCB; but the same for all four boards while they actually are visually fine just doesn't make sense.

Makes me wonder, are there any other differences between the processors?

There are certainly differences, especially when it comes to peripherals. The ATmega32 is quite old, and its replacement, ATmega324 is much "closer" to the 1284.

That being said, The 32 and 1284 is pin-compatible, so programming with USBasp should work without any issues. Is the ATmega32 brand new/unused? If so, it's running of its 1 MHz internal clock. the USBasp is usually too fast for an AVR running at 1 MHz. That's why I've added USBasp slow (MightyCore) a programmer option in MightyCore. Please try this option and report back :slight_smile:

hansibull:
There are certainly differences, especially when it comes to peripherals. The ATmega32 is quite old, and its replacement, ATmega324 is much "closer" to the 1284.

It's the ATmega32A, I suppose that's an updated/bugfix/whatever version of the ATmega32. I don't know whether there's any significant difference. New, unused chips.

That's why I've added USBasp slow (MightyCore) a programmer option in MightyCore. Please try this option and report back :slight_smile:

I've actually tried that one already, out of curiousity, as I'm using USBasp and it's the only such MightyCore specific programmer.
No luck, same result.

I don't have an external crystal installed (the pads are there, just didn't populate it) as I intend to run it off the 8 MHz internal clock.

The 32A has exactly same pins for serial programming like 1284P, and for both packages DIL/anySMD. Internal 1MHz oscillator by default. So, it should work.

Hard to say but what's about to apply external clock, just for try.

Some log available?

Finally I got around trying this one again.

Budvar10:
Internal 1MHz oscillator by default. So, it should work.

That's what I thought - internal oscillator by default, can upload that way, set other speed or external clock by the "burn bootloader" function. No log available - it just said "upload failed".

The solution turns out to be an external crystal. I was planning to run them on the internal oscillator (saves parts; no need for the precision/speed of a crystal), but luckily had designed the PCB with space for a crystal - another use of the project would benefit from 20 MHz speed. So I soldered on the caps and a crystal (16 MHz) and bootloader uploaded without further issues. Apparently the internal oscillator had been disabled in the factory...?!