ATtiny85 upload on Sparkfun Tiny Programmer 11801 250502

Hello Arduino forum,

Although the Tiny Programmer 11801 has been used successfully
a couple of times before, on Tuesday, April 29 after the sketch was compiled in Arduino IDE V 2.3.5,
when the sketch is sent to the Tiny Programmer the IDE returns:
"Failed programming: uploading error: exit status 1 "
The setup to sending the sketch is:
Win-11 USB port and the Arduino IDE set to Board: ATTiny…85, Processor: ATtiny85, Clock: Internal 1MHz and
Programmer: USasp (Attiny CoreBtiny)
After the setup at “Tools” at the “Sketch” tab the “Upload Using Programmer” option is chosen.
Have tried several times with same result.

At the Sparkfun forum it was suggested that the USBTinyISP programmer be used.

Tried selecting the USBTinyISP. It worked once then subsequent attempts to upload to
the Atttiny using Arduino IDE V 2.3.5, when the sketch is sent to the Tiny Programmer the IDE returns:
"Failed programming: uploading error: exit status 1 "

I have two Sparkfun Tiny Programmer 11801. Neither work.
Tried different ATtinies. Tried different ports. Tried different cables.
Tried plugging the Tiny Programmer directly into the USB on
the laptop. Tried different sketches like the Blink sketch in the
IDE Examples.
Attached is a screen shot of the set up at the Arduino IDE Tools tab.

Have tried running the Bootloader Result:
Error while burning the bootloader: Failed chip erase: uploading error: exit status 1

The various articles and tutorials like

have been scoured for hours but no solution can be found,

I am dead in the water until I can get the sketch uploaded to
the microcontroller.

Thanks.

Allen Pitts
*


*

Hi @AllenPitts.

In order to make all relevant information available to any who are interested in this subject, I'll share a link to @AllenPitts's topic on the SparkFun Forum here:

I'm going to ask you to provide the full verbose output from an upload attempt.


:red_exclamation_mark: This procedure is not intended to solve the problem. The purpose is to gather more information.


Please do this:

  1. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Uncheck the box next to Show verbose output during: compile in the "Preferences" dialog.
  3. Check the box next to Show verbose output during: ☐ upload.
  4. Click the "OK" button.
    The "Preferences" dialog will close.
  5. Attempt an upload, just as you did before when you encountered that error.
  6. Wait for the upload to fail.
  7. You will see an "Upload error: ..." notification at the bottom right corner of the Arduino IDE window. Click the "COPY ERROR MESSAGES" button on that notification.
  8. Open a forum reply here by clicking the "Reply" button.
  9. Click the <CODE/> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
  10. Press the Ctrl+V keyboard shortcut (Command+V for macOS users).
    This will paste the error output from the upload into the code block.
  11. Move the cursor outside of the code block markup before you add any additional text to your reply.
  12. Click the "Reply" button to post the output.

Hello ptillisch and the Arduino forum,

Sketch uses 888 bytes (10%) of program storage space. Maximum is 8192 bytes.
Global variables use 13 bytes (2%) of dynamic memory, leaving 499 bytes for local variables. Maximum is 512 bytes.
"C:\Users\pitts\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino18/bin/avrdude" "-CC:\Users\pitts\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.5.2/avrdude.conf" -v -pattiny85 -cusbasp  "-Uflash:w:C:\Users\pitts\AppData\Local\arduino\sketches\0438EE1B7F588594F509E6973059F21A/SPSF_Fader_ATtiny_250430.ino.hex:i"

avrdude: Version 6.3-20201216
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Users\pitts\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.5.2/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : usbasp
         Setting bit clk period        : 5.0
avrdude: error: could not find USB device with vid=0x16c0 pid=0x5dc vendor='www.fischl.de' product='USBasp'

avrdude done.  Thank you.

Failed programming: uploading error: exit status 1

Excellent directions for pasting error message to post.

Thanks.

Allen Pitts

Select Tools > Programmer > USBtinyISP (ATTinyCore) SLOW, for new or 1 MHz parts from the Arduino IDE menus and then try again.

usbasp <> USBTinyISP

Hello ptilliisch, ledsyn and the Arduino forum,

Shout out to ptilliisch. Changing to
Tools > Programmer > USBtinyISP (ATTinyCore) SLOW, for new or 1 MHz parts
allowed me to get the sketch to load to the ATtiny85.

At the risk of imposing on your excellent knowledge another question
is addressed.

This is not a fatal error but is just something noticed and not understood.


Using a circuit based on attached schematic titled
"Attiny Tester Schematic" and
sketch

