This paper proposes a lightweight task scheduler useful for AVR-GCC-based embedded software projects on 8-bit ATmega microcontrollers. The task scheduler, which is mostly implemented in the C language, operates in a non-preemptive context-switching ma...
This paper proposes a lightweight task scheduler useful for AVR-GCC-based embedded software projects on 8-bit ATmega microcontrollers. The task scheduler, which is mostly implemented in the C language, operates in a non-preemptive context-switching manner, leveraging the stack-frame characteristics of AVR-GCC. A running task voluntarily issues a yield request when it must wait for a certain period, wait for an external event, or detects a yield flag set by interrupts such as a timer interrupt. Compared to FreeRTOS, the proposed scheduler consumes less than 50% of the memory and achieves execution times up to 67% shorter under the given experimental conditions. However, due to its non-preemptive nature, its response time to general interrupts is about 5.8 times slower than that of FreeRTOS, whereas its response time to timer interrupts is significantly superior.