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😣
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.
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.
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!
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.
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.
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🧡
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!
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.
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.
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.
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!
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.
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!
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.
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.👍👍👍👍👍👍👍👍
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 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.
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.
@@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) ....
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.
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.
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.
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
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.
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.
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. 😂
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 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 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.
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
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.
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!
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!!! :(
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.
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
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.
@@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.
@@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.
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.
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 ;)
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 .
@@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.
@@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?
@@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.
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.
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!
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.
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.
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.
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.
@@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.
@@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
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.
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
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.
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.
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)
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.
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
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
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)?
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!
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.
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.
@@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
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.
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😣
watching element14 videos always left me wanting exactly this kind of content! very detailed, interesting, and useful. glad others agree!
3:30 yú
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.
Thank you for providing! These chips are awesome
You are a hero! Thanks, Eli.
These things are awesome definitely putting one in my hand
Sick dude
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.
This has to be the best AVR introduction I've ever come across, much less specifically for the ATTiny10!
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.
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!
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.
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.
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🧡
Last year I bailed on attiny because the tutorials were too intimidating. Thank you, you made it all clear!
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!
Good tip! Thanks for your comment.
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.
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.
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
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.
Man, what a drop in videography production and what a huge climb in actual tech knowledge and content. Worth it.
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!
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.
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!
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.
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.👍👍👍👍👍👍👍👍
Long videos are usually boring, but for some reason I really like this one!
Probably as it's very factual but still has a lot of pace.
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 ;)
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.
@@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.
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.
@@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) ....
@@MakenModify Thanks for the recommendation. I'll look into it.
happy to see you continue to upload Ben!
Oh man i hope he would continue
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.
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.
"we only have 32 bytes of RAM"
...Congratulations, you've found something less capable than an Atari 2600 to make a portable out of
The RCA CDP1802 squad would like to know your location
**Facepalm**
I thought my OSI 300 with 128 bytes of RAM was the smallest I’d see, and that was from 1975.
@@funposting8912 o no theres a lot of small chips out there
You're being too pessimistic. I can think of dozens of uses for this today. While you're only seeing it's limits.
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.
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
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.
Where were you 45 Years ago!! I think I am finally "getting" it. You explain it so clearly! Subbed. Thank You.
I feel I'm attending a high level course on ATTiny programming, mixed up with a little bit of electronics and logics.
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.
"As an English major..approximately 1% of this video *_contains_* real words..."
FTFY bruh
r/iamverysmart
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. 😂
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.
I drew the schematic after I built it. Yes there was a 1K between them. Good catch!
@@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. ;)
This is where i am still a newbie in electronics design - knowing when current limiting resistors are needed with this scenario
@@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.
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
THERE'S A PROGRAMMER MODE ON WINDOWS CALCULATOR?!
This is amazing!
Richard Ziegler Windows calculator has supported base 2,8,10 and 16 for almost 30 years... since win 3.0
Yeah and also gnome calculator, for those who use the best kind of os (jk but Linux is cool)
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!
Wow - 53 minutes flew by! It's incredible what sort of hardware and knowledge is available for hobbyists these days.
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.
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!
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!!! :(
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.
Best video on bit shifting, ever! Thanks, you have explained perfectly.
Def saving this to watch later, seems like a great video to learn the basics of how a computer works
You're a smart guy! This was fantastic. Wish. you would do videos like this in '22.
Fantastic video. I sometimes wonder if I will learn anything by watching videos like this, and I always do! Thanks for this.
that was the most EPIC video/tutorial that i've watched recently!
-Greetins from Turkey.
This brings me back to the revision3 days. I love episodes like this. I’ll watch every minute of these. Awesome work Ben!
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
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.
Yes Ben the magic smoke will get out!.
@@rfdave3980 Yes, I know well of the smoke. Never speak of it with a pc on. They only hide the smoke for so long.
I have absolutely no experience with any of this stuff but this is very fascinating
Please keep doing this. This helped me learn more about interrupts and even serial! Long live the BenHeck Show!
These videos actually made me learn something. The element14 didn't quite get that going. Thanks Ben
Absolutely brilliant video. I tried and completed every stage and will use the notes I made, again and again, I am sure.
Thank You
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 :)
43:44: Print "Hello"? Not Hello world? Unforgivable.
@@computerman2830 not enough ram to print hello world?
@@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.
@@computerman2830 lol
@@ropersonline it's a rom, not ram 😅
@@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.
"let's get started"....pewpewpew, amazing hax....
He forgot this is not BHS... Old manners... I laughed when I heard this!
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.
I was about 3min in and thought “wait a second... I know that voice!” Glad to see you have your own channel!
where else is he active or known? Im curious!
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 ;)
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 .
39:09: NB: The "case 2 ... 9" syntax with ellipsis is a non-standard GCC extension. Careful now.
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: ...
@@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.
@@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?
@@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.
@@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.
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.
love those little pre-made boards!! look very handy..
Outstanding tutorial - what a great endpoint to reach in a single video!
Excellent, I bought some of these a couple of years ago and never got around to playing with them. This'll get me going.
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!
Dude, this is one of the most incredible videos I've ever seen. Awesome! Thank you so much for making and uploading it!
I just discovered this channel and love the format and vidiography. Very educational.
Inspiring and Educational! Thank you for sharing your knowledge with the world
This tutorial could come in very handy for a project I’m working on, thanks Ben.
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.
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
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.
It is an important issue so that it is a good thing of this chip.
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.
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.
@@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.
@@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
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.
That ASCII chart on the wall is awesome!
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
Man, a lot of work went into making this video. Thank you !
This video really helped demystify what's going on behind the arduino IDE. Thank you so much.
Wanted to see the uC. Learned a lot about Eagle, and some electronics tricks! Good content. Enjoyed :D
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.
this is an excellent tutorial. I understood every word. Greets from Germany.
jajajaja, definitivamente el mejor y mas gracioso vídeo sobre programación de micro controladores que he visto , felicitaciones .
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.
Great tutorial!!! Very fun delivery and a great teacher!!!
I'm so happy Ben Heck is making videos!!!
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)
Great video, thank you!!! One note, you can use a single 3PDT switch instead of 3 separate switches.
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.
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
I didn`t know Ben has his own channel. Good to know. I`ve missed the Ben Heck show so much. Greetings NicoD.
i've missed this man so much
You Sir are one of the YT GOATs. Thank you!
Fascinating, I watched until the end.
Great job!
This thing puts a whole new spin on the term "microcontroller" with its size!
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
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)?
3am on Christmas Eve? That's dedication!
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!
This was freaking amazing. Please more of this kind of stuff!
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.
Very nice content, reminds me of the old days. Thank you!
Anyone hear the Minecraft baby zombie hurt noise at 9:20?
Lol!! Yes.
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.
@@jlucasound yea, you gotta go back and listen. It's there alright! Haha...
@@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
I Really ❤️ Your Explainable Flow Of Energy 🙏
😊 Helps Me Understand Life As I Evolve