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.
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".
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!
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.
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.
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
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.
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...
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.
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.
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".
In name of all electro'noobs I say thankyou!
electronoob am your follower on instagram, check out my IG @hello_inventions
Wow
Thanks for your great tutorials Joop!
It really inspires me to up my game when it comes to Arduino programming :)
Nice tutorial, especial the last example.
damn dude... you should do more videos. you're so good at it.
Awersome explanation! Thanks a lot and tumbs up again of course!
what a fantastic tutorial. thouroughly enjoyed it.
This is a very good explanation. Please keep up the good work :)
Thanks for the clear and valuable explaining
Absolutely fantastic :) Thank you.
So good pedagogic content
Very nice video series, and well explained; thanks!
Your videos are great! Show us more about the atmel studio.
How does your program at 8:25 not freeze at the delay(10) if timer 0 is disabled?
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!
That is great to hear.
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.
I really like your Bigbird and Elmo images in the diagram
Outstanding video. Thank You!
Fantastic and very useful videos. Thank you for your work :)
EXTREME VALUABLE VIDEO !!! Thanks mate!!!
Awesome Job brother, keep up the good vids :)
Great job presenting this.
very nice video, well explained, thanks
Can you kindly make a similar video on static qualifier?
Do we need Atmel Ice to be able to see the stack, the mrmories, etc.?
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.
great explanation!
Hi Joop, this is another nice video. I like it, good job. :-D
Great video dude!
Hi, where can we buy the Atmel debugging tool and the software? for Arduino?
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
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.
when new videos coming ??? :)
Very nice video. Thanks!!!!
impressive work, thank you!
How you switched to hexdecimal view??? I couldnt find this way.
Are there any new videos coming out? 😁😁
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.
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...
The volatile is used to make temporary timers.
Thank You!
Nice video is it possible to hack the code from the flash memory.
With the debugger it's possible to change the data in the flash memory.
how to add GPS in YMFC V2 ?
Very well explained, thank you ;-)
AMAZING!
can you put link of programming of drone through adruino uno
www.brokking.net/ymfc-al_main.html
Good video.
Thanks !
Great channel Joop, sub'd
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.