Counting Troubles


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2005
    Posts
    5

    Default Counting Troubles

    I am trying to build a program that uses the count function on a pin of a 16f877A pic. The program must count to a number around 150,000 and with the 16 bit limit I know this is impossible. I have the program counting for one second before looping and adding the counts to CountTotal. In the end I would like to make it a number between 0 and 15,000. I am just having trouble wrapping my brain around an easy way of doing this. I have thought about taking the counts and dividing it by 10 and adding it to a countsTotal and taking the remainder and making it the starting number for counts on the next loop. If someone can show me a more efficient way of doing the math it would be much appreciated.

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Hi mungam753,

    Here's one way...

    32-bit Variables and DIV32, Hourmeter 99999.9
    http://www.picbasic.co.uk/forum/showthread.php?t=1942
    <br>
    DT

Similar Threads

  1. COUNT is not counting again
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 33
    Last Post: - 19th June 2009, 04:52
  2. Remain counting while sending out a pulse
    By ultiblade in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 10th January 2007, 15:51
  3. hardware counting while software runs
    By Archangel in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 2nd October 2006, 03:26
  4. continious counting process (capture)
    By asynch in forum General
    Replies: 1
    Last Post: - 17th February 2006, 07:42
  5. Counting Button Pushes
    By Tissy in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 27th November 2005, 22:10

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