PDA

View Full Version : Multitasking



Tomexx
- 14th November 2004, 01:36
Hi,
How can I achive true multitasking on a 16F628A. Like running a main loop and another piece of code at thesame time.
An example appreciated.

Thanks,
Tom

Melanie
- 14th November 2004, 15:11
The only thing that truely runs at the same time are the other hardware components of your PIC... ie ADC, Comparators, USART, Timers etc. They all run independantly of your main program code. All other multitasking is performed by time-slicing your code between several tasks to give the appearance of running simultaneously. Naturally the faster the PIC, the better this illusion is carried out.

Take a room full of IBM 370 Mainframe, it doesn't have parallel processing capability, so it STILL performs just ONE instruction at a time... it just happens to do it damn quick, so a hundred users all end up thinking that the computer is serving their needs simultaneously with everyone elses... it's NOT... break it down and you discover that at any instant in time, it's still serving ONE user at a time.