Arduino is designed to be easy to use. But what penalty does that impose on instruction execution times? Find out how direct port bit manipulations can speed things up ten fold. Plus a little look at interrupts.
Good morning all…
Youtuber, shed dweller, solar charge controller aficionado
This site uses Akismet to reduce spam. Learn how your comment data is processed.
Why not use FREERTOS library and run progra pararell mean trun on off led on same time and then check output
Fascinating, and good info. Thanks.
hello sir
arduino nano in india
I basically do this stuff as my job lol oh man i love arduino timer interrupts
Thank you. Extremely well explained. Doesn't the Arduino also have a 'micros' function which keeps a count of the elapsed microseconds? Does this also use an interrupt?
Wouldn't using a more efficient compiler make a massive difference? Just a simple machine code loop then use an avr programmer.
Keeps calling high-level function calls โinstructionsโ, as if they were assembly language. Clearly doesnโt understand how much assembly C/C++ code actually gets compiled into. This video should be called โHow slow is C/C++?โ.
How do I read a complete port in a similar way that what you wrote to a port without using the Digital write function?
By the way these solderless prototype boards have very large internal capacitance that can alter the final results of the circuit.But writing in the arduino language seems like talking in some native's language that give things their own names and they known nothing other about 'em except ready made examples and sketches that are dont able even to alter them.
Remember that the sampling capability of your scope may not be linear relative to slowing down and speeding up the time scale. May I ask what is the sampling capability of your scope? And if it maintains the same sampling rate at this very slow time scale? You are doing great job BTW.
Thanks Julian, I wonder if the bootloader is taking up any cycles or resources.
Two things. C++ is closer to the metal but it is not assembler.
1) Each line of code will be 1 to n lines of assembler.
2) any function call in c++ pushes values onto the stack and the return pops those values off the stack… Or potentially anyway. Pushes and pops are moving registers to / from memory and take time.
3) use an xor to flip the bit. That should leave the other bits of the register alone.
For what it is, and what it costs, it is still an impressive little piece of hardware. Thanks for the insightful video,