Program an ATtiny45/85 with an Arduino Uno without Any Errors | Complete In-Depth Tutorial (2024)

Поділитися
Вставка
  • Опубліковано 22 лип 2024
  • Welcome to Keon's Lab!
    In this video I'll show you how to program an ATtiny 45 or ATtiny 85 using an Arduino Uno as programmer! I'll point out the most common reasons errors occur and how to avoid them to get a successful program upload every time!
    When I first learned about the ATtiny, it took me forever to figure out how to upload a sketch onto it because all the tutorials and guides always left out a couple key pieces of information regarding pin numbers and uploading that are critical to successfully uploading a program using Arduino as ISP.
    My goal in making this tutorial is to provide an in-depth guide to programming an ATtiny that I wish I had back when I learned about the ATtiny over 10 years ago. I hope this video is useful to anyone having trouble getting their ATtiny to work.
    Additional Boards URL: raw.githubusercontent.com/dam...
    Remember to please Like and/or Subscribe for more videos! :)
    Chapters:
    00:00 Intro
    01:03 About the ATtiny
    02:12 Required Materials
    02:42 Setting the Arduino as ISP
    04:38 Wiring up the ATtiny
    08:15 Configuring the Arduino IDE
    10:21 Configuring Upload Settings for the ATtiny
    11:22 Burning the Bootloader to the ATtiny
    12:14 Uploading a Sketch to the ATtiny
    14:33 Blink Sketch Running on the ATtiny
    16:12 Adding a Second LED
    19:08 Powering with a Lithium-ion Battery
    20:00 Lithium Super Capacitor Powering the ATtiny
    20:38 Outro
  • Наука та технологія

