Upload via FTDI / 328p / not working

Go To Last Post
19 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

Last week I build an PCB with the ATMEGA328P and ISP programming (SPI) is (after AVRfreaks help) working like a charm:

  • Burned the bootloader successfull
  • Uploading programs via the ISP ("Upload via the programmer") is working

 

Now I also would like to use the FTDI to upload new software to the 328p. When connecting the FTDI breakout to my PCB the program running on the 328 sends information via the FTDI to my PC (so this works as programmed).

However when I want to upload a program via the FTDI I cannot get it working?? Get the following message

 

          Using Port                    : COM3
          Using Programmer              : arduino
          Overriding Baud Rate          : 19200

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00

 

  • Fuses incorrect? Have tried several settings but all the same result (upload via ISP work but not via FTDI)
    • LOW - 0x62 or 0xFF
    • HIGH - 0xDA
    • EXTENDED - 0xFD or 0x05
  • Wrong implementation?
    • Have basically used the open hardware schema for an Arduino setup (see FTDI image / P29 connected to PC6 (RESET))
      • R1 - 10k
      • C3 - 0,1uF (when starting to upload the 328 seems to reset)

 

So I am a stuck and hope somebody can push me in the right direction.

 

Thanks,

Buffel

Attachment(s): 

This topic has a solution.
Last Edited: Thu. Oct 27, 2016 - 06:27 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Did you install the bootloader via ISP? 

 

 

 

Keys to wealth:

Invest for cash flow, not capital gains!

Wealth is attracted, not chased! 

Income is proportional to how many you serve!

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes the bootloader installed via ISP (using 'Arduino as ISP').

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 The FF,DA,05 setting for the fuses looks right, assuming your using an external xtal, you would have bricked it if your not.

Can you post a pic of your board? 

 

Jim

 

 

Keys to wealth:

Invest for cash flow, not capital gains!

Wealth is attracted, not chased! 

Income is proportional to how many you serve!

 

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Burn your bootloader via the Arduino IDE. This will ensure that you get the correct Flash, fuses, lockbits.
Bootloaders expect the AVR to run with a 16MHz or 8MHz crystal.
They generally use 115200 or 57600 baud.
If you are using the 8MHz RC, you should build for 8MHz and set the fuses for RC.
.
David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Uno fuses are set to: FF:DE:05  and use a 16MHz xtal.

 

Jim

 

 

Keys to wealth:

Invest for cash flow, not capital gains!

Wealth is attracted, not chased! 

Income is proportional to how many you serve!

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

- Could attached a pic of the PCB but I guess that does not help / not using a breadboard

- Have an external xtal installed (Murata CSTCE16M0V53-R0) on the PCB but with the current fuse settings I wanted to use the internal RC osc (and after everything is working start to use the external osc)

 

Why do you think it is bricked // I still can upload new software to the board (upload via programmer / Arduino as ISP)

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I assumed that setting low fuse to 0xE2 would use the internal 8MHz RC osc.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Using Port                    : COM3

And is the FTDI appearing on that com port when installed?

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Absolutely on COM3 - when I hook up the 328p board via the FTDI breakout to my PC I see, via the serial monitor (Arduino IDE),  that the sw is running.

I.e. I get all message I programmed thru the serial monitor (COM3).

 

 

 

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DeBuffel wrote:
Get the following message
Can you show the invocation of avrdude when you try to access the bootloader?

 

But in passing I cannot help noticing:

DeBuffel wrote:
Overriding Baud Rate : 19200
david.prentice wrote:
They generally use 115200 or 57600 baud.
One of these things is not like the other!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When I have burned the optiboot and set 0xFF 0xDE 0xFD as fuse / when trying to use FTDI to upload sw to the 328 I get the following (using 19200 or 57600 results in the same response)

 

C:\Users\Buffel\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino6/bin/avrdude -CC:\Users\Buffel\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino6/etc/avrdude.conf -v -patmega328p -carduino -PCOM3 -b19200 -D -Uflash:w:C:\Users\BUFFEL\AppData\Local\Temp\arduino_build_622522/MWapp.ino.hex:i

