COUNT Function


Closed Thread
Results 1 to 3 of 3

Thread: COUNT Function

  1. #1
    Join Date
    Jun 2005
    Posts
    29

    Default COUNT Function

    Hi everyone, I just wanna know if there's a define to change the COUNT instruction for counting high to low instead of low to high transitions. I know I can simply place a little transistor to invert the signal but if a define can do the trick...

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


    Did you find this post helpful? Yes | No

    Default

    i don't think so but you can do it in software easily using an internal Timer/Counter. There you'll be able to specify the transition you need

    Sometimes, depending the PIC, it's assign to PORTA.4/T0CKI pin.

    easy to implement and, by far, much code efficient.

    do a search with T0CKI and you should find something 'round here.
    Steve

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

  3. #3
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    For every high there has to be a low. If you know the state of your input pin at the beginning and end of the count process, cannot you get high-low counts from the low-high count?

    CountStart = PORTB.3
    Count 3, 1000, W1
    CountEnd = PORTB.3

    Paul Borgmeier
    Salt Lake City, Utah
    USA

Similar Threads

  1. Single button function
    By DynamoBen in forum mel PIC BASIC Pro
    Replies: 40
    Last Post: - 4th April 2020, 18:33
  2. Doubling the pusle count
    By malc-c in forum mel PIC BASIC Pro
    Replies: 43
    Last Post: - 17th May 2012, 13:17
  3. COUNT is not counting again
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 33
    Last Post: - 19th June 2009, 04:52
  4. Can't get COUNT to count
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 23rd March 2009, 23:14
  5. Count command
    By hawk72501 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 6th September 2005, 19:04

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