ATmega644 and FTDI Upload

Hi at all,

I am building a weather station and I want to use an ATmega644p or ATmega1284p for this project.

To get the sketches quickly on the chip, I installed FTDI headers to my board with the following layout:

To be able to upload, I flashed the optiboot bootloader “optiboot_atmega644p.hex” (GitHub - Lauszus/Sanguino: Sanguino add-on for the Arduino IDE, based on http://code.google.com/p/sanguino/). I flashed the bootloader via Arduino as ISP.

After that, I could upload the blink sketche via the Arduino as ISP.

When I take the ATmega644 out of my ISP board and put it into the intended board, the LED still blinks. When I connect the FTDI Basic to the board, I also can read the serial messages on my computer.

However, I cannot upload a sketch via FTDI. Why??

I tried:

  • Upload
  • Upload using Programmer
  • Programmer AVRISP MkII
  • Programmer Arduino as ISP
  • I also modified the boards.txt, see attachment

With “Upload” and “Programmer AVRISP MkII” I get:

avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is “C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf”

Using Port : COM9
Using Programmer : arduino
Overriding Baud Rate : 115200
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x65
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x65
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x65
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x65
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x65

With “Upload with Programmer” and “Programmer AVRISP MkII” I get:

avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is “C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf”

Using Port : usb
Using Programmer : stk500v2
Invalid library found in C:\Program Files (x86)\Arduino\libraries\ER-TFTM070-5-with-CTP-SD_Arduino_Libraries_Examples: C:\Program Files (x86)\Arduino\libraries\ER-TFTM070-5-with-CTP-SD_Arduino_Libraries_Examples
avrdude: usbdev_open(): did not find any USB device “usb”

Any Ideas?

Thanks,
Robert

Maybe I should mention that I use Arduino IDE 1.6.7.

Connect Avcc to Vcc. Connect 2nd Gnd pin to Gnd.
Try adding 0.1uF caps from VCC and AVCC pins to Gnd, close to the part.
Try swapping the Rx & Tx pins.

Check your fuses, here's what I use for 1284P:
bobuino.bootloader.low_fuses=0xf7
bobuino.bootloader.high_fuses=0xde
bobuino.bootloader.extended_fuses=0xfd

Thanks man, however no luck so far.

  • AVCC and VCC are connected now
  • AVCC and GND are connected with a 0.1uF capacitor now
  • Have reflasht the Chip with the fuses: Low=0xB7, High=0xDE, Ext=0xFD
  • Haven't tried the RX / TX swap, since the serial monitor works

-->Still doesn't work

In my previous fuse settings, I choose the "external crystal oscillator". However I just fund out, that "full swing" is the right choice for a crystal over XTAL 1 and XTAL 2.

Before I continue troubleshooting:
What are the right settings to upload via FTDI in the Arduino IDE?
Which programmer? Simple Upload or Upload with programmer?

Again, thanks for the help!!!
Rob

Have answered the questions for the settings by myself now. I have a Funduino Nano sitting around and I tried the upload with it.

FTDI needs the following settings:

Programmer: AVRISP MkII (maybe doesn't even matter)
Upload: Just simple "Upload" (not "Upload using Programmer")

This works for Funduino Nano via the FTDI Basic.

The same does not work for the ATmega644p though. Is it maybe a problem with the optiboot?

Here on more time the Boards.txt settings:

############################################################

atmega644o.name=[Optiboot] ATmega644P

atmega644o.upload.tool=avrdude
atmega644o.upload.using=arduino:arduinoisp (I have also tried to remove this line)
#atmega644o.upload.protocol=arduino
atmega644o.upload.verbose = true
#atmega644o.upload.maximum_size=63488
atmega644o.upload.maximum_size=64512
atmega644o.upload.maximum_data_size=512
atmega644o.upload.speed=57600

atmega644o.bootloader.tool = avrdude
atmega644o.bootloader.low_fuses=0xB7
atmega644o.bootloader.high_fuses=0xDE
atmega644o.bootloader.extended_fuses=0xFD
#atmega644o.bootloader.path=optiboot_new
atmega644o.bootloader.file=optiboot_new/optiboot_atmega644p.hex
#atmega644o.bootloader.file=atmega/ATmegaBOOT_168_atmega644p.hex
atmega644o.bootloader.unlock_bits=0x3F
atmega644o.bootloader.lock_bits=0x0F

atmega644o.build.mcu=atmega644p
atmega644o.build.f_cpu=16000000L
atmega644o.build.core=arduino
atmega644o.build.core=arduino:arduino
atmega644o.build.variant=arduino:standard

Do I have to make any changes anywhere else besides the boards.txt file?

MolleMoll:
To be able to upload, I flashed the optiboot bootloader “optiboot_atmega644p.hex” (GitHub - Lauszus/Sanguino: Sanguino add-on for the Arduino IDE, based on http://code.google.com/p/sanguino/). I flashed the bootloader via Arduino as ISP.

After that, I could upload the blink sketche via the Arduino as ISP.

When I take the ATmega644 out of my ISP board and put it into the intended board, the LED still blinks. When I connect the FTDI Basic to the board, I also can read the serial messages on my computer.

However, I cannot upload a sketch via FTDI. Why??

When you uploaded the blink sketch using the Arduino as ISP you erased the bootloader you had burnt in the previous step which is necessary for upload using the FTDI. So you need to connect the Arduino as ISP and Tools > Burn Bootloader. After that you should be able to Upload using the FTDI. Tools > Programmer setting doesn’t matter for Upload, only for Burn Bootloader or Upload Using Programmer.

That's it. It works!

Thank you so much guys :slight_smile: :slight_smile: :slight_smile: :slight_smile: