Failure to upload with Tiny AVR programmer

For several years I have been using the Arduino IDE (my current version is 2.3.7) and the Tiny AVR Programmer to upload cod to ATtiny85 chips.

Generally I have not had any trouble doing this until yesterday when the following message appeared when trying to upload the code:-

Sketch uses 3182 bytes (38%) of program storage space. Maximum is 8192 bytes.
Global variables use 125 bytes (24%) of dynamic memory, leaving 387 bytes for local variables. Maximum is 512 bytes.
Warning: cannot open USB device: Permission denied
Error: cannot find USBtiny device (0x1781/0xc9f)
Error: unable to open port usb for programmer usbtiny
Failed programming: uploading error: exit status 1

The last time I worked on this project was 10 days ago when no problems were experienced uploading code. aAs far as I’m aware have not changed any permission settings (Do I even know how to?!) or any other parameters since that time. The PC has just been used for emailing, word processing and internet searches

Opening <Control Panel / Device Manager> shows “libusb-Win32 devices” as “FabISP” suggesting that the PC recognises the programmer - checking Properties shows thatthe operating system thinks that it is loacated at Port_#0010.Hub_#0001and is Working Properly

As a user I have Administrator rights.

So my question is how do I solve this problem and get back to being able to upload code?

Is the port you have selected, correct?

When you compile, do you see something like; "Please, plug in the device. Will time out in 60 seconds..."?

Have you verified your USB cable is for data and not just a power cable?

Do you an Arduino UNO? If yes, you can try to program your ATtiny85 usinng Arduino as ISP programmer.

Thank you both xfpd & GolamMostafa for your replies. To answer your comments I would reply:-

Previously the programmer has been plugged into the PC and with all parameters in IDE - Tools (Board, Clock, Processor & Programmer) set correctly there has been no problem in burning bootloader or uploading code. Under tools the “Port” line is greyed out, so no option to manually select the port.

No the code compiles without any comment or problem

The Tiny AVR Programmer is plugged directly into the PC usb slot, no cable involved

Yes I do have an UNO and that is an option that I have to work-round the problem.

What I would like to understand is why this problem has suddenly occured, when as far as I know there have been no changes to the PC. Incidentally it is still using Windows 10 as the operating system.

Thanks

