Multiple operations at once?


Closed Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Jun 2007
    Location
    england
    Posts
    15

    Default Multiple operations at once?

    hi does anyone know if it is at all possible to make a 16f877a do more than one operation at a time? ie, flash led on one port whilst looking for an input on another port and outputting to an lcd screen at the same time?
    any help would be greatfull, thanks

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    You will want to look at interrupts.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Or build your own time slicing system... not hard, but a bit time wasting

    Interrupt all the way!

    Timer interrupt is one of my favorite.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    Or simply a loop that does those three operations one after the other... since they happen so fast, to the user they will look simultaneous.
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

  5. #5
    Boomslang's Avatar
    Boomslang Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    Or build your own time slicing system... not hard, but a bit time wasting

    Interrupt all the way!

    Timer interrupt is one of my favorite.
    Bit time wasting...hahaha, I'm also a newby to PBP (used assembly untill now), but I think the OP need to learn a bit more about basic PIC operation, and try some of the sample programs to see how things happen in "real life".

  6. #6
    Join Date
    May 2007
    Posts
    65


    Did you find this post helpful? Yes | No

    Default

    I (and many/{all} of us) had exactly that question.
    Happily, interrupts were made for that, reacting at specific realtime events, such as: -A/D activity, USART I/O, QEI, Timers, Capture, Keyboard, switch, and so on.-

    There are 2 ways to handle interrupts:
    1.- The standard way is using 'ON INTERRUPT' statement & stuff. (see manual/forum)
    2.- The recommended way is using Darrel Taylor's 'Instant Interrupts', once you understand it, you'll enjoy it's benefits. (documentation in a thread in the forum).

    My personal choice is labeling tasks to optimize troubleshooting (if happen), code and memory. (why labeling? because PBP doesn't allow functions or sub/procedures structure)

    Rodrigo.
    "Beethoven had his critics too, see if you can name 3 of them"

  7. #7
    Join Date
    May 2007
    Posts
    65


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by RodSTAR View Post
    I (and many/{all} of us) had exactly that question.
    Happily, interrupts were made for that, reacting at specific realtime events, such as: -A/D activity, USART I/O, QEI, Timers, Capture, Keyboard, switch, and so on.-

    There are 2 ways to handle interrupts:
    1.- The standard way is using 'ON INTERRUPT' statement & stuff. (see manual/forum)
    2.- The recommended way is using Darrel Taylor's 'Instant Interrupts', once you understand it, you'll enjoy it's benefits. (documentation in a thread in the forum).

    My personal choice is labeling tasks to optimize troubleshooting (if happen), code and memory. (why labeling? because PBP doesn't allow functions or sub/procedures structure)

    Rodrigo.
    I forgot to specify... Interrupts don't need to be handled within a loop, they just 'pop-up' in realtime things happen.
    "Beethoven had his critics too, see if you can name 3 of them"

  8. #8
    Join Date
    Mar 2006
    Location
    INDIA
    Posts
    89


    Did you find this post helpful? Yes | No

    Default

    For Multiple work, you can make Multiple interrupt (pin) on port c or d or b then ON INTERRUPT, you can do as you wish.

    .

Similar Threads

  1. Multiple PICS from Same Crystal?
    By WOZZY-2010 in forum General
    Replies: 2
    Last Post: - 6th February 2010, 15:18
  2. Multiple RETURNS within a single subroutine
    By BrianT in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 21st June 2009, 16:43
  3. Problems controlling multiple pics
    By gandora in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 29th May 2007, 08:59
  4. Multiple PIC's with 1 crystal
    By puma in forum Schematics
    Replies: 11
    Last Post: - 20th March 2007, 17:02
  5. Multiple SERIN's
    By JoeR in forum mel PIC BASIC
    Replies: 4
    Last Post: - 6th October 2005, 22:22

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