КОМЕНТАРІ • 40

  • @KeonsLab
    @KeonsLab  16 днів тому +2

    Should I make a tutorial on programming the Atmega328p or the ATtiny13a?

  • @dpbarry
    @dpbarry Місяць тому +1

    Of all the videos I have looked at, this is the 'Holy Grail'. Top marks. I had built a shield for my Uno based on the instructions from another video. Got the PCB made and inserted the relevant components, Attempted to program an ATTiny85 - Nothing!! Tried all combinations of settings. Nothing. Programmer required!! Looked at other videos. Still no joy!
    Came across your video an noticed the words 'Complete in-depth tutorial' and thought, Okay. try this one to see what happens. Wired up the breadboard as per your instructions and set the test program up. THEN CAME THE CRITICAL BIT at 12:20 in the video!!
    None of the other tutorials mentioned using the 'Upload using Programmer' command in the sketch menu. WHAT!!! OKAY!!. Hmm!! Do as the man says!! It uploaded to the breadboard setup and I had no errors. OKAY!! Try the Blink sketch. Uploaded it and Hey Presto! the LED started blinking!! One happy guy so, curiosity then kicked in.
    I installed the PCB header I got made. and uploaded the same sketch. Boom!! LED started blinking on the PCB.
    BRILLIANT!! And all because of one small command - A KEY STEP!! - that every other video seems to have missed out.
    Thank You!!

    • @KeonsLab
      @KeonsLab  Місяць тому +2

      Awesome! I'm so glad the video helped you with your project! 😊
      Reading comments like this makes me so happy! I'll be making more videos like this for programming all the components that I can't find proper tutorials for. :)
      Future Edit: I liked your comment so much that I’m actually going to save it to my phone notes and read it every time I don’t feel motivated to record/edit a video. Thank you ❤️

  • @pierodis
    @pierodis 2 місяці тому +2

    Hi, I was getting so frustrated, then I found your tutorial. It worked right away. THANK YOU so much!

    • @KeonsLab
      @KeonsLab  2 місяці тому +2

      Oh you’re very welcome!
      It’s only happened a couple times so far but it makes me so happy when someone says that they got something to work after seeing one of my videos! 💚

    • @janakasilva9207
      @janakasilva9207 24 дні тому +1

      I had similar frustration i will try it. Only diffrence for me is i did not use capacitor .

    • @janakasilva9207
      @janakasilva9207 24 дні тому +1

      I had frustration also since I got invalid signature error when uploading i will try this. Only diffrence for me is i did not use capacitor .

    • @KeonsLab
      @KeonsLab  20 днів тому

      So the capacitor made it work properly right? Or was it the other way around and removing the capacitor made it work?

    • @janakasilva9207
      @janakasilva9207 20 днів тому

      @@KeonsLab no dear no it did not. I feel it csnnot be connections

  • @murilomilani
    @murilomilani 4 місяці тому +3

    Perfect video lesson.
    I have damaged an Attiny85 tried in other ways. Your explanation is accurate and it works, it works very well.
    Thank you very much.

    • @KeonsLab
      @KeonsLab  4 місяці тому +1

      You’re very welcome!! 😁

  • @valixg7557
    @valixg7557 4 місяці тому +1

    Nice👍, very interesting.
    Now learned something new, thanks to you.
    Keep doing such interesting videos.

    • @KeonsLab
      @KeonsLab  4 місяці тому

      Aw that’s awesome! When I read comments like this it makes me so happy 😊 I’m so glad you found it interesting and I’ll definitely keep making cool videos!

  • @LarryFourfingers
    @LarryFourfingers 4 місяці тому +1

    Thanks buddy, good video 🎉🎉

    • @KeonsLab
      @KeonsLab  4 місяці тому

      You’re so welcome :)

  • @SamiJumppanen
    @SamiJumppanen 3 місяці тому +1

    Excellent, thank you!
    Btw 8192 bytes is exactly 8 kB.

  • @sooraj369_9
    @sooraj369_9 2 місяці тому +1

    Why do we need to insert a 10 uf cap ??

    • @KeonsLab
      @KeonsLab  2 місяці тому +2

      (If I remember correctly) It’s to stop the Arduino from self-resetting when uploading (I hope I’m getting that right but it’s just for stability when the ArduinoISP is uploading to the ATMEGA)

  • @JH-uu7jl
    @JH-uu7jl 3 місяці тому +1

    Always wanted to use these little guys but the documentation isnt as easy to understand for me. Maybe now I can give it a go. Thanks for the video.

    • @KeonsLab
      @KeonsLab  2 місяці тому +1

      Definitely! It’s really straightforward too, just make sure you get the ATtiny45 or 85, not the ATtiny13 because that programming that one needs some extra steps.

  • @redpill7238
    @redpill7238 Місяць тому +2

    Such a clean and well explained tutorial! I suppose this will work the same for other Attiny85 variants such as the ATTINY85-20SU model? I also noticed this smaller version is used in Digispark Attiny85 boards. I have a few 20SU that i need to program and then i will have to solder them to the ready PCB i ordered. Since this model is smaller, i will have to connect it to the breadboard using a OTS-20-1.27-01 SOP8 adapter socket.

    • @KeonsLab
      @KeonsLab  Місяць тому +2

      I’ve never tried the ATTINY85-20SU but I’d imagine it should also work if it’s got the same overall specs as the ATTINY85-20PU.
      I glanced over the specs and it seems like the 20SU is just the surface mount version, and since you said it’s also used on those digispark boards, I think it’s got a pretty good chance of working the same.

    • @redpill7238
      @redpill7238 Місяць тому +1

      @@KeonsLab thanks! I will update if i successfuly program the 20SU using your clean method! 👍

    • @KeonsLab
      @KeonsLab  Місяць тому +2

      Sounds good, I wish you luck!

    • @redpill7238
      @redpill7238 26 днів тому +1

      @@KeonsLab update. Worked perfectly using your method! Used the adapter i was talking about and everything went smooth. Code upload success! Thanks to your well informed and clean tutorial! Thanks mate! Cheers!

    • @KeonsLab
      @KeonsLab  25 днів тому

      Awesome!!😄

  • @janakasilva9207
    @janakasilva9207 23 дні тому +1

    Hi im getting theerror invalid signature failed to erase chip. Wiring correct.please help.

    • @KeonsLab
      @KeonsLab  23 дні тому +1

      I’ll try my best here with a comment but if you still end up needing help, feel free to send an email to the channel’s email address accessible on the ‘About’ tab of the channel page.
      Ok so let’s try and solve the issue, that error is one I usually get when something’s wrong with the physical integrity of my connections, so everything may be wired up correctly but it may be something like the breadboard or wires themselves that’s causing the issue.
      Since I can’t really tell you how to fix it without any context, I’ll leave a few questions below to get a better idea of what may be causing your error:
      - Have you burned the Bootloader successfully?
      - Is the programmer set to “Arduino as ISP”?
      - Are the jumper wires you’re using new or have they been used a lot or with currents over 1 Amp?
      - When you insert a resistor lead into the breadboard, does it seem to make a snug fit or does it just barely grab on?
      - Not a question but try rewiring everything with different or unused jumper wires on either the other side of the breadboard or on a different breadboard if possible.
      - What is the CPU frequency for the attiny set to? If not already, try 1 MHz instead of 8 MHz.

    • @janakasilva9207
      @janakasilva9207 23 дні тому

      @@KeonsLab ok

    • @janakasilva9207
      @janakasilva9207 23 дні тому +1

      Cannot find an email in About section please

    • @janakasilva9207
      @janakasilva9207 23 дні тому

      I have the error invalid signature and failed to erase the chip. Somehow first time worked then I wanted to amen program . Then continuely error there. Similar errorcthere for ATTiny13 also. I refrred help lines in Arduino community website. But was not successful .

    • @janakasilva9207
      @janakasilva9207 23 дні тому

      Downloaded library using your link.