Cannot program Pro Mini using either FTDI adapter or USBASP

I am getting pretty desperate, so help would be greatly appreciated :frowning:

I am trying to program a brand new Pro Mini clone, 5V & 16 MHz (specs attached).

  1. USBASP

Using USBASP, on Windows 7 64 bits, I have a really hard time figuring the right driver to use.
My last attempt comes from here: http://andybrown.me.uk/2010/11/14/usbasp-drivers-for-64-bit-windows-7/

I see a USBASP device in my device manager:
usbasp.JPG

Note however that is says “libusb-win32” device, this topic seems to say that that is a problem.

Any way avrdude just locks up and never returns (this is avrdude 6.3 from my 1.8.2 IDE):

avrdude "-CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf" -v -patmega328p -cusbasp
-Pusb -Uflash:w:C:\Users\Franck\AppData\Local\Temp\arduino_build_726981/DoorSensor.ino.hex:i

avrdude: Version 6.3, compiled on Jan 17 2017 at 12:00:53
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

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

         Using Port                    : usb
         Using Programmer              : usbasp

I have tried a couple other drivers, and I get the same result.

Using the CP2102 friend

The driver is installed and the loopback test works on the adapter. However when I try to upload the Blink sketch I get this:

.../avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM9 -b57600 -D -Uflash:w:C:\Users\Franck\AppData\Local\Temp\arduino_build_678204/Blink.ino.hex:i 

avrdude: Version 6.3, compiled on Jan 17 2017 at 12:00:53
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 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          : 57600
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x8f
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x8f
...
Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
avrdude done.  Thank you.

Here are the connections (labels from the boards):

FDTI Pro Mini

DTR/Grn DTR
RX TX
TX RX
VCC Vcc
CTS GND
GND/Black GND

No matter what I try I can’t seem to program those pro minis, so any help would be really really appreciated!

Thanks,
Franck

Pro Mini Enhancement.pdf (115 KB)

Update: after upgrading my USBASP driver to “libusb0 (v1.2.6.0)” using Zadig, I now get this error trying to upload the Blink sketch:

C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cusbasp -Pusb -Uflash:w:C:\Users\Franck\AppData\Local\Temp\arduino_build_814714/Blink.ino.hex:i 

avrdude: Version 6.3, compiled on Jan 17 2017 at 12:00:53
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

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

         Using Port                    : usb
         Using Programmer              : usbasp
         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 : usbasp
         Description     : USBasp, http://www.fischl.de/usbasp/

avrdude: auto set sck period (because given equals null)
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
An error occurred while uploading the sketch
avrdude: error: program enable: target doesn't answer. 0 
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

Still not helping much… besides uploading a sketch is there a simple way I can test the programmer <-> pro mini communication?

Franck

[edit] Setting a low clock speed (-B 10) didn’t help:

avrdude: set SCK frequency to 93750 Hz
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: error: program enable: target doesn't answer. 0

USBASP is a Programmer, you use it with Tools: Burn Bootloader, or File:Upload Using Programmer, and connect to Power, Gnd, Reset, D13 (SCK), D12 (MISO), and D11 (MISO).

If you upload a sketch that way, it wipes out the Bootloader.

Once you have a Bootloader installed (I use Uno for all my 328P chips), then select Uno as the board type, altho the actual form factor may be different (such as burning a ProMini as an Uno), and your CP2102 connected as you mentioned earlier. Does the CP2102 actually say DTR? Some bring out their Reset Input at the DTR location, you can cut the trace to that pin and wire the DTR output signal from the chip over to the pin instead. Hard to tell from your picture.

Here is a related question: the pads are really small on that pro mini clone and I had a hard time heating them up when soldering.

I know the goal is to solder a pin in about 2s, how likely would you say is it to damage the board if it takes me up to 4-5s for a pin?

The blink test is happily running on that pro mini when powered through Raw, so the regulator at least is not fried :)

Franck

Do the pads look lifted at all? If not, you are probably ok. When soldering headers on, it can take longer to heat the larger mass of the pins up and then for the solder to melt. You can always buzz the connection from header pin to the pins on the device with a multimeter.

CrossRoads: USBASP is a Programmer, you use it with Tools: Burn Bootloader, or File:Upload Using Programmer, and connect to Power, Gnd, Reset, D13 (SCK), D12 (MISO), and D11 (MISO).

If you upload a sketch that way, it wipes out the Bootloader.

Once you have a Bootloader installed (I use Uno for all my 328P chips), then select Uno as the board type, altho the actual form factor may be different (such as burning a ProMini as an Uno), and your CP2102 connected as you mentioned earlier. Does the CP2102 actually say DTR? Some bring out their Reset Input at the DTR location, you can cut the trace to that pin and wire the DTR output signal from the chip over to the pin instead. Hard to tell from your picture.

Yes, sorry, I failed to mention that indeed I used: - Upload using programmer when connected through the USBASP; and the connections where just as you describe - Upload sketch when connected through the FTDI adapter.

