hardware counting while software runs


Closed Thread
Results 1 to 6 of 6

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    And depending wich PIC you're using you may have 1,2,3,... Timer/Counter who can work with external Clock. Be sure the PIC you select provide you at least 2 of these with external Clock Source.

    Or there's still this interrupt on something stuff.

    @Sayzer
    @ DEVICE HS_OSC,WDT_ON,PROTECT_OFF,CPD_ON,PWRT_ON,BOD_ON
    You know what i want to say now
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default

    Yeap, I forgot to say that the code above is for 16F877-20Mhz.

    Also,

    Quote Originally Posted by mister_e
    @Sayzer

    @ DEVICE HS_OSC,WDT_ON,PROTECT_OFF,CPD_ON,PWRT_ON,BOD_ON
    I know what you mean Steve! I will never forget.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  3. #3
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default HMMMMMMMMmmmmmmm

    Thanks,
    I will take this code home and chew on it a while . . . . I am not manipulating data in an lcd, rather I am using it to control hardware.something like so:

    x var byte

    main:
    if porta.0 !=0 then
    pause50
    DoSomthing
    else
    endif
    goto main


    DoSomething:
    for x = 50 to 0 step - 1
    goto encoder
    portB.5 low
    next x
    return

    encoder:
    Portb.5 high ' to power up encoder
    some code here to count encoder subtracting code from var X
    return

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Joe S.
    .....


    main:
    if porta.0 !=0 then
    pause50
    DoSomthing 'is a goto not a gosub
    else
    endif
    goto main


    DoSomething:
    for x = 50 to 0 step - 1
    goto encoder 'another one here
    portB.5 low
    next x
    return

    encoder:
    Portb.5 high ' to power up encoder
    some code here to count encoder subtracting code from var X
    return

    I guess this was a quick example.
    Check "goto" !
    Last edited by sayzer; - 2nd October 2006 at 03:29.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

Similar Threads

  1. Benefits of hardware usart over software?
    By sccoupe in forum Serial
    Replies: 2
    Last Post: - 19th March 2009, 01:16
  2. Hardware or Software
    By bmagistro in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 16th March 2009, 23:22
  3. Software Stack
    By yasser hassani in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th December 2007, 10:04
  4. IR software & hardware basics
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 6th May 2007, 10:05
  5. Programming software for PicAll Hardware
    By bcd in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 16th July 2006, 08:15

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