Timer Question 16f877


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Mar 2003
    Posts
    41


    Did you find this post helpful? Yes | No

    Default Flashing status LED

    Timers are often too valuable to use just to blink a LED and adding a PAUSE statement can stuff up other parts of the code. What I do for such time insensitive issues is use a loop counter and the TOGGLE command.

    Activity VAR portb.0 ' activity LED
    LoopCntr VAR word

    MAIN:
    LoopCntr = Loopcntr + 1
    IF loopcntr//1000 = 0 THEN TOGGLE Activity

    your code goes here

    goto MAIN

    Depending on your system cycle times, you can adjust the divisor to get an appropriate flash rate.

    Cheers
    Brian
    Last edited by btaylor; - 8th November 2005 at 02:46.

  2. #2
    Join Date
    Dec 2004
    Location
    Scarborough UK
    Posts
    77


    Did you find this post helpful? Yes | No

    Smile Timers

    Hi Btaylor

    You say that timers are too valuable to use for an led, what kind of things do you use them for generaly ?, i ask because i have not used them before and dont know what they can be used for.
    In the case of the status led, i had the idea that i could somehow tell the timer to flash an led independant of my code, since charles told me how its done i dont think that will be possible, but, its introducing me to a new tool i might use in other projects.
    ---------------
    Bri
    Reading the datasheet & understanding it are two different things.

Similar Threads

  1. Simple Timer question
    By jimseng in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 24th September 2009, 23:12
  2. Timer / CCP Question
    By jamie_s in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd November 2005, 08:22
  3. Timer Question
    By aywho in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 22nd October 2005, 21:54
  4. 16F877 RAM Question
    By Art in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 6th August 2005, 11:47
  5. PIC 16F877 Question
    By koossa in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 5th August 2005, 18:06

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