7. How to Output to a Pin to Blink an LED for Arm Microcontrollers - GPIO Tutorial Part 2

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024
  • Purchase my new book: Arm Microcontroller Programming and Circuit Building Volume 1
    www.amazon.com...
    I use the STM32CubeIDE in the book!
    Get your STM32 kits at Newbiehack.com
    I recommend using the STM32CubeIDE:
    www.st.com/en/...
    You can still download the CoIDE here:
    sourceforge.ne...
    This time, the GPIO control registers are set in code. The underlying concepts are explained thoroughly. The RCC Reset Clock and Control register explanation is added so that the GPIO Port C can be enabled.
    Official Website:
    newbiehack.com/
    ARM Tutorials on NewbieHack.com:
    newbiehack.com...
    Equipment that I use to make videos:
    Canon EOS Rebel: amzn.to/2rJSeh0
    Macro Lens: amzn.to/2qaSKmK
    Microphone: amzn.to/2qO2RB4
    3D Mouse to rotate/zoom/move the object (Must have for CAD!!!): amzn.to/2ruFnSn
    The drafting pencil I use on these videos: amzn.to/2qioYg2
    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 multimeter that I use and the one I recommend: amzn.to/2qicUez
    Want to have your own Patreon campaign? / wpllxz

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

  • @olajideoyekunle9044
    @olajideoyekunle9044 7 лет назад +23

    opportunities that people like Patrick create for millions of learners worldwide is immeasurable. i will keep pushing and sharing your videos on all my social media pages, at least if that's how i can say thank you.

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

    Finally I found what I was looking for. Someone who explains how everything works at basic level instead of pointing to a library and blindly believe it works.
    Thank you

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

    My deepest gratitude towards You. Thanks is less to express

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

    Man, if my professors at uni could explain stuff like this. Thanks a lot! I can't believe MCU programming is starting to make sense for me already.

  • @MegaBanb
    @MegaBanb 9 лет назад +8

    You're the best youtuber I have ever seen!!!!

  • @osmanyurdakul2355
    @osmanyurdakul2355 9 лет назад +1

    your explanation is great. This is important thing for who tries to understand what you say. I really want to migrate from AVR to ARM and i think your uploads will help me again :) Thank you for your huge effort. Bye

    • @PatrickHoodDaniel
      @PatrickHoodDaniel  9 лет назад

      You're welcome. The concepts and instruction I develop I hope will engender a complete understanding.

  • @jlenriquez
    @jlenriquez 9 лет назад +3

    Great!! I've been waiting for your new uploads :) thank you!

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

    Thank you for your perfect explanation :)

  • @knki_95
    @knki_95 9 лет назад

    Sir ,tutorials on RTOS would be just Divine .

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

    You also need to make sure MODER bit 13 is zero. The |= will leave a 1 there if it is already there.

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

    Such an underrated channel! I would buy something from your website, unfortunately shipping costs much more than the items. Sir, do you have a patron account?

  • @mindaugasvaskevicius1818
    @mindaugasvaskevicius1818 8 лет назад

    Great video. Thumbs up!!! Waiting for ADC or Timer videos.

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

    Great explanation , congratulations

  • @pickedupapencil
    @pickedupapencil 9 лет назад

    Great series. Will definitely follow along, and perhaps try to make my own little project.

  • @gsinghinus
    @gsinghinus 9 лет назад +1

    Thank you Patrick for great tutorial.
    I have few question. Hope you can elaborate a bit.
    1. Why did we chose push-pull instead of open-drain in type register. May be I need to understand the difference between push pull & open drain . Will you please point me to relevant literature?
    2. I am guessing choosing a higher speed will make register clocked at higher speed which would explain high power consumption. Please confirm.
    3. Why we chose no-push and no pull. Why not pull down as initial state as we will pull LED up later?
    Thanks in advance.

  • @user-yz7db5bc8f
    @user-yz7db5bc8f 4 года назад

    Дружище спасибо тебе большое!! У нас на русском YT нет таких крутых и подробных видео!! Лайк и подписка однозначно!!!

  • @Andythatshowiroll
    @Andythatshowiroll 7 лет назад +2

    I want to commend you on the quality of your videos as many users have done before, but i want to ask you a question as well. We are all learning from you, but who did you learn from/what resources did you use to learn all of this information?

    • @PatrickHoodDaniel
      @PatrickHoodDaniel  7 лет назад +8

      I'm auto-didactic (learned on my own), but that is only the programming and microcontroller aspects. My father was learning electrical engineering in his profession and I tagged along with him (as much as I could understand). This was about 40 years ago, so it was strictly circuits rather than microcontrollers. I can also credit much of my formal education in college as well, even though the subject matter was not the same.
      Learning this very intense subject stems from more than simply going out an learning. It requires a passion for the content, and I have a few goals that cause me to keep my passions alive. As long as your passion is strong, the information and intelligence on the subject will be quite fruitful. Specifically, the resources I used was simply online content such as mine, and many many datasheets. I learned programming from a very young age (1975) and just kept on with it. It's good to have a background in programming, but it's not a must. Sometimes I believe that it would be better to not have the past programming in my head which cloud new techniques, so new programmers may actually be in a better place than me. Books have also played a role, but a minor one. The books that I read were used as reference and I would find myself googling the information instead (which lead me into stackoverflow most of the time). So, I would say, currently, online resources was and is my best resource to learn.

  • @ohmyfly3501
    @ohmyfly3501 9 лет назад

    looking forward for next in series, don't make us wait please or ill die because of enthusiasm. #urawsm

    • @PatrickHoodDaniel
      @PatrickHoodDaniel  9 лет назад

      +Chinmay Gharat Will do. Kind of you to share your interest. Thanks!

  • @masterproducts0
    @masterproducts0 7 лет назад

    Amazing content as always! Like it a lot :)

  • @Brainstorm4300
    @Brainstorm4300 8 лет назад

    One thing I would criticise about STM datasheets is that they don't tell the associated registers of any peripherals, another thing is that the registers don't have good explanations of their operation which makes life harder for a beginner.

  • @shubhamsingh-nd6wo
    @shubhamsingh-nd6wo 9 лет назад

    you are the best..hats off sir.

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

    Hey man ! help me i m a big fan of yours.
    I think this playlist is numbered wrong or the some of the tutorials are removed(39&40) , is that right ?? plz clarify it to me.

  • @GS-xg7sl
    @GS-xg7sl 6 лет назад

    Hi. Can you explain the terms Address offset and Reset value in the data sheet.

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

    I have a query, supposedly the maximum frequency of the MCU is HCLK = 48 Mhz, but the reset values of the register set the HCLK = 8 Mhz, because of the change of PLL's settings. So, in every program that I made, I need to set the correct values of the register to set the HCLK = 48 Mhz?, or what is the default values of clock frecuency with not registers modified (RCC)?

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

    Good job, please can I use simulator program as I don't have the microcontroller??

  • @PiyushSharma-iu3bd
    @PiyushSharma-iu3bd 5 лет назад

    started learning but CooCox is down..not abhi to get software components .....user doesn't login

  • @yuganshbansal6824
    @yuganshbansal6824 7 лет назад +1

    Is this programming language different from ARM Cortex M0 microcontroller programming ?

    • @PatrickHoodDaniel
      @PatrickHoodDaniel  7 лет назад +1

      The language is the same C/C++. The libraries are based on the STM32 libraries that contain register definitions and macros.

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

    Hi
    I use Eclipse IDE
    it does not show intellisense and suggestions.
    what should i do?

  • @trt969
    @trt969 7 лет назад +1

    Is there a way to make a donation? Apart from Patreon I mean... Thanks for the video!

    • @PatrickHoodDaniel
      @PatrickHoodDaniel  7 лет назад +2

      Wow, thank you! Yes, there is a way donate and support my channel.
      You can go to my channel: ruclips.net/channel/UCC7ifdmN7ebFo-eXBUZkeiw
      There is a "Support this Channel" in the lower right hand of the channel art (logo). If you are wondering, I just added it as per your comment. Many thanks!

    • @trt969
      @trt969 7 лет назад +1

      Thank you for the video... Keep uo the good work! =D

    • @PatrickHoodDaniel
      @PatrickHoodDaniel  7 лет назад +2

      I will. Thanks!

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

    I thought it would be easy to convert this to M3, but at the reference manual there is no GPIOCEN under AHBENR. In fact it seems that there is no GPIOCEN at all for M3. I chose M3 because the Blue Pill is very popular around here. I will try to find it at COIDE the way you did, but thanks anyway, cool videos.

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

      What does the reference manual show for the AHBENR? You may need to find the enable for the port under a different bus.

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

      Let me know the chip number and I will take a look in the reference manual.

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

      Ok, the chip number is STM32F103C8T6, and the reference manual is RM0008, thanks.

  • @matt_313
    @matt_313 7 лет назад

    Hi Patrick, I noticed in the data sheet for the STM32F030R8 is says the CPU frequency is "up to" 48MHz and that the system clock selection is done on startup. Does this mean by default the clock speed is slower? And if so, how would someone set it? (I apologize if you've already covered this topic, I'm only a few videos into your series so far) Keep doing what you're doing!

    • @PatrickHoodDaniel
      @PatrickHoodDaniel  7 лет назад

      Matt Pamenter not a problem. The uC defaults to 8mhz. You need to use the PLL to increase it. See my #48 video on how to do this.

    • @matt_313
      @matt_313 7 лет назад

      Patrick Hood-Daniel Thanks!

    • @PatrickHoodDaniel
      @PatrickHoodDaniel  7 лет назад

      You're welcome. Hope it helps.

    • @matt_313
      @matt_313 7 лет назад

      Patrick Hood-Daniel I took a look at video 48 but there was no mention of PLL or clock speed. Is it possible its in a different video?

    • @PatrickHoodDaniel
      @PatrickHoodDaniel  7 лет назад

      Embarrassingly, I was actually referring to previous to my last video, but that video is on patreon. My apologies.

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

    Hello!:) Ive been viewing your videos for a while now but I just recently got started with finally trying my hand at it! Strangely, I find that many of the variables like "GPIO_MODER_MODER6_0" seem to be missing froom the IDE :( Could it be because they have changed it to the Cube library?

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

      Javier Lam yes. That is the case. You will see me use the cubelib in my more recent videos.

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

      Oh wow thank you for the reply really appreciate it! Thanks for all the great tutorials they're really awesome as heck!

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

      Not a problem at all.

  • @MNasiriFilms
    @MNasiriFilms 7 лет назад

    Is there any datasheet that explain all the "REGISTERS" ?

    • @PatrickHoodDaniel
      @PatrickHoodDaniel  7 лет назад

      Yes, the programmers reference manual shows the registers very clearly. Here is the reference manual: newbiehack.com/Documents/STM32F030Reference.pdf
      The microcontroller's features are separated into chapters, , the registers are at the end of those chapters. The title of the register would be something like this: RCC_CR and to access it in the code, you would write RCC->CR. That would contain the contents of the register and also allow you to modify or test a part of the register. Say you wanted to modify the HSI on register and set that bit: RCC->CR |= RCC_CR_HSION; If the | "pipe" symbol for the bitwise "or" is foreign to you, I would watch the AVR series in my channel.

    • @MNasiriFilms
      @MNasiriFilms 7 лет назад

      Thank you for the fast answer , i have found the section how to modify the Registers. But i have to go one step backwards , i mean is there any tutorial or Datasheet where i can read the function of the Registers . Lets say i want to know , what is the function of "RCC" or there are many Clocks and what are the functions of each of these clocks.
      In the reference manual there is a short description but its not really good for a amateur like me.
      In the previous video you said , we need to modify these Register "Mode , OSpeed , OType ...." but where do you know that we need these register .

    • @PatrickHoodDaniel
      @PatrickHoodDaniel  7 лет назад

      I'm going to have to recommend you keep watching these videos.

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

    What software you are using for coding

  • @AbdelrhmanKamal1
    @AbdelrhmanKamal1 7 лет назад

    First of all Thanks for your great videos :D
    ruclips.net/video/uNuxK1ARuwU/видео.htmlm6s
    Here you've put a 1 in the required bit, but haven't put the required 0.
    Can we put booth of them in a single step or we've to OR and AND in a separate steps?
    Thanks in advance!

    • @PatrickHoodDaniel
      @PatrickHoodDaniel  7 лет назад +1

      Absolutely. If you need to reset a bit (put a 0 in that position), then you can do that in a separate and/not, "& = ~", statement. It is recommended to do this. If I didn't do this in the video, then I probably should have (if it is necessary)..

  • @serhioromano
    @serhioromano 9 лет назад

    Ok, it was all good untill this video. I thought I can finally get it all. But this video switch my brain off. I am completely lost. It looks like my programmer experience in PHP and JavaScript only do not give me advantages here. I am like in a different world.

    • @PatrickHoodDaniel
      @PatrickHoodDaniel  9 лет назад +4

      I would suggest watching the AVR series first. I explain a ton of basic concepts that you really need to know before diving into the more advanced ARM. All of what you see in the AVR series will be of use in ARM development.