Timer interrupt
Periodic hardware tick for regular scheduler updates.
Hardware demo · low-level systems
Mini OS • Advanced OS • PIC microcontroller • Timer interrupts • Task scheduling
Restored hardware demo integrated into the same unified maximinfo.com portfolio menu as the other projects.
Embedded systems demo
A minimal scheduler demonstrating periodic ticks, flags, low-level timing, and interrupt-driven task execution.
Operating systems
Advanced operating-system video reference linked directly to the original YouTube video.
Periodic hardware tick for regular scheduler updates.
Interrupt service routine sets flags; the main loop executes pending tasks.
Microcontroller-oriented code structure with explicit timing control.
Source code
/* Minimal hardware scheduler sketch */
volatile unsigned char tick_1ms = 0;
volatile unsigned char task_a_ready = 0;
volatile unsigned char task_b_ready = 0;
void interrupt isr(void) {
if (TMR0IF) {
TMR0IF = 0;
TMR0 = 6;
tick_1ms++;
if ((tick_1ms % 10) == 0) task_a_ready = 1;
if ((tick_1ms % 50) == 0) task_b_ready = 1;
}
}
void main(void) {
init_timer0();
while (1) {
if (task_a_ready) { task_a_ready = 0; task_a(); }
if (task_b_ready) { task_b_ready = 0; task_b(); }
sleep_until_interrupt();
}
}