avrdude is annoying me

I'm trying to pgoram a legit Arduino Mini 05 (atmega328) using an FTDI FT232RL.

"avrdude: stk500_getsync(): not in sync: resp=0x00"

A pretty common error as I found out after I got it, what did I try to fix it?

  • COM5 is the port that the FTDI is on, so check
  • Drivers are fine, the device is properly recorgnized in the device Windows manager
  • Checked if I had the right board (Arduino Mini w/ ATmega328), I tried this on the IDE (1.0.6) and Visual Studio 2013 with Visual Micro
  • Bootloader on the Mini should be fine, I did program the Mini with a Chinese Arduino Uno setup before (because I had no serial adapter), so there is a sketch on the Mini that runs some motors, and it's working fine
  • Disconnect the RX (Pin 0) on the Mini, I don't know why, but somewhere on the internet they say it should work (RX on the FTDI was connected to TX of the Mini during this attempt)
  • Connect TX to TX and RX to RX

But none of these "solutions" did do the trick for me...

The Arduino does get power from the VCC/GND (5V), it does also reset (DTR to Reset), but I'm left with that annoying dude...

What's the Avrdude command you are using?

mart256:
What’s the Avrdude command you are using?

I don’t know…

In Visual Studio I use CTRL+F5 to upload.
In the Arduino IDE (1.0.6, I’m currently getting the latest version to try if that’s the issue) I just use the upload button, and I keep double checking if I have the right things selected before I press upload…

SparkyRih:
I did program the Mini with a Chinese Arduino Uno setup before (because I had no serial adapter), so there is a sketch on the Mini that runs some motors, and it's working fine

How did you program the Mini? Via Arduino as ISP? Did you burn bootloader after uploading the motors sketch?

mart256:
How did you program the Mini? Via Arduino as ISP? Did you burn bootloader after uploading the motors sketch?

I used a Chinese Arduino before I got my FTDI adapter and that worked great, never did anything with the bootloader... Someone is telling me now that I should burn the bootloader, but didn't the Mini 05 have it on board already?

Edit: It does come with the bootloader preburned:

The ATmega328 on the Arduino Mini comes preburned with a bootloader that allows you to upload new code to it without the use of an in-system-programmer. The bootloader communicates using the original STK500 protocol

Edit 2: Tried updating the drivers, now everything is totally f'd... Can't even get the drivers to sintall anymore.........

Edit 3: Ok, I fixed the driver issues, I actually had to install 2 drivers in an unusual way, but now I'm running the latest versions of the FTDI drivers (2.12 instead of 2.10), but still I have the issue that I describe in my first post...

I did program the Mini with a Chinese Arduino Uno setup before

"Upload using programmer" will erase any bootloader that was present on the chip, and you will have to reinstall it.

westfw:
"Upload using programmer" will erase any bootloader that was present on the chip, and you will have to reinstall it.

What I did is I wired:

Uno > Mini
Reset > GND
RX > RX
TX > TX
5V > 5V
GND > GND

Than I simply hit upload on the IDE, but just before uploading I manually pressed the reset button on the Mini...

So you say that wiped my bootloader? I just want to make sure because flashing a new bootloader requires me to take apart everything, de-solder some wires and temporarily solder new wires :S I can't just burn it using the FTDI right?

SparkyRih:
What I did is I wired:

Uno > Mini
Reset > GND
RX > RX
TX > TX
5V > 5V
GND > GND

Then you didn't erase the bootloader, because you didn't use ISP to upload, you used the usb to serial that was on arduino board.

Why don't you try uploading with FTDI and manual reset?

mart256:
Then you didn't erase the bootloader, because you didn't use ISP to upload, you used the usb to serial that was on arduino board.

Why don't you try uploading with FTDI and manual reset?

I just started to get an Arduino Uno ready, even though I thought it would be very strange that I wiped the bootloader like that... Oh well :smiley:

So I did try your suggestion already, I connected the FTDI, even though it does reset the Mini, I did manually reset it, but that didn't work... I can keep trying some more, maybe I timed wrong...

But the whole reason why I purchased the FTDI is because it had proper drivers (took me 1.5 hours to get them to work again yesterday) and because it had a proper reset pin without the need of soldering on it :S

Edit: So I uploaded a sketch using another Arduino Uno liek I did before, worked fine... I put a Serial.begin(9600) and Serial.println("Success") in the setup()... When I open the serial monitor, the line is printed, and the sketch (motors) start...

Now when I connect the FTDI, the motors start as well, when I open the serial monitor in the IDE the Arduino Mini resets, but the sketch appears to never run? There is no line printed in the serial monitor, and the motors won't turn on... Now for the crazy part (at least I think it's crazy), I leave everything plugged in, but I just close the IDE's serial monitor (IDE itself still running), and the motors suddenly start running again like they're supposed to...

Maybe this gives you guys any clues? Because it only confuses me even more :S

Edit 2: Maybe the FTDI keeps "holding" the reset, instead of giving it a pulse?

