5
\$\begingroup\$

I followed this tutorial and got the following error when trying to (削除) compile (削除ここまで) upload the attiny85 sketch:

avrdude: usbdev_open(): did not find any USB device "usb"

The attiny is already soldered on a circuit (with two leds, a buzzer, button and a brightness sensor). Can this cause the error?

Also, the attiny already has a program on it (that I want to overwrite) so I assume I don't need to install the bootloader?

I found two files with the attiny hardware files, one that adds ATtiny85 (w/ Arduino as ISP) and one that adds ATtiny 85 (internal 1Mhz clock) to the Board menu. When using the first one (Arduino as ISP) i can only compile the blink sketch when I add

#include <Arduino.h>
#include <wiring.h>

otherwise it says "OUTPUT" was not declared in this scope.

UPDATE: Tried it with setting programmer in the tools menu. I changed it to Arduino as ISP. The error is now a different one (with upload as well as upload using programmer):

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

- Board: ATtiny85 w/ Arduino as ISP - Programmer as ISP - COM port correct (I also tried the other one)

Sometimes I get this error (only with normal upload), which indicates a successful upload according to the tutorial, but the ATtiny still performs the program that was installed before.

avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny85
avrdude: stk500_program_enable(): protocol error, expect=0x14, resp=0x50
avrdude: initialization failed, rc=-1
 Double check connections and try again, or use -F to override
 this check.
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51
asked Aug 19, 2012 at 15:45
\$\endgroup\$
5
  • \$\begingroup\$ And the question is...? \$\endgroup\$ Commented Aug 19, 2012 at 15:47
  • \$\begingroup\$ @stevenvh What can cause the error?, How can I circumvent it? \$\endgroup\$ Commented Aug 19, 2012 at 16:04
  • \$\begingroup\$ Are you following these instructions? \$\endgroup\$ Commented Aug 19, 2012 at 18:46
  • \$\begingroup\$ @Dean Yes, these instructions are the same. They provide different "board" files (that go to the hardware folder) but both of them lead to the same error. \$\endgroup\$ Commented Aug 19, 2012 at 19:48
  • \$\begingroup\$ This is almost certainly an error in not telling avrdude how to talk to the arduino as a programmer (or not preventing it from resetting the arduino), rather than anything to do with the chip/board you are trying to program. \$\endgroup\$ Commented Aug 19, 2012 at 21:33

4 Answers 4

3
\$\begingroup\$

UPDATE 2

If the tiny is running a sketch then it must already have a bootloader.

I think there are a lot of factors to be wrong here because the tutorial was written pre arduino 1.0. I think the 1mhz one is a problem and best avoided for now. The tin85 w/ Arduino ISP sounds to be pre-arduino 1.0 and needs to compile correctly.

In a few days I will have some time so if you haven't fixed it by then I hope to give you some info.

First I will take 2 arduinos, one as ISP and one as normal arduino. We need to prove the ISP sketch is working correctly when uploading blink to a 2nd arduino.

Once the ISP is proven with arduino 1.0 we need to see why normal compile of the tiny85 fails. It might be there is an updated tiny85 hardware folder for arduino 1.0 on the web but if not then we can change the tiny85 hardware folder sources to use 1.0 instead (hopefully).

FYI: You mention the arduino.h, in versions earlier than arduino 1.0 the file was called wprogram.h, arduino 1.0 also expects a few other differences. If the tiny85 is including wprogram.h I think it will be a problem to also include arduino.h

IDEA

If you have some time spare why not go onto the arduino.cc and down load version 0023 of the arduino IDE. (All of the older version of arduino are available). Upload the Arduino ISP example to the UNO using 0023 then try the upload to the tiny85 (w/ arduino ISP) for the blink sketch. I would expect 0023 to work exactly like the video, so if it fails you can look to the wiring of the tiny85 for the problem. It it works we will know we need to update the tiny85 hardware folder to arduino 1.0 format

If it works in 0023 then you should follow Deans instructions above for Arduino 1.0.1.

UPDATE

The only way I can find to reproduce the error you see is if I attempt to "Upload using programmer" when the programmer is set to "AVRISP". If I upload the ISP sketch to an arduino and attempt to program an unconnected tinyxx I get different errors.

So sorry if these are time wasting questions but.. are you clicking "Upload" in the arduino ide or "Upload using programmer"? You should be clicking "Upload" after selecting the ATTiny (w/ Arduino ISP) as the board.

Info..

It is a bit confusing but the board definition for ATTiny xx (w/ Arduino ISP) forces the correct programmer settings for the normal arduino "Upload". In the arduino ide, the menu item "Upload using programmer" uses whichever programmer is selected on the "Tools>Programmer" menu, in this case probably AVRISP mkII which, if unconnected, will produce the error you have reported.

answered Aug 21, 2012 at 16:40
\$\endgroup\$
4
  • \$\begingroup\$ I checked this part of the ISP code and it originally had a delay of 20. \$\endgroup\$ Commented Aug 21, 2012 at 18:20
  • \$\begingroup\$ Okay, so what I tried now is disconnected all wires from the arduino, uploaded the ArduinoISP sketch, then attached a 5uF capacitor between reset and ground with - to ground and unplugged and replugged the Arduino. The device manager displays the Arduino UNO, but no ISP. Am I supposed to see an ISP entry in the device manager? \$\endgroup\$ Commented Aug 21, 2012 at 20:07
  • \$\begingroup\$ Ignore my comment about device manager. More info posted above as can only seem to add a 1 line comment \$\endgroup\$ Commented Aug 22, 2012 at 14:05
  • \$\begingroup\$ I updated the question and reported what happens if I set a programmer. \$\endgroup\$ Commented Aug 22, 2012 at 15:34
1
\$\begingroup\$

Do you have AVRStudio installed as well? If so, your PC might use a "wrong driver" for your AVRISP mkII programmer.

The driver that comes with AVRStudio is not compatible with avrdude. Re-install the driver (the one that comes with avrdude/Arudino IDE) or use a different PC.

answered Sep 13, 2012 at 12:21
\$\endgroup\$
2
  • \$\begingroup\$ There does not appear to be an avrisp mkII involved \$\endgroup\$ Commented Sep 13, 2012 at 12:39
  • \$\begingroup\$ I dont have AVRStudio installed on my PC. \$\endgroup\$ Commented Sep 21, 2012 at 13:24
1
\$\begingroup\$

Search ATtiny on YouTube and you will find some videos that may help, including my effort: http://youtu.be/sqrknwcdXu8

answered Aug 29, 2013 at 2:46
\$\endgroup\$
0
\$\begingroup\$

Unplugging and re-plugging may fix it. Otherwise you may want to look at a similar question here.

answered Aug 20, 2012 at 21:29
\$\endgroup\$

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.