Multitasking Ideas


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2009
    Location
    Ankara,TURKEY
    Posts
    45

    Default Multitasking Ideas

    I want to do two or more processes at the same time, I searhed on net and find some ideas for multitasking with pic mcu.

    And what you think about it?
    Electrical & Electronic Engineering
    Undergraduate Student

  2. #2
    Join Date
    Sep 2007
    Location
    USA, CA
    Posts
    271


    Did you find this post helpful? Yes | No

    Default

    You can either use interrupts, or you can use a loop where you poll conditions to perform different operations.

    Just like Windows before dual processors, the PIC cannot multitask. It can only give time slices each task. It is up to you how to allocate the time slices.

  3. #3
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Actually I disagree... PICs can multitask...

    ... from another thread (to paraphrase a quote from BattleStar Galactica "all of this has happened before and will be again")...

    --- available from use of the SEARCH button ----

    Usually you need multiple or parallel processors to do multitasking. Most computers give the illusion of multitasking through a process of time-slicing - ie devoting a portion of the overall CPU time to a given job, then switching to another task. If done fast enough then you have your multi-tasking illusion (typical example is Microsoft Windows).

    Actually PICs do genuinely multitask quite well. They're able to sample an ADC channel, perform multiple Timer functions, execute PWM trains, catch data in the USART and perform Analogue Comparisons all genuinely simultaneously whilst your program is doing something completely different. It's called using the features provided within your PIC and the secrets of exploiting these multitasking features are... in the Datasheet.

  4. #4
    Join Date
    Sep 2007
    Location
    USA, CA
    Posts
    271


    Did you find this post helpful? Yes | No

    Default

    Well, ok, the peripherals can multitask, but the code execution cannot.

  5. #5
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    PICs can multitask...
    Yep. As far as hardware is concerned, they definitely can multi-task.

    As for firmware, nope. Not even the fastest controller can. They all execute program
    instructions line-by-line - no matter how creative the programmer is. And time-slicing
    is for sure not real multi-tasking
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  6. #6
    Join Date
    Jan 2009
    Location
    Ankara,TURKEY
    Posts
    45


    Did you find this post helpful? Yes | No

    Default

    I agree with him time slicing is not multitasking, it is another form of code execution line by line

    I think that if I use one more pic I can multiask comfortable. In my latest project I used a main controller Pic 18f452 and a slave pic 16f628 to do real multitask. And it really working

    I send slave pic processes serially,when it doing its process, main mcu does another things

    When the main processor doing program saving or something else, slave pic cut material,count etc. However it is a industrial machine,it work fine. Now it has no problem,hope it has no problem.
    Electrical & Electronic Engineering
    Undergraduate Student

  7. #7
    Join Date
    Jan 2009
    Location
    Ankara,TURKEY
    Posts
    45


    Did you find this post helpful? Yes | No

    Default

    And I couldn't use time slicing operation, for me it is so complex

    Thanks all
    Hasan.
    Electrical & Electronic Engineering
    Undergraduate Student

Similar Threads

  1. Any Ideas for a cheap touch sensor??????
    By rsocor01 in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 19th October 2013, 01:33
  2. Ideas on ir-code for dimmer
    By tirithen in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 14th February 2009, 00:22
  3. Timing inaccuracy - any ideas?
    By Optech in forum General
    Replies: 6
    Last Post: - 7th February 2008, 10:37
  4. Any ideas on how to accomplish this?
    By bartman in forum General
    Replies: 18
    Last Post: - 27th January 2007, 01:48
  5. A category for Project Ideas
    By Pic_User in forum Forum Requests
    Replies: 2
    Last Post: - 23rd June 2006, 08:29

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts