1

I have a digispark ATtiny85 development board and I am using the Arduino IDE to program it along with the Arduino UNO as my hardware programmer.

I have successfully burned the fuses for both the internal 1 and 8 MHz RC oscillators using the original Arduino as ISP sketch (you'll understand why I said original in a moment), but as my application needs precise timing, I would like to use an external oscillator, however, every time I tried to burn/program the bootloader/fuses using the Arduino IDE and using the original Arduino as ISP, the avrdude spits the infamous (Yikes). I searched online and found an updated version of the Arduino as ISP sketch, which is supposed to an updated version, it has only one downside, which is, it can't do anything other than burn/program the bootloader/fuses, meaning that it can't be used to program the ATtiny85 like the original Arduino as ISP could do.

So without hesitating, I tested it to burn/program the bootloader/fuses for the internal 1 and 8 MHz RC oscillators, and it worked perfectly, and as expected, it fails to upload the code. But the original Arduino as ISP successfully uploaded the code. When I tried to burn/program the bootloader/fuses for the external 8MHz crystal oscillator using the updated Arduino as ISP, it worked flawlessly... until I noticed that the ordinary Arduino as ISP can not upload the code anymore and I am presented with the infamous (Yikes!) error.

Let me elaborate the difference in the connections between the two sketches. The updated Arduino as ISP generates a clock signal on pin #9, which connects to the CLKI of the ATtiny85 (AKA Pin #2 "PB3"), while the original Arduino as ISP does not utilize this pin at all.

I found the updated Arduino as ISP on the electronics stack exchange forum, but unfortunately I lost the link to the question which contained why is this updated Arduino as ISP is better. I can provide both codes though if someone needs them.

I have my crystal connected in both cases, burning/programming the bootloader/fuses and while trying to upload my code.

This is the infamous (Yikes!) error which I was talking about. enter image description here

This is my current wiring. enter image description here Please note that I connect pin #9 to the CLKI of the ATtiny85 (AKA Pin #2 "PB3"), only when I am using the updated Arduino as ISP.

This is the actual wiring. enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

My two questions are:

  1. How could I burn/program the bootloader/fuses of the ATtiny85 to use an external oscillator of 8MHz or 16 MHz?
  2. How could I upload my application code after burning/programming the bootloader/fuses?

I hope the answers elaborate how the connections would differ, if it would.

Thank a lot in advance.

9
  • 1
    It may just be because I'm tired, but: You programmed the fuses for use with a crystal. Did you not attach a crystal?
    – timemage
    Apr 5, 2021 at 1:22
  • @timemage, good comment, I forgot to mention that I have my crystal connected in both cases, burning/programming the bootloader/fuses and while trying to upload my code. Apr 5, 2021 at 1:27
  • 1
    Can you show how this is wired?
    – timemage
    Apr 5, 2021 at 1:30
  • @timemage, yes, allow me 5 minutes to upload a proper image please. Apr 5, 2021 at 1:32
  • 1
    Let us continue this discussion in chat.
    – timemage
    Apr 5, 2021 at 1:46

1 Answer 1

3

If you look at the Digispark Schematic you'll see resistors and Zener diodes attached to XTAL1 and XTAL2: Digispark Schematic with circuitry connected to XTAL1 and XTAL2 pins highlighted.

These are for the USB D+ and D- signals that the Digispark bit-bangs. I deeply suspect that the crystal is just not going to resonate with these parts connected.

To get back to a working Digispark you'll probably have to inject signal onto XTAL1 again and reprogram the fuses to internal OSC.

7
  • Thank you, I am glad you asked for actual wiring. Can I "in theory" remove the resistors R1 and R2 so I can test this out? The end-user project will not be using a digispark, but a bare-metal ATtiny85 on a PCB. Apr 5, 2021 at 2:20
  • Yes, that should allow you to use an external crystal. Although it will no longer bit-bang USB, but I suspect you understand that.
    – timemage
    Apr 5, 2021 at 2:34
  • Yes, I do understand, thank you very much for your time. I will try what I have said and get back to you if you please. Thank you. Apr 5, 2021 at 2:36
  • It may be a number of hours before I see any update or respond to it.
    – timemage
    Apr 5, 2021 at 2:38
  • 2
    It worked, thanks a lot. Words can't express it really. Apr 5, 2021 at 3:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.