Advanced AVR 3 0 time management
Channel:
Subscribers:
579
Published on ● Video Link: https://www.youtube.com/watch?v=ez47kpPJfwI
The goals for Time Management on an embedded system are efficiency, responsiveness, and code-size. AVR-C library comes with a _delay_ms() and _delay_us() function that can be inserted between 2 lines of code to add a delay on the executions of these 2 lines of code, but it should be avoided at all cost because a 1ms delay is equivalent to 0.001/(1/16000000)=16000 CPU instructions wasted during that period of time if the CPU is clocked at 16MHz, and during that 1ms, the CPU is considered frozen. These 2 delay functions were intended for debug purpose, so by skimming through a source code, and looking for these 2 functions, one can easily assess if the code is trash or not.