ATMEGA644P - Target doesn't answer

I am currently trying to program the ATMEGA644P using a usbasp connector, and I keep encountering this problem when using the ‘make’ and ‘make bake’ command

avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: error: programm enable: target doesn’t answer. 1
avrdude: initialization failed, rc=-1

I have attached a jumper to slow down the clock on the usbasp, as to not program at 375kHz, but this problem still is occuring. when I use the -F command to bypass this error, I then receive this:

avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
avrdude: Expected signature for ATMEGA644P is 1E 96 0A

This is essentially telling me that the ucontroller isn’t even being recognized, despite the thing being wired correctly with the connector. Any ideas on how to circumvent this problem? I’ve seen somewhere that a blank mega needs an external clock or crystal driving the xtal1/2 pins in order to be programmed, but I’m not sure if this is the problem I am encountering.

Any pointers would be much appreciated, thank you!

I haven’t tried updating my Shruthi, and have decided to stick with the firmware it came with (Yam 0.5, IIRC), but I have made some changes to my Hackme Rockit Synth firmware (an example of KickStarter abandonware) - that’s also based on an ATMega644P, plus I have brief experience of flashing the ATMega1284P (similar, more features); in both cases, using a cheap USBasp.

So, one of the main problems is power to the AVR / MCU. The USBasp can normally provide enough to flash the chip, but not all boards are wired up to allow that. I have looked at the Shruthi schematics before, briefly, but I can’t remember if it does.

If that is allowed, you still need the correct voltage set on the USBasp, if there is an option. Often, they have a removable jumper block, or just some solder pads, to choose between 3.3V and 5V power.

When it’s not allowed to power the AVR from the USBasp, during programming, you have to provide power externally - but check the instructions before trying that, because it may not be advisable, in some cases.

I have two different types of simple AVR prototyping boards, sold as suitable for the ATmega16, but both work with the ATmega1284P. They look very similar, but are subtly different designs. On one of them, powering it from the USBasp works fine, during flashing, though other things should be disconnected, ideally. On the other, I have to provide 5V DC to the board.

In the case of the Shruthi, you might need to provide the usual 8V+ external DC power, during flashing, or that might be ill advised - check the manual, and the schematics. By all means ask me for a second opinion if you’re still stuck, but I’d have to look again - I can’t remember.

I am programming indepently on a breadboard, the USBasp has a 5V jumper (3.3V is the other option) that I am using to power the mega. I ordered a 16MHz crystal online to attach to the XTAL pins, and am going to power the chip off of a 9V battery with a voltage regulator for 5V of power

I am hoping that the USBasp can’t provide enough power to the chip, as that would make everything so much simpler, but I do not really know until I try it

Thank you though! I will let you know how it works

1 Like

You’re welcome.

One option is to cut the power line on the ribbon cable, which connects the USBasp to the ISP header. The MCU of the synth or dev board then has to get it’s power another way, so there’s less confusion, and no chance at all of damaging your computer’s USB port (though they’re normally quite robust anyway).

You can get another cable for a couple of dollars / euros, normally, if you need to. You can also make one up out of DuPont cable, with female connectors on each end. Clear tape around the black plastic ends, to hold them together, tends to work well. Just be careful to orientate it properly, of course.

It’s possible to spread out the wires in a ribbon cable by using your thumb nails - you don’t need to do it all the way along, just an inch or two, to let you get to an individual wire. I forget which one carries 3.3V/5V but the spec / pinout is easy to google.