the problem facing me is that microcontroller doesnot support multitasking
This is a subject with many answers.....
Look at the screen you are reading this on, while you have several other "windows" open right now.....
How many processors are in your PC???
Hit Ctrl-Alt-Del for a list of all of the other "tasks" that are running in the background??
orcasdeveloper, Please understand that all processors are capable of multi-tasking, it is just a matter of programming style. I have written all of my programs based on the style of multi-tasking.
Create a timer interrupt routine that decrements a variable. Call it isr_delay_1
Now do something like this:
isr_delay_1 = 45;
What you have done is create a delay between Do_Something and Do_Something_New that will be 45 times the timer interrupt rate. OK? COOL!!!
Pretty simple, YES. But what IF you do 15 other things while waiting?
With further questions, I will be happy to expand on this subject. The details are a bit long in explanation, but I will do my best to explain.
Think of this example:
Flash 5 LEDs at different rates, read a keyboard, read 5 analog channels, send serial data of current status at a regular update rate and write to an LCD display. Do all this while maintaining a real-time clock, handling alarms and time-outs along with whatever you choose to add to the list of TASKS you want.
Please understand this is easy, but it is a different style (a different way) of programming.
Just let me know if you want to learn how to do this with the SMALLEST processor you can think of.
Be aware: There is no limit to what you can do, just imagine it, create it and DO IT.
I will be watching for your response.
the Caveman smiles