Pages: [1]   Go Down
Author Topic: Solved - Can't upload sketches with USBtinyISP to arduino pro mini.  (Read 1078 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm using the 6 pin header to connect the arduino mini pro and a USBtinyISP. When I try to upload a sketch to this arduino, I get the avrdude: initialization failed, rc=1 error.
However, when I connect the usbISP to the ICSP of my arduino mega, I can upload a sketch to the mega.
The mini pro receives its voltage, and the power led is on, the other led blinks. (first time I use this arduino board btw).
I'm using the following pinout diagram:
Nothing else is connected to the arduino board yet.
Pictures of the ISP, connector and arduino:


« Last Edit: December 28, 2013, 02:22:54 pm by Ward123 » Logged

Atlanta, USA
Offline Offline
Edison Member
*
Karma: 34
Posts: 1476
AKA: Ray Burne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

A similar thread
http://forum.arduino.cc/index.php?topic=156431.0
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The drivers are installed correctly, my computer(s) detect the USBtinyISP AVR Programmer correctly. However, when I try to upload the sketch using "upload with programmer" it gives me this initialization failed, rc=-1 error, which points to the fact that the connection between usbtinyisp and the arduino mini isn't correct? I've tried several times to start all over again with the wiring and tripple checking my connections to the pin header, but I'm sure that these connections must be correct, using this pinout picture:
I've tried to use an old laptop with windows 7 32bit and my laptop with win 8.1 instead of desktop(win 8 64 bit) so I think I can say that the problem is not situated in the OS that I'm using.
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 119
Posts: 4591
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I can't think of any reason it won't work. "-1" is usually a wiring error.


One of the first things you should check is if your "GND" wire coming out of the connector connects back to "GND" on the USBtinyISP (ie. the metal shell of the USB connector). Once that's established, check you have 5V where you expect it.

If not, you got the connector backwards.

After that, try swapping your MISO and MOSI. They're never labelled sensibly.


I'm not sure what the Mega328 pinout diagram has to do with a Pro Mini.
Logged

No, I don't answer questions sent in private messages...

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There is no connection between the arduino's GND and the outer shell of the usb connector. however, the internal lines of the usb connector are connected, and my arduino blinks with the default (out of factory) program, and the power-led is on.
Swapping the miso and mosi gave me still the same error.
That pinout was one I found looking for the arduino pro mini?
Another one: http://www.pighixxx.com/pgdev/Temp/ProMini.png
edit* I don't know if its usefull, but here is the output when I try to upload the sketch:
Compiling 'SerialCommunication' for 'Arduino Pro or Pro Mini w/ ATmega328 (5V, 16 MHz)'
Binary sketch size: 5410 bytes (used 18% of a 30720 byte maximum) (0,29 secs)
Minimum Memory Usage: 181 bytes (9% of a 2048 byte maximum)
Uploading to I/O board using 'usbtinyisp'
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 119
Posts: 4591
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That pinout was one I found looking for the arduino pro mini?
Another one: http://www.pighixxx.com/pgdev/Temp/ProMini.png

That's not what's in the first post up there ^^

edit* I don't know if its usefull, but here is the output when I try to upload the sketch:
Compiling 'SerialCommunication' for 'Arduino Pro or Pro Mini w/ ATmega328 (5V, 16 MHz)'
Binary sketch size: 5410 bytes (used 18% of a 30720 byte maximum) (0,29 secs)
Minimum Memory Usage: 181 bytes (9% of a 2048 byte maximum)
Uploading to I/O board using 'usbtinyisp'
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

No, not useful.
Logged

No, I don't answer questions sent in private messages...

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 119
Posts: 4591
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If all else fails, suspect the wires/breadboard...

Have you got an oscilloscope? Make sure signals are arriving at the pins on the Pro Mini.
Logged

No, I don't answer questions sent in private messages...

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I placed the arduino on a different spot on the breadboard, and used other wires. Using visual studio (and visual micro addin), I succeed uploading a sketch, but the program seems not to be loaded (tried the blinking program, pin status doesn't change, what I checked using my scope.)
Using the Arduino environment (v1.5.4), I get this:
avrdude.exe: error: usbtiny_send: usb_control_msg: sending control message failed, win error: A device attached to the system is not functioning. (expected 128, got -5)avrdude.exe: verification error, first mismatch at byte 0x0008              0x0c != 0x04avrdude.exe: verification error; content mismatch
Could it be that the arduino is broken?
Thinking about a plan B, wouldn't it be easier to use an arduino mega 2560 or arduino nano to act as an ISP, and upload my sketches using a second arduino? :/
« Last Edit: December 08, 2013, 08:23:47 am by Ward123 » Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 119
Posts: 4591
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Could it be that the arduino is broken?

It could be that the ISP isn't configured correctly and is sending data too fast. I'm not sure how to change that.

Try selecting "8MHz" in the list of boards.

Thinking about a plan B, wouldn't it be easier to use an arduino mega 2560 or arduino nano to act as an ISP, and upload my sketches using a second arduino? :/

Easiest way would be to get an FTDI adaptor and use the six pin connector you soldered on the end of the Pro Mini.

(Although you might have killed the bootloader by now)
Logged

No, I don't answer questions sent in private messages...

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Unfortunately again the same error it gave me last time. smiley-sad But the comminucation led starts flickering when the uploading process starts.
Some info from my oscilloscope: the signals on MOSI/MISO are lasting for approximately 2 seconds. But I don't really know what to look for in these signals...
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 119
Posts: 4591
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Make sure RESET goes fully low during communication.

Logged

No, I don't answer questions sent in private messages...

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I tied down the reset pin using a wire, no change however smiley-sad
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 119
Posts: 4591
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can you turn on verbose info and see what the fuse bits are? Maybe they turned off SPI programming (unlikely but we have to eliminate it)

Logged

No, I don't answer questions sent in private messages...

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Seems like 'the problem solved itself' put my arduino on the side for a while and today was miraculously enough able to upload the sketch. The avrdude.exe: error: usbtiny_send: usb_control_msg: sending control message failed, win error: A device attached to the system is not functioning. (expected 128, got -5) error was still there, but the program is running fine.
« Last Edit: December 28, 2013, 02:22:24 pm by Ward123 » Logged

Pages: [1]   Go Up
Jump to: