Multi-tasking


Closed Thread
Results 1 to 10 of 10

Thread: Multi-tasking

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default multiple timing routines

    You could use an incrementing, looping counter/timer that counts up to a number that is evenly divisible by all "timing" constants. After each increment, divide the counter total by the number of counts desired for each independent light (i.e. - 10 for one, 11 for another, 6 for a third). Check the modulus, and if it's 0, then set the associated countdown byte to turn on an output for the proper number of count cycles. Check your next constant and do the same. When you've done all 3, then decrement the countdown bytes and go to a routine to turn each output on if its associated countdown byte is non-zero. Rinse and repeat.

    Picster

  2. #2
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Hi,

    See these links:

    AN585 - A Real-Time Operating System for PICmicro™ Microcontrollers
    http://ww1.microchip.com/downloads/e...tes/00585b.pdf

    AN585 Source Code
    http://ww1.microchip.com/downloads/e...otes/00585.zip

    Best regards,

    Luciano

Similar Threads

  1. Multi Slow speed PWM and Instant Interrupts
    By DaveC3 in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 2nd November 2010, 12:50
  2. multi functions button press
    By malwww in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 27th May 2009, 00:12
  3. 16-48 pin Multi slow PWM
    By krohtech in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 28th March 2009, 03:28
  4. Multi diomencinal array
    By morphyn in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th February 2009, 21:19
  5. parallel port multi pic programmer?
    By SuB-ZeRo in forum Schematics
    Replies: 8
    Last Post: - 25th June 2005, 10:20

Members who have read this thread : 0

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