Need help with Counter/Timer application


Results 1 to 22 of 22

Threaded View

  1. #11
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by keithdoxey
    .....

    True... because of the way the program is written it will repeatedly service the PortB loop until such time as PORTB.0 = 1

    If you want BOTH loops to be serviced then there is a way of doing that. Admittedly they wont be serviced simultaneously but each will be repeatedly serviced.....

    I wanted to indicate that when a continious loop is in progress and you need that progress as long as your circuit is in operation, you will not be able to do other things.

    In my example above, "While" statements have loops inside.
    They are not a single line of instructions, they are loops.

    One must be completed so that other can run. But, if you need an infinite loop, it will never exit that loop.

    However, if we had a dual core PIC as Melanie mentioned or quad core, then you can do a simple thing as below. Say CORE1, CORE2, CORE3 etc. are new commands of PBP's 2010 version.


    Code:
    CORE1    'Separate Job Handler.
    
    While PORTB.0 = 0 
       Do a loop here....
    Wend
    
    END CORE1
    
    CORE2     'Separate Job Handler.
    
    While PORTB.A = 1 
       Do a loop here....
    Wend
    
    END CORE2
    
    
    CORE3      'Separate Job Handler.
    ...
    END CORE3
    
    ..
    ...
    ....
    
    etc...
    they all work simultaneously.


    Am I being too much imaginery here?
    Last edited by sayzer; - 1st September 2006 at 10:24.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

Similar Threads

  1. Simple TMR1 application example needed
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 4th February 2010, 09:52
  2. Unusual Interrupts Application Problem
    By Joe Rocci in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 8th May 2009, 11:55
  3. PIC16F877A for application in mobile robot...
    By mcbeasleyjr in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 30th January 2009, 14:47
  4. DS1307 automotive application
    By DynamoBen in forum Schematics
    Replies: 10
    Last Post: - 31st August 2006, 00:33
  5. Timer Application
    By charudatt in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 16th February 2004, 06:05

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