Does this device require a third-party driver? I use a device whose driver gets kicked out every time Windows has an update (I allow automatic Windows updates), so I must re-install the driver (my driver requires I enable Win7 compatibility, run as Admin... so it's a time taker)

SparkFun provides a driver download link here:

https://www.sparkfun.com/tiny-avr-programmer.html#content-documentation

Again thank you for your replies -apologies for the short delay in acknowledging them.

I have downloaded the Tiny programmer driver from the Spark Fun site and and used the download to update the driver on my PC. Result no change, the error message still reports “Permission denied”. (Previosly I had used the Zadig - FabISP driver, after downloading from SparkFun the device manager shows it as USBTiny)

I have not yet had time to try the UNO route to programme the ATtiny85, but wil do so when time permits

Sort out the problem as soon as possible. The attached file might help you programing the ATtiny85 using Arduino UNO as ISP Programmer.
ProgrammingATtiny85 (5).pdf (172.6 KB)

Again thank you GolamMostafa for your reply. I have studied the pdf document that you suggested and followed the instructions to add the drazzy.com item to the boards manager. It failed to install with the error message:-

Downloading packages

arduino:avrdude@6.3.0-arduino18

ATTinyCore:micronucleus@2.5-azd1b

Failed to install platform: 'ATTinyCore:avr:1.5.2'.

Error: 2 UNKNOWN: Get "https://azduino.com/bin/micronucleus/micronucleus-cli-2.5-azd1b-x86_64-mingw32.zip": dial tcp 3.218.2.136:443: connectex: No connection could be made because the target machine actively refused it.

So I was unable to programme the tiny85 in the way suggested by the linked document. However searching for other help for programming using the Arduino UNO gave me another link (to Circuit Digest):-

https://circuitdigest.com/microcontroller-projects/programming-attiny85-microcontroller-ic-using-arduino

Which in turn named a different board manager package:-

https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json

Which did work successfully (with attiny 1.0.2 by David A Mellis listed in the board manager) and then enabled me to (apparently) successfully down load code to the ATtiny85 chip. I say apparently as I have yet to put the chip into the project to see if it works.

However unlike the document you suggested the Circuit Digest document does not say anythink about Burn Bootloader, so I am left wondering how I can do that - even if it is necessary, for example to change the internal clock frequency. Any help with this would be appreciated.

Thank you

  1. Connect the programmer to the target ATtiny85.
  2. Select the appropriate configuration from Arduino IDE's Tools > Clock menu.
  3. Select Tools > Burn Bootloader from the Arduino IDE menus.

The "burn bootloader" operation will now start. It should complete successfully.

It might seem unintuitive to perform an operation named "burn bootloader" in a case like this where you aren't actually using a "bootloader". However, Arduino IDE's Tools > Burn Bootloader actually does two things:

  1. Set the configuration fuses on the chip according to the values specified by the board definition.
  2. Flash the bootloader binary.

So we use this even in the case where we don't need to use a bootloader (or even when there is no bootloader, as in this case), simply as a convenient way to correctly set the configuration fuses.

If you don't do it, the chip will have whatever fuse settings that happen to have been set previously. If they haven't been set since purchasing a chip fresh from the factory, then it will have the factory default fuse settings.

1 Like

Have you followed the following instructions correctly of the referred pdf?

(a) Open the Arduino IDE and on the main menu, select Files -> Preferences. In
the Additional Boards Manager URLs textbox, type this URL (if you have pevious URL, ten put a comma ,)

http://drazzy.com/package_drazzy.com_index.json

and then press the OK button.

(b) Perform this task: Tools → Board: → Boards Manager… → click. When the Borads Manager wondow appears, type ATTinyCore in input box and then follow menu. You will see something like Fig-1:


Figure-1:

Unfortunately this won't work. In addition to the platform itself, Boards Manager also downloads and installs any tool dependencies specified by the platform developer. One of the tool dependencies of the ATTinyCore platform is the Micronucleus uploader tool. @DrAzzy/SpenceKonde hosted the archive file for this tool on their website azduino.com. The azduino.com website is currently down:

So when Arduino IDE attempts to download the tool from that site, it fails and this causes the ATTinyCore platform installation to fail:

Arduino IDE caches the downloaded tool dependency archive files. Before downloading a tool dependency, it first checks to see if it is present in the local cache. If so, it uses the local file instead instead of performing the download. So if you have previously installed ATTinyCore, you won't encounter this problem if you try uninstalling and reinstalling as a test. However, someone who is installing ATTinyCore for the first time will encounter this.

I describe a workaround for the problem here:


I do recommend the use of ATTinyCore instead of the alternative "attiny" platform from David Mellis. The reason is that ATTinyCore is far more feature rich and provides a much deeper level of support for the target chips than the very minimal "attiny" platform. I see "attiny" platform as mainly having historical value as one of the early 3rd party platforms that successfully expanded the Arduino hardware ecosystem. However, in the current moment where it is a bit challenging to install ATTinyCore, it is reasonable for users who just want a simple solution to choose the "attiny" platform. Despite no longer being maintained, the minimal design of the "attiny" platform allows it to hold up very well.

Many thanks to ptillisch for a very well constructed reply. As an “old dog leatrning new tricks” I need to consider your reply very carefully to understand it! Unfortunately other commitments mean that such study and action will have to wait a while. But again thank you it is much appreciated

1 Like

Check drivers, select correct board and port, choose USBtinyISP, slow clock, verify wiring, reset target, update firmware, retry upload now.

Thank you “Waqassb” for you comment. I am confident that all your suggestions have already been tried, about the only thig I haven’t done is to un-install Adruino IDE (V2.3.7) and re-install it. At the moment I have a work-around using the UNO so getting on with the project has a higher priority than sorting out why the Tiny AVR programmer does not work as it has done in the past and and was doing 3 weeks ago!

Again I thank all those who have responded to my plea for help.