Go Down

Topic: Arduino Pro Mini - Can't Upload (Read 5997 times) previous topic - next topic

hopkir

I'm new to Arduino, so there has to be something I'm doing wrong. I've tried three different Arduino Pro Minis...

On the first, a generic, I was unable to upload using the FTDI board. I used an Uno to upload using Arduino as ISP, and was able to upload one sketch. But when I tried to upload an update to that sketch, was unable to do so, even using the Uno as ISP again. The red light on it flashes very rapidly whenever connected to power, so I figured it has to be bad.

I bought another generic from Amazon, and again, unable to upload with FTDI, so I used Arduino Uno as ISP, and uploaded. Once. After that, it fails. I returned this Pro Mini, as I couldn't get it to do anything else.

Finally, I spent 3x the money on a Sparkfun Arduino Pro Mini, with www.arduino.cc on the bottom, so I believe that this one is the name brand, right? Well, it will not upload with the FTDI board, nor through an Uno as ISP. When I try to use the Uno as ISP, I get the error that the avrdude can't sync (I'll post the exact error below). When I try using the FTDI board, it just says "uploading" forever, without ending. The blue light on the FTDI board and the red light on the Pro Mini both flash very rapidly, but nothing seems to be happening.

Have I just had incredibly bad luck with getting bad boards, or am I doing something terribly wrong? Even right now as I type this, I'm trying to upload this very simple sketch, and it is "uploading" forever.
Code: [Select]
int x;

void setup() {
  // put your setup code here, to run once:
Serial.println("Setup");
}

void loop() {
  // put your main code here, to run repeatedly:
Serial.println(x++);
}


Here is the error I get after disconnecting the USB cable:
Quote
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 "Z:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM8
         Using Programmer              : arduino
         Overriding Baud Rate          : 57600
avrdude: ser_drain(): read error: The I/O operation has been aborted because of either a thread exit or an application request.


Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
Well, what do you know.... I tried one more time using the Uno to program the Pro Mini, and it seems to have worked. I'm still curious why I have been 100% unsuccessful in programming using the FTDI board, or why so often it fails with the Uno. There has to be something I'm doing wrong here.

hopkir

:/

I'm back to not being successful in uploading through the Uno...

Quote
Sketch uses 8,050 bytes (26%) of program storage space. Maximum is 30,720 bytes.
Global variables use 612 bytes (29%) of dynamic memory, leaving 1,436 bytes for local variables. Maximum is 2,048 bytes.
Z:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CZ:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM5 -b57600 -D -Uflash:w:C:\Users\rich\AppData\Local\Temp\build785044087903e7549bbc785bdf17e1d0.tmp/EAA690_Door.ino.hex:i

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 "Z:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM5
         Using Programmer              : arduino
         Overriding Baud Rate          : 57600
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=0xe0
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xe0

avrdude done.  Thank you.


CrossRoads

You have a Programmer? Or can run an Uno as one?
http://www.gammon.com.au/bootloader
Bootload the Promini's as Unos to ensure they have a bootloader, then try the FTDI to upload sketches normally.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

You need to select Uno as the board type after you bootload them as Uno. I bootload all my 328Ps as Uno, no matter what board I put them on.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

DrAzzy

The error shown when you yank out the USB cable is not useful. That error is produced by the act of disconnecting a USB cable while it's in use.

Enable verbose uploads in the settings.

Allow the upload to complete, or time out with an error, and post that error.

How many FTDI boards have you tried? Many FTDI adapters floating around are counterfeit, and the new FTDI drivers don't work with them. I use CH340G serial adapters precisely because I don't have time or money to vet the sources of my serial adapters to make sure they're sending me real FT232's - the CH340G is so cheap already there's no incentive for china to make fake ones.
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

hopkir

The error shown when you yank out the USB cable is not useful. That error is produced by the act of disconnecting a USB cable while it's in use.

Enable verbose uploads in the settings.

Allow the upload to complete, or time out with an error, and post that error.

