Skip to main content

Posts

Showing posts with the label Multitasking

Protected Switching Power Supply for Development Boards

When I was prototyping a circuit in my college, one of the ground wire accidentally touched the positive of the power supply unit (PSU) and there by causing major damage to breadboard and PSU. This made me to develop this device that would avoid such accidents. This device uses LM2576 a switching regulator, LM317 a linear regulator, and ATMega8A for controlling the power supply unit. As this needs a real time protection, I have used OS for real time simultaneous protection. Protected Switching Power Supply: The block diagram of this device is shown below The AC step down transformer provides isolation from AC grid, the bridge rectifier and capacitor bank removes ripples to large extent, however small amount of ripples is present and this is not good for micro-controllers. In order to eliminate those ripples LM2576 is used. There is local linear voltage regulator to power the MCU, it also drives the relay and indicators. Why Operating System? As I

Preemptive Multitasking Scheduler for AVR

Hey there! Today we shall discuss about the scheduler, in this case its for AVR. During this summer vacation I was working on a project which needed multitasking to serve UI program. So I had to design a preemptive multitasking scheduler. If you ask why preemptive, I chose preemptive because there were tasks which would never terminate ( infinite loop functions ). I assume you know what multitasking is, now lets see what is scheduler and how it works... Scheduler: It is a program that schedules the execution of the tasks. When there are at least 3 or more tasks and there is a need for multitasking a scheduler needs to be implemented. It is usually written as ISR. Consider 3 tasks T1, T2, T3 namely. Assuming all tasks are of equal priority, initially the scheduler allows mcu to execute T1, after a certain or specified amount of time is elapsed the timer interrupts the execution and switches over to the ISR, before the scheduler takes over the context is saved to the