[SOLVED] Unable to send sketches to Arduino Pro Mini

Hello all, I am having issues when trying to upload my sketch to an Arduino Pro Mini 3.3v

I used to use my Arduino Mega to do this, by sending his reset to GND, and then connecting tx, rx, 3.3 and gnd to the pro mini, but I decided it was too cumbersome, so I bought one of these FT232RL. The one I bought is not from this site, but it looks exactly the same Buy Buy FT232RL USB TO TTL Adapter Module For Arduino Uno R3 And Esp 8266 Modules And Beaglebone Black Development Boards. Online In India. Hyderabad

These pins already soldered, match exactly the same as the holes in the pro mini, and I've seen videos in YouTube of people programming their pro mini by just inserting the pins, and that being it...

I connect both PCB, I choose in Arduino IDE, the "Pro or Pro Mini" board, then I choose the 3.3v, 8MHz version, and I choose the proper port (In my case it is /dev/ttyUSB0 and /dev/ttyUSB1).

When I try to upload a sketch, I get some LEDs blinking in the FT232RL, but the arduino IDE would just show

avrdude: stk500_recv(): programmer is not responding

After a while, it will show this and fail

avrdude: verification error, first mismatch at byte 0x0280
0xff != 0x0e
avrdude: verification error; content mismatch
avrdude: verification error; content mismatch

After enabling verbose output I see this

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 "/home/frapell/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
         User configuration file is "/home/frapell/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyUSB1
         Using Programmer              : arduino
         Overriding Baud Rate          : 57600
         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: 2
         Firmware Version: 1.16
         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.01s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file "/tmp/arduino_build_834996/GettingStarted_CallResponse.ino.hex"
avrdude: writing flash (4624 bytes):

Writing | ################################################
avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x21
## | 100% 3.53s

avrdude: stk500_cmd(): programmer is out of sync
avrdude: stk500_cmd(): programmer is out of sync


.... Suppressed over 4000 lines of the same out of sync error ...


avrdude: stk500_cmd(): programmer is out of sync
avrdude: 4624 bytes of flash written
avrdude: verifying flash memory against /tmp/arduino_build_834996/GettingStarted_CallResponse.ino.hex:
avrdude: load data flash data from input file /tmp/arduino_build_834996/GettingStarted_CallResponse.ino.hex:
avrdude: input file /tmp/arduino_build_834996/GettingStarted_CallResponse.ino.hex contains 4624 bytes
avrdude: reading on-chip flash data:

Reading | avrdude: stk500_loadaddr(): (a) protocol error, expect=0x14, resp=0x00

avrdude: stk500_paged_load(): (a) protocol error, expect=0x14, resp=0x00
#avrdude: stk500_cmd(): programmer is out of sync
avr_read(): error reading address 0x0000
    read operation not supported for memory "flash"
avrdude: failed to read all of flash memory, rc=-2
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x00

avrdude done.  Thank you.

The weird thing is, that if I program the pro mini, using the old method by going through the Mega, I can then use the FT232RL to read the Serial monitor output...

Any suggestion?

frapell:
I've seen videos in YouTube of people programming their pro mini by just inserting the pins, and that being it...

It's not clear what you mean by this. Are you saying you just have the pins of the FTDI board poked through the holes on the Pro Mini with no solder or connector to make a proper electrical connection between them?

pert:
It's not clear what you mean by this. Are you saying you just have the pins of the FTDI board poked through the holes on the Pro Mini with no solder or connector to make a proper electrical connection between them?

In the YouTube videos I've seen (Example: https://www.youtube.com/watch?v=ewEne937YyQ) They pretty much do this... making sure they properly connect...

In my case, I have pins soldered both in the pro mini as well as the FTDI, and I have both plugged in a protoboard...

Just to be sure, I have pins connected like this:

FTDI Pro Mini

DTR <-> DTR
RX <-> TX
TX <-> RX
VCC <-> VCC
CTS <-> GND
GND<-> GND

By the way, when I burn the pro mini using the Mega, everything works fine, and this is the output

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 "/home/frapell/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
         User configuration file is "/home/frapell/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyACM0
         Using Programmer              : arduino
         Overriding Baud Rate          : 57600
         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: 2
         Firmware Version: 1.16
         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.00s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file "/tmp/arduino_build_225078/nrf24_pro_mini.ino.hex"
avrdude: writing flash (8290 bytes):

Writing | ################################################## | 100% 2.59s

