No video

Arduino Interrupts Revealed

  Рет қаралды 50,391

Lewis Loflin

Lewis Loflin

Күн бұрын

Пікірлер: 41
@IntegralMoon
@IntegralMoon 9 жыл бұрын
Just an addition, to my understanding; volatile also tells the c compiler that the value of a particular variable can be changed externally to the program (i.e: in an interrupt). Without declaring volatile, the value of a variable that changes only inside an interrupt will will "optimised" to a constant.
@LewisLoflin
@LewisLoflin 9 жыл бұрын
What it means is the variable is stored in RAM not a register. Non-volatile will work but according to the literature it can be inaccurate.
@Clip7heApex
@Clip7heApex 2 жыл бұрын
Such a mine of information in this video!
@timstrack4573
@timstrack4573 2 жыл бұрын
Great presentation
@alleksandrs
@alleksandrs 6 жыл бұрын
Thank you very much! I did not understand why a *delay()* command does not work in my timer interrupt subroutine, and spent many hours for troubleshooting until I luckily found your video and you explained it very clearly at 12:09.
@LewisLoflin
@LewisLoflin 6 жыл бұрын
When you call an ISR it disables all other interrupts - delay() uses interrupts which is why I use my own delay routine.
@martinkolar2008
@martinkolar2008 3 жыл бұрын
@@LewisLoflin Hi, thank you for your excellent videos! Just one note - your myDelay(int x) routine actually delays for one more millisecond than indended, since the variable i is going from zero. Should be for (int i=0; i
@whitefields5595
@whitefields5595 5 жыл бұрын
Minor slip, at 7:21 you press switch it goes from low to high (not high to low as you say). Great video, thanks
@LewisLoflin
@LewisLoflin 5 жыл бұрын
The switch closure pulls the pin from high to low. This is because of the internal pullup as I remember. Wasn't clear on that thanks.
@whitefields5595
@whitefields5595 5 жыл бұрын
Lewis Loflin OK, I was wondering if you were pulling down. Useful to note that I think the 328 data sheet says pulling down is more reliable. Thanks again. (While I have your attention don’t forget to make the trailing edge phase control video ...Greatscott has done one recently, but the subject needs the LL treatment!
@LewisLoflin
@LewisLoflin 5 жыл бұрын
@@whitefields5595 Thanks. One can only pull down if using internal pullups. Again this illustrated leading and trailing edge. I normally would use falling. Thanks.
@WistrelChianti
@WistrelChianti 2 жыл бұрын
I came here hoping to find out about interrupt registers... I came away having learnt what volatile actually does, and found out that Triacs and SCRs exist and what they are, and having learnt about phase controlled limiting of AC power output... I'm not complaining.
@txkflier
@txkflier 2 жыл бұрын
My eyes glazed over at the 20 minute point..
@TheOldmankk
@TheOldmankk 9 жыл бұрын
Thanks pal, always learnt something from your clips.
@adilmachrouki4173
@adilmachrouki4173 8 жыл бұрын
Hello Lewis Loflin i work for long time to understand pin change int but it doesn't work i want to have code wich use pin 7 (on arduino uno ) as pin change int to turn on and off led on pin 13
@LewisLoflin
@LewisLoflin 8 жыл бұрын
+Adil Machrouki If pin 7 isn't a hardware interrupt pin it won't work unless you use what is called polling.
@cyber2244
@cyber2244 8 жыл бұрын
#include #include #include #include include all this and use attachPCINT(digitalPinToPCINT(pin no.),function, CHANGE); only work with CHANGE.
@tubeamplifiermk2305
@tubeamplifiermk2305 8 жыл бұрын
How about interrupts in software. How to do an ISR when, for example, specific amount of hardware timer ticks happened? Have you tried that with atmega328p (uno/nano)?
@anthonymayberry3354
@anthonymayberry3354 8 жыл бұрын
A stack is a "temporary permanent storage area"?
@LewisLoflin
@LewisLoflin 5 жыл бұрын
Just temporary. Thanks.
@evangelosbrouzoukis429
@evangelosbrouzoukis429 3 жыл бұрын
I don't know if you read those things, but you are not just quoting the manual here, are you? Nice to meet you, Sir.
@LewisLoflin
@LewisLoflin 3 жыл бұрын
I read the specs but built the circuits to see if they work. For example the manual never said NOT to use delay in the interrupt routines.
@christheother9088
@christheother9088 9 жыл бұрын
I would probably want to try a hall effect tach setup using interrupts to count rotations.. Is there a way to detect or calculate the shortest usable duration between events? Presumably you need some minimum processing time between interrupt events and when that goes to zero you are swamped!
@LewisLoflin
@LewisLoflin 9 жыл бұрын
***** The deal is while servicing an interrupt (ISR) other interrupts are ignored until a return is issued. If using say INTR0 and an interrupt comes in on INTR1 that will be serviced (if programed) afterward - but if multiple interrupts occurred on INTR1 they are lost.
@takedowntheccp.5167
@takedowntheccp.5167 4 жыл бұрын
hi ,can you add the chinese subtitle. I want study followed to you. thank you much.
@makissavaidis9046
@makissavaidis9046 9 жыл бұрын
how to read with interrupt a keyboard with network of resistors in a pin (or two? one for the int and one for the analogRead())
@LewisLoflin
@LewisLoflin 9 жыл бұрын
makis savaidis Not sure what you are asking. Are you referring to a PC keyboard? There is a library for that.
@jaakkooksa5374
@jaakkooksa5374 8 жыл бұрын
Can you debounce the buttons programmatically?
@LewisLoflin
@LewisLoflin 8 жыл бұрын
+Jaakko Oksa Yes you can.
@jaakkooksa5374
@jaakkooksa5374 8 жыл бұрын
+Lewis Loflin Thanks Lewis, I am just starting with Arduino. Ordered some Arduino cards, motors, micro switches etc. from China, waiting for them to arrive. I decided build an automated tea bag dipping machine for a first project :-)
@LewisLoflin
@LewisLoflin 8 жыл бұрын
Great!
@longdongsilver4719
@longdongsilver4719 3 жыл бұрын
Normally your ISR should be as fast and as short as possible. So it is just absurd to put a delay in an ISR.
@rolandberendonck3900
@rolandberendonck3900 3 жыл бұрын
As far as I know the compiler will even leave it out. But haven't tested it myself.
@davidw7015
@davidw7015 6 жыл бұрын
OFF topic: Your UTube audio is weak and muddy on MAX volume! ........ Well it's back when I pull the headphone plug partly out. This has happened on two UTube videos tonight. Others are fine. It repeats on those same videos and makes absolutely NO SENSE! Anyone experienced this?
@LewisLoflin
@LewisLoflin 6 жыл бұрын
This video has been out a while and I have better equipment than back then so I'll make an updated video on this subject.
@davidw7015
@davidw7015 6 жыл бұрын
Lewis, don't make any updates because of my experience. When the audio came back (partly pulling the headphone jack) I could easily understand your voice. There is a bit of noise but not bad. The PC speaker works like it should! The reason I posted is this is a strange effect. It occurs at exactly the same places on those videos that display it. On one video the ad at the beginning is just fine but the following audio is bad. Although it is good on the PC speaker and a partly pulled headphone jack a fully inserted headphone has this inability to play some sections of the audio that otherwise is fine on the PC speaker. I am an engineer and want to know how this can be possible. Maybe the left and right channels are 180 deg out of phase on some audio and are cancelling each other? Just my first guess.
@LewisLoflin
@LewisLoflin 6 жыл бұрын
Needs to be updated and additional material added. Thanks
@tombudd1281
@tombudd1281 5 жыл бұрын
Delaying for 5 seconds inside an ISR? Are you mad? I get this is a basic instructional video, but that would kill more sophisticated programs.
@LewisLoflin
@LewisLoflin 5 жыл бұрын
This is a demo to learn what interrupts are.
@cr6925
@cr6925 5 жыл бұрын
You can do whatever you like in an interrupt, including a long delay IF that's how you've chosen to use your interrupt.
LESSON 28: Tutorial for Programming Software Interrupts on Arduino
25:14
Level Up Your Arduino Code: External Interrupts
18:55
SparkFun Electronics
Рет қаралды 173 М.
SPONGEBOB POWER-UPS IN BRAWL STARS!!!
08:35
Brawl Stars
Рет қаралды 21 МЛН
Prank vs Prank #shorts
00:28
Mr DegrEE
Рет қаралды 10 МЛН
Parenting hacks and gadgets against mosquitoes 🦟👶
00:21
Let's GLOW!
Рет қаралды 13 МЛН
Bony Just Wants To Take A Shower #animation
00:10
GREEN MAX
Рет қаралды 7 МЛН
TL431 Under-Voltage, Over-Voltage Detection
8:35
Lewis Loflin
Рет қаралды 6 М.
MOSFETs and Transistors with Arduino
40:50
DroneBot Workshop
Рет қаралды 1 МЛН
Level Up Your Arduino Code: Timer Interrupts
17:22
SparkFun Electronics
Рет қаралды 228 М.
Arduino Uno to ATmega328 - Shrinking your Arduino Projects
37:17
DroneBot Workshop
Рет қаралды 787 М.
Arduino Basics 102: Control Structures, Variables, Interrupts
7:38
These Keys Shouldn't Exist | Nostalgia Nerd
19:32
Nostalgia Nerd
Рет қаралды 657 М.
Top Fifteen Mistakes People Make When Designing Prototype PCBs
12:26
Cosplay Light and Sound
Рет қаралды 147 М.
Arduino Timer Interrupts tutorial
19:05
eTech Tom
Рет қаралды 123 М.
SPONGEBOB POWER-UPS IN BRAWL STARS!!!
08:35
Brawl Stars
Рет қаралды 21 МЛН