Programming ATtiny85/84 with Arduino Uno (ATTinyCore)

Поделиться
HTML-код
  • Опубликовано: 19 авг 2024

Комментарии • 110

  • @kenc2239
    @kenc2239 3 года назад +2

    Brilliant. The key point with Matt's video is that it is up to date: so many videos are not. MATT, please keep this posting checked over. Two points: the Arduino RESET 10microfarad capacitor is probably an electrolytic with polarised ( + and - ) terminals. It is important that the capacitor's negative ( - ) terminal is connected to 0V or GND. : I connected the test LED to a pin not used to programme the chip (ie. not pin0 - PB0), in my case pin3 - PB3 (physical chip pin 2) on an ATTiny85. Thus the LED can be left connected while code is flashed into the chip. Don't forget to change all coding from pin0 to pin3. Hope this helps someone?

    • @MattInglot
      @MattInglot  3 года назад

      Thanks Kenneth. Yes the polarity of electrolytic capacitors is important.

    • @embedded-academy
      @embedded-academy 3 года назад

      hi there,
      thanks for the excellent tips. I have also something to share. Wokwi Arduino simulator has also the capability to simulate ATtiny85 😀 I use this to write Arduino sketch and also verify it without real hardware.
      The simulator is free of cost and doesn't require any installations. It can run also on my mobile browser 🙂🙂
      ATtiny85 examples are here:
      ATtiny85 and FastLED
      wokwi.com/arduino/projects/283910810787381773
      ATtiny85 and simple LED
      wokwi.com/arduino/projects/283022189068812813
      Please visit wokwi.com for more such Arduino simulations. Kindly give a like, if this information was interesting.

  • @billy-joemurphy5388
    @billy-joemurphy5388 4 года назад +2

    AWESOME TUTORIAL. I spent the day trying to upload on to my 85 and your video took me to success. thanks a lot!

    • @MattInglot
      @MattInglot  4 года назад

      Nice work! Very happy to hear :)

  • @muhammadabubakr4250
    @muhammadabubakr4250 4 года назад +1

    after doing a lot of tries for months finally found this video and at last i was able to use attiny85 now. thank you so much

    • @MattInglot
      @MattInglot  3 года назад

      Awesome to hear! What did you end up building with it?

  • @thanedarley3750
    @thanedarley3750 2 года назад +1

    Thanks for pointing out the ICSP/SPI header, it's the only thing that worked for me.

    • @MattInglot
      @MattInglot  2 года назад

      Glad to hear! Good luck on your project.

  • @gurnamsingh1108
    @gurnamsingh1108 2 года назад +1

    Very well explained! I watched other videos but couldn't get it to work. I followed your guide and it worked first time. Thank you.

    • @MattInglot
      @MattInglot  2 года назад

      Glad to hear! Have fun with your project!

  • @BuildandTinker
    @BuildandTinker Год назад +2

    Great tutorial, well presented and very clear. This is all quite new to me but you helped me understand this so much better.

  • @AhmadNader
    @AhmadNader 3 года назад +2

    AMAZING! This is the only tutorial that worked for me, many thanks. Flawless, informative, and to the point.

    • @MattInglot
      @MattInglot  3 года назад +1

      Thanks! Glad it helped!

  • @BuildWealthCanadaPodcast
    @BuildWealthCanadaPodcast 4 года назад +4

    Great tutorial! Well explained. Looking forward to seeing more.

    • @MattInglot
      @MattInglot  4 года назад

      Thanks so much! Filming more as we speak!

  • @hcdebey
    @hcdebey 3 года назад +1

    Well done tutorial. I tried two other RUclips tutorials and they only frustrated me. Your tutorial worked the first time I tried. it. Keep it up.

    • @MattInglot
      @MattInglot  3 года назад

      Woohoo! That's great to hear, thank you Henry. What are you building with the ATtiny?

  • @jeanhuguenin
    @jeanhuguenin 2 года назад +1

    Thanks Matt. I have tried with a ATtiny 25 and it works perfectly.

  • @DreamsOfTheMind-video
    @DreamsOfTheMind-video 3 месяца назад +1

    Thank you ferry much for explaining!

  • @gmigliarini
    @gmigliarini 2 года назад +1

    Thank you very much Matt you are the first person who really helped me. CONGRATULATIONS

  • @ClaudeDufourmont
    @ClaudeDufourmont 2 года назад +2

    *Good work, I like the ATtiny85 and ATtiny84 too*

    • @MattInglot
      @MattInglot  2 года назад

      They are very handy chips. And best of all, it still seems possible to buy them despite the MCU shortage. Whereas the newer ATTiny chips anytime I looked they have been out of stock.

  • @xzadeh
    @xzadeh Год назад +1

    It is 3 July 2023 and still works! Thanks, good job.

    • @MattInglot
      @MattInglot  Год назад

      Super glad to hear thank you! Did you run into any setup issues or differences that I should note in the description?

    • @xzadeh
      @xzadeh Год назад +1

      @@MattInglot Your explanation was good, and my 1st attempt was successful, however things vent south after that! I could not reload the same chip with updated code! Have not tried a new chip yet. Have you encountered a similar problem?

    • @MattInglot
      @MattInglot  Год назад +1

      @@xzadeh Sorry to hear. Honestly it could be so many things. I would suggest triple checking your connections and orientation of your chip because a wire coming loose on a breadboard or you putting the chip in one hole off or the wrong way is all stuff that's super common and has happened to me.
      Less common but possible is you bricked the chip. Usually happens if you mess around with the fuse settings, such as telling it to use external clock or setting the clockspeed too low.

    • @xzadeh
      @xzadeh Год назад

      @@MattInglot Hi Matt, now that I have had some time to check my setup, I don’t see any issues with wiring! Just a little background, I have been using Atmel Dragon to program ATTinys for years until my Dragon died and Atmel (Microchip now) no longer supports Dragon, they call it obsolete! Trying alternatives led me to Arduino. I don’t think it is a reliable alternative! Still looking for a programmer that I can reliably use without spending $100s dollars for a hobby programmer. Any suggestions? Thanks in advance.

    • @MattInglot
      @MattInglot  Год назад

      @@xzadeh sorry but unfortunately "Arduino" is the answer. For what it's worth, I program ATTiny chips all the time and anytime I've had an issue, it's always been my fault in the end (wiring, pins, bricking the chip, etc).

  • @JayHanley
    @JayHanley 4 года назад +7

    "Huh, no smoke, that's a good sign" :D

    • @MattInglot
      @MattInglot  4 года назад

      :D that was seriously a relief!

    • @hazexuan8840
      @hazexuan8840 3 года назад +2

      @@MattInglot YES, it is. HAHA. By the way nice vid. 👍

  • @alwoolhouse6255
    @alwoolhouse6255 4 года назад

    Thank you Matt - that was super on point and the right kind of pace to follow along (I've never used an ATTiny85 before but it's definitely on my agenda). You took the mystique out but left the magic smoke in - proper job. :-)

    • @MattInglot
      @MattInglot  4 года назад

      Thanks so much :) And trust me, I was very surprised that the magic smoke didn't come out ;)

  • @aangelbaunino
    @aangelbaunino 2 года назад +2

    thank you so much for this tutorial! was very hepful, best regards

  • @reshairo
    @reshairo 3 года назад +1

    Good, clear tutorial, very easy to understand. Thanx

  • @johndowney9319
    @johndowney9319 Год назад +1

    It worked! Great video.

  • @express375
    @express375 3 года назад +1

    You're a great teacher Matt :)

    • @MattInglot
      @MattInglot  3 года назад

      Thanks so much. Glad you enjoyed the video!

  • @englishrupe01
    @englishrupe01 3 года назад +1

    Great demonstration and explanation.....thanks!

  • @peterhuesmann3956
    @peterhuesmann3956 2 года назад +2

    Great description.

  • @chrisleech1565
    @chrisleech1565 4 года назад

    Thanks for taking up the Arduino tutorials !
    Just subbed you in hopes that you might bring some applications for the AT84 or any of the line up, that might push the boundary beyond "Hello World" and Blink.

    • @MattInglot
      @MattInglot  4 года назад

      Thanks Chris! I'm using the ATtiny for the disco dog collar light that I'm currently working on, so you'll be seeing a vid on that in the near future (PCBs are getting made soon). That's definitely a project that bridges the gap between blinking light and functional product (which ironically is a blinking light.... but one takes 5 minutes the other has been months of design).
      Open to any ideas you may have!
      Btw you might already know this, but one thing I didn't explicitly state in the video is that the ATtiny series is part of the AVR family of chips, just like the ATmega chip you see on most Arduino boards. So an ATtiny is usable in a lot of Arduino projects you see online, but it really shines when you are trying to save space and power.

  • @vietvietnguyen8715
    @vietvietnguyen8715 2 года назад +1

    thank you so much !!

    • @MattInglot
      @MattInglot  2 года назад

      So glad to hear, congrats on getting it working :)

  • @LN_599
    @LN_599 4 года назад +1

    Hi I followed everything in the tutorial and uploaded blink to the chip successfully but the LED will not blink.

  • @zetaconvex1987
    @zetaconvex1987 2 года назад +1

    I'm thinking of buying a few tiny84's. I have some 85's, but the pin count is very restrictive.

  • @pakistanzindahbad
    @pakistanzindahbad Год назад +1

    good can we use usb to serial adopter for uploading code after burning bootloader on attiny 84 by the way i want to use attiny2313 programming for T12 soldring iron

  • @MohamedEldakamawy
    @MohamedEldakamawy 4 месяца назад

    A programmer is required to upload this message appears after burning blink code to attiny85

  • @ch3tankate469
    @ch3tankate469 3 года назад

    No 🚬 smoke is always a good sign

  • @jwtfpv8957
    @jwtfpv8957 4 года назад +2

    Really clear. :)

  • @tybot6224
    @tybot6224 4 года назад +1

    I'm getting a attiny85 for a small project I want to do. You mentioned that I needed a 0.1uF Ceramic capacitor. You made it sound like I really needed a ceramic capacitor but I just have normal ones. Can I just get away with the normal ones?

    • @fernandoperez-garcia7832
      @fernandoperez-garcia7832 3 года назад

      Apparently, it's important for high frequencies: electronics.stackexchange.com/questions/232631/ceramic-caps-vs-electrolytic-what-are-the-tangible-differences-in-use

  • @felixx824
    @felixx824 6 месяцев назад

    Good video! I finally got my led blinking using ATTiny85, but I have a weird problem that I sometime have to upload the code several times because of this error: "avrdude stk500_getparm() error: protocol expects OK byte 0x10 but got 0x14" I have to hit upload several times to get it working and I still can't figure out what's the problem. The same error also occurs when I tried to burn the bootloader.

    • @MattInglot
      @MattInglot  6 месяцев назад +1

      Unfortunately I'm not sure, you could try Googling or asking GPT. The first thing you want to consider with intermittent AVR errors is a loose connection or something not wired correctly.

  • @coreybuchanan776
    @coreybuchanan776 3 года назад

    Has anyone successfully done this with an Arduino Uno Wifi Rev2? I'm having trouble with the error: avrdude: stk500_getsync() attempt x of 10: not in sync: resp = 0x03 while trying to burn the bootloader.

    • @MattInglot
      @MattInglot  3 года назад

      Unfortunately I've never worked with that Arduino but before assuming it's the board triple double quadruple check all your connections against the wiring diagrams and make sure you are using the correct pin diagram for your ATTiny. Then double check everything else is wired up too, and that the software settings are all correct. Also read the comments of the Arduino ISP program carefully in case it mentions your board and requires any changes. What my video didn't show was the 2 hours of troubleshooting owing to various connection mistakes.

  • @venkatasaiprasadbhumireddy2314
    @venkatasaiprasadbhumireddy2314 2 года назад +1

    Which language is used for Attiny 85

    • @MattInglot
      @MattInglot  2 года назад +1

      If you're using the Arduino platform to program it then you would be using Arduino's version of C++. But because of the way you phrased the question, I want to clarify that the chip itself doesn't read or understand C++. The compiler turns your code into a set of instructions that the chip can understand (machine language).

  • @johnritz5991
    @johnritz5991 4 года назад +1

    I double checked my connections and set it up like shown in Arduino IDE but I was using Arduino 1.8.11 with ATTiny Core.
    It did not burn boot loader. I got error "avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x06...", which I have seen before so it cannot connect to ATTiny84 or something.
    This was a fresh ATTiny84 chip from Mouser and I know I got ATMega328 from Mouser that come blank so you have to upload boot loader. But I am not sure why it is giving the error.

    • @MattInglot
      @MattInglot  4 года назад

      Hey John,
      This should be very solvable so don't panic just yet. I didn't see that error message, but my programmer's instinct says it might be either a problem with how you setup your Arduino, or the fact that you are using 1.8.11 which is super new. I suggest going through the steps of setting up your Arduino again (when you upload the programmer sketch make sure your attiny isn't connected and reset doesn't still have capacitor!!!), setting the ATtiny options, and make sure you have reset disabled with the capacitor trick shown in the video (this is not an optional step). There are lots of little steps with the IDE configuration and selecting the correct options that it's very possible you just missed something. We all do it no matter how closely we feel we followed the instructions. If that fails to work, try using 1.8.9 since that is confirmed to work and ATTinyCore page listed troubles with 1.8.10.
      If all that fails, please share what Arduino you are using and screenshot ALL settings you have set in the IDE and share that info.
      I

    • @johnritz5991
      @johnritz5991 4 года назад +1

      I uploaded the wrong program to the Arduino, now it works. thanks.

    • @MattInglot
      @MattInglot  4 года назад

      @@johnritz5991 Awesome! Happy coding!

    • @johnritz5991
      @johnritz5991 4 года назад

      Hello, I was trying to use my USBTiny ISP (uses an ATTiny2313A) to program the ATTiny84 chip as I did with my Arduino Uno as a programmer.
      So I set the Arduino programmer to USBTiny ISP but it won't recognize the port when the USBTiny ISP is plugged in.
      The Win10 PC device manager clearly shows it and identifies it but it just won't show up on Arduino IDE.
      I think my USB Tiny ISP might not work properly; only the first light is on but the second light does not come on.
      Any ideas?

    • @MattInglot
      @MattInglot  4 года назад

      @@johnritz5991 I've never used that device so I honestly have no idea. You could do the usual USB troubleshooting like trying a different USB cable (this has worked for me a couple times when having trouble getting Arduino IDE to recognize what I've plugged in), different USB port, etc. Beyond that I don't know, I would contact Adafruit.

  • @spreeuferberlin
    @spreeuferberlin 4 года назад +1

    thx

  • @varboy3136
    @varboy3136 4 года назад +1

    bro can we do self watering plants by connecting LCD display and soil moisture sensor pls reply me

    • @MattInglot
      @MattInglot  3 года назад

      Lots of people on RUclips have done exactly this. Do a search and you should be able to find a project that does it (typically with the regular Arduino boards, no real reason to go to the trouble of using the ATTiny here).

  • @bubba1341
    @bubba1341 4 года назад

    So How would I upload custom code onto the ATTINY 85? (IE code that isn't heartbeat or blink) Do I need to change anything?

  • @Mato3
    @Mato3 3 года назад

    Hi, I probably successfully uploaded the Arduino ISP to the Arduino Pro Mini (the LED lights up like it's breathing).
    When I want to upload an example to Attina 85 Blink will print an Arduino IDE error:
    avrdude: Expected signature for ATtiny85 is 1E 93 0B
    Double check chip, or use -F to override this check.
    Attiny85 board set, 1 MHz internal clock, com3 and Arduino as ISP. I don't know what's wrong anymore ..
    AVRISP mkII encountered an error while loading the project

    • @MattInglot
      @MattInglot  3 года назад

      If avrdude is coming back with something like signature is 0 expected is ____ then it can't see the ATTiny. When this happens to me it's almost always a wiring error or connection. Could possibly be bad ATTiny, or mistake in how you setup your programmer.
      Sooo. I would suggest starting by triple checking your wiring and if you are still banging your head against the wall then unfortunately next step is go through the video and making sure you got all other steps right. But 80% it's wiring.
      Good luck!

  • @charlesklein7232
    @charlesklein7232 3 года назад

    at approximately time 930 you said dont use these 6 pins/ports that are above the "aref" WHAT ARE THEY? i have searched and found nothing to identify them! i never noticed them also what is "aref" and their are two pins next to the six pins that are unmarked?

  • @elmop3609
    @elmop3609 4 года назад +1

    What is the link to ATtiny pin-out where all of them shown one after another?

    • @MattInglot
      @MattInglot  4 года назад +1

      github.com/SpenceKonde/ATTinyCore scroll wayyyy down.

  • @sunilminz6998
    @sunilminz6998 2 года назад

    Nice

  • @luhanmonat6683
    @luhanmonat6683 3 года назад

    Like many of these videos, you loaded the bootloader and then overwrote it with blink. The point of the bootloader is to not need ISP programming but go directly to serial RX, TX, and Reset pins using a serial FTDI or something.

    • @MattInglot
      @MattInglot  3 года назад +1

      The issue is that you have to burn the bootloader in order to set the fuses.
      Per the documentation on github.com/SpenceKonde/ATTinyCore
      "When using a chip for the first time, or after changing the clock speed, EESAVE or BOD settings, you must do "burn bootloader" to set the fuses, even if you are not using the chip with a bootloader"

    • @luhanmonat6683
      @luhanmonat6683 3 года назад

      Thanks, that makes sense now. So nobody I've watched is actually wanting to use it stand alone? That is what I have done with all of my ATTiney/ATMega chips. Then I can use them in projects with just a serial connection to the Arduino development system.

  • @regal_7877
    @regal_7877 4 года назад

    Please help, does anyone know what are the list of classic Arduino functions that the ATTinyCore supports? I can't find this anywhere on the internet. I'm not a pro at programming so looking at the source files and libraries on GitHub confuses me even more.

    • @MattInglot
      @MattInglot  3 года назад

      It's a loaded question because it depends on how far down the rabbit hole you want to do. Since you are a beginner the easiest answer is that most of the Arduino functions and libraries should work just fine, and you are encouraged to try stuff out and experiment for yourself. For the stereotypical Arduino examples it should mostly work (assuming you hook things up to the correct pings and number them correctly).
      Of course that's not the whole answer. The ATmega328 (the processor that Arduino Uno uses) has more capabilities than the different ATtiny processors. So of course you're not going to be able to use functionality that the processor doesn't support.
      How does this affect you? It depends on the complexity of the code you are writing. For a beginner the biggest impact is that ATmega328 has a lot more I/O pins, more PWM capable pins, and so on. All of which you can grab easily from the datasheet for your chosen ATtiny.
      If you continue down the rabbit hole to lower level programming and start dealing with things like interrupts, those are all different not only with ATtiny vs ATmega328 but within the ATtiny family as well. At that point you *need* to download and read the datasheets to understand if a particular processor will work for your needs, and how to access those advanced capabilities.

  • @cornellsludggedrip
    @cornellsludggedrip 4 года назад

    Ok I am confused, can the ATtiny85 read in analog input in reference to serial communication SCL and SDA ? Pins 6 and 7 I saw were not used.

    • @embedded-academy
      @embedded-academy 3 года назад

      You can definitely use ATtiny85 to read an analog pin and also have serial communication via SCL and SDA.
      If you would like to program the ATtiny85 in Arduino style and also want to verify the code without the real sample, please go ahead and visit wokwi.com
      ATtiny85 code sample links are here:
      wokwi.com/arduino/projects/283910810787381773
      wokwi.com/arduino/projects/283022189068812813
      wokwi.com/arduino/projects/283019827166052872
      Please give a like if you find this information interesting 🙂
      for more Arduino simulations visit wokwi.com
      Wokwi Arduino simulation is free. It is based on AVR8js platform and is open source. Many people have developed interesting projects using the open-source Arduino compiler.
      You can easily save and share the projects you create.
      The Arduino projects can be run instantly on a web browser or a mobile browser🌐
      No need to install or download anything - No hassles
      It also has a huge number of peripherals to play with
      OLED, FastLED, NeoPixels, LCD1602, Servos, Potentiometers, Matrix Keypad and more. Please give a like if you find this interesting

  • @jecht3009046
    @jecht3009046 4 года назад

    Everything seemed to upload correctly. However, when I try to blink the LED, it seems to just stay on permanently. This happens regardless of which ATtiny pin it is plugged into. Why would this be?

    • @MattInglot
      @MattInglot  4 года назад +1

      It's very difficult to debug this kind of stuff online because I don't see your setup, I obviously can't touch it and fiddle with it, and so on. The best tip I can give you for any sort of troubleshooting is to isolate as much as possible. So in this case if the LED isn't blinking, pull out the ole multimeter, and prob the pin you THINK is the correct pin, and see if the voltage changes as if it were blinking (one lead should be on the pin, one on ground as in the negative part of your power supply). If it does, check your wiring. If it doesn't, then there is something wrong with your program. I would guess you have the incorrect pin # or some error in the code. Sorry I can't be more help, but if you reason it out you should be able to figure it out. This stuff takes a bit of troubleshooting and fiddling.

    • @jecht3009046
      @jecht3009046 4 года назад +1

      @@MattInglot thanks, I appreciate the advice! Otherwise, the video was great and definitely one of the best tutorials for this out there.

  • @abolfazlabbasi4854
    @abolfazlabbasi4854 3 года назад +1

    Thanks for the tutorial, Is this method going to work with ATtiny13 as well?

    • @MattInglot
      @MattInglot  3 года назад +1

      It looks like ATtiny13 also uses ISP for programming so the steps *should* be identical, however you must select the correct ATtiny and look at the pin out diagram for ATtiny13 to make sure you have all the pins connected correctly. Good luck!

    • @abolfazlabbasi4854
      @abolfazlabbasi4854 3 года назад +1

      Matt Inglot , thanks for the reply, it looks like there is no ATtiny13 in the boards’ list. Do I need to choose some other chips? Or not gonna work?

    • @MattInglot
      @MattInglot  3 года назад +1

      @@abolfazlabbasi4854 Hmmmmmm! You are right. You could try the core listed here: www.electronics-lab.com/project/how-to-program-attiny13attiny13a-using-arduino-ide/ Good luck!

  • @trashos817
    @trashos817 4 года назад

    hello yesterday i bought an at tiny 85 and before 5 minutes it worked fine but the last time i plugged it in i put reverse voltage by mistake and now it doesnt run did i burn it?

    • @MattInglot
      @MattInglot  4 года назад

      Unfortunately it sounds like it. With how little the chips cost it's a good idea to have a few on hand in case you make mistakes like that. It's almost inevitable that as you play with this stuff you'll burn *something* out by accident.

    • @trashos817
      @trashos817 4 года назад

      @@MattInglot oh thank you for answering so quick and secondly I also had plugged in an 8*8 matrix and this also doesnt light up does it mean I burned this too

    • @MattInglot
      @MattInglot  4 года назад +1

      ​@@trashos817 It's really not something I could tell you over the internet. It's certainly possible that it broke, but it's just as possible that you now have it hooked up wrong, programmed wrong, etc.
      The only way you can really work that out is to start troubleshooting. If you have spares of the components the obivous thing to do is double check all your writing, then pop in a good component. If you don't, then you need to start pulling out the multimeter and seeing if your getting power where you expect it (including output on any output pins). It can also be helpful to break up your circuit into the simplest possible components needed to test it before testing everything together.
      Good luck!

  • @bimbo-yw6ny
    @bimbo-yw6ny Месяц назад

    arduino 2.x the board manager doesn't showup more the attiny??