AtMega32L using Arduino UNO as ISP

When I try to communicate to the microcontroller i get this error:

~/avrdude-5.11.1$ sudo avrdude -c avrisp -p atmega32 -P /dev/ttyACM0

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

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.

What may be the problem?

Could the problem be related to the fact that the ATMega32L isn’t using any external clock?

Are you trying to burn the bootloader into the 32 chip here? Did you first upload the ArduinoISP sketch into the UNO chip? Did you then select the proper board when burning the bootloader? Do you have all the proper connections between boards?

Thank you for your help. I've put a 120 Ohm resistor between the Arduino Reset and GND, but it needed a 10 uF capacitor instead of it. Now I see the heartbeat LED powered on.

Now I get this error:

sudo avrdude -c avrisp -p atmega32 -P /dev/ttyACM0
avrdude: stk500_getsync(): not in sync: resp=0xe0

avrdude done.  Thank you.

If I try to specify the baud rate I get this:

sudo avrdude -c avrisp -p atmega32 -b 19200 -P /dev/ttyACM0 

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.12s

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.

Thank you for your help. I've put a 120 Ohm resistor between the Arduino Reset and GND, but it needed a 10 uF capacitor instead of it. Now I see the heartbeat LED powered on.

In the future if you want to use a resistor to defeat auto-reset it has to wire between +5V and reset, a capacitor wires from reset to ground as you found out. Either method works.

Funny thing is I've used arduinoISP sketch quite a bit recently on an older Duem board and have never had to defeat the auto-reset to have it function. It's a timing thing I know but I wonder what the variations are that make it required for some but not for others? Actually my Duem has the optiboot bootloader on it so it thinks it's a Uno board and has to be selected as such to upload to it.

Lefty

I suppose the problem is that Arduino cannot communicate to the ATMega because of the signature being 0. Could the lack of an external clock cause the problem?

cancelliere: I suppose the problem is that Arduino cannot communicate to the ATMega because of the signature being 0. Could the lack of an external clock cause the problem?

Yes, if the target chip has had it's fuse settings change in the past to work with an external clock source that would prevent it from working.

Lefty

cancelliere: Thank you for your help. I've put a 120 Ohm resistor between the Arduino Reset and GND, but it needed a 10 uF capacitor instead of it. Now I see the heartbeat LED powered on.

Now I get this error:

sudo avrdude -c avrisp -p atmega32 -P /dev/ttyACM0
avrdude: stk500_getsync(): not in sync: resp=0xe0

avrdude done.  Thank you.

You didn't answer any of my questions. Besides those, which target board did you select?

oric_dan: Are you trying to burn the bootloader into the 32 chip here? Did you first upload the ArduinoISP sketch into the UNO chip? Did you then select the proper board when burning the bootloader? Do you have all the proper connections between boards?

I'm sorry I didn't answer before. I've uploaded successfully the ArduinoISP sketch. The connections are ok, I've checked many times. What do you mean by saying "proper board"?

I meant which target board did you select in the Arduino IDE? I don't see one specifically for the 32L chip.

Since I am not uploading anything to the board, but I'm just trying to communicate to it, I haven't selected anything.

retrolefty: Yes, if the target chip has had it's fuse settings change in the past to work with an external clock source that would prevent it from working.

Lefty

I don't have any 16 MHz oscillator. Will I have any problems by using a different frequency (14 or 22)?

cancelliere:

retrolefty:
Yes, if the target chip has had it’s fuse settings change in the past to work with an external clock source that would prevent it from working.

Lefty

I don’t have any 16 MHz oscillator. Will I have any problems by using a different frequency (14 or 22)?

Not for just the purpose to burn a sketch or a bootloader onto the target. However the frequency does need to be correct for the bootloader to work with the arduino IDE as the baud rate will not be correct if not clocked at the speed the specific bootloader was created to work at.

Lefty

retrolefty: Not for just the purpose to burn a sketch or a bootloader onto the target. However the frequency does need to be correct for the bootloader to work with the arduino IDE as the baud rate will not be correct if not clocked at the speed the specific bootloader was created to work at.

Lefty

Do I have to use the two capacitors? If so, their capacitance has to be as said here (18 or 22 pF)?

Quote from: cancelliere on Today at 02:12:33 PM Since I am not uploading anything to the board, but I'm just trying to communicate to it, I haven't selected anything.

You named this thread "AtMega32L using Arduino UNO as ISP". Therefore, I assumed you had (a) burned the ArduinoISP sketch into the UNO, and were (b) trying to burn the bootloader into the 32L chip. If that is correct, then you need to select a target board to burn the bootloader.

If you have already burned the bootloader into the 32L chip, then you still need to select the correct target board to upload a sketch to the 32L.

But like I said, I don't even see a target board selection for using a 32L chip. Are you sure it's a 32L, and not 328 or 32U4 or 324 or something else? Plus, looking around, I can't even find a bootloader version for the 32L chip.

oric_dan:

Quote from: cancelliere on Today at 02:12:33 PM Since I am not uploading anything to the board, but I'm just trying to communicate to it, I haven't selected anything.

You named this thread "AtMega32L using Arduino UNO as ISP". Therefore, I assumed you had (a) burned the ArduinoISP sketch into the UNO, and were (b) trying to burn the bootloader into the 32L chip. If that is correct, then you need to select a target board to burn the bootloader.

If you have already burned the bootloader into the 32L chip, then you still need to select the correct target board to upload a sketch to the 32L.

But like I said, I don't even see a target board selection for using a 32L chip. Are you sure it's a 32L, and not 328 or 32U4 or 324 or something else? Plus, looking around, I can't even find a bootloader version for the 32L chip.

Here it says:

Not using a bootloader If you want to use the full program space (flash) of the chip or avoid the bootloader delay, you can burn your sketches using an external programmer.

So I assume that by using my Arduino Uno as ISP, I don't need to upload any bootloaders to the ATMega.

The ATMega32L is the same as ATMega32, but it can work with a lower voltage.

I've added to the circuit a 14.318 MHz crystal oscillator with the 2x22 pF capacitors and now the ATMega works.

sudo avrdude -c avrisp -p atmega32 -b 19200 -P /dev/ttyACM0

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.12s

avrdude: Device signature = 0x1e9502

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

So, then I take it, you are using something other than the Arduino IDE to compile the code, since the IDE has no selection for the 32. I guess that answers a lot of unanswered questions.