How to use the Atmel ATTINY10 Microcontroller

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

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

  • @Codeaholic1
    @Codeaholic1 6 лет назад +574

    YES. This. This us what I always wished the element14 episodes were. Happy to see you continue making content and actually show how things are done.

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

      Yea this gentleman is a great teacher thanks for true quality content.
      This is where you tube actually is great.
      Contributing to everyone as to further knowledge and understanding.
      You can always learn something.
      If you need to know whatever.
      Their is someone to help take you through it.
      Sweet right now if you tube would quit messing it up with every update we would be fine😣

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

      watching element14 videos always left me wanting exactly this kind of content! very detailed, interesting, and useful. glad others agree!

    • @JoseRamos-h8e
      @JoseRamos-h8e 5 месяцев назад

      3:30 yú

  • @elimiller5374
    @elimiller5374 6 лет назад +206

    These are some of the chips that I make at my job, it's nice to finally understand not just how to make them but how they actually work.

    • @VerticalWit
      @VerticalWit 5 лет назад +13

      Thank you for providing! These chips are awesome

    • @jlucasound
      @jlucasound 5 лет назад +3

      You are a hero! Thanks, Eli.

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

      These things are awesome definitely putting one in my hand

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

      Sick dude

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

      Thank you so much for your labour Eli! These things are really cool and could be / are incredibly productive for humanity with the right applications. They're 100-1000x cheaper than I assumed a rice-grain-sized computer would cost! I can think of so many ways these things could help people (especially so with tiny rechargeable batteries and solar cells). It's miraculous to me that you can fit a timing oscillator in such a small thing, let alone a CPU, RAM, and ADC!
      This alone has inspired me to learn far more about low-level / low-resources programming. The price and size is a huge, huge deal.

  • @CollinEddy
    @CollinEddy 5 лет назад +28

    This has to be the best AVR introduction I've ever come across, much less specifically for the ATTiny10!

  • @VideoNOLA
    @VideoNOLA 6 лет назад +5

    Fascinating. I'm still back at 1977 Heathkit level knowledge. I watch your videos in awe... the kind of awe you get watching someone solving problems you didn't even know were problems.

  • @dparson
    @dparson 6 лет назад +7

    Think this is one of my all time favorite videos. 12V programmer design and build, implementing serial communication with a timer, and using Atmel Studio. Thanks a ton Ben!

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

    I'd like to first thank Mr. Ben Heck for putting together this rather excellent and thorough explanation of several neat topics and second, the "RUclips algorithm" for putting it in front of me. Micro-controller programming was my favorite area of study at university.
    My passion for these kinds of projects has been re-ignited.

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

    I’m a comp sci student, with an interest in IOT and hardware, but since I took a more software oriented path, I don’t see a lot of hardware in class. It’s so entertaining to watch someone who knows what they’re doing just work for a bit, and I learned a bunch of stuff along the way.

  • @damianofoschia7756
    @damianofoschia7756 Месяц назад

    This is the best tutorial for programming a microcontroller on the internet. Have recently struggled a lot making an atTiny412 communicate on a serial channel and you showed exactly that, step by step, from character tho whole strings. Incomparably useful, thank you a lot🧡

  • @d3line
    @d3line 6 лет назад +16

    Last year I bailed on attiny because the tutorials were too intimidating. Thank you, you made it all clear!

  • @BrainSlugs83
    @BrainSlugs83 6 лет назад +88

    Ben, you rock so much. Showing the actual dates sheets and raw code from start to finish; building your own ICSP board, there's really something for everyone here. This is how I got my start with AVR chips back before arduino; and there is huge nostalgia factor here for me. One thing to keep in mind (may not be relevant to this chip), but in general when working with raw MCUs is a good idea to include a decoupling capacitor (pretty much any value ceramic cap) between VCC and GND because toggling the IO lines can cause a drop on VCC causing the MCU to misbehave (on some lines of MCUs, like the PIC16 it can cause them to just reboot mid program!) anyway, great fucking content, I love that you showed the whole development process. -- And hey, you should take a look at the V-USB library for the ATTiny / ATMega (you can create a bit bang HID device without even needing a crystal oscilator, just a few zeners! Though you'll need a bit more ram than 32 bytes!) -- Happy Holidays Ben, you fucking rock! Keep up the good work!

  • @BanCorporateOwnedHouses
    @BanCorporateOwnedHouses 6 лет назад +57

    I honestly did not know enough about electronics to know what in the flying fuck I was watching, but it was well delivered enough that I could follow along really closely. Don't change your content or delivery for dummies like me, I'll pick it up eventually.

    • @nagualdesign
      @nagualdesign 6 лет назад +3

      Hah! Well put, Brandon. Pretty much mirrored my own thoughts. I've done a fair bit of soldering and a fair bit of programming but I'd never think myself capable of this sort of thing _...until I watch a video like this._ Loved it.

    • @MaxJ.ProfessionalLilGuy
      @MaxJ.ProfessionalLilGuy 5 лет назад +3

      The way I understood none of it but loved all of it reminds me of old VSauce, back when it took like 3 rewatches to understand, but was super fun

  • @bloviatingbeluga8553
    @bloviatingbeluga8553 5 лет назад

    I like that you used a large led to show what you are doing. Even if there were small LEDs on the board it makes it easy to see what and where you are talking about.

  • @directive0
    @directive0 6 лет назад

    Man, what a drop in videography production and what a huge climb in actual tech knowledge and content. Worth it.

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

    This is a really great "howto". All details from "how to solder such a tiny chip" up to "how to program it in C" and "how to analyze via Oscilloscope". I am impressed and I learned a lot ;-) Thank you very much! Well done!

  • @FlorinBalanescu
    @FlorinBalanescu 6 лет назад

    What really strikes me with Ben Hack videos is that he explains either the very basic or the very high end concepts, but not what's in the middle. It's nice that he always takes one project to a finish.

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

    Mind-blowing what those can do. Never thought that I could reuse the reset pin. Big thanks for sharing all this knowledge. A masterpiece indeed for the one who knows what to do with it!

  • @SyedRizvii
    @SyedRizvii 6 лет назад

    Finally! this is what was missing from the main stream electronic channels. This is quite therapeutic tbh. Just like revising before an exam that you know you took a course on a decade ago.

  • @jacksat2252
    @jacksat2252 6 лет назад

    Ohh boy , This is pure quality , you can learn alot from this vid as a NOOB in programming and experimenting with MCU's.
    I know i did.
    Please mooooor of this long TUT's . AVR and PIC's.
    Thumbs up who want more of this.👍👍👍👍👍👍👍👍

  • @NNNILabs
    @NNNILabs 6 лет назад +5

    Long videos are usually boring, but for some reason I really like this one!

    • @eLJaybud
      @eLJaybud 6 лет назад

      Probably as it's very factual but still has a lot of pace.

  • @MakenModify
    @MakenModify 6 лет назад +76

    I'm glad i leaned programming microcontrollers like that in university and get why it can be important but man am I glad an arduino is all I need for most projects. So i don't have to spend so much time in the datasheet ;D great video, well explained ;)

    • @ray-charc3131
      @ray-charc3131 6 лет назад +1

      What the importance of it is it's tiny and does the right amount of works or functions as well as is cheaper than an normal arduino chip.

    • @MakenModify
      @MakenModify 6 лет назад +1

      @@ray-charc3131 sure I also allways have some attinys laying around for when i need a small form factor. But i referred more to the IDE than the boards itself. Sometimes it's important to have every bit of control over the chip but sometimes it is just more convenient to not have to deal with the registers.

    • @NolePTR
      @NolePTR 6 лет назад +1

      Never used an Arduino myself. It's just ridiculously overpriced for what it is, and massive and slow. If I need to actually do some more intensive calculations, I use an ESP8266. I use ATTINY85s for most my stuff with the TinyISP programmer. Will probably get an ATMEL ICE or similar for debugging, and stuff.

    • @MakenModify
      @MakenModify 6 лет назад +3

      @@NolePTR hm massively overpriced is true if you buy the original... Most of the time i use pro micros. From China a pro micro board is cheaper than buying the Atmega32u4 that is on it separately (even if you would buy >100) ....

    • @NolePTR
      @NolePTR 6 лет назад

      @@MakenModify Thanks for the recommendation. I'll look into it.

  • @ChillWizardGames
    @ChillWizardGames 6 лет назад +65

    happy to see you continue to upload Ben!

  • @D3ltaLabs
    @D3ltaLabs 6 лет назад +69

    Hey Ben, thanks for continuing your work on your personal channel. It feels like the old bhs I subbed to many years ago. I love it. My only suggestions would be to upgrade your Mic and make a second channel which is more like an uncut version or semi live. Thanks again Ben. Oh yeh bring Felix in aswel for a celeb appearances.

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

    Thankyou for the super-clear description of your code; especially explaining how the bitwise operations work. I've always been hazy on how C handles this, but I understand it now. Brilliant, again, thank you.

  • @SuperSmashDolls
    @SuperSmashDolls 5 лет назад +250

    "we only have 32 bytes of RAM"
    ...Congratulations, you've found something less capable than an Atari 2600 to make a portable out of

    • @samdeutsch4587
      @samdeutsch4587 5 лет назад +17

      The RCA CDP1802 squad would like to know your location

    • @Aeroshogun
      @Aeroshogun 5 лет назад +2

      **Facepalm**

    • @funposting8912
      @funposting8912 5 лет назад +6

      I thought my OSI 300 with 128 bytes of RAM was the smallest I’d see, and that was from 1975.

    • @4dirt2racer0
      @4dirt2racer0 5 лет назад +3

      @@funposting8912 o no theres a lot of small chips out there

    • @AnonMedic
      @AnonMedic 5 лет назад +10

      You're being too pessimistic. I can think of dozens of uses for this today. While you're only seeing it's limits.

  • @curtstacy779
    @curtstacy779 6 лет назад

    Ben your back! my wife is happy for us. after I shouted holy crap Ben is back! It hasn't been the same without you. I have missed you. Looks like some new and good content also. this is going to be amazing. Thank you for coming back. 46K subs I know you are going to do better than that wait till the word gets out. its been awesome to see you again.

  • @SJFrzrbrn
    @SJFrzrbrn 5 лет назад

    Keep this stuff going, this is the best content you've had in years. Not that the last few years were bad, but this is what I loved about watching your stuff

  • @willierants5880
    @willierants5880 6 лет назад

    I think I found a new level of respect for Ben. I'll be honest I haven't been a fan in the past, but this so far has been excellent. If there is more of stuff like this I didn't know about I'm going to have to issue an apology for my negative thoughts and opinions.

  • @jlucasound
    @jlucasound 5 лет назад

    Where were you 45 Years ago!! I think I am finally "getting" it. You explain it so clearly! Subbed. Thank You.

  • @waltercomunello121
    @waltercomunello121 5 лет назад +17

    I feel I'm attending a high level course on ATTiny programming, mixed up with a little bit of electronics and logics.

  • @dingdongbells3314
    @dingdongbells3314 6 лет назад +11

    As an English major studying language in college, I can safely conclude that approximately 1% of this video is real words. But I still highly enjoyed this video, and it was a great way to relax before bed. Thanks for giving me a good night of sleep, Ben Hack.

    • @AverageJoe8686
      @AverageJoe8686 6 лет назад +1

      "As an English major..approximately 1% of this video *_contains_* real words..."
      FTFY bruh

    • @muhammadosama3358
      @muhammadosama3358 6 лет назад

      r/iamverysmart

    • @eLJaybud
      @eLJaybud 6 лет назад

      As an English major... You gave us all the information we needed there... If only you had taken a real subject, instead of one where you cover a subject that you should already have learned anyway. 😂

  • @argcargv
    @argcargv 6 лет назад +42

    Shouldn't there be a current limiting resistor between the optocoupler and the pnp transistor? When saturated the pnp base will be about 11.3 v which will be across the optocoupler transistor. Seems a bit extreme.

    • @BenHeckHacks
      @BenHeckHacks  6 лет назад +35

      I drew the schematic after I built it. Yes there was a 1K between them. Good catch!

    • @electronash
      @electronash 6 лет назад +6

      @@BenHeckHacks
      Well worth adding a few decoupling caps to the adapter board, as I had many issues years ago when programming PIC and AVR chips without any caps.
      Unless you already put the caps on the underside of the board, of course. ;)

    • @jamesrbrindle
      @jamesrbrindle 6 лет назад +2

      This is where i am still a newbie in electronics design - knowing when current limiting resistors are needed with this scenario

    • @argcargv
      @argcargv 6 лет назад +2

      @@jamesrbrindle Any diode junction, once conducting, will see an exponential increase in current with an associated further increase in the voltage applied. To prevent runaway current a limiting resistor is usually applied. In this case the base-emitter junction is also a forward biased diode and like a LED or other diode can potentially draw an arbitrarily large current if some mechanism isn't provided to stop it. So mostly knowing where to put a limiting resistor is a case of identifying the diode junctions that have a low resistance current path between the power rails. To quickly see this takes experience, but understanding how to determine if they are needed is basically as I described.

    • @WoodmanFFM
      @WoodmanFFM 6 лет назад +3

      Just wanted to write this, but then I thought that someone MUST have caught this by now and found your comment after scrolling down for quite a bit... ;-)
      Alternatively, one could also use a P-Channel FET, with the added bonus of preventing the voltage drop across the PNP. Not that it would be strictly necessary, but 12V is 12V... :-D

  • @RichardULZ
    @RichardULZ 5 лет назад +10

    THERE'S A PROGRAMMER MODE ON WINDOWS CALCULATOR?!
    This is amazing!

    • @andrewpiroli482
      @andrewpiroli482 5 лет назад +2

      Richard Ziegler Windows calculator has supported base 2,8,10 and 16 for almost 30 years... since win 3.0

    • @KingJellyfishII
      @KingJellyfishII 5 лет назад +2

      Yeah and also gnome calculator, for those who use the best kind of os (jk but Linux is cool)

  • @edwarddickhoff4140
    @edwarddickhoff4140 6 лет назад

    As a Computer Engineering Major I found this to be a great how to! Definitely going to try and implement these on some smaller projects! Great job!

  • @nagualdesign
    @nagualdesign 6 лет назад +1

    Wow - 53 minutes flew by! It's incredible what sort of hardware and knowledge is available for hobbyists these days.

  • @AnonMedic
    @AnonMedic 5 лет назад

    Wonderful video. Love full tutorials like this. And you don't use a generic about section, bravo. Can't stand channels that just paste the same about in each video.

  • @Stabby666
    @Stabby666 6 лет назад

    I recently wrote a bit banged 9600bps UART on an ATTiny24 running at 1mhz. . Used assembler to save space and had to cycle count each instruction to ensure it emitted (and received) at the right speed. The code was tiny, and really useful for debugging 😁 Great to see Ben back!

  • @ZaneDaMagicPufferDragon
    @ZaneDaMagicPufferDragon 6 лет назад +7

    I love watching you in full on "Coding Mode" and I actually could not stop watching you work!!!
    And Yes Benjamin J. Heckendorn, it was extremely exciting and interesting and informative and I watched it from beginning to end without stopping!!!! ;) P.S. I used to watch TBHS Religiously and I miss Felix and Karen!!! :(

  • @captainsolder5247
    @captainsolder5247 6 лет назад +3

    This is how the Ben heck show should have been.
    This is incredibly informative on so many levels.
    I especially enjoyed the programmer build right at the start.
    Unfortunately the audio still has some issues.

  • @everythingquads
    @everythingquads 6 лет назад +1

    Best video on bit shifting, ever! Thanks, you have explained perfectly.

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

    Def saving this to watch later, seems like a great video to learn the basics of how a computer works

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

    You're a smart guy! This was fantastic. Wish. you would do videos like this in '22.

  • @parrottm76262
    @parrottm76262 6 лет назад

    Fantastic video. I sometimes wonder if I will learn anything by watching videos like this, and I always do! Thanks for this.

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

    that was the most EPIC video/tutorial that i've watched recently!
    -Greetins from Turkey.

  • @Rcdude10tc32
    @Rcdude10tc32 6 лет назад

    This brings me back to the revision3 days. I love episodes like this. I’ll watch every minute of these. Awesome work Ben!

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

    Great video. Used to do something similar 10+ years ago in college with pic microcontrollers.
    +1 for the art on the wall
    +1 for practical programing illustration
    +1 for references to the datasheet

  • @lincamarius7092
    @lincamarius7092 6 лет назад +13

    Hello, at 10 min it is clear that, the current limiting resistor is missing from the base of transistor Q1 2N2907 and the collector of optocoupler transistor . Both transistors will be destroyed. Success and a Happy New Year.

    • @rfdave3980
      @rfdave3980 6 лет назад +3

      Yes Ben the magic smoke will get out!.

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

      @@rfdave3980 Yes, I know well of the smoke. Never speak of it with a pc on. They only hide the smoke for so long.

  • @Henrix1998
    @Henrix1998 6 лет назад

    I have absolutely no experience with any of this stuff but this is very fascinating

  • @thomasandrews9355
    @thomasandrews9355 6 лет назад

    Please keep doing this. This helped me learn more about interrupts and even serial! Long live the BenHeck Show!

  • @IAMSolaara
    @IAMSolaara 6 лет назад

    These videos actually made me learn something. The element14 didn't quite get that going. Thanks Ben

  • @garyrowlands8537
    @garyrowlands8537 6 лет назад +1

    Absolutely brilliant video. I tried and completed every stage and will use the notes I made, again and again, I am sure.
    Thank You

  • @QuantumFluxable
    @QuantumFluxable 6 лет назад

    Hey Ben, just found this channel, it's way more up my alley than what you did on the Ben Heck Show, so thank you for making great content :)

  • @ropersonline
    @ropersonline 4 года назад +43

    43:44: Print "Hello"? Not Hello world? Unforgivable.

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

      @@computerman2830 not enough ram to print hello world?

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

      @@computerman2830 Per the datasheet, the ATTINY10 also has 1024 bytes of flash RAM in addition to its 32 bytes of SRAM. Presumably that could have been utilised to pull this off.

    • @Amit-sp4qm
      @Amit-sp4qm 4 года назад

      @@computerman2830 lol

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

      @@ropersonline it's a rom, not ram 😅

    • @ropersonline
      @ropersonline 4 года назад +3

      @@ottobass9193 Yes and no. It's not technically ROM, no, but: "Internal write operations to Flash program memory have been disabled and program memory therefore appears to firmware as read-only. Flash memory can still be written to externally but internal write operations to the program memory area will not be successful."
      Either way, it wouldn't stop you from using the flash RAM to store and source a hello world const. You don't actually need that string to be variable. You don't actually need to alter it at runtime.

  • @sonicase
    @sonicase 6 лет назад +80

    "let's get started"....pewpewpew, amazing hax....

    • @dmnsonic
      @dmnsonic 6 лет назад +1

      He forgot this is not BHS... Old manners... I laughed when I heard this!

  • @bizzy423
    @bizzy423 6 лет назад

    Great video! Atmel studio and its complex structures and define statements can be daunting but you kept it bit banging and understandable. Thank You and make more.

  • @Chris_Ray97
    @Chris_Ray97 6 лет назад +4

    I was about 3min in and thought “wait a second... I know that voice!” Glad to see you have your own channel!

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

      where else is he active or known? Im curious!

  • @timrichter1980
    @timrichter1980 6 лет назад +1

    Well done Ben, look at those comments, so much positive feedback! You are some kind of electronics hero, don't know what that means, but you are one ;)

  • @مقاطعمترجمة-ش8ث
    @مقاطعمترجمة-ش8ث 4 года назад

    I stop doing anything related to uC year ago , but the joy I have watching this video had nothing to compare , 43:26 Kudos to C and all it programmers .

  • @ropersonline
    @ropersonline 4 года назад +6

    39:09: NB: The "case 2 ... 9" syntax with ellipsis is a non-standard GCC extension. Careful now.

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

      As long as you use GCC, what's the issue.
      The alternatives are either
      A) case 2: case 3: case 4: ...
      B) case 0: break; default: ...

    • @ropersonline
      @ropersonline 4 года назад +3

      @@DanCojocaru2000 The issue is, if you put non-standard stuff in your instructional video, you should highlight it as such. Otherwise someone else is going to have a bad time, and a video that guarantees at least some learners a bad time is not good teaching material.

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

      @@ropersonline A fair point mostly. Mostly since someone intending to learn stuff like manipulating registries from C on a microcontroller should be able to quickly find out why this non-standard extension might not work for them on Google, or at least find out how to make it work using standard ways.
      By the way, are there compilers for AVR that don't have this extension? GCC and clang support it, but are there any others?

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

      @@DanCojocaru2000 I'm not sure, but even if there aren't, once you put a tutorial-style video out there in front of a significant audience, its content will spread beyond a narrowly defined use scenario, and it's always a good idea to point out that something doesn't generalise. Saying, well users doing X should be expected to figure out Y is pulling-up-the-ladder logic. It's better to keep things as accessible and universally applicable as possible.

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

      @@ropersonline Up to a certain point. You don't start programming tutorials with how to turn on a computer or how to use a keyboard.

  • @MadJDMTurboBoost
    @MadJDMTurboBoost 6 лет назад

    This was very interesting! I regularly program and work with the Atmel ATMega328P and the Microchip PIC24H, and this has really inspired a lot of interesting ideas.

  • @keithking1985
    @keithking1985 5 лет назад +1

    love those little pre-made boards!! look very handy..

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

    Outstanding tutorial - what a great endpoint to reach in a single video!

  • @John_Ridley
    @John_Ridley 6 лет назад

    Excellent, I bought some of these a couple of years ago and never got around to playing with them. This'll get me going.

  • @graffaelv
    @graffaelv 6 лет назад

    Ben, This was a great video. I found the real world practical approach including the searching through the datasheet really enlightening. Glad you are still producing content. Keep up the wonderful work. Have a Happy New Year and hope to see more of this in the future!

  • @bluehornet6752
    @bluehornet6752 6 лет назад

    Dude, this is one of the most incredible videos I've ever seen. Awesome! Thank you so much for making and uploading it!

  • @cffellows
    @cffellows 6 лет назад

    I just discovered this channel and love the format and vidiography. Very educational.

  • @halasimov1362
    @halasimov1362 6 лет назад +1

    Inspiring and Educational! Thank you for sharing your knowledge with the world

  • @ccandrew111
    @ccandrew111 6 лет назад

    This tutorial could come in very handy for a project I’m working on, thanks Ben.

  • @CarlBright
    @CarlBright 6 лет назад

    Nice and entertaining for us geeks. Thanks for the demo. I plan to use it to read a voltage in and PWM out a signal to control a PWM speed control fan via simple voltage input. Imagine a speed control fan based on the LM35 and an op-amp.

  • @ExSiegfried
    @ExSiegfried 6 лет назад

    This is pure quality content
    The sensor and the magnet it's like the triggers on the xbox one controller :0
    and happy new year guys :3

  • @andrsam3682
    @andrsam3682 6 лет назад +3

    Those are pretty neat little mcus. Used them in couple of my projects and I like them a lot. I also tried the PIC10 family, falsely thinking they are the same as those ATtinies. How surprised I was when I found they have single timer, but they DON'T HAVE INTERRUPTS.

    • @ray-charc3131
      @ray-charc3131 6 лет назад

      It is an important issue so that it is a good thing of this chip.

  • @Xilefian
    @Xilefian 6 лет назад +11

    For function args most compilers for most architectures are likely to pass them by register, rather than store in memory, so the concern should be matching the register size, rather than keeping memory usage light. This architecture has 8 bit general purpose registers, so uint8_t would likely be most ideal anyway.

    • @BenHeckHacks
      @BenHeckHacks  6 лет назад +4

      That makes sense, considering RAM access has a 2 cycle penalty.
      Not shown in video but doing the same toggle test in assembly yields an identical speed.

    • @Xilefian
      @Xilefian 6 лет назад +9

      @@BenHeckHacks this is a very nice video, by the way - you've managed to describe incredibly low level C programming in quite the understandable manner. Reminds me very much of Gameboy Advance programming in C.

    • @etopowertwon
      @etopowertwon 6 лет назад

      @@BenHeckHacks
      Even more, if you enable optimisation, pins function gets inlined into the main AND it's optimised down to the single instruction: cbi for clearing bit, sbi for setting bit
      Here's the assembly listing: godbolt.org/z/8c1pY5
      And if you mark the function as static, compiler will know that there are no other object files that will ever call it and remove completely
      godbolt.org/z/Du-HFP

    • @Adolf1Extra
      @Adolf1Extra 5 лет назад

      I'm curious why you would be doing this in C at all and not C++ where you can leverage constexpr and templates for compile time computations so as many things can go on the flash as possible.
      Also yes, compilers are way smarter than you, just make sure your data is word size and it will fo magic to your code. I recommend watching cppcon presentations on the topic and toying around with godbolt just so you can witness how truly powerful C and C++ compilers are.

  • @Samuel_el_toro
    @Samuel_el_toro 6 лет назад

    That ASCII chart on the wall is awesome!

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

    after five years i happen to come across this and enjoyed every thing you teach us. one thing i had doubt, at 6:02 the PC817 emitter is directly grounded. since the collector of PC817 is at 11.3V and Emitter-collector voltage VECO of PC817 is only ablut 6V, this direct grounding may destroy the PC817. i think we need an 1k ~ 4.7K resistor to limit the current through PC817 / 2N2907

  • @mexykanu
    @mexykanu 6 лет назад

    Man, a lot of work went into making this video. Thank you !

  • @porklaser
    @porklaser 6 лет назад

    This video really helped demystify what's going on behind the arduino IDE. Thank you so much.

  • @AssetMalik
    @AssetMalik 5 лет назад

    Wanted to see the uC. Learned a lot about Eagle, and some electronics tricks! Good content. Enjoyed :D

  • @mikebrown7366
    @mikebrown7366 6 лет назад

    I haven't dug through the datasheet for the optoisolator, so I might be going off half cocked; but, 100 ohms seems a little small on the current limiting resistor for the internal LED. Outside of that, excellent video. Reminds me of the pain of learning to program PIC chips when I was first getting started. This type of material should be a prerequisite for new developers, especially those that think Java can do anything. ;). Doing useful, timing sensitive work with 32 bytes of RAM and a tiny amount of flash is the best way for beginners to appreciate limited resources and gain a true perspective on what's really going on behind the scenes of "luxury" programming languages.

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

    this is an excellent tutorial. I understood every word. Greets from Germany.

  • @awesomeproject2755
    @awesomeproject2755 6 лет назад

    jajajaja, definitivamente el mejor y mas gracioso vídeo sobre programación de micro controladores que he visto , felicitaciones .

  • @tamarathompson9418
    @tamarathompson9418 6 лет назад

    Legend . I have a packet of these lol . Thanks for putting this all in one place and with so much information. I know what I'll be getting up to next weekend.

  • @joeritchey4348
    @joeritchey4348 6 лет назад

    Great tutorial!!! Very fun delivery and a great teacher!!!

  • @JacobAntoun
    @JacobAntoun 6 лет назад

    I'm so happy Ben Heck is making videos!!!

  • @AlexHuebi
    @AlexHuebi 6 лет назад

    At the Programming Part: in school, we used to use Atmel Studio as our main IDE, but when compared to Visual Studio with the Visual Micro extension, then the VMicro is much more convinient and forgiving when using a CH340 instead of the CP2102. And you have the features like autocomplete or one-click to compile and program. (and no need to press the reset switch while programming the atmega2560)

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

    Great video, thank you!!! One note, you can use a single 3PDT switch instead of 3 separate switches.

  • @TentoesMe
    @TentoesMe 6 лет назад

    I have a bunch of Tiny 10's. I just love the idea of a whole stupid computer in that tiny part! I'm always keeping my eyes open for projects I can use them in.

  • @jchelm1979
    @jchelm1979 6 лет назад

    Cool video, watching this reminds me of years ago (over 10) using Eagle for everything. So glad I moved to Kicad, far far superior. It's painful to change packages, but once it's down you will never look back. Also glad to see you making good content, I stopped watching Element 14 presents as without you it wasn't worth watching

  • @NicoDsSBCs
    @NicoDsSBCs 6 лет назад

    I didn`t know Ben has his own channel. Good to know. I`ve missed the Ben Heck show so much. Greetings NicoD.

  • @martinwestermeyergondonnea84
    @martinwestermeyergondonnea84 6 лет назад

    i've missed this man so much

  • @JakobWierzbowski
    @JakobWierzbowski 6 лет назад

    You Sir are one of the YT GOATs. Thank you!

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

    Fascinating, I watched until the end.
    Great job!

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

    This thing puts a whole new spin on the term "microcontroller" with its size!

  • @sundhaug92
    @sundhaug92 6 лет назад +1

    39:55 sendByte should start by waiting for the state-machine to be in the ready-state before starting. Would also recommend using defines instead of magic-numbers for the state-machine

  • @klave8511
    @klave8511 6 лет назад +1

    Excellent video, well done. Just watch overheating the poor chip when you remove the solder blobs.
    Is there a good reason to add Q1, the optocoupler is already switching the 12v supply for you, why not use it directly?
    In fact, I don’t see the need for opto-isolation, why not use a single transistor in place of the optocoupler (you will then need Q1 to level shift)?

  • @jakemercer1528
    @jakemercer1528 5 лет назад

    3am on Christmas Eve? That's dedication!

  • @northshorepx
    @northshorepx 6 лет назад

    HOLY CRAP Ben!!!! This was awesome - real nuts and bolts coding and building. Just a thought ff you put those commands DEFINES into an include file on git hut then perhaps people could build a teeny tiny library for simple (read sensor --> output value) easily. Either way I loved this video and will be watching more. Thanks!

  • @Sharklops
    @Sharklops 5 лет назад

    This was freaking amazing. Please more of this kind of stuff!

  • @CMB27000
    @CMB27000 6 лет назад

    You can use the transistor side of the the optocoupler as a PNP transistor, provided it is rated to work with 12 volts, which a great many are. There is no need for the additional PNP transistor.

  • @RobertGallop
    @RobertGallop 6 лет назад

    Very nice content, reminds me of the old days. Thank you!

  • @caydenwright9548
    @caydenwright9548 5 лет назад +48

    Anyone hear the Minecraft baby zombie hurt noise at 9:20?

    • @arcadesunday4592
      @arcadesunday4592 5 лет назад +1

      Lol!! Yes.

    • @jlucasound
      @jlucasound 5 лет назад +1

      I didn't hear a thing. I will have to go back and check. Why would anyone hurt a Minecraft baby zombie? I guess because it is a Zombie. Could you imagine if they were real? That would be terrifying. Oh, that's right, I was learning electronics and programming. If this young man is into Minecraft, we must accept it.

    • @arcadesunday4592
      @arcadesunday4592 5 лет назад

      @@jlucasound yea, you gotta go back and listen. It's there alright! Haha...

    • @jeffpierce147
      @jeffpierce147 4 года назад +3

      @@jlucasound uuìì>>>lDU5>>l>the D5 AND 55555INCHES AND I 5AM THE BEACH 5AM 5TH AND THE FIRST CD CD IN 5TH 55INCHES 55TH ST. A 555555INCHES 5 TO THE BEACH HOUSE 5AM 5TH ANNIVERSARY OF 5TH CENTURY 5AM THE 5TH AND 5TH 5AM THE FIRST 55INCHES 55INCHES AND I 55INCHES 55INCHES 5555INCHES 555TH ANNIVERSARY 5TH 5AM 5AM 5555CUT 5AM THE 5555TH ANNIVERSARY 5TH 55555INCHES 5FOR THE BEACH IS THE FIRST 5555TH CENTURY AND A 555TH ANNIVERSARY OF 5555INCHES 5 5555INCHES 5AM 5 A 5 AND 5555555555555555CUT IN 5INCHES IN 55INCHES AND 6555 CALIFORNIA 55 5TH 5NEW 55 BIRTHDAY PARTY 55TH IN A 55555 HAVE 5555INCHES 5CD 5655 AND THE 55 ANNIVERSARY 5TH CENTURY CHURCH AND 5AM CHURCH 55CCR 7555INCHES ARE 5AM 5TH AND I 55INCHES THE SAME WAY TO 5AM 5555INCHES CALIFORNIA AND I AM A MEMBER WHO 5 OF 55INCHES THE STATE AND 5CO 5⁵55⁵ THE ⁴ WHO 5AM THE FIRST AND 555INCHES ARE 5AM 5555INCHES OF 555555⁵54⁵ AND 5TH 55555INCHES IN A 55 MINUTE WALK 55INCHES AND 554INCHES 5545TH STREET IN 5AM 5AM IS THE 55INCHES 5TH IS 5AM 6AM IS THE 5555TH 55INCHES 5AM THE BEACH AND A 55TH 55INCHES 5AM 54555⁴5⁵ AND 5555INCHES 55INCHES 5AM 5TH ⁴55555 FEATURES 5AM 555 IN A 555TH 5 HOUR 5TH 55INCHES 55 DRIVE 5AM NEW 5AM VIDEO 5AM AND A NEW 555555TH GRADE AND 5555455INCHES 555INCHES ARE 5AM IN A 55555 AND 5AM 55⁵55 THE ⁴555 THE BEACH 5AM AND 555BUCKS 55INCHES 5AND AND 555INCHES 4⁵5⁵5 AND 5TH 5TH STREET FEATURES CALIFORNIA 55INCHES 55AM THE 5AM 5AM ⁵ A 4 AND ⁵555555 AND I 55INCHES A ⁵5 OR THE BEACH 5AM AND I 55INCHES 5TH AND I AM A NEW YORKER WITH A 54INCHES OF 5TH 4AM IS THE 55INCHES OF MY 5 YEAR TO DATE 55TH 5AM 55555INCHES 5TH CENTURY 5654TH CENTURY 555INCHES 65INCHES 55INCHES A 55INCHES 55INCHES 5 A 5 IN A 55INCHES 55555INCHES 5⁴ A GREAT WEEKEND TO THE BEACH CALIFORNIA USA AND THEN THE BEACH 5AM FEATURES CALIFORNIA AND 5TH ST. ANN ⁴ THE BEACH 5AM FEATURES CALIFORNIA AND I

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

    I Really ❤️ Your Explainable Flow Of Energy 🙏
    😊 Helps Me Understand Life As I Evolve