Hi Bruce. These are exactly what I've been looking for. Been trying to learn embedded software for a while, and badly needed these sort of lectures to listen to. Thanks.
Thanks, everything is clear but the " int time" variable to record time since boot. I didnt understand how it is initialized and how it calculates the time passed.
Dear Bruce Land sir, In your lecture you mentioned that the code you have written in the blackboard is available online.I have searched but found none...it would be very nice if you mention the link...
I think the interrupt routine may have some clock ticks missed per this design. Because the ISR is waiting for the 3 timers to be set back to a non-zero value, its possible(likely) that the ISR will be entered, check that the value is zero, not do a decrement on the timer, and continue waiting until the next cycle of Main() to reset the timer(s). I think perhaps a better solution would be reset the timer once it hits zero in the ISR itself, and only use "Tmr_Done" flag in Main to be reset.
Sorry for the stupid question in advance. Why task names you defined earlier are different from task names in main if statements? And tremendous thanks for the video avr lectures series. It is a rare treasure and as an engineer I fully appreciate the quality content and how it is presented and structured (sadly I am civil engineer design concrete structures and avr is just a hobby:)
Instead of writing the "Yoda condition" (0 == x), you can just turn on the appropriate warning flag of the compiler (the AVR-GCC toolchain is being used in this course, right?) - for example, -Wall will do that among other (which is a good idea to use anyway). As to begin-end, students would benefit from increasing the font size too, instead. Picking some decent editor settings (including a big font size, a dark background and an easy-to-read font face) even has health implications.
Prof.Land , first thanks for sharing Us in a so fashinating way Your great knowledge. I have one question: since in task 3 we will check for a button press I suppose we will use an ISR(INT0_vect). (Maybe on INT0). Why didn't you have set in the initialization code before sei ( ); also: EIMSK |=(1
Oh, sorry for the stupid question,Prof.Land. I am currently following lecture 4 and actually saw it just now in task 3. I was going to erase my comment but saw your answer. .. Luckily enough I made not the question in lecture... thanks alot. You inspire so many people. Regards
For the 328p (Arduino Uno) there is the Xplained mini board with integrated debugger. Around 13 euro. The ATAMEL ICE Basic debugger is 100 euro. Atmel should have made affordable debuggers available much earlier. Switching a led by tinkering with an IO register in a live setting is fun. Also stepping through the scheduler examples of this course would be a great demonstration how things actually work. I wait for my ordered debugger. I probably was fooled in the nineties by teachers with beards that said that programming in higher languages make debugging obsolete. Implicitly they said that C is not a genuine higher programming language. Interestingly this is stated in the RISC V course from Berkeley, "One of my personal goals in this class is for you to develop a rational hatred of C", Nicholas Weaver inst.eecs.berkeley.edu/~cs61c/sp19/lectures/lec01.pdf For a higher language on 8 bit's AVR, check out TinyGo, tinygo.org/
You're a great teacher Bruce. Live long and prosper.
Thanks!
Good Tip: Never put a print statement in your ISR. I learned it a hard way when I was trying to send data on Serial port in an ISR.
Hi Bruce. These are exactly what I've been looking for. Been trying to learn embedded software for a while, and badly needed these sort of lectures to listen to. Thanks.
Good to hear!
Thanks, everything is clear but the " int time" variable to record time since boot. I didnt understand how it is initialized and how it calculates the time passed.
in this code all timer variables are incremented by a hardware timer in an isr.
@@ece4760 Thank you very much for the fast response. Now I understand. I guess a " time++;" instrucion in ISR is missed.
@@Maryjanewotson The millisecond timer is hardware, not software. longer times increment software variables.
True, if any of the routines takes more than a mSec, but they are all quite short.
Link is now in the video comments.
Dear Bruce Land sir,
In your lecture you mentioned that the code you have written in the blackboard is available online.I have searched but found none...it would be very nice if you mention the link...
Glad someone is teaching microcontrollers on a low level and it's on youtube.
I think the interrupt routine may have some clock ticks missed per this design. Because the ISR is waiting for the 3 timers to be set back to a non-zero value, its possible(likely) that the ISR will be entered, check that the value is zero, not do a decrement on the timer, and continue waiting until the next cycle of Main() to reset the timer(s).
I think perhaps a better solution would be reset the timer once it hits zero in the ISR itself, and only use "Tmr_Done" flag in Main to be reset.
Sorry for the stupid question in advance. Why task names you defined earlier are different from task names in main if statements? And tremendous thanks for the video avr lectures series. It is a rare treasure and as an engineer I fully appreciate the quality content and how it is presented and structured (sadly I am civil engineer design concrete structures and avr is just a hobby:)
I am not sure what you are asking since this video is 10 years old. Can you give me a link the the exact code, or to time stamps in the video?
@@ece4760 thank you for the replay i found what i was missing in the next video. thanks again
Instead of writing the "Yoda condition" (0 == x), you can just turn on the appropriate warning flag of the compiler (the AVR-GCC toolchain is being used in this course, right?) - for example, -Wall will do that among other (which is a good idea to use anyway). As to begin-end, students would benefit from increasing the font size too, instead. Picking some decent editor settings (including a big font size, a dark background and an easy-to-read font face) even has health implications.
Prof.Land , first thanks for sharing Us in a so fashinating way Your great knowledge. I have one question: since in task 3 we will check for a button press I suppose we will use an ISR(INT0_vect). (Maybe on INT0). Why didn't you have set in the initialization code before sei ( ); also:
EIMSK |=(1
I do not use intrrrupts to read a keypad
Oh, sorry for the stupid question,Prof.Land. I am currently following lecture 4 and actually saw it just now in task 3. I was going to erase my comment but saw your answer. .. Luckily enough I made not the question in lecture... thanks alot. You inspire so many people. Regards
17:41
#define begin {
#define end {
FYI: accepted in IDE VSCode & PlatformIO.
google: Debugging C, the Mega, and the STK500
and take the first link
For the 328p (Arduino Uno) there is the Xplained mini board with integrated debugger. Around 13 euro. The ATAMEL ICE Basic debugger is 100 euro. Atmel should have made affordable debuggers available much earlier. Switching a led by tinkering with an IO register in a live setting is fun. Also stepping through the scheduler examples of this course would be a great demonstration how things actually work. I wait for my ordered debugger. I probably was fooled in the nineties by teachers with beards that said that programming in higher languages make debugging obsolete. Implicitly they said that C is not a genuine higher programming language. Interestingly this is stated in the RISC V course from Berkeley, "One of my personal goals in this class is for you to develop a rational hatred of C", Nicholas Weaver inst.eecs.berkeley.edu/~cs61c/sp19/lectures/lec01.pdf For a higher language on 8 bit's AVR, check out TinyGo, tinygo.org/
very pascal-ish aproach with begin and end :D cool thing to do! would look funny tough if you wanna assign to an array some values :D
Dear Bruce land sir, you explain stuffs so well, thank you.
Very useful thank you.