avrdude: Version 6.3, compiled on Sep 12 2016 at 17:24:16
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Users\Buffel\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino6/etc/avrdude.conf"

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

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What xtal are you using with the 328? 

 

Keys to wealth:

Invest for cash flow, not capital gains!

Wealth is attracted, not chased! 

Income is proportional to how many you serve!

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you are using 16MHz crystal, you would expect Optiboot to want 115200 baud.
.
This is crazy. There are Tutorials for burning Optiboot on a bare mega328p. Just do what they say.
.
David.
.
p.s. Life is much simpler of you buy a Nano or better still, a Uno.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The Murata CSTCE16M0V53-R0

 

For my understanding -

  -> In case I do not activate the external osc. and (f)use the internal 8MHz it should also work right?

  -> This external osc has build-in capacitors

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Wow David!!! I used 115200 (instead of 57200) ...and now it seems to work. But strange thing is the oscillator indication (28kHz running)  - see below?

 

avrdude: Version 6.3, compiled on Sep 12 2016 at 17:24:16

         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

         Copyright (c) 2007-2014 Joerg Wunsch

 

         System wide configuration file is "C:\Users\Buffel\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino6/etc/avrdude.conf"

 

         Using Port                    : COM3

         Using Programmer              : arduino

         Overriding Baud Rate          : 115200

         AVR Part                      : ATmega328P

         Chip Erase delay              : 9000 us

         PAGEL                         : PD7

         BS2                           : PC2

         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        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff

           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff

           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00

           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00

           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00

           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00

           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

 

         Programmer Type : Arduino

         Description     : Arduino

         Hardware Version: 3

         Firmware Version: 4.4

         Vtarget         : 0.3 V

         Varef           : 0.3 V

         Oscillator      : 28.800 kHz

         SCK period      : 3.3 us

 

avrdude: AVR device initialized and ready to accept instructions

 

Reading | ################################################## | 100% 0.00s

 

avrdude: Device signature = 0x1e950f (probably m328p)

avrdude: reading input file "C:\Users\BUFFEL~1\AppData\Local\Temp\arduino_build_720264/MyApp.ino.hex"

avrdude: writing flash (13318 bytes):

 

Writing | ################################################## | 100% 5.02s

 

avrdude: 13318 bytes of flash written

avrdude: verifying flash memory against C:\Users\BUFFEL~1\AppData\Local\Temp\arduino_build_720264/MyApp.ino.hex:

avrdude: load data flash data from input file C:\Users\BUFFEL~1\AppData\Local\Temp\arduino_build_720264/MyApp.ino.hex:

avrdude: input file C:\Users\BUFFEL~1\AppData\Local\Temp\arduino_build_720264/MyApp.ino.hex contains 13318 bytes

avrdude: reading on-chip flash data:

 

Reading | ################################################## | 100% 4.53s

 

avrdude: verifying ...

avrdude: 13318 bytes of flash verified

 

avrdude done.  Thank you.

 

Last Edited: Wed. Oct 26, 2016 - 06:38 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@David - the bootloader I can burn via ISP.

The challenge was to burn an application via the FTDI interface - that seems to work at 115200 and not on 19200 ... do not understand this

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DeBuffel wrote:
that seems to work at 115200 and not on 19200 ... do not understand this

Why? Do you think a bootloader is going to magically adapt to any randomly picked baud rate then? What made you choose 19200 in the first place?

As David said in #5 and I reiterated later:

david.prentice wrote:
Bootloaders expect the AVR to run with a 16MHz or 8MHz crystal. They generally use 115200 or 57600 baud.

So it's a bit of a mystery as to why you picked 19200?

 

I assume it's Optiboot we're talking about? This is part of the source:

 

https://github.com/Optiboot/opti...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Fully agree with you that I made a wrong assumption wrt baud. Could have looked it up ... 

 

The 19200 I got from other threads (similar problem) to use lower baud rates when it is not working. 

 

Yes it is optiboot I use.

 

Thanks ...