Timer and 12F509


Results 1 to 5 of 5

Threaded View

  1. #2
    Join Date
    Mar 2006
    Location
    China
    Posts
    266


    Did you find this post helpful? Yes | No

    Default 16.0000000000 seconds or

    Hi,

    How accurate do you need this 16 seconds to be and how long is is the signal you are looking for?

    A simple way would be polling the pin in a tight loop with a short delay inside.

    Lets say you have a delay of 10 ms in the loop and do this loop 1600 times you should end up with a 16 second time window.

    If you need more accuracy yuu can adjust the delay by using delay_us if timing is critical..

    You didnt mention the clock frequency but unless it is really slow it will be hard to get 16 seconds time by just using a timer... in that case you need to reset it several time or count how many times it overflows... or something

    /me
    Last edited by Jumper; - 3rd November 2008 at 14: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