In subsequent posts I have posted cmd line avrdude attempts with USBASP, using -cusbasp -Pusb.

I will look into your DTR/RST suggestion. Although I can't confirm it obviously I assume that the board was pre-loaded with a bootloader... then I may assume wrong. The blinking let does show any disturbance when the upload attempt starts.

On the other hand, through the USBASP, trying to read the fuses using cmd line avrdude the led does a little double blink... then resumes blinking every 3s.

Franck

CrossRoads: Do the pads look lifted at all? If not, you are probably ok. When soldering headers on, it can take longer to heat the larger mass of the pins up and then for the solder to melt. You can always buzz the connection from header pin to the pins on the device with a multimeter.

Should have thought of that :)

So all pins have a 0 ohm to exactly one of the 328 pins (vcc & gnd are ok too). I do get between 11 Mohms and 15 Mohms (megas) between pins 10-11-12-13 and some of the ATMega pins; the pads do look slightly lifted...

Franck

Another error using my UNO as an ISP: verification error, first mismatch at byte 0x0000 / 0x00 != 0x0c. This is a bit of a nightmare :(

I haven't yet tried to modify the DTR pin on the FTDI adapter... but I'm losing hope.

Can a UNO be folded in 4 to fit inside a pro mini enclosure? :)

avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cstk500v1 -PCOM10 -b19200 -Uflash:w:C:\Users\Franck\AppData\Local\Temp\arduino_build_814714/Blink.ino.hex:i 

avrdude: Version 6.3, compiled on Jan 17 2017 at 12:00:53
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

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

         Using Port                    : COM10
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
         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 : 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.02s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "C:\Users\Franck\AppData\Local\Temp\arduino_build_814714/Blink.ino.hex"
avrdude: writing flash (928 bytes):

Writing | ################################################## | 100% 1.12s

avrdude: 928 bytes of flash written
avrdude: verifying flash memory against C:\Users\Franck\AppData\Local\Temp\arduino_build_814714/Blink.ino.hex:
avrdude: load data flash data from input file C:\Users\Franck\AppData\Local\Temp\arduino_build_814714/Blink.ino.hex:
avrdude: input file C:\Users\Franck\AppData\Local\Temp\arduino_build_814714/Blink.ino.hex contains 928 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.65s

An error occurred while uploading the sketch
avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
         0x00 != 0x0c
avrdude: verification error; content mismatch

avrdude done.  Thank you.

A question, can I detect/monitor the reset sent by the FTDI adapter using a digital voltmeter? Or is the pulse too short to register?

Thanks!

Yay... finally getting somewhere this morning, here is what worked:

  • Burn a bootloader (IDE's pro mini 3.3V) using Arduino as ISP. I powered the 3.3V mini from a breadboard 5V power supply; that made me cringe but I thought that maybe a 3.3V Vcc with 5V logic levels from the UNO was causing problems.

[EDIT - WARNING]: Just tried to recover one of the two bricked pro minis I had with the same method. The 5V to Vcc quickly fried a small cap with a little puff of white smoke. It is the one close to the vcc & gnd, C106 on the schematics, except on my board it seems to say A70. It seems that cap is only used for Raw input, so I'll try to remove it.

  • I can now upload sketches using an FTDI adapter: not the cp2102 (haven't tried), but a red FTDI chinese clone

A few things I learned in the process:

  • I had naively been assuming that the pro mini came with a bootloader and fuses at 8MHz. It may well be that the board actually had no bootloader and was set for 1MHz.

  • I wish I had seen this thread earlier: USBASP Update Warning

After reading it, I wouldn't recommend the USBASP programmer to my worse ennemy, not if the goal is to reliably program a board. I understand the issues identified should only affect a small percentage of users / setups, however given that there are 10 of them at several levels good luck figuring what is wrong if things happen to not work out of the box...

Franck

Sorry for the rambling but after all this may help another newbie someday:

With the 3.3V pro mini that doesn't go in smoke with 5V on Vcc, I just verified that when connected to the UNO as ISP:

  • if I power the pro mini from a 5V breadboard supply I can reliably read the fuses, and avrmode in safemode doesn't complain that they've been change or ask if I want to change them back

  • if I power the pro mini at 3.3V, avrdude has trouble reading the fuses:

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: safemode: hfuse reads as DA
avrdude: safemode: efuse reads as FD

avrdude: safemode: Verify error - unable to read lfuse properly. Programmer may not be reliable.
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 26
avrdude: safemode: lfuse changed! Was ff, and is now 28
Would you like this fuse to be changed back? [y/n] n
avrdude: safemode: hfuse changed! Was da, and is now 0
Would you like this fuse to be changed back? [y/n] n
avrdude: safemode: efuse changed! Was fd, and is now 26
Would you like this fuse to be changed back? [y/n] n
avrdude: safemode: Fuses OK (E:FD, H:DA, L:FF)

Based on that I suspect it is perfectly possible to brick a 3.3V pro mini by trying to program it with the UNO while it is powered at 3.3V...

Franck