Atmega64 Failed Programming

Hi,
I am trying to code to an Atmega64 with Arduino. I learned though that first, the boot loader has to be uploaded via ISP. I’ve tried to do that with an Arduino uno with the ArduinoISP sketch on it and the response is wrong address of 0xff.

Can you show your wiring please.

I’m using the official Arduino tutorial. Here is the photo link: https://www.arduino.cc/wiki/static/c3f22e90bda8cfd4f75bdff576559cdf/b53cf/BreadboardAVR.png
Here is the tutorial link:
https://www.arduino.cc/en/Tutorial/BuiltInExamples/ArduinoToBreadboard

NO - please show YOUR wiring.

My whole setup is for a rc car. Everything is on a pcb. Here’s the entire schematic link:

The main reason why isn't working is because the wiring for the programming pins is incorrect. The MOSI and MISO programming lines should connect to PE0 and PE1 instead (PDI/PDO). Have a look at the MegaCore minimal setup schematic for 64-pin AVRs such as the ATmega64:

Hi,
Thanks for the answer. So could I upload the boot loader via a rx tx programmer? And how would a nrf24l01 be wired to it?

Here is the new output from the IDE:

Arduino: 1.8.13 (Mac OS X), Board: "ATmega64, No bootloader, EEPROM retained, BOD 2.7V, LTO disabled, External 16 MHz"

/Users/kgray/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C/Users/kgray/Desktop/Arduino/hardware/MegaCore-2.0.4/avr/avrdude.conf -v -patmega64 -cstk500v1 -P/dev/cu.usbmodem14101 -b19200 -e -Ulock:w:0x3f:m -Uefuse:w:0xff:m -Uhfuse:w:0b11000111:m -Ulfuse:w:0b10111111:m

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 "/Users/kgray/Desktop/Arduino/hardware/MegaCore-2.0.4/avr/avrdude.conf"
User configuration file is "/Users/kgray/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/cu.usbmodem14101
Using Programmer : stk500v1
Overriding Baud Rate : 19200
AVR Part : ATmega64
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 20 64 0 no 2048 8 0 9000 9000 0xff 0xff
flash 33 6 128 0 yes 65536 256 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
calibration 0 0 0 0 no 4 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00

Programmer Type : STK500
Description : Atmel STK500 Version 1.x firmware
Hardware Version: 2
Firmware Version: 1.18
Topcard : Unknown
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.03s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000 (retrying)

Error while burning bootloader.
Reading | ################################################## | 100% 0.03s

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.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Hi,
I'm trying to put the Arduino Bootloader onto my Atmega64 with an Arduino Uno as the programmer, but I keep getting an address of "0x00000". Here's what the IDE said:

Arduino: 1.8.13 (Mac OS X), Board: "ATmega64, No bootloader, EEPROM retained, BOD 2.7V, LTO disabled, External 16 MHz"

/Users/kgray/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C/Users/kgray/Desktop/Arduino/hardware/MegaCore-2.0.4/avr/avrdude.conf -v -patmega64 -cstk500v1 -P/dev/cu.usbmodem14101 -b19200 -e -Ulock:w:0x3f:m -Uefuse:w:0xff:m -Uhfuse:w:0b11000111:m -Ulfuse:w:0b10111111:m

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 "/Users/kgray/Desktop/Arduino/hardware/MegaCore-2.0.4/avr/avrdude.conf"
User configuration file is "/Users/kgray/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/cu.usbmodem14101
Using Programmer : stk500v1
Overriding Baud Rate : 19200
AVR Part : ATmega64
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 20 64 0 no 2048 8 0 9000 9000 0xff 0xff
flash 33 6 128 0 yes 65536 256 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
calibration 0 0 0 0 no 4 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00

Programmer Type : STK500
Description : Atmel STK500 Version 1.x firmware
Hardware Version: 2
Firmware Version: 1.18
Topcard : Unknown
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.03s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000 (retrying)

Error while burning bootloader.
Reading | ################################################## | 100% 0.03s

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.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

No connection to the target MCU.

  1. Check your ISP connection carefully.
  2. Programmer - the sketch must be loaded, trivial but check the USB cable too.
  3. MCU didn't start, 3 things of minimal circuit:
    a) power missing - all appropriate pins have to have VCC and GND connected,
    also decoupling on VCC pins is strongly recommended
    b) RESET pin, should be pulled-up to VCC, 10kOhm is widely used optimum
    c) clock source, usually 16MHz crystal with 22pF caps is standard and easy.
    Check conditions of the circuit with the DMM. VCC needs no further comments. RESET - should be VCC,in the moment the uploading starts, significant voltage drop should be observed. Clock signal (full swing crystal) should be signal measurable between XTAL1 pin and GND with the DMM as DC voltage about VCC/2, a bit less.

Maybe schematics could help, if you could post any or photo of the wiring. Keep the circuit as simple as it is possible in case of such problem.

@kgray9, do not cross-post. Threads merged.

Hi,
Sorry about the cross posting. I thought this my go better in that other section now.
Schematic:

I only soldered on the parts you mentioned though, till I can get the atmega64 programmed.

So could I upload the boot loader via a rx tx programmer? And how would a nrf24l01 be wired to it?

ISP programming is done on the same pins as RX and TX. This doesn't mean it is the same thing. You're using PDI/PDO for ISP programming.

The NRF24L01 module does not have anything to do with this. This module still connects to the MOSI/MISO/SCK pins.

Hi,
Ok. Thanks for the explanation.

Schematic: Arduino Chip RC Motor Drivers - EasyEDA open source hardware lab

OMG this is mess. No wonder it does not work.

I only soldered on the parts you mentioned though, till I can get the atmega64 programmed.

Did you follow steps I wrote? Can you be more specific? Does it work already...?

Hi,
I followed the steps you wrote. Still not working though.
ISP connection is good, I just keep checking it.
Uploaded the ArduinoISP example code a couple times.
Power to the chip is good, reset pin is pulled up, and their is a 16mhz crystal with two 22pf caps.

Is it connected according this


like @hansibull wrote above?
Did you measure the reset pulse?
What voltage is XTAL1 - GND and XTAL1-XTAL2?
Still all zero response?

Hi,
Sorry for the late response. I've been really busy lately. Just tested it as you described and I'm getting 0v on XTAL1 - GND and XTAL1 - XTAL2. :frowning:

OK, this is potential problem. The MCU cannot start without the clock source/signal.
You can try modified ISP sketch which produce the clock signal on pin #9 of UNO. Get rid of crystal and connect this to XTAL1.

Hi,
Sorry. What should I change in the ArduinoISP code? I scrolled through it and didn't see anything blatantly obvious. :confused: