#4 How to control the world outside?

Поделиться
HTML-код
  • Опубликовано: 31 июл 2024
  • This lesson shows how to blink the three-color LED of the TivaC Launchpad board.
    The lesson starts with explaining how the LED is connected to the microcontroller based on the User Manual for the board.
    Next, you learn about the memory map of your microcontroller and you get the first look at the Microcontroller's Data Sheet.
    Next, you experiment in the debugger trying to access the registers of the GPIO (General-Purpose Input/Output) block to control the LED.
    You learn about the "clock gating" feature of the modern microcontrollers and you find out in the Data Sheet how to turn the GPIO module on by setting the appropriate bit in the system clock-gating register.
    Still in the debugger, you configure the GPIO bits for digital output and finally, you can turn all three colors on and off.
    After the experiments in the debugger, you proceed to code the same actions in C. This turns out to be simple, because of your knowledge of pointers from lesson 3.
    You run the code, and discover a need for a delay loop. Again you use the counting loop from lesson 2 to code this part.
    Finally, you have the working program that blinks an LED at a rate of about once per second.
    In the next lesson, you will learn how to improve the program by using the C preprocessor and the volatile keyword.
    ------
    Resources:
    Companion web page for this video course:
    www.state-machine.com/quickstart
    GitHub repository for projects for this video course:
    github.com/QuantumLeaps/moder...
    RUclips PLAYLIST of the whole course:
    • Modern Embedded System...
    Resources:
    "Tiva™ C Series TM4C123G LaunchPad" Board Manual (applies also to the Stellaris Launchpad)
    www.state-machine.com/course/...
    "Tiva™ TM4C123GH6PM Microcontroller" Datasheet (identical to LM4F230H5QR MCU on the Stellaris LaunchPad)
    www.state-machine.com/course/...
  • НаукаНаука

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

  • @StateMachineCOM
    @StateMachineCOM  10 лет назад +12

    I keep getting a lot of emails from people having trouble connecting to the LaunchPad board. Please visit the companion web-page to this course (state-machine.com/quickstart/ ), where you can find "Tiva/Stellaris In-Circuit ICDI Manual (USB drivers installation instructions)". There is also a screen shot of the Windows Device Manager that shows how the LaunchPad board should appear in the USB devices section.
    --MMS

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

      could kindly tell me what do you mean by set bit 5 for the data in register addressfor GPIO F

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

      if we use MSP430 for the same lesson, is there any differents??

  • @sandpaper-egg-2020
    @sandpaper-egg-2020 10 месяцев назад +4

    I recently got hired by a company for a mixed programming position. I had NO experience in embedded systems programming whatsoever and was struggling to catch up. This course single-handedly brought me up to speed with quality and clarity unrivaled by any other RUclips training course (and I have watched quite a few). If you have just found this course, keep going. You have come to the right place. The fact that Miro Samek has posted this course for free is the height of scholastic generosity. I have learned more from this course than any computer-science college class.

  • @StateMachineCOM
    @StateMachineCOM  11 лет назад +14

    I'd love to talk about embedded protocols, like I2C, SPI, UART, CAN, USB, etc., but I feel that this belongs to an intermediate-level course.
    However, before I do this, I have to cover so much more. In this course for beginners. I still need to talk about functions, interrupts, structures, arrays, etc. I'd also like to talk about the software architecture: such as encapsulation and inheritance in C, as well as superloop, RTOS, state machines, and frameworks. Stay tuned...
    --Miro

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

      Kindly please start with the protocols. You really are amazing and this is the best course I have ever studied. I have redid the basics of this course twice already. Great content. Thanks a lot

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

      in this ide:
      counter = 0;
      while counter < 10000......
      in arduino:
      delay(1000);

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

      when can you start these protocols sir.

  • @malgailany
    @malgailany 10 лет назад +1

    This is one of the best Cortex-M microcontrollers tutorials ever!
    Thank you, and keep the work.

  • @MCilmi1
    @MCilmi1 10 лет назад +2

    I recently discovered your channel and I have learned so much already.
    I can't thank you enough for these wonderful tutorials. Much appreciated.

  • @StateMachineCOM
    @StateMachineCOM  11 лет назад +10

    You need to pay attention to the _offset_ values listed with the register. For example, the GPIODIR register lists an _offset_ 0x400. This means that the full GPIODIR register address for GPIOF, APB bus is 0x40025000+0x400. The same register on the AHB bus has the address 0x4005D000+0x400. So, you can that by giving the common offset, the authors of the datasheet avoid repetitions.
    The same for 0x4002551C=0x40025000+0x51C, whereas 0x51C is the offset of the GPIODEN register.

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

    This is still a really cool tutorial, but you go a bit fast past some of the LED configuration settings, I would prefer a bit more time spent on the manual explaining these memory values and what they do. Digital function register bits 1,2,3 etc?

  • @klausennersouza8692
    @klausennersouza8692 10 лет назад

    Very, very good! Excellent! Were missing typecast know about. I read many books, but only now became clear.

  • @StateMachineCOM
    @StateMachineCOM  11 лет назад +7

    I will try to explain this in the next lesson-5. But basically, the GPIO block in the Stellaris microcontrollers has 255 registers to control the pins. These registers are at offsets: 0x000, 0x004, 0x008, ... 0x3FC. In lesson-4, I've used only the last register (offset 0x3FC). In lesson-5 I'll show how to use the others. Stay tuned...
    --Miro

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

    The most useful tutorial in RUclips keep doing. Thank you very much.

  • @Jay_Long_626
    @Jay_Long_626 10 лет назад

    Hi Miro,
    Sorry for the late reply . Yes I eventually came across the "bit masking" idea and got my head around it and moved on with the tutorials , only to see it was covered later ! But thank you for the help your videos are fantastic !

  • @StateMachineCOM
    @StateMachineCOM  11 лет назад +4

    Coding starts in this video at time 11:00.
    I realize that I have not shown all the registers involved in the Data Sheet (specifically the GPIO.DATA register). There is actually the whole bunch of registers associated with changing data in the GPIO, and I will explain it in the upcoming lesson 5. Stay tuned...
    --Miro

  • @s0ftwaredev
    @s0ftwaredev 11 лет назад

    I've learned more in this one video than from reading a whole book on the subject, thanks.

  • @ashkanalaei6735
    @ashkanalaei6735 11 лет назад

    Thanks for your favor Miro. I am looking forward to your next lesson

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

    Very clear, keep up the good work

  • @ayanghosh96
    @ayanghosh96 8 лет назад +1

    Thank you for these videos!

  • @zhitailiu3876
    @zhitailiu3876 4 года назад +5

    Really really valuable tutorials for everyone learning MCU.
    Students like to jump to example codes and making things working through manipulating given APIs,
    in this way they are very often incapable of debugging things in the register levels.
    Highly recommend this series of courses!
    Great jobs, Miro!

  • @StateMachineCOM
    @StateMachineCOM  11 лет назад +2

    Again, I'll try to explain it in the next lesson-5. But basically, the GPIO block in the Stellaris microcontrollrs can be accessed through two buses: the legacy APB (Advanced Peripheral Bus) and the new AHB (Advanced High-performance Bus). These two buses are mutually exclusive, whereas APB is the default. In lesson-4, I've used the default legacy ABP bus. In lesson-5, I'll show how to switch to the AHB and how to use it. Stay tuned...
    --Miro

  • @LiveAndLearnWithMe
    @LiveAndLearnWithMe 8 лет назад +1

    Thanks for the video, and it is pretty cool. There are not too many software developers around who can program at the low level like this. we (programmers) have been spoiled by easy to use libraries which abstracts us away from this.

  • @StateMachineCOM
    @StateMachineCOM  11 лет назад

    This, as well as most other questions, refer to a feature that I haven't introduced yet. In this case, the names of the registers must be defined as macros in a header file. Both macro definitions and file inclusion require the C preprocessor, which I promised to introduce in the next lesson 5. Stay tuned...
    --Miro

  • @leohuang990
    @leohuang990 2 месяца назад

    Great thanks for mentioning the clock gating control, GPIODIR (direction), and GPIODEN (digital enable). It seems that we may design the busy-waiting loop(s) based on the clock frequency and the tolerable frame-per-second range for human eyes.

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

    Dankeschön Kiewitt!

  • @VishalRamani
    @VishalRamani 11 лет назад

    Thank you buddy.I loaded the blinking programmer as soon as I received my board.and I like the performance of ARMCortex M4F performance

  • @EugeneSorokacorp
    @EugeneSorokacorp 10 лет назад

    Thank you so much. Your videos really helped me.

  • @RajSharma-ff8iq
    @RajSharma-ff8iq 8 лет назад +1

    you are fabulous. good videos really helped.

  • @jfernandmy
    @jfernandmy 11 лет назад

    Hi! Thanks a lot for your videos Mr Samek, I came across them reading the Embedded Muse from Mr Jack Ganssle, and have been following them for the last days using a kinetis kwikstik I won at an technology event here in Guatemala. Even though the peripherals are different, I have been able to blink an IR LED in the kwikstik following your explanations and searching in the processor datasheet. Please keep these great material! Thanks!

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

    best channel ever.

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

    For an entire semester i searched for this kinda tutorial and finally!!. _/\_

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

    I love your "You are rocking!" comment.

  • @girishgujar6740
    @girishgujar6740 11 лет назад

    Thanks for the reply and i am eagerly waiting for lesson 5...:-)

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

    Loved it!

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

    U seems like a God sends me a gift to know more about embedded☺. Thanks a ton . If my life changes to big level . U r one of the main reason thank you sir.

  • @StateMachineCOM
    @StateMachineCOM  11 лет назад +4

    I would highly recommend watching lesson7, where I explain the GPIO DATA register. This lesson also shows how to use the faster AHB bus.
    --MMS

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

    Thank you so much.

  • @StateMachineCOM
    @StateMachineCOM  11 лет назад

    Absolutely, but please remember that I haven't introduced the concept of a "function" yet. Also, I'd like to show how to access registers according to the CMSIS (Cortex Microcontroller Software Interface Standard), but this requires structures, which I haven't introduced yet either.
    All this is coming up. Stay tuned...

  • @xvjeko741
    @xvjeko741 11 лет назад

    and thank you alot for the tutorials :)

  • @ElectronicsGate
    @ElectronicsGate 11 лет назад

    Nice!
    I suggest that you use the ready made functions for I/O setting and clearing from the library. Anyway, dealing directly with registers is a great thing.

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

    Very nice!

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

    Hi Miro, I have the same question of understanding the GPIO PORT F data register. I saw a reply from you for another post regarding this but, as per your reply, i could not find the direct address for the Data register in the datasheet. the base address looks good but the offset is 0x000 which i am not able to understand.
    I have pasted the portion as below.
    GPIO Port F (APB) base: 0x4002.5000
    GPIO Port F (AHB) base: 0x4005.D000
    Offset 0x000
    Type R/W, reset 0x0000.0000

  • @VishalRamani
    @VishalRamani 10 лет назад +1

    here in the lesson four i was able to understand till the turning on og the GPIO port F.Then after I din't understand how you designated the pin as outputs and gave them digital output functionality.Can you please explain in detail with concepts and datasheet references?I am getting confused about it.

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

    For those who needs to understand the registers that miro have used for blinking the LED, look at the data sheet page 660 (GPIO Register MAP). for GPIO Data go to page 662, GPIO Direction go to page 663 & for GPIO Digital Enable go to page 682.

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

    Never used the execution speed itself to time something. That really puts into perspective how freaking fast even a slow chip is these days.

  • @TheVideoGarden
    @TheVideoGarden 10 лет назад

    Hi
    I have a real problem
    When I connect the board to the USA cable , through the upper USB/ICDI connector the both leds turn on .
    Should I connect to the seccond USB plug ?
    Also when i try to get into DEBUG mode I get an error message why ?
    Elico

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

    nice vid. can you explain more in detail about the datasheet. how to pick values and insert them in the code? confused about 5400

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

    hello,
    if i want to connect a sensor to the launchpad and read its values,can you name please the steps that i need to do to connect it?
    thanks in advance!

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

    I have been learning to progam ARM-Cortex M4 microcontrollers by learning to write to the corresponding registers as well as using the TivaWare Peripheral Driver Library API functions. It seems the latter is quicker to program in, however i'm sure there are many reasons to program using registers and data sheets. Can anyone explain the advantages?
    Thanks in advance.

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

    Silly question: after setting everything up, download and debug, there is a warning, as 'verify error at address 0x000000, target byte:***, byte in file', what did I do wrong?

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

    awesome!

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

    from where does 0x20eU comes place of a complete number which is present on the other side of bracket

  • @StateMachineCOM
    @StateMachineCOM  11 лет назад +1

    The pins in a 32-bit microcontroller are a very precious commodity. There simply aren't enough of them to go around. Therefore many pins have assigned multiple functions. The GPIODEN register controls the "Digital Enable" function of the GPIO. Setting bits in this register tells the MCU that the pins are used for digital GPIO, as opposed to doing some other things (such as being pins of a UART, etc.) I hope this clarifies the question.
    --MMS

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

    thanku Miro sir for such an awesome video series. I don't have the stellaris launchpad board at present but i have ordered one.all the registers that u use in this video show 0xcdcdcdcd in memory view.
    is the board required to get appropriate value

  • @akshimmu
    @akshimmu 8 лет назад +2

    brilliant tutorials.. itl be amazing if you expand to RTOS as well

    • @StateMachineCOM
      @StateMachineCOM  8 лет назад +5

      +Akshay Immanuel The main concepts behind a RTOS, such as context switch and scheduling are coming up. Currently, the course is at the level of interrupt handling, which is fundamental to understanding saving and restoring context. Stay tuned...

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

    +Quantum Leaps, LLC
    What does r in DATA_R stand for?

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

    Hello Miro, First of all thank you for this video lessons, I have stm32f103c8 MCU and I want to blink led, I find address of register, and led is on GPIOC (0x40011000) register and after I can not do anything cause can not find clock gating and base address can you help me?

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

    Hi there, I tried download and debug in TI Stellatis, but there was a warning which showed "Warning: There were warnings during download, see Log window". And the Log window showed a lot of bugs about verify error at address.

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

    Trying in simulator mode, when I try "Debug w/o downloading", I get pop up: "Stack pointer is setup to incorrect alignment Stack addr: 0xCDCDCDCD" How do I fix it?

  • @StateMachineCOM
    @StateMachineCOM  11 лет назад +1

    The explanation of the GPIODATA register is in Lesson 7. I hope this will clarify things...
    --MMS

  • @robinhood-gs8oq
    @robinhood-gs8oq 11 лет назад

    thanks man :)

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

    Really good tutorial. I understand how you set the direction for the GPIO port pins because I am an Embedded Software Engineer but maybe you should have shown that the datasheet show the location of the register that allow directions (and other settings of the GPIO port) to be set for others who might not have previous experience to clearly understand...
    Also, you could have just done it in code to show further use of pointers to modify memory directly...
    Really good though, really good explanations.

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

      My bad..you mention that...You are god sent for all aspiring Embedded Software Designers..

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

    I saw all of your ARM Cortex tutorials, but I am still not able figure out the the code for displaying alphabets on a LED dot matrix display. If you could please help get a code for any one of the alphabets, I'll try writing for other alphabets myself.

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

    whats the difference between an arduino (for instance UNO) and TI stellaris?

  • @friendman2001
    @friendman2001 8 лет назад +10

    how did you know that you had to go to address 40025400 to set the bits for the LEDs?
    same goes for the other addresses you mentioned that you went to without explanation. How do you find that you had to go to thos specific addresses?

  • @nashs.4206
    @nashs.4206 3 года назад +1

    Good tutorial however it seems that we needed to be aware of the fact that GPIO port F was clock gated in the first place. If you hadn't mentioned this fact in the video, I probably wouldn't have been able to get the LED to blink. For a beginner like myself, how would I even be aware of things like clock gating? I had never even heard of clock gating until you mentioned it! Is it mentioned somewhere in the reference manual that to use GPIO port F, I would first have to disable the clock gating?

  • @StateMachineCOM
    @StateMachineCOM  10 лет назад +1

    Hi Jason,
    I explain the GPIODATA registers in Lesson 7, and I highly recommend that you watch this. As you will see, there are 256 4-byte DATA registers, each representing one possible *combination* of 8 GPIO bits. The last DATA register corresponds to the combination 0xFF (all bits on). But, as I said, all DATA registers are 4-byte wide, so the address of this register is 0xFF*4==0x3FC .
    --MMS

  • @StateMachineCOM
    @StateMachineCOM  10 лет назад +7

    Many people keep asking about the GPIO data register. This register (or actually a group of 256 registers) is explained in Lesson 7. Please WATCH! Also, I keep getting emails asserting that bit 5 corresponds to 0x10. This is WRONG. Bits are counted from bit 0, which corresponds to 0x01 (== 1

    • @nareshveda
      @nareshveda 10 лет назад +2

      Thank you very much Sir. I watched the complete series of videos. waiting for the next video. Again thanks a ton for your excellent summary!

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

    For those of you confused about the Clock Gating part, here is some clarification (Though this is only an assumption). bit 0 is 0x01 (0000 0001) which enables GPIO Bank A (R0), a 5 bit shift gives 0x10 (0001 0000) enabling Block F, but 0x20 is (0001 0001) enabling both F and A. From this I can assume that if i wanted to enable all the blocks I would set the value to 0x1F (0001 1111), setting all the registers (R0~R5) to 1. Makes sense to me... but I could be wrong.

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

      You are pretty close. Except that 0x20==0b00010000. To get 0b00010001 you need 0x21==(0x20 | 0x01). --MMS

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

    do we need to download driver for it ? it giving me driver error please anyone can help

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

    please provide the datasheet link again, the link in the desc isn't working

  • @StateMachineCOM
    @StateMachineCOM  11 лет назад

    These addresses come directly from the Datasheet. In fact, in the next lesson5, you will see that 0x4002551CU will be replaced with the GPIO_PORTF_DEN_R macro, and 0x400253FCU with GPIO_PORTF_DATA_R. These macros are taken from the lm4f120h5qr.h header file, which is provided by Texas Instruments for the MCU. Again, I explain all this in the next lesson5.

  • @matthewszklany101
    @matthewszklany101 2 месяца назад

    Hi I'm in keil changing all the bits as directed to enable the LED, however when I set the bits to 0x2 at address 0x400253FC, nothing happens. Any idea why this might be the case?

  • @MostafaMohamed-kd8kk
    @MostafaMohamed-kd8kk 5 лет назад

    The portf Gpio data register addresses is 0x40025000 without offset why you use 0x400253fc instead please reply me

  • @xvjeko741
    @xvjeko741 11 лет назад

    hello, i was unable to enable my RCC (clock gating) by changing the value in the symbolic memory (I'm using stm32f4 board, and debugging it via SWD). The only solution was to enable the clock gating in the code itself. Now my question: How can I access/modify the registers directly in debug like you do on the video ?

  • @AlbertoRomero-ee3cs
    @AlbertoRomero-ee3cs 2 года назад

    Somebody could explain to me how he knows the address 0x400253FC is to turn on/off the LEDs? I don't find that address in the datasheet...

  • @ashkanalaei6735
    @ashkanalaei6735 11 лет назад

    I would really appreciate your help

  • @robinhood-gs8oq
    @robinhood-gs8oq 11 лет назад

    yup, I am :), you are doing the greatest work man. thanks. BTW, what about my first question, regarding PORT-F filled with zero, before breaking the clock gate ?

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

    i cant seem to edit the symbolic memory data. need help

  • @mehsank
    @mehsank 9 лет назад +2

    Hi Miro! I have a quick question, in the latest version of IRM the address values are all initiated to 0xcdcdcdcd; what does this mean? Are the ports already initialized? Please advice. Thanks again for the amazing videos.

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

      same with me today in 2019

  • @MinhTran-wn1ri
    @MinhTran-wn1ri 4 года назад

    @10:11 I'm using the Tiva EK-TM4C123GXL. The reference manual says the GPIO Port F data register (GPIODATA) is located at base address 0x4002500 at offset 0x000. Why do we use the offset 0x3FC in the video to toggle the Red LED?

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

      This is all explained in lesson-7 "Arrays and Pointer Arithmetic". Please watch. --MMS

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

    Subscribed

  • @SujithBabuKommineni
    @SujithBabuKommineni 11 лет назад

    the datasheet link appears to be broken. Can some one pls post the updated datasheet link. I goolgled for it but couldn't find.

  • @haengineer7
    @haengineer7 11 лет назад

    How do u find out that led pins are 0x400253FCU as the address. Isn't there an easier way to set the pins as high or low?

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

    Thank you for the lesson, but I don't understand why 400253FC is located in the right most column in the memory window? Don't the last two digits correspond to 400253FF ? Thank you, if someone could clarify.

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

      Hi. I had this question at the first time watching it, and finally I got my answer: 400253FC is just the location of the memory block, it means: starting from this address is the 32 bits of the register Port F.

  • @robinhood-gs8oq
    @robinhood-gs8oq 11 лет назад

    I can't able to find out, why we are writing, in 0x400253fcU to change the LED. the GPIO base for F is, 0x4002.5000 and the offsets are starting with 0x400. I can able to find ,0x3FC only in Channal control Structure. But, I have no idea of what it is? :)

  • @khaledgharbi5827
    @khaledgharbi5827 8 лет назад +6

    Hello Mr Miro Hamek, Thank you very much for this interesting training, in fact I have a question concerning the 5 th video "Blinking the Led" :after starting the configuration (clock gating, direction of pins,digital output resgister) you said that GPIO-F Data register is located at 0x400253FC, but I can't find that in datasheet GPIO Port F (APB) base: 0x4002.5000 ,offset: 0x000 ! can you tell me plzz what is the problem here? thanks!

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

      3FC is to set the GPIO to be an output/read. The narrator did not mention it in this video. You need to data register operation.

    • @SwirlOfColors
      @SwirlOfColors 8 лет назад +1

      +han34han34 But Where do you get the 3FC part? I'm as confused as the other guy.

    • @SwirlOfColors
      @SwirlOfColors 8 лет назад +2

      +SwirlyColors Ok, I get it. Setting bit mask [9:2] yields 3FC magic number.

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

    Hi Miro! I am trying to do the same using the STM32F4 Discovery kit, however, it seems that the GPIO ports are all enabled by default? This is weird - does this have anything to do with IAR configuration! Any suggestions? Thanks.
    Thanks for these videos, they are indeed wonderful.

    • @StateMachineCOM
      @StateMachineCOM  8 лет назад +1

      +Ehsanul Karim The STM32F4 devices have different peripherals (such as GPIO) than TivaC, even though they both have the same ARM Cortex-M4F core (but even there could be differences, for example the number of implemented interrupt priority bits in the NVIC). But anyway, the peripherals are exactly where the various vendors differentiate their offerings and that's how they compete with each other. This means that, almost by definition, anything that pertains to Tiva GPIO will not apply to STM32 GPIO.

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

    Hello sir,
    I did not understand why you were entering 20 in symbolic memory. Can you please explain me.

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

      The Symbolic number 20 came as the bit/field 5 was complemented and which would be 010 in binary so 20 in the addressing if my understanding was correct

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

    Hi sir, i am working on FRDM KW36 board with IAR workbench , and as per your instructions i have located port where RGB LED is connected and tried to do this all by debugging the board ,but i am struck at when i tried to change the value in direction register of GPIO it does not change the value as in with the board you are using,, please if any one can help.

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

      I'm having this similar problem.Any solutions to this problem?

  • @ragavendrapec
    @ragavendrapec 11 лет назад

    if my understanding is correct ur referring to register name which should have been defined else where probably say a header file (which should be included in the c file) while holds the same address as explained in the c code in the video...

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

    In the given mcu data sheet I couldnt find offset 0x3fc for 0x40025 register address. Am I missing something?

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

      The details of the GPIO registers are explained in lesson #7 "Arrays and Pointer Arithmetic". The GPIO organization in the TivaC MCU is quite unusual, but it is actually very clever. Please watch! --MMS

  • @ashkanalaei6735
    @ashkanalaei6735 11 лет назад

    I really appreciate your help. Thanks for your consideration
    I have two more questions Miro, what is the difference between AHB & AHP?
    & my second question is what is the purpose of DIGITAL ENABLE (GPIODEN)?because as i had experienced in AVR micro-controllers it is just needed to define a port or pin as an input or output, I mean as long as you define the direction of the pin or port it is usable but in ARM it is needed to activate GPIODEN as well as GPIODIR,Could you explain what its point is?

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

    What the difference between the register 136 and 60?
    In some guides they set the address 0x400FE108 and you had set 0x400FE608.
    Could you explain to me?
    Thanks!

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

      +Joeyhkbx This is about the GCGCGPIO register (GPIO clock gating). The explanation of the offset 0x608 is given in the TM4C123GH6PM MCU on page 338. But, basically, offset 0x608 is recommended, while offset 0x108 (RCGC2) is only provided for legacy software, but is not recommended.

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

    Hello Sir i am very new in Embedded System. Can you please tell me how you get this value 0X20 from the General-Purpose Input/Output Run Mode Clock Gating Control. Thanks

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

      5 th bit in 32 bits from 0 to 31 has to be set to 1. Which means you get 00......00100000. Which is hexadecimal 0X20

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

    Do you recommend any good book on ARM Cortex-M microcontroller programming? or any programming sources. I like to own one as learning and referencing. Thanks again.

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

      +Paul Le It is better to see the video directly. Books are not as straight forward as the video.

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

    Could anyone tell me how did he get the address400253fc as the address of the pin

  • @arunkollam85
    @arunkollam85 11 лет назад

    How do u find out that led pins are 0x400253FC
    as the address.

  • @hvign
    @hvign 9 месяцев назад

    Hi! I have two doubts..
    1. I have connected the Tivac Launchpad and at 2:32 you have selected TI Stellaris -> Reset will do system reset option. However I have not found that in the latest IAR Workbench. What should I do?
    2. After we had waken up the GPIO-F hardware block, the island from 0x40025000 has been enabled. But the next time when I dosconnect and reconnect the board, I assumed everytime it will get disabled in power cycle, but it remained enabled.. Should we reset the board everytime? if yes how can we do it?
    Thank you very much for the video lessons, these are really great!

    • @StateMachineCOM
      @StateMachineCOM  9 месяцев назад

      1. IAR has removed the option "Reset will do system reset" option, so just don't worry about it. 2. Once you enable the GPIOF clock in your code, and you program that code into the board, it will get executed after every reset. That's why GPIOF clock appears enabled when you connect the board. You might want to experiment and revert to a blank main.c and program that into your board. But I agree that truly resetting the TivaC board over the TI Stellaris debug interface is sometimes tricky. --MMS

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

    I'm using the version 8.40 of the workbench and I get a lot of "CDCDCDCD" data in several addresses. It seems I didn't have to enable the GPIO-F hardware block, or at least I don't know if it is activated. Does someone know more about it?

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

      Please check whether you are running in the simulator. You can actually see this on the main menu bar. Simulator prefills the memory regions, like your GPIO address space, with CDCDCDCD... --MMS

  • @12345armaan
    @12345armaan 6 лет назад

    what changes i have to make for working with tm4c123 i am going to buy a microcontroller and i was thinking for tm4c123 should i go for it or should buy something else

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

      The whole point of using exactly the same embedded board (Tiva123 LaunchPad) is that you don't need to make any changes. You just download the project for each lesson (from state-machine.com/quickstart ) and you run it on your board (which costs only $12.99). And finally, just for the record, I have no affiliations with TI (the manufacturer of this board) or any distributor. I simply chose this board, because it is inexpensive and yet has all features that I needed for this course. --MMS

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

    Hi, could you elaborate on what you mean by the memory map not having segments or memory banks? 5:25 By segments, I am assuming you mean that the memory doesn't have any missing memory segments. By memory banks, did you mean that if there were memory banks, they would be spread out across different address ranges? Cause I think I've see 1 or 2 memory maps where SRAM was divided up into separate banks.

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

      Older processors didn't have a simple, linear memory space. Instead, processors (like 8051, PIC12/16/18, AVR, 8086 etc.) had separate "memory spaces" (e.g., separate program space, separate data space, separate I/O space, etc.), segments of memory, and other such concepts, which immensely complicated addressing. Many processors of that era had also different instructions to accessing program memory, data memory, I/O space, or external memory. Finally, regarding "memory banks", often the processors could not address the whole memory they had using a single register (like the PC or SP). Instead, an address was a combination of multiple registers, one register used to address a "bank" of memory, and the other used as an offset into that bank. All of this is complicated and you would need to read about specific processors (like the 8051 or the 80x86), but the point is that modern CPUs, like ARM, make it so much simpler. --MMS

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

    In my Simulator(same as yours) In memory it doesn't show 00000000 or even -------- at the address 0x40025000. It shows cdcdcdcd ! even after setting the R5 bit in the GPIO clock gate control register. I think that over these years Ti and EWIAR have modified something that's why the method you show isn't working. please suggest something

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

      I understood the technique but just am not able to practice.