Sketch upload for 1284P with USBTTL232-5V cable not possible

I used a Nano v3 as ISP to burn the MightyCore Bootloader to the 1284P with 20Mhz. Worked fine.
I'm able to upload a sketch with this configuration. I tried the blink example and added a simple serial.print for checking. When I open serial monitor it shows nothing whent I print something to 9600. I guess this is normal(!?). The led on Pin0 blinks as it should.
If I use the USBTTL232-5V cable, I'm getting the error messages. But(!): I get the text that I printed to the serial monitor... So I guess my setup can't be completely wrong...
The cable connections: black-->Gnd (Pin11), blue-->not connected, red-->vcc (Pin10), white-->Rx0 (Pin14), yellow-->Tx0 (Pin15), green-->reset via a 0.1uF cap (Pin9).

Does anybody have a suggestion what I'm doing wrong with the cable? I must say, I'm not a 100% sure how to configure the tools in the Arduino IDE for the cable. To me, STK500 as ISP sounds good (?!). The led on Pin0 stops flashing when I try to upload, but then the error occurs. Tried holding the reset button while uploading, but same result, just the error needs longer to occur when pressed.

I also tried PlatformIO: The led starts blinking when trying to upload and then the error occurs.

PlatformIO output:

> Executing task in folder 1284PTest: C:\Users\jlesc\.platformio\penv\Scripts\pio.exe run --target upload <

Processing ATmega1284P (platform: atmelavr; board: ATmega1284P; framework: arduino)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/ATmega1284P.html
PLATFORM: Atmel AVR (3.1.0) > ATmega1284P
HARDWARE: ATMEGA1284P 16MHz, 16KB RAM, 128KB Flash
DEBUG: Current (simavr) On-board (simavr)
PACKAGES:
 - framework-arduino-avr-mightycore 2.0.8
 - tool-avrdude 1.60300.200527 (6.3.0)
 - toolchain-atmelavr 1.50400.190710 (5.4.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 11 compatible libraries
Scanning dependencies...     
No dependencies
Building in release mode
Checking size .pio\build\ATmega1284P\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   1.2% (used 190 bytes from 16384 bytes)
Flash: [          ]   1.6% (used 2042 bytes from 130048 bytes)
Configuring upload protocol...
AVAILABLE: arduino
CURRENT: upload_protocol = arduino
Looking for upload port...
Auto-detected: COM4
Uploading .pio\build\ATmega1284P\firmware.hex
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00

avrdude done.  Thank you.

*** [upload] Error 1
============================================================================================================================================== [FAILED] Took 4.05 seconds ==============================================================================================================================================
The terminal process "C:\Users\jlesc\.platformio\penv\Scripts\pio.exe 'run', '--target', 'upload'" terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

As I'm writing this, I saw that the board is not correctly set with 20Mhz in PlatformIO. I tried to change it, but I must admit, I don't understand how to change it. I see the terminal commands in the documentation, but I don't understand what to do with it. Maybe somebody has a hint here for a good source or a direct answer. Searched google but had no luck for a "beginner" explanation..
edit: I was able to change it by adding "board_f_cpu = 20000000L" to the platform.ini . Still get the error.

Thanks in advance!

Jan

Did you burn the bootloader? If NOT this is why. But also you have selected 16MHz in the software, but soldered a 20MHz crystal (Needs to be 16MHz to work)

Install MightyCore in the IDE, then you can select 20 MHz as the clock frequency.

Hi,
thanks for the quick replies! I'm sorry half of my text seems to be gone.. I wrote about the whole setup. I'll do it again:
I did this with the Arduino IDE:

  • I used a Nano v3 as ISP to burn the MightyCore Bootloader to the 1284P with 20Mhz. Worked fine.
  • I'm able to upload a sketch with this configuration. I tried the blink example and added a simple serial.print for checking. When I open serial monitor it shows nothing whent I print something to 9600. I guess this is normal(!?). The led on Pin0 blinks as it should.
  • If I use the USBTTL232-5V cable, I'm getting the error messages. But(!): I get the text that I printed to the serial monitor... So I guess my setup can't be completely wrong...
  • The cable connections: black-->Gnd (Pin11), blue-->not connected, red-->vcc (Pin10), white-->Rx0 (Pin14), yellow-->Tx0 (Pin15), green-->reset via a 0.1uF cap (Pin9).

I'm unsure how to configure the Arduino IDE with the cable. I chose the Board with 20Mhz, Port and so on. Is STK500 as ISP correct? Do I need to "Upload with Programmer"? I tried both. I also tried pressing the reset button of the 1284P while uploading. When pressed, the error messages are coming slower. No other difference beside that..

Any ideas on how I can get the cable running?

Some "news". The following steps work:

  • Program Nano as ISP. Connect to 1284P via MOSI, MISO etc.
  • Burn bootloader MightyCore with 20Mhz --> only works when I press reset on 1284P
  • Programm blink sketch with Serial.print command via Nano as ISP with same connection (MOSI etc) and Upload with Programmer. --> only works when I press reset on 1284P
  • the LED blinks.
  • Disconnect cables and connect FTDI cable --> Gnd to Gnd and Rx of cable to Tx of 1284P. (These connections are sufficient.. I can connect everything, but it doesn't change the result.)
  • Now I can read the Serial.prints with the serial monitor in the Arduino IDE

Now it gets interesting. From this point on I'm not able to upload a sketch anymore. with the Nano. Getting the following error when trying as before using the MISO, MOSI etc connection and upload with programmer:

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x15
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x15

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x14

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x01
avrdude: stk500_initialize(): (a) protocol error, expect=0x14, resp=0x10
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: stk500_disable(): unknown response=0x12
Der ausgewählte serielle Port avrdude: stk500_disable(): unknown response=0x12
 ist nicht vorhanden oder das Board ist nicht angeschlossen

It works again, when I start all over burning the bootloader, uploading a sketch via MOSI etc...

When I read the board information with the Arduino IDE it says:

BN: Unbekanntes Board
VID: 1A86
PID: 7523
SN: Laden Sie irgendeinen Sketch hoch, um sie abzurufen

The uploads never work using the FTDI cable. Only for reading serial.print commands, even when all connections are made as described in my previous post. I also checked the soldering with the DMM.. thought may there is a problem with the Tx from the cable or the Rx of the 1284P respectively..

Can anybody help?
The ideal combination would be: Burning bootloader with the nano as ISP and then using the FTDI via Rx/Tx.

Man.... I think I got it...

I always put a sketch on the board via the nano before I tried it with the FTDI cable..

I burned the bootloader again and directly switch to FTDI and everything works out like charm.

Sorry guys. Thanks for your advices.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.