Now when I connect the FTDI, the motors start as well, when I open the serial monitor in the IDE the Arduino Mini resets, but the sketch appears to never run? There is no line printed in the serial monitor, and the motors won't turn on... Now for the crazy part (at least I think it's crazy), I leave everything plugged in, but I just close the IDE's serial monitor (IDE itself still running), and the motors suddenly start running again like they're supposed to...

Try a simply FTDI loopback with the serial monitor - just the FTDI, no Arduino.

Connecting the FTDI should not cause a reset. Opening the Monitor will cause a reset since the CTS is pulsed. After reset, the board should run stable. Remember, if you are powering the Arduino separately, DO NOT connect the FTDI +5V (or 3.3V if jumpered) connection!

Good luck,

Ray
My Projects

SparkyRih:
Maybe the FTDI keeps "holding" the reset, instead of giving it a pulse?

Well, your mini works with Aruino's usb-serial but not with FTDI.
I guess maybe your FTDI is bricked. Is it a clone?

mrburnette:
Try a simply FTDI loopback with the serial monitor - just the FTDI, no Arduino.

Connecting the FTDI should not cause a reset. Opening the Monitor will cause a reset since the CTS is pulsed. After reset, the board should run stable. Remember, if you are powering the Arduino separately, DO NOT connect the FTDI +5V (or 3.3V if jumpered) connection!

Good luck,

Ray
My Projects

There is no reset when I plug it in, the arduino just starts running like it's supposed to, but when I open the serial monitor (or Putty) it resets, but it appears that it keeps resetting until I close the serial monitor...

The Arduino Mini is powered using a battery on the 9v input, but I always disconnect it when I connect it to the PC, so I do need to connect the 5V and GND from the FTDI to the 5V and GND of the Arduino Mini right?

mart256:
Well, your mini works with Aruino's usb-serial but not with FTDI.
I guess maybe your FTDI is bricked. Is it a clone?

The adapter does come from China...

Loopback test does work fine...

SparkyRih:
There is no reset when I plug it in, the arduino just starts running like it's supposed to, but when I open the serial monitor (or Putty) it resets, but it appears that it keeps resetting until I close the serial monitor...

The Arduino Mini is powered using a battery on the 9v input, but I always disconnect it when I connect it to the PC, so I do need to connect the 5V and GND from the FTDI to the 5V and GND of the Arduino Mini right?

The FTDI cannot supply more current than the PC USB port which is generally limited to 500mA max. A 9V alkaline battery really should not be drained more than about 100mA but can supply more for short times but at the expense of terminal voltage.

Neither the USB or the 9V battery is appropriate for motor operation: due mainly to the peak current requirements of these units: notes here.

but when I open the serial monitor (or Putty) it resets, but it appears that it keeps resetting until I close the serial monitor

Normal behavior.

SparkyRih:
Loopback test does work fine...

Is your FTDI well plugged?

FTDI - > Arduino mini
Vcc - > Vcc
Tx - > Rx
Rx - > Tx
GRN (or RTS) - > RST
BLK (or GND) - > Gnd

There are circuits in place that control the (4) motors and separate the power from the motors and the arduino, and limit the power to the arduino to 3.3V (200mAh if I'm not mistaking) (it's connected after the diode on the 9v input of the Mini)... The motors turn very slowly when I connect it over USB, but they turn at the expected rate when I connect a 3.7V battery...

So the motors can get the 3.7V and their desired mAh, but the arduino is limited to 3.3V, 200mAh (skipping the diode on the arduino, otherwise it would only get 2.7V)...

I don't have a lot of knowledge of electrical circuits (so the above might not make sense to you guys), but I'm doing this project together with someone who does have professional knowledge and daily experience for over 35 years in this stuff...

But I don't think that's the issue here right? I just have to be able to program the Arduino Mini using the FTDI instead of an Arduino Uno...

mart256:
Is your FTDI well plugged?

FTDI - > Arduino mini
Vcc - > Vcc
Tx - > Rx
Rx - > Tx
GRN (or RTS) - > RST
BLK (or GND) - > Gnd

FTDI > Mini
5V > 5V (using 5V jumper, not 3.3)
GND > GND
RX > TX
TX > RX
DTR > Reset
CTS > Not connected

I also tried purposly swapping the RX to RX and TX to TX to make sure they were not swapped on the FTDI for some reason...

Edit: Please don't tell me the CTS and DTR are wrong?

SparkyRih:
FTDI > Mini
5V > 5V (using 5V jumper, not 3.3)
GND > GND
RX > TX
TX > RX
DTR > Reset
CTS > Not connected

I also tried purposly swapping the RX to RX and TX to TX to make sure they were not swapped on the FTDI for some reason...

Edit: Please don't tell me the CTS and DTR are wrong?

On Arduino IDE, what board do you select? Arduino UNO or Arduino mini pro w/ atmega328p?

mart256:
On Arduino IDE, what board do you select? Arduino UNO or Arduino mini pro w/ atmega328p?

It's an Arduino Mini 05, so I select: Arduino Mini w/ Atmega328

Edit 2: No this should be fine...

But I do read at some places that you need to put a 100nF capacitor and 10K pull-up resistor after the DTR?