Skip to main content


Showing posts from December, 2016

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 specified location in…

DFT Audio Analyser

The idea here is to implement DFT on AVR 8 bit mcu platform with simplest algorithm and achieve real time display of Fourier transform of audio signal.

Before we get started with this project here are few prerequisites you need to know DFT - mathematical representation and significanceAVR micro-controller: fundamentals and C programmingAudio electronicsWell if you are aware about the above mentioned topics, lets get started.

As we know 'sound' is caused due to physical disturbance in a medium, these disturbances are created using a speaker which converts sinusoidal electrical signal to displacement. Hence all the sound waves are made from sinusoidal signals. Also any wave can be represented as the weighted sum of sinusoids with angular frequency multiples of base frequency, the below represents mathematical form of any waveform.Here the weights are the amplitudes of the corresponding frequency. The DFT algorithm finds these weights for their corresponding frequency when unknown s…