How many FTDI boards have you tried? Many FTDI adapters floating around are counterfeit, and the new FTDI drivers don't work with them. I use CH340G serial adapters precisely because I don't have time or money to vet the sources of my serial adapters to make sure they're sending me real FT232's - the CH340G is so cheap already there's no incentive for china to make fake ones.
I've only tried one FTDI board. Looking on Amazon, is this what you are referring to? http://smile.amazon.com/OSOYOO-ATMEGA328P-Module-Micro-controller-Arduino/dp/B00UACD13Q/
I don't come up with anything searching for a CH340G on sparkfun.


hopkir

You have a Programmer? Or can run an Uno as one?
http://www.gammon.com.au/bootloader
Bootload the Promini's as Unos to ensure they have a bootloader, then try the FTDI to upload sketches normally.
Do I have a programmer or can run Uno as one? I'm not sure what that means. I have this FTDI board (http://www.microcenter.com/product/432350/FTDI_Adapter_USB_Controller) and it has not worked. I have used an Uno to program the Pro Mini by connecting the Rx and Tx pins between the two boards, the ground and Vcc pins, and connecting the Uno's reset pin to ground, then using USB between the Uno and the PC to upload the sketch. I did get this to work once again, so there must have been something I was doing wrong before.

On the link you've provided, I'm not sure what is going on there. Is that telling how to dedicate an Uno to the task of programming other Arduinos? I'm also not sure what you're meaning when you say to bootload the Pro Mini as an Uno. I've tried using the Burn Bootloader option in the Arduino IDE, but that didn't succeed.

hopkir

One thing that I have figured out, which was rather surprising to me, is that if I want to upload a new sketch, I have to remove the Pro Mini from the circuit. If I don't, it fails every time. I wasn't expecting that.

dmjlambert

One thing that I have figured out, which was rather surprising to me, is that if I want to upload a new sketch, I have to remove the Pro Mini from the circuit. If I don't, it fails every time. I wasn't expecting that.
There are many factors that could cause that.   Connected devices drawing too much current could interfere with the upload process.  Or having something connected to RX and TX (pins 0 and 1) could interfere with the upload process.   If you're uploading via ISP, having something connected to the reset pin or pins 11, 12, or 13 could interfere.   

The thing about Pro Mini is, since the USB-to-serial adapter is separate and there are many different options to connect to it and program it (as you found out), it ends up being a more complicated thing.   You were not able to use your FTDI adapter so you improvised and did other things.   You mentioned using Uno as ISP, and mentioned using RX and TX of the Uno to program it.   This is resourceful, good job on accomplishing what you have done so far.   

Since you have just this one topic and a few posts, and you have a LOT of stuff going on, it is kind of difficult to follow and I'm sure you are a little confused.   You will need some patience to really get comfortable and to figure all this stuff out.

I recommend these topics of research and learning, much of which you can learn in books that may be available at your library (that's what I did), or you may be able to learn from Googling things.   Unfortunately a lot of what you see on the web you have to take with a grain of salt.
1.  research how to do ISP programming by making your Uno an ISP programmer.   Learn the difference between loading a sketch via ISP and loading a bootloader via ISP. 
2.  research how to tell if your FTDI has a working driver on your computer.  Most computers have something like a device manager that will tell you the health of the device and driver and where you can tell the name of the serial port assigned to your device.
3.  learn about the Loop Back Test and see if the test passes for your Uno and for your FTDI adapter.  (It will pass for the Uno, since you have used the Uno's onboard USB-to-serial adapter successfully before).  The Loop Back Test steps are detailed in one of the pinned posts at the top of the forum.   

Notes:  If you load a sketch via ISP, the board will no longer have a bootloader on it.   A bootloader is what allows you to load a sketch via FTDI.  Once you know you have a working FTDI with good drivers and the Loop Back Test works on it, use your Uno as an ISP programmer and burn the bootloader on your Pro Mini.   Then disconnect it and hook it up to your FTDI adapter and upload a sketch. 

I don't think you've had bad luck and probably you don't have bad boards.  Your situation is complex and it all started getting more complex when you couldn't get your FTDI adapter working.   To work with Pro Minis you really must have a known good working USB-to-serial adapter.   



Go Up