Best Microcontroller Projects


[?] Subscribe To This Site

XML RSS
Add to Google
Add to My Yahoo!
Add to My MSN
Subscribe with Bloglines


Home
Forum
Problem?-Solution
Projects Showcase
LCD-KEYS OnePort
PIC Introduction
PIC Programmer
Schematic Tool
PIC Projects
Tips & Techniques
PIC Tutorials
C Course
Digital Downloads
Store
My SECRET
Oscilloscopes
About Me
Search This Site
Freebies
Articles
Books
Resource Links
Site Map
Video du Jour
Rant/Rave
Privacy Policy
Contact
Terms of Use


Custom Search

Sign up for MicroZine:
''The'' Microcontroller Newsletter


:
:
Don't worry -- your e-mail address is totally secure. I promise to use it only to send you MicroZine
Enter your first Name and primary email address in the form above:

And receive absolutely FREE a full project for:


"Measuring Analogue Voltages
Without An ADC"

(Using only one pin).

Instant Download:
You Can
Get It Right Now

Warning: This project could be Removed
at any time.  

It will NOT be
available indefinitely SO

To avoid
disappointment get it:

Now



Remember this is a project with full description and fully debugged C Source code - and it's not available from the main website.

You can only get it through this newsletter.


To get exclusive access Enter your first name Name and primary email address Now in the form above.:

But wait !

There's more...

You'll receive more
free and exclusive reports as well as site information and site product updates.

Scroll up to the form above and sign up NOW.  Don't forget it's FREE and if you don't like it you can unsubscribe at any time.

Click Here Now to use the form above to get your Valuable information absolutely free.



Social Bookmarking
Click & Add:
add to BlinkBlink
add to Del.icio.usDel.icio.us
add to DiggDigg
add to FurlFurl
add to GoogleGoogle
add to SimpySimpy
add to SpurlSpurl
Bookmark at TechnoratiTechnorati
add to YahooY! MyWeb
Readers comments

"I wanted to thank
you so so so much
for all the information
you have provided in
your site it's

SUPERB and FANTASTIC."


- Ranish Pottath


"This site really is
the best and my favorite.
I find here many useful
projects and tips."

- Milan

bursach<at>gmail.com

Learn PIC C Now
Wondering how to program your next project using C and need a great start?


"Awesome site,
very, very easy and nice
to navigate!"


- Matt
matt_tr<at>
wolf359.cjb.net


"I am a newbie to PIC
and I wanted to say
 how great your
site has been for me."


- Dave

de_scott<at>bellsouth.net

Learn Microcontrollers
"Interested in
Microcontrollers?"


Sign up for The
Free 7 day guide:

FREE GUIDE : CLICK HERE

"Your site is a great
and perfect work.
congratulations."


- Suresh

integratredinfosys<at>
yahoo.com

"I couldn't find the correct
words to define
yourweb site.

Very useful, uncovered,
honest and clear.

Thanks so much for
your time and works.
Regards."


- Anon





Multitasking for PIC micros


"Download Your Essential
Guide To Logic Level MOSFETs"

"This is completely Free"

CLICK HERE to DOWNLOAD NOW

Sponsored Links...

Every time you turn on your computer it is multitasking and all the tasks that the PC performs are done using one instruction at a time.

Multitasking simply means switching attention from one task to another to make it appear that many tasks are happening all at the same time.

To make it work in a PC the task manager shares out the processing time between each task giving it a set amount of time and then moving on to the next task.  The key to its operation is the speed of the processor - the faster it is the more tasks it can handle and the more complex they can be.  For really difficult tasks a separate processor may be involved e.g. a graphics processor or a floating point co-processor (built into Pentium chips now).

You can use the same idea for a PIC microcontroller but since it is not going at GHz speeds you have to carefully decide what tasks you need to do and how to make it work distributing a fair share of processing time to each task (or peripheral).

RTOS

An RTOS (Real Time Operating System) is the ultimate multitasking system and it makes writing code easier using flag signals for inter-process communication and provides prioritized task scheduling.

The penalty for using an RTOS is that it takes up code space and RAM resource (and there is a learning curve as there are a lot of details for RTOS control and task switching).

"Download Your Essential
Guide To Logic Level MOSFETs"

"This is completely Free"

CLICK HERE to DOWNLOAD NOW

Sponsored Links...


On the web you can find RTOS code for PIC micros but this is probably more appropriate for the larger 18F series micros as RTOS's tend to require larger RAM and program resources (Ram is used to save all the current task data between task switching) so you won't fit many tasks into a mid-range PIC micro.

Simple Multiple task scheduling

You can make a simple multiple task scheduler using interrupts and careful coding and it won't need a huge amount of memory or resources.

The advantage of this method is that you have full control over the code generated and can therefore fit it into tiny devices.

The disadvantage is that you have to be completely on top of how your code is working.  With an RTOS time slices are assigned to each task giving them a fair share of processing time.  With this method you need to decide how tasks are assigned processor time as you design the code.

All you do is place all your code in an loop and use variables within the loop to test the conditions you need e.g polling an input.  Each test section is more or less equivalent to a task in an RTOS.

Interrupts

As with any multitasking system the heart of a task scheduler is the main timer that can assign time slices to each process.  For this method a timer interrupt e.g. Timer 0 operating every n milliseconds calls subordinate functions that require the highest priority.  Everything else is a low priority task that gets interrupted by the highest priority task.

When you use this multitasking method you have to balance the processing time of the interrupt routine against the processing needed by subordinate tasks so that enough time is spent doing the subordinate tasks.  All this really means is make the ISR (Interrupt Service Routine) as short as possible and as infrequent as possible. 

You can find more information from the website here.

Copyright © John Main 2006

Free to distribute if the article is kept complete.

http://www.best-microcontroller-projects.com

"Download Your Essential
Guide To Logic Level MOSFETs"

"This is completely Free"

CLICK HERE to DOWNLOAD NOW

Sponsored Links...


Jump from multitasking page to
Best-Microcontroller-Projects Home Page


Don't forget to Sign Up for your

Microcontroller Newsletter

With "Essential tips and techniques",

..."New Site Info" and more...

Including a free project :

How to drive an LCD and 12key keypad using "Only One 8 Bit Port" with no interface logic!...

(Works for any microcontroller)

This costs you : Nothing...
Just fill out the form below and you'll get full C source code and project schematic and description.



:
:
Don't worry -- your e-mail address is totally secure. I promise to use it only to send you MicroZine
Google
 
  Best Microcontroller projects.





<-- --> <-- -->