Improve your Arduino programming skills - The qualifier volatile explained.

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 พ.ย. 2024

ความคิดเห็น •

  • @Lkabouter
    @Lkabouter 5 ปีที่แล้ว +4

    A very nice explanation of the volatile keyword ! Great !
    It is mainly used when programming interrupt routines and perhaps it is usefull also emphasizing another important thing when using this volatile keyword when programming interrupts:
    If the volatile variable consists of more than one byte ( a 16 bit int or a 32 bit long variable), the microcontroller can not read it in one cycle, because we are (often) dealing with 8 bit microcontrollers. This means that sometimes while the main code is reading the first byte of the volatile variable, an sudden interrupt can allready change the next byte of it ! This is often forgotten and can produce hard to find "now and then" errors in the value of this volatile variable !
    A solution is to disable the interrupts while reading the volatile variable in the main code, so the individual bytes of this volatile variable will be "kept together".

  • @coldwolf6735
    @coldwolf6735 6 ปีที่แล้ว +8

    This is one of the most enlightening series I have ever watched. Thank you for sharing your knowledge, you are doing a very great job explaining engineering at it's finest. If possible please upload more on this series, it is like treat for budding engineers like me. Bless you.

  • @ELECTRONOOBS
    @ELECTRONOOBS 7 ปีที่แล้ว +34

    In name of all electro'noobs I say thankyou!

    • @mpls_link
      @mpls_link 7 ปีที่แล้ว

      electronoob am your follower on instagram, check out my IG @hello_inventions

    • @barunbasnet
      @barunbasnet 3 ปีที่แล้ว

      Wow

  • @cloudlee1027
    @cloudlee1027 3 ปีที่แล้ว

    Nice tutorial, especial the last example.

  • @MC-Cali
    @MC-Cali 7 ปีที่แล้ว

    I really like your Bigbird and Elmo images in the diagram

  • @pirateman1966
    @pirateman1966 7 ปีที่แล้ว +1

    damn dude... you should do more videos. you're so good at it.

  • @tiagovla
    @tiagovla 7 ปีที่แล้ว

    Your videos are great! Show us more about the atmel studio.

  • @KrisTemmermanNP
    @KrisTemmermanNP 7 ปีที่แล้ว +2

    Thanks for your great tutorials Joop!
    It really inspires me to up my game when it comes to Arduino programming :)

  • @sh8zen
    @sh8zen 4 ปีที่แล้ว

    Joop, great video!
    So is it only Atmel Studio that defaults to Optimizing some data this way?
    I've had unexpected results with AVR chips when working in AS7 that I don't have in PlatformIO on VScode. I wonder if some of my data was optimized away.

  • @Jlousauvage
    @Jlousauvage 4 ปีที่แล้ว

    So good pedagogic content

  • @Dekan88
    @Dekan88 ปีที่แล้ว

    Hi, where can we buy the Atmel debugging tool and the software? for Arduino?

  • @tameroran5551
    @tameroran5551 5 ปีที่แล้ว

    Thanks for the clear and valuable explaining

  • @IGBeTix-Electronique
    @IGBeTix-Electronique 7 ปีที่แล้ว

    The volatile is used to make temporary timers.

  • @knki_95
    @knki_95 6 ปีที่แล้ว

    Can you kindly make a similar video on static qualifier?

  • @phinok.m.628
    @phinok.m.628 5 ปีที่แล้ว

    How does your program at 8:25 not freeze at the delay(10) if timer 0 is disabled?

  • @rahulr9301
    @rahulr9301 4 ปีที่แล้ว

    great video....what you mean is in first example the bigbird variables value is copied from flash and in second example the bigbird variable is copying from sRAM , please correct me if iam wrong.

  • @incxxxx
    @incxxxx 4 ปีที่แล้ว

    How you switched to hexdecimal view??? I couldnt find this way.

  • @Avionics1958
    @Avionics1958 7 ปีที่แล้ว

    what a fantastic tutorial. thouroughly enjoyed it.

  • @jeanpierredaviau7478
    @jeanpierredaviau7478 4 ปีที่แล้ว

    Do we need Atmel Ice to be able to see the stack, the mrmories, etc.?

  • @ChrisFredriksson
    @ChrisFredriksson 7 ปีที่แล้ว

    I've learned a lot! I knew maybe about 5% of what you said, so the rest is new knowledge =D Really nice, for my brain, that you used the cartoons, made it a little bit easier to follow!
    I haven't used volatile a whole lot, but when I have its because I "had" to.. well, I tried without and found that it didn't work, tried volatile and then it did work =D Now I know a little more, so I will hopefully be able to use it more responsibly and more accurately =) Thanks!

  • @PoulBundgaard
    @PoulBundgaard 6 ปีที่แล้ว

    This is a very good explanation. Please keep up the good work :)

  • @Ringer1982
    @Ringer1982 6 ปีที่แล้ว

    Hi. I tried to debug Arduino with Atmel ICE and it showed me the message that the fuses should be modefied, I click OK button, it showed the message that I must toggle the power, I did. After that I see errors and the ATMEGA chip is no longer recognizable by Atmel Studio... What can I do now? I saw some mentioning that a pull up capacitor on Arduino board is interfering with the debugger but I don't know if that's true and where that capacitor on the Arduino board...

  • @edilsonfernandes4703
    @edilsonfernandes4703 7 ปีที่แล้ว

    Awersome explanation! Thanks a lot and tumbs up again of course!

  • @AxelWerner
    @AxelWerner 7 ปีที่แล้ว

    EXTREME VALUABLE VIDEO !!! Thanks mate!!!

  • @VDDThomas
    @VDDThomas 7 ปีที่แล้ว

    Very nice video series, and well explained; thanks!

  • @noijze
    @noijze 7 ปีที่แล้ว

    Hi Joop, quick question; how did you manage to use the DebugWire on the arduino board. I'm able to read out the fuses and other data via the SPI interface with the ICE, but when try the debugwire i get some errors saying that it doesnt support the interface. thanks for the great series so far ! groetjes

    • @Joop_Brokking
      @Joop_Brokking  7 ปีที่แล้ว +1

      Next to the 16MHz crystal you see two blobs of solder with a small line between them (RESET EN). You need to cut this wire to activate the debug wire.
      To get it to work again with the Arduino IDE you need to disable the debug wire fuse, solder a bridge between the pads and burn the bootloader.

  • @SumitKumar-fc4bq
    @SumitKumar-fc4bq 7 ปีที่แล้ว +2

    when new videos coming ??? :)

  • @josef.prosek
    @josef.prosek 7 ปีที่แล้ว +2

    Absolutely fantastic :) Thank you.

  • @andreashotzel172
    @andreashotzel172 7 ปีที่แล้ว

    Hi Joop, this is another nice video. I like it, good job. :-D

  • @nldestinyx1440
    @nldestinyx1440 7 ปีที่แล้ว +2

    Are there any new videos coming out? 😁😁

    • @Joop_Brokking
      @Joop_Brokking  7 ปีที่แล้ว

      Sorry, I have very little time to make videos. I'm currently working on a new project but it takes a lot of time to make the videos.

  • @mpls_link
    @mpls_link 7 ปีที่แล้ว +1

    very nice video, well explained, thanks

  • @VentoRacing1
    @VentoRacing1 7 ปีที่แล้ว

    Great job presenting this.

  • @FisVii77
    @FisVii77 7 ปีที่แล้ว

    Awesome Job brother, keep up the good vids :)

  • @wargaming67
    @wargaming67 7 ปีที่แล้ว

    Fantastic and very useful videos. Thank you for your work :)

  • @nmgreg11
    @nmgreg11 6 ปีที่แล้ว

    Outstanding video. Thank You!

  • @caioqwerty1
    @caioqwerty1 7 ปีที่แล้ว

    Thanks for the video!! I would appreciate a LOT if you could teach how to use the Arduino Nano as a programmer for Atmel studio, because I have no money to buy an Atmel programmer!

    • @Joop_Brokking
      @Joop_Brokking  7 ปีที่แล้ว +1

      This video should give you some ideas: th-cam.com/video/zEbSQaQJvHI/w-d-xo.html

  • @JesseBaker121
    @JesseBaker121 7 ปีที่แล้ว

    Great video dude!

  • @H1ghtower3
    @H1ghtower3 7 ปีที่แล้ว

    great explanation!

  • @ilyakos8178
    @ilyakos8178 5 ปีที่แล้ว

    impressive work, thank you!

  • @SumitKumar-fc4bq
    @SumitKumar-fc4bq 7 ปีที่แล้ว

    how to add GPS in YMFC V2 ?

  • @patrickvangulik4680
    @patrickvangulik4680 7 ปีที่แล้ว

    Very nice video. Thanks!!!!

  • @mukund22kar
    @mukund22kar 7 ปีที่แล้ว

    Nice video is it possible to hack the code from the flash memory.

    • @Joop_Brokking
      @Joop_Brokking  7 ปีที่แล้ว +2

      With the debugger it's possible to change the data in the flash memory.

  • @subarnaadhikari677
    @subarnaadhikari677 7 ปีที่แล้ว

    can you put link of programming of drone through adruino uno

    • @Joop_Brokking
      @Joop_Brokking  7 ปีที่แล้ว

      www.brokking.net/ymfc-al_main.html

  • @TheKetsa
    @TheKetsa 7 ปีที่แล้ว

    Thanks !

  • @robertparenton7470
    @robertparenton7470 7 ปีที่แล้ว

    Thank You!

  • @sidharthtalia
    @sidharthtalia 6 ปีที่แล้ว

    Couldn't you just put the value of the volatile variable into a non volatile variable and get the best of both worlds? like the value can be changed at any instant for the volatile variable and the non-volatile variable is say updated just once every cycle with the value of the non volatile variable. The reason why i would want to use a volatile variable is that I have had some bad experience with arduinos and interrupts when i didn't declare the variable as volatile. Hence i declare the ISR variables as volatile just to be on the safe side.

  • @RSP13
    @RSP13 5 ปีที่แล้ว

    AMAZING!

  • @MDFRESCUER
    @MDFRESCUER 7 ปีที่แล้ว

    Good video.

  • @daskasspatzle2396
    @daskasspatzle2396 7 ปีที่แล้ว +2

    Very well explained, thank you ;-)

  • @rusticza1355
    @rusticza1355 7 ปีที่แล้ว

    Great channel Joop, sub'd