Bare-Metal MCU #8: Optimizers and Bit-Banging

  Рет қаралды 23,325

Mitch Davis

Mitch Davis

Күн бұрын

Пікірлер: 61
@Optinix-gz1qg
@Optinix-gz1qg 3 жыл бұрын
This is pure gold. Im literally learning this stuff as an engineer and the fact that u explain all this topics that easily and understandably is amazing. Can’t wait for more. Thanks sir
@n-o-i-d
@n-o-i-d 4 жыл бұрын
The way you are explaining these topics is great, you're making them so easy to understand.
@gaborzsamboky3252
@gaborzsamboky3252 3 жыл бұрын
Absolutely brilliant! Only a handful of educators are capable of translating complex processes to this level of simplicity. Thank you, Mitch.
@gokulramakrishnan4079
@gokulramakrishnan4079 Жыл бұрын
This series of videos make me to see embedded system a simple one. Thanks for this.
@hansdietrich83
@hansdietrich83 3 жыл бұрын
I have watched many many many low level programming tutorials, but this series is better than all of the others by a few magnitutes.
@hansdietrich83
@hansdietrich83 3 жыл бұрын
@@MitchDavis2 i already watched the first episode and it's perfect, that I found this series, as I'm looking for a low power uC that can be programmed over it's own USB interface and this series cleared up a lot of things
@SodAlmighty
@SodAlmighty 3 жыл бұрын
Mitch, this video has a couple of technical inaccuracies. Firstly, "bit banging" is the practice of emulating a peripheral (e.g. PWM, I²C) via direct port manipulation. What you meant to say was "bit manipulation". Secondly, it's not an "amperstand", it's an AMPERSAND.
@deltakid0
@deltakid0 3 жыл бұрын
Actually, it's not "bit manipulation" as you state but instead it's "bitwise"
@SodAlmighty
@SodAlmighty 3 жыл бұрын
@@deltakid0 No, it isn't.
@deltakid0
@deltakid0 3 жыл бұрын
@@SodAlmighty why not?
@SodAlmighty
@SodAlmighty 3 жыл бұрын
@@deltakid0 Three reasons. First, bitwise is an adjective, not a noun. Secondly, the term I used wasn't wrong. And thirdly, while what he's doing *is* bitwise, the term 'bit manipulation' is more descriptive and specific. There are many "bitwise" tasks you can perform. Bit manipulation is one of them.
@deltakid0
@deltakid0 3 жыл бұрын
@@SodAlmighty ok, I agree 1. and 3. but 2. sounds odd since is not very descriptive.
@jayedr8728
@jayedr8728 Жыл бұрын
bruh, your videos are literally a gold mine, you really demystified bare metal MCU for me, before i watched your videos i didn't know what happened after i write C code and upload it, it was a total Pandora box for me that i was scared to get into, but THIS! this makes it that much more exciting and easy to understand, you truly have a gift for teaching complex concepts using easy language! thanks a lot man! especially given the fact that i have looked to learn this information through other vids/courses, but there is always a problem of them using too specific examples and not explaining how to translate this knowledge to other processors/compilers and how to use the manuals to find all these necessary infos that you can implement for whichever processor you're using. you are amazing, thanks again Mitch
@rick_100
@rick_100 4 жыл бұрын
Very good series. I've watched them all. I liked how you showed the assembly language output of the compiler.
2 жыл бұрын
These tutorials are so good! I keep coming back to these videos every time I need to implement more and more complicated things on microcontrollers
@zyghom
@zyghom 2 жыл бұрын
this part at 7:15 is simply what I was trying to understand for ages probably (not that I am not aware of boolean algebra but in practice) -as many said already: you really have this "thing" that makes you super teacher ;-)
@minhajsixbyte
@minhajsixbyte Жыл бұрын
in the previous video i commented about "less" being the pager for man file. in this video i can see that you're using "more". this is basically the same thing. "more" being the old pager. nowadays "more" isn't used anymore. in most systems if you run "more", it actually uses "less" instead (more is symlinked to less). the original more couldn't go "up" direction in the text.
@kaxbyrita9279
@kaxbyrita9279 11 ай бұрын
So goooood. I cant believe these videos dont have more views than they do.
@emilsitka7590
@emilsitka7590 2 жыл бұрын
Most Excellent! This deserves MUCH more views.
@warrior7740
@warrior7740 10 ай бұрын
Thank you bro👍 finally clear my all confusion about bit wais operation.
@SquadQuiz
@SquadQuiz 2 жыл бұрын
Thanks for your video, that helped me a lot to understand the difference between the two methods, Cheers!
@paulg.3067
@paulg.3067 3 жыл бұрын
This video just made it to my usefull µC Bookmark list :D. Thanks for the effort you put in!
@Ewecnt
@Ewecnt 8 ай бұрын
PORTB^=(B11
@testme2026
@testme2026 4 жыл бұрын
thank you love it! please keep them coming!
@saikirangudla3389
@saikirangudla3389 2 жыл бұрын
wow! Got to learn a lot of fundamentals. Thank you!
@superchromat
@superchromat 4 жыл бұрын
Just discovered your channel. Great stuff!
@johnsun2416
@johnsun2416 8 ай бұрын
Like "Bit-Banging"
@markmaker2488
@markmaker2488 3 жыл бұрын
Great tutorial, I’d love to see more on bit manipulation.
@LewisCampbellTech
@LewisCampbellTech 3 жыл бұрын
I am loving these videos. I always thought the standard presentation of the arduinos was a bit "black box". I get it, it was targeted at makers, not high level programmers who wanted to dabble in lower level programming. but I never found it that satisfying to just download libraries and use the arduino IDE. I have a 7 segment display and a temperature sensor and my humble goal is to make a little thermometer without using the arduino IDE or libraries (I'll let myself use the AVR headers though)
@albertroswell
@albertroswell 2 жыл бұрын
thanks for this series!
@whatever361
@whatever361 Жыл бұрын
ur seris is so cool , thank you so much!
@MrMaxgarin
@MrMaxgarin 4 жыл бұрын
Great videos! Your explanations on bitwise operators is well done. Would you mind sharing your slides? I'd love to have them for reference.
@user-mr3mf8lo7y
@user-mr3mf8lo7y 2 жыл бұрын
Great videos.
@flaviocunha7576
@flaviocunha7576 3 жыл бұрын
Thank You, great video!!!
@aregjan
@aregjan 11 ай бұрын
You described two ways to turn on bit 5. One is 1
@davei7
@davei7 10 ай бұрын
you can use 0b00100000, 32, 0x20, (1
@joymakerRC
@joymakerRC 2 жыл бұрын
Thanks Mitch
@MilanKarakas
@MilanKarakas 3 жыл бұрын
How it is possible that your "Bit-Banging" is not flagged by KZbin algorithm as an adult content as it is case with one of my video about bit and byte banging necessary for chip AD9850?
@MitchDavis2
@MitchDavis2 3 жыл бұрын
I don’t understand anything that goes on with KZbin auto-flagging. Right now I’m dealing with a copyright claim on my next video saying I used a copyrighted song. You may notice that none of my videos even have any songs.
@MilanKarakas
@MilanKarakas 3 жыл бұрын
@@MitchDavis2 Can you please put here link to that video? I think some persons copyrighted silence, white noise and similar things.
@James_Hello
@James_Hello 3 ай бұрын
Fantastic ❤
@kenjiyoshida2330
@kenjiyoshida2330 6 ай бұрын
bro your content is Awesome! Having issues on programming attiny85 using arduino.The ADC analog read is not working properly I'm thinking arduino library isnt correct when it comes to the adc code parts.please help
@orenwolfe6506
@orenwolfe6506 Жыл бұрын
at 5:00, might I suggest clearing bit 5 with 'PORTB &= 0b11011111' or 'PORTB &= ~0b00100000' instead? IMHO this makes the bit manipulation slightly more obvious to the future reader.
@SteveRobillard
@SteveRobillard 3 жыл бұрын
Thank you, I have really enjoyed this series, though I think it would benefit from one addition a make file video (no more cheat sheet needed).
@MitchDavis2
@MitchDavis2 3 жыл бұрын
I certainly do want to revisit this series and add some above-and-beyond things. I tried to keep these videos as basic as possible to teach the fundamentals, and tried not to focus on many “quality of life” improvements yet. Sometimes, things like makefiles scare people when first introduced, but if you see what life is like without them, it makes it easier to understand why automated build scripts are an absolute necessity
@SteveRobillard
@SteveRobillard 3 жыл бұрын
@@MitchDavis2 Thanks for the reply. I use makescripts etc. in my classes often as black boxes to avoid student's needing to remember or retype long/cryptic commands. But, I am firmly in the camp of wouldn't want to go back to the time before I discovered make files etc. especially since I have arthritis and typing can be especially painful.
@metamud8686
@metamud8686 2 жыл бұрын
when you compiled to assembly which you subsequently studied, you did not use -Os for size, but you typed -O1 .. at least in the video.
@MitchDavis2
@MitchDavis2 2 жыл бұрын
Oh wow, nice catch. I had to re-watch to see where I slipped up. It’s been so long since I made this that it’s probably just a mistake on my end
@AlyssaNguyen
@AlyssaNguyen 2 жыл бұрын
I generally prefer to use "0b00100000" rather than "(1
@stocothedude
@stocothedude 2 жыл бұрын
Yes, It’s all preference. In the end the compiler doesn’t care if you write in binary notation or bitwise shifts. It will optimize it if it’s instructed to do so.
@choudharyom1
@choudharyom1 3 жыл бұрын
Thankyou very much
3 жыл бұрын
Have you tried to make 32 as variable and indicate it as PROGMEM? Is there any difference then?
@dineshganesh6723
@dineshganesh6723 3 жыл бұрын
Tq bro very helpful ❤️😎
@WildEngineering
@WildEngineering 4 жыл бұрын
when you're doing bitwise stuff, if you use hex instead of decimal it makes it a lot easier :) nice video! i came from a reddit post in r/embedded.
@ruffrecords
@ruffrecords 2 жыл бұрын
The (1
@RFDarter
@RFDarter Жыл бұрын
As you saw in the assembler code that is not correct
@ruffrecords
@ruffrecords Жыл бұрын
@@RFDarter If you are referring to the actual assembler output rather than the pseudo assembler earlier in the video then the assembler clearly never shifts the one nor inverts the result.. In fact the compiler is smart enough to know that the AVR has bit set/reset instructions for ports and invokes them when it sees PORTB |= ( 1
@TomCarbon
@TomCarbon 3 жыл бұрын
I don’t understand the point about sacrificing performance with “~(1
@MitchDavis2
@MitchDavis2 3 жыл бұрын
This is only calculated as a constant by the compiler if you tell the compiler to optimize things like this. By default, the compiler will often not optimize trivial things like this to reduce code. You have to add a “-O” flag to get the optimization code to kick in. The Arduino compiler adds the optimization flag by default, but you have to explicitly call it if you’re running avrgcc on your own
@TomCarbon
@TomCarbon 3 жыл бұрын
@@MitchDavis2 Nope, whatever optimization level you set, such a 'direct' computation is always handled by the preprocessor way before the compiler could do anything, thus it will always end up with a constant - the final value - (either on a register or on the stack depending on the usage or the architecture) rather than instructions... It's easy to check (and I just did with gcc, clang, pcc, msvc...): you can either get the preprocessor output or just check the generated binary. In earlier processors, operations using the alu were often very costly in cycles... and even if shifting was way better than multiplying / dividing, its cost was for instance something like 4 + 2n cycles (where n is how much you shift). So a great effort has always been made on the preprocessor side to avoid these computations.
Bare-Metal MCU #9 - Review; ATTiny85 from scratch
14:25
Mitch Davis
Рет қаралды 72 М.
Bare-Metal MCU #4 - Bootloaders and Programmers
18:24
Mitch Davis
Рет қаралды 61 М.
How Many Balloons To Make A Store Fly?
00:22
MrBeast
Рет қаралды 139 МЛН
БУ, ИСПУГАЛСЯ?? #shorts
00:22
Паша Осадчий
Рет қаралды 3 МЛН
STM32 Guide #4: Generated Code, HAL, and Bare Metal
26:20
Mitch Davis
Рет қаралды 85 М.
EEVacademy #4 -  I²C (I2C) Bit Banging
10:57
EEVblog
Рет қаралды 74 М.
Bit-Banging It Old School
20:25
Stuart Patterson
Рет қаралды 2,7 М.
Running MSBASIC on my breadboard 6502 computer
36:53
Ben Eater
Рет қаралды 228 М.
Bare-Metal MCU #7: Libraries (Preprocessor & Linker)
19:58
Mitch Davis
Рет қаралды 17 М.
Bare-Metal MCU #6: Compilers, Assemblers, and Friends
23:36
Mitch Davis
Рет қаралды 23 М.
C++ vs Rust: which is faster?
21:15
fasterthanlime
Рет қаралды 404 М.
Bare-Metal MCU #5 - AVRDude and fuses
20:30
Mitch Davis
Рет қаралды 35 М.
How Many Balloons To Make A Store Fly?
00:22
MrBeast
Рет қаралды 139 МЛН