/*
240816 
Processor ATtiny85
Programmer USBTinyISP
 Compiled this sketch at Internal Clock 8 MhZ: LEDs blink at 5 second on and .5 second off
 Compiled this sketch at Internal Clock 16 MhZ: LEDs blink at 8 second on and 2 second off
 Compiled this sketch at Internal Clock 1 MhZ: LEDs blink at 1 second on and imperceptible off

  ATtiny Tester 230811
  Turns on an five LEDs on for one second, then off for one second, repeatedly
  as  a test of the microcontroller. If the internal clock is set to 8 MHZ
  the D1 LED blinks at 9 seconds on and 4 seconds off.
 */

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin 4 as an output.
  pinMode(0, OUTPUT);
  pinMode(1, OUTPUT);
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(0, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(500);            // wait for a second
  digitalWrite(0, LOW);   // turn the LED off by making the voltage LOW
  delay(100);            // wait for a second

  digitalWrite(1, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(500);            // wait for a second
  digitalWrite(1, LOW);   // turn the LED off by making the voltage LOW
  delay(100);            // wait for a second

  digitalWrite(2, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(500);            // wait for a second
  digitalWrite(2, LOW);   // turn the LED off by making the voltage LOW
  delay(100);            // wait for a second

  digitalWrite(3, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(500);            // wait for a second
  digitalWrite(3, LOW);   // turn the LED off by making the voltage LOW
  delay(100);            // wait for a second

  digitalWrite(4, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(500);            // wait for a second
  digitalWrite(4, LOW);   // turn the LED off by making the voltage LOW
  delay(100);            // wait for a second
}

type or paste code here

Previously the circuit operated as directed in the sketch.
That is, the LEDs came on for a half second and then
off for one tenth second before turning on the next LED.
Now, the LEDs come on for eight seconds and the delay
is 1.6 seconds, 16 times the delay intervals
specified in the sketch.
What changed to makes the intervals increase by 16
fold?
Video of Attiny Tester attached herewith.
Thanks again.
Allen Pitts

The Arduino forum does not allow for the video to be uploaded so the video
was published to YouTube at

Be advised, the first LED is so bright that is all the camera sees.
After a few seconds the circuit operation is more visible.

The reason for the timing problem is that you have changed the selection in Arduino IDE's Tools > Clock Source menu to a different clock speed than what is actually being used by the ATtiny85.

This menu controls two different things:

  • The configuration fuse settings that will be made on the ATtiny85 microcontroller when you perform a "Burn Bootloader" operation.
  • The value of the F_CPU macro which the sketch program uses for its timing calculations.

So if you had one option selected from the menu at the time you performed a "Burn Bootloader" operation, then later selected a different item from the menu, this causes the timing of your program to be off. This is why you must perform a a "Burn Bootloader" operation any time you change the selection in the Tools > Clock Source menu.

Try this:

  1. Make an appropriate selection from Arduino IDE's Tools > Clock Source menu.
    :warning: Note that if you select an "(external)" option from the menu, it will "soft brick" your ATtiny85 if you don't actually have an external clock source connected.
  2. Select Tools > Burn Bootloader from the Arduino IDE menus.
  3. Wait for the "Burn Bootloader" operation to finish successfully.
  4. Upload your sketch to the ATtiny85 again.

This time the timing should be correct.


The name of the "Burn Bootloader" menu item can be a bit confusing in a case like this where you aren't using a bootloader on the target chip. Despite the name, the "Burn Bootloader" feature actually typically performs two distinct operations:

  1. Set the configuration fuses on the target according to the configuration in the selected board definition.
  2. Flash the bootloader binary to the target.

In the case where you aren't using a bootloader, the second of these is pointless (and in fact ATTinyCore is configured so that this doesn't truly flash a bootloader binary), but the "Burn Bootloader" feature is still very useful as a convenient way to set the fuses alone.

1 Like

Hello ptillisch and the Arduino forum,

  1. Selected Board > AttinyCore > ATiny85 (Optboot) option
  2. Selected Tools > Burn Bootloader from the Arduino IDE menus.
  3. Arduino IDE returns: Failed chip erase: uploading error: exit status 0xc0000005

Allen Pitts

Hello ptillisch and the Arduino forum,

Changed Tools > Programmer to
Programmer: "USBtinyISP (AttinyCore) FAST for running >= 2 MHZ before
running Burn Bootloader.
Result:

  1. Failed chip erase... does not appear.
  2. Upload of ATtiny Tester sketch successful.
  3. ATiny tester operation normal. That is, the five LEDs operated
    by ATtiny Tester sketch come on for one half second and the off
    delay is one tenth of a second.

THANKS.

Question:
...if you select an "(external)" option from the menu, it will "soft brick" your ATtiny85...

What is soft brick?

Allen

If you configure the fuses on a microcontroller to use an external clock source, but don't provide an external clock source, then the processor simply doesn't run. When the microcontroller is in that state, you can't upload programs (and it wouldn't run them anway), and you won't be able to change the fuses back to using the internal oscillator as the clock. So you could say that the microcontroller is equivalent to a brick in that state.

However, you can recover the microcontroller to functionality by connecting an external clock source to it. Because it is recoverable, rather than being permanently destroyed, the bricking is "soft".

Hello ptillisch and the Arduino forum,

If Board > AttinyCore > ATiny85 (no bootloader) option is chosen the Burn Bootloader option does not appear at the Tools menu.
If Board > AttinyCore > ATiny85 (Optboot) option is chosen the Burn Bootloader option does appear at the Tools menu.

Allen