avrdude: 8290 bytes of flash written
avrdude: verifying flash memory against /tmp/arduino_build_225078/nrf24_pro_mini.ino.hex:
avrdude: load data flash data from input file /tmp/arduino_build_225078/nrf24_pro_mini.ino.hex:
avrdude: input file /tmp/arduino_build_225078/nrf24_pro_mini.ino.hex contains 8290 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 1.86s

avrdude: verifying ...
avrdude: 8290 bytes of flash verified

avrdude done.  Thank you.

No one uses these serial programmers? it is such a pain in the a** to have to wire the pro mini through the mega every time I want to program them...

Do I need to burn anything into the programmers itself for them to work? I've tried 3 different programmers, they all have the same issue

The onboard barebones firmware on the 328P will only accept programming through the SPI port.

Pin 11 = MOSI
pin 12 = MISO
pin 13 = SCK

I don't think the FTDI has SPI capabilities. Perhaps someone else can enlighten both of us on how to use the FTDI, withg or without the bootloader.

You can use an FTDI to bootload a 328P, this Adafruit tutorial covers it.

I've never tried it. It is much faster to burn the bootloader in with a Programmer, or an Arduino programmed as a Programmer.

I just use a dedicated Programmer myself, an old Atmel AVRISP MKii.

C_Raynor:
The onboard barebones firmware on the 328P will only accept programming through the SPI port.

Pin 11 = MOSI
pin 12 = MISO
pin 13 = SCK

I don't think the FTDI has SPI capabilities. Perhaps someone else can enlighten both of us on how to use the FTDI, withg or without the bootloader.

But this is not the case when I upload a sketch through the Mega... In the Mega, I send the reset pin to GND, and then I wire it like this:

Mega Pro Mini
TX <-> TX
RX <-> RX
3.3V <-> VCC
GND <-> GND

So, I choose the port where the Mega is connected to the PC, and when I click "Upload", I have to press the reset button in the Pro Mini right after the IDE has finished uploading...

CrossRoads:
You can use an FTDI to bootload a 328P, this Adafruit tutorial covers it.

Programming the Arduino Bootloader | FTDI Friend | Adafruit Learning System

I've never tried it. It is much faster to burn the bootloader in with a Programmer, or an Arduino programmed as a Programmer.

Gammon Forum : Electronics : Microprocessors : Atmega bootloader programmer

I just use a dedicated Programmer myself, an old Atmel AVRISP MKii.

But, If I am able to upload sketches to the pro mini through the mega... shouldn't that mean that the pro mini already has a bootloader? Seeing that in youtube videos people are just connecting the FTDI programmer to the pro mini and it works fine, it sounds to me there's an issue with my programmer... although, I have bought 3 of them, and they all behave the same :frowning:

Have you tried a different USB cable and USB port with your three FTDI programmers? Your hookup should work. I use the same hookup with 5V 16Mhz Pro Mini's all the time. If you can program using the Mega,you have a bootloader on the Mini.

frapell:
But, If I am able to upload sketches to the pro mini through the mega... shouldn't that mean that the pro mini already has a bootloader?

Correct. Please ignore the replies about burning the bootloader and using the Mega or FTDI board as an ISP. That is not necessary.

kprims:
Have you tried a different USB cable and USB port with your three FTDI programmers? Your hookup should work. I use the same hookup with 5V 16Mhz Pro Mini's all the time. If you can program using the Mega,you have a bootloader on the Mini.

Do I feel stupid now... Changing the USB cable to a different USB port worked !!!

Thanks!!

frapell:
Do I feel stupid now... Changing the USB cable to a different USB port worked !!!

Thanks!!

Huh! That's... strange. A strange solution to a strange problem. Theres a voice in my head screaming "loose connection"

DrAzzy:
Huh! That's... strange. A strange solution to a strange problem. Theres a voice in my head screaming "loose connection"

The person who teached me more about troubleshooting (years ago) always said that the FIRST thing to do is "check the f***ing cables", I keep getting surprised by the different places and situations where this is true.
But in this particular case is looks that the problem was the usb port and not a loose connection. Maybe that particular tty was not well configured or busy and it was solved when changing to a new device.

Yeah, there's something definitely wrong with that specific USB port... I tried plugging the cable back in the same one and again I cannot upload sketches... what is weird though is that I can open the serial monitor and it works fine...

Anyway... plugging it into another USB works fine, so who knows what might be happening there...

Thanks again everyone