#5 ARM Microcontroller Tutorial - The 4 Basics to Control ALL!!

Поделиться
HTML-код
  • Опубликовано: 5 авг 2024
  • Purchase my new book: Arm Microcontroller Programming and Circuit Building Volume 1
    amzn.to/3LFRaU5
    This video has the must-know basics!!
    Links to the software:
    STM32CubeIDE:
    bit.ly/41J0A9U
    STM Studio:
    bit.ly/3GYVVHo
    STM32CubeMonitor:
    bit.ly/47lHKqm
    Parts you will need in your prototyping environment:
    Kits to get you up to speed quickly:
    newbiehack.com/Categories/ARM
    If you already have the microcontroller, here are some breakout boards to use:
    64 pin - amzn.to/3rUXeiq
    48 pin and others - amzn.to/3IVkC6D
    STM-Link V2 Programmer:
    bit.ly/3NGVrZZ
    amzn.to/3IIZlgj
    Prototyping Breadboards:
    bit.ly/3RFXajI
    amzn.to/3o2Nh1g
    Resistor Assortment Kit:
    amzn.to/3H4R3ii
    Solid core hook-up wire 22 AWG:
    amzn.to/3IDGinA
    amzn.to/3g5TKUJ
    LEDs and Displays:
    bit.ly/3RXpFdT
    amzn.to/3Az1zf7
    Trimmer potentiometers:
    bit.ly/3tBoFTr
    amzn.to/3H6q067
    The Dynamixel servo I will be using in the USART videos:
    amzn.to/35s3qHl
    Microfarad Capacitor Assortment:
    amzn.to/32BIX1G
    Capacitors on Newbiehack.com:
    newbiehack.com/Categories/cap...
    Electrolytic Capacitor Assortment:
    amzn.to/33TtLxt
    The cheap oscilloscope that I use (because it's cheap and will work all of the projects in these tutorials): amzn.to/2rSHnBa
    A better oscilloscope and the one I would recommend: amzn.to/2qizK5M
    The brand of the multimeter that I use and the one I recommend: amzn.to/2qicUez
  • КиноКино

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

  • @PatrickHoodDaniel
    @PatrickHoodDaniel  2 года назад +7

    I noticed the screen recording portion is only HD. My apologies for this. I will fix this for the next video!!

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

    Patrick, your teaching method is perfect for me.
    Thanks

  • @carminezecca6179
    @carminezecca6179 3 месяца назад +1

    Good explanation.

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

    You are a great teacher. Thanks for sharing!

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

    I liked it before I even watched it.....I knew it would be a high quality video ! Thanks for the content!

  • @Jose-tw9bl
    @Jose-tw9bl 2 года назад +1

    Vert well explained, usefull, straight to the point. Thumbs up!

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

    I love the Space Odyssey Hal part lol. Great stuff Patrick. I really enjoy your video series on STM32

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

    Great series thank you and keep up 👍👌

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

    Definitely informative and love the ending

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

    it’s 3:30am and i laughed way too hard at the beginning

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

    I really appreciate the effort (and humour!) you put into these videos, it's great!
    Since your videos are aimed at folks starting out with this type of programming I wanted to offer my 2 cents -- not criticism at all, just a couple of things that can trap "young players" as EEVBlog might say :)
    Early in the video you talk about testing a register's value with a 'bit number' using the '&' C operator. This may trip up some because you don't really want to use the bit *number* here but its *mask* value instead. If the bit number is 7 for example you wouldn't want to compare with 7, you would want to use (1 CR & ADC_CR_ADCAL)'. Some people feel this is more explicit than comparing to zero, I prefer it because it seems easier to read.

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

      I actually thought about that while I was making the video, but that gets into some scary territory for new folks. I will probably create a card in that video directing them to more advanced videos I made a while back, talking about truth tables, adding and boring binary numbers using masks. I have heard some folks say that this is hard, and there really isn't here that is hard, so I am giving them the easy way now and adding more advanced information later in a scaffolding approach.
      On another note, when you suggested using the HSE, were you thinking I would add an external osc? I am using the HSI and multiplying that instead. I am uploading a video I made 4 years ago today or tomorrow that shows this working in the GND library environment. The HSE option did not work, but I think an interesting video of it not working yet, will come out of this.

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

      ​@@PatrickHoodDaniel No, I didn't mean to suggest you should use HSE, I only meant to clarify that *if* you wanted to use it you need to 1) have the component on your board :) and 2) enable it in the RCC. At the time I didn't know what board you were using, now I've looked into the NewbieHack and know a bit more. I am not an EE ... but I wouldn't recommend putting a MHz oscillator on a breadboard -- stick with the HSI if you can. As long as the UART bitrate is not crazy high you should be fine with it. Use all the tricks at your disposal to work around the sloppy clock (oversampling for RX and bitrate tweaking for TX/RX) before going the HSE route. I think you said your application was transmit-only, which opens the door to generating your own byte frames. You could do this either using bit-banging or, on the STM32F it's fairly straightforward to drive a GPIO pin directly from a timer-driven DMA: program your byte frame's start + ones & zeroes + stop into RAM and DMA that to your GPIO pin, using a timer to control the bitrate. What fun!

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

      @@PatrickHoodDaniel At first I sort of understood your logic here about staying away from the "scary" stuff and building up knowledge like scaffolding, but after I watched your video a second time I think the video does deserve a follow up or on-screen corrections (whatever those pop-up text messages are that you see all the time).
      If you're really trying to build knowledge (and I believe you are) then what you present should fundamentally be correct. If a newcomer is just starting to figure out masking like this and they see you tell them to compare with bit numbers it's going to lead the newcomer astray and probably frustrate them more. It's a great idea to layer the material and not dive into tricky topics too soon, sure, but if you do choose to cover 'while' loop conditions then what you present should be fundamentally correct, even if it's not a thorough treatment. Saying "!= 0" is the same as "== 1" is just plain wrong.
      You wrote ".. and there really [isn't] anything here that is hard..". If I've quoted you correctly, then I disagree with you. This register-based programming *is* hard. I do this for a living and can assure you this is exactly where everyone, professionals included, make mistakes time and time again. It's the very reason companies like ST Micro invest countless $$ into developing tools like their HAL libraries and CubeMX/CubeIDE code generators.

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

    Thanks, it is another great video! I am used to spend time in PM0214
    (Programming manual) for the flow of operations looks like your book is becoming my go-to reference ;-)
    You just demystified bits manipulation. For people coming from higher level language, this is unavailable! Thanks 👍

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

    more in-depth information about AVR is here, thank you sir. but I haven't found on youtube how to long press the button on the AVR, can you give an example video .. @hope

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

    Great video, but I have to correct something...
    (register & bitnum) == 1 will most likely never be true. Example:
    1111 & 0100 = 0100, which equals 4, not 1. You can test if it's not zero, but you can't test if it's 1.

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

    Hi, I'm a fan of your videos and glad to see you continuing to make more! So, I'm coming more from the software side. My electronics knowledge is very weak. Do you have any recommendations for how to build that knowledge for a microcontroller-embedded system emphasis? I find that going through an entire basic circuits book is not practical because my goal isn't to really learn all the integrals and whatnot. Its to learn the key aspects of microelectronics that do come up when I'm reading datasheets or trying to program features of an IC or possibly trying to design an embedded system (I know some parts of what i'm saying are contradictory). If you can provide me any direction for developing hardware knowledge, I'd greatly appreciate it. Thank you.

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

      I would just continue watching these videos as I will be explaining the circuits as I use them in the projects. If you need to understand how a particular circuit works in a pinch for a specific project, RUclips never fails. You can learn every aspect of electronics from other RUclipsrs as well.

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

      @@PatrickHoodDaniel thank you!

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

    I really like your goal of simplicity, for instance removing the code bloat introduced by the IDE - I like that. However, in this video you left-in the SystemClock_Config(). Was that 100% necessary - or would the power-up clock defaults be okay without SystemClock_config()? In otherwords can SystemClock_config() be removed without any *unpredictable* results?

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

      It may actually not be necessary since the default values in the microcontroller already start the HSI internal clock. If you want to change the clock through the ioc file (CUBE MX), you will still need the SystemClock function. If you set the registers yourself, there is no need for the SystemClock.

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

    This is awesome. Do you have a pdf we could purchase. I don’t have kindle and paperback doesn’t give me the search function a pdf allows.
    Thank you.

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

      Unfortunately not. PDF files get distributed very easily. If there is a way I can figure out how to keep pdf files safe from being distributed over the internet, I will make it available.

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

    Hi, me again,
    In this video you exactly show what's I find confusing. There are so many steps to just turn on/off a LED.
    Mode, Speed, pull up/down and Set/Reset.
    My understanding is, each pin has several different functions and we need to specify which one we are using. Are all ARM uC the same?
    Other question, when you talk about the register, are you referring to the address? Ex: 0x25
    Thanks again for taking your time to record and explain.

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

    I am having a problem with the ST-LINK V2. STM32CubeIDE keeps saying I need to update the firmware for the ST-Link and won't let me program the chip

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

    I am working my way through your book. I was wondering if there is a code repo for the books code. I have arthritis and typing can be painful. Also, do you want notifications about erors/typos,; and if so where?

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

      I don't currently have a repo for the code. The code was developed to serve as content for RUclips and as I was writing the book, I didn't think of putting the code on Github. I would love if you could provide me any information you see could improve the book. I just created a FAQ that can build over time for the book here: buildyourcnc.com/FAQ/14935. Thank you so much for this suggestion!

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

    Sir, it's hard to see the editing code from my phone chell, if... larger font it will be great, aniway this is great video, loved it so much & sure, I'll check it out on my laptop for biger screen. Thank you for dis amazing lesson.

  • @dev-rachid
    @dev-rachid Год назад +1

    For coding, can we use anyone software like Visual Studio Code or Notepad++ instead ? Great Thanks 👍

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

      Yes,but it is far more difficult to setup. The STM32CubeIDE is quite easy.

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

    Excuse me but there is black gaps at left and right side so we can't see the code clearly. Can you make full screen video next time please ?

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

    Please zoom in to your code so your videos are legible even on mobile devices with smaller screens!

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

    😄😄😄

  • @carminezecca6179
    @carminezecca6179 3 месяца назад +1

    Arduino so simple......just pin mode and digital write and is done

    • @PatrickHoodDaniel
      @PatrickHoodDaniel  3 месяца назад

      Enjoy your Arduino. Arduino has its place, but I don't focus on Arduinos. I would rather focus on a development that is best for production.

    • @carminezecca6179
      @carminezecca6179 3 месяца назад

      With just 2 lines of code using xor portx we can toggle that port

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

    Has anybody watching this video seen "2001: A Space Odyssey?"

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

      No but I knew of a company named HAL that made an Intel 4004 support board. Awesome chip and loved playing with it.

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

      @@okiopie you must watch that movie. The HAL segment in the video will make a lot of sense. It's a classic.

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

      Yes, best film ever, Stanley Kubrik was a genious. You will end in the deep space using HAL

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

      HAL == I-- B-- M-- spooky

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

      A cool project idea, build a HAL voice synthesized ;-)
      Daisy, Daisy, give me your answer, do.

  • @WaddahMoghram
    @WaddahMoghram 7 месяцев назад +1

    The STM Links are out of date

    • @PatrickHoodDaniel
      @PatrickHoodDaniel  7 месяцев назад

      It appears that RUclips put three dots (elipsis) cutting off the link. I have replaced them with shortened links. Thank you so much for letting me know. It looks like I will need to do this for all of my vidoes.

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

    That's a whole lot of code and research just to blink an LED.

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

    Thanks for the video.
    BTW: Your book is very difficult to read on Kindle, unfortunately. It has a very fine and light gray writing, so that you have to strain very much if you want to read it.

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

      Hmmm... That is not good. Can you tell me what specifically is wrong so I can make the necessary modifications? Font size, colors, margins, etc.? Thanks

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

      @@PatrickHoodDaniel I am not a technical Kindle expert. The problem seems to be, that your book does not use the font, that is configured in the Kindle and what all other books use.
      Normaly, I can configure, what font the Kindle should use. All other books follow that configuration. But your Book uses another font. It is a finer font and, even worse, it has a light gray as the font-color and not black, as it is used by all other books.
      But I do not know, why this is the case, I do not know, how the Kindle exactly .works.

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

    sorry to say but, number 5 Tutorial the 'the 4 basics to control all' is out of focus when looking at program.

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

      Yes, I mention this in my pinned comment. My apologies for this.

  • @SamLee-lk4pn
    @SamLee-lk4pn 11 месяцев назад

    I know these video's have been out for a while however, Why when typing in code is the screen so much bigger? Secondly you say for beginners then charge off leaving them behind. Make up your mind, for begginers like me, or for those already up the ladder.
    It would be great if you did another, skip the IDE you did that well, but remember idiots like me, trying to grasp it, before charging off, with a screen so tiny and possibly a little out of focus. In saying that, when you show the chip data sheet it's great.
    All in all bless you for trying at least, I have found trying to find a good RUclips course frustrating & proliferated by Asians speaking poor & broken English. Keep on trying. Thankyou. Sam

    • @PatrickHoodDaniel
      @PatrickHoodDaniel  11 месяцев назад

      I have a slew of videos that cover the basics and a book that will also get you up to speed. These videos are a continuation of the more beginner series and the book.