Today 01:42
Forum: Proton Plus Compiler v3
Starter: mjturner
Views: 0
Replies: 5
Yesterday 22:02
Forum: Proton Plus Compiler v3
Starter: Dave-S
Views: 0
Replies: 1
Go to last post By: mjturner
Yesterday 21:22
Forum: The Lounge
Starter: mjturner
Views: 0
Replies: 4
Yesterday 18:52
Forum: Website / Forum Issues
Starter: pe1pme
Views: 0
Replies: 77
Go to last post By: johngb
Yesterday 14:57
Forum: The Lounge
Starter: Mellbreak
Views: 0
Replies: 33
Yesterday 13:24
Forum: The Lounge
Starter: craig
Views: 0
Replies: 4
Yesterday 12:54
Forum: The Lounge
Starter: Henk57
Views: 0
Replies: 117
Yesterday 12:46
Forum: The Lounge
Starter: basparky
Views: 0
Replies: 7
Yesterday 10:42
Forum: Absolute Beginners Section
Starter: amod
Views: 0
Replies: 20
+ Reply to Thread
Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Pulse counter using COUNTER command30 days old

  1. #1
    Junior Member amod's Avatar
    Join Date
    Mar 2018
    Posts
    27
    Thumbs Up
    Received: 24
    Given: 4
    Total Downloaded
    5.95 MB

    0 Not allowed!

    Default Pulse counter using COUNTER command

    How I can use counter command for counting pulses on portd.3 of 16f877A.Iam making a 8 digit object counter.

  2. #2
    Member Henk57's Avatar
    Join Date
    Jan 2014
    Posts
    393
    Thumbs Up
    Received: 38
    Given: 35
    Total Downloaded
    192.60 MB

    0 Not allowed!

    Default Re: Pulse counter using COUNTER command

    Code:
     If spanning = 1 And pompen_aanuit = 1 Then ; spanning = pulses to count and pompen_aanuit, = the just a flag, for enable counts
            If telbit = 0 Then	
               Inc teller	        ;  counter
                DelayUS 100         ;  If needed
           EndIf
            telbit = 1 		' 2-divider (first part)
         Else                   
            telbit = 0		' 2-devider (second part) 
       EndIf
    Here's a little snippet for counting pulses.

    Henk

  3. #3
    Junior Member amod's Avatar
    Join Date
    Mar 2018
    Posts
    27
    Thumbs Up
    Received: 24
    Given: 4
    Total Downloaded
    5.95 MB

    0 Not allowed!

    Default Re: Pulse counter using COUNTER command

    Not able to understand code.

  4. #4
    Member Henk57's Avatar
    Join Date
    Jan 2014
    Posts
    393
    Thumbs Up
    Received: 38
    Given: 35
    Total Downloaded
    192.60 MB

    0 Not allowed!

    Default Re: Pulse counter using COUNTER command

    Code:
    If PORTD.3 = 1  Then            ; pulses to count on PORTD.3
            If telbit = 0 Then	
               Inc teller	        ;  counter
            telbit = 1 		' 2-divider (first part)
         Else                   
            telbit = 0		' 2-divider (second part) 
       EndIf
    Code simplified.

    Henk.

  5. #5
    Junior Member amod's Avatar
    Join Date
    Mar 2018
    Posts
    27
    Thumbs Up
    Received: 24
    Given: 4
    Total Downloaded
    5.95 MB

    0 Not allowed!

    Default Re: Pulse counter using COUNTER command

    Thanks Henk.it worked.
    How can I get rpm by this code?

  6. #6
    Member Henk57's Avatar
    Join Date
    Jan 2014
    Posts
    393
    Thumbs Up
    Received: 38
    Given: 35
    Total Downloaded
    192.60 MB

    0 Not allowed!

    Default Re: Pulse counter using COUNTER command

    It depends how often you want to read-out.

    Every second multiply the outcome of teller with 60.
    Every minute sit and wait, until minute passes.

  7. #7
    Junior Member amod's Avatar
    Join Date
    Mar 2018
    Posts
    27
    Thumbs Up
    Received: 24
    Given: 4
    Total Downloaded
    5.95 MB

    0 Not allowed!

    Default Re: Pulse counter using COUNTER command

    Hi Henk,

    How can I read and write single value in EPROM of 16f877A.

  8. #8
    Prolific Poster joesaliba's Avatar
    Join Date
    Sep 2004
    Posts
    2,293
    Thumbs Up
    Received: 75
    Given: 23
    Total Downloaded
    3.27 GB

    0 Not allowed!

    Default Re: Pulse counter using COUNTER command

    Amod,

    I would suggest to read the manual, put up a piece of code, publish it here and one can help where to fix.
    Regards

    Joseph

  9. #9
    Junior Member amod's Avatar
    Join Date
    Mar 2018
    Posts
    27
    Thumbs Up
    Received: 24
    Given: 4
    Total Downloaded
    5.95 MB

    0 Not allowed!

    Default Re: Pulse counter using COUNTER command

    Thanks Joseph,

    My code is
    Ewrite 00,[x]
    X=Eread 00

    Is this correct?

  10. #10
    Junior Member amod's Avatar
    Join Date
    Mar 2018
    Posts
    27
    Thumbs Up
    Received: 24
    Given: 4
    Total Downloaded
    5.95 MB

    0 Not allowed!

    Default Re: Pulse counter using COUNTER command

    Got my work done .thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. pulse counter with single LED to display total
    By Automods in forum Proton Plus Compiler v3
    Replies: 17
    Last Post: 14th July 2011, 16:05
  2. Counter pulse width/rise time?
    By GregZ in forum Proton Plus Compiler v3
    Replies: 1
    Last Post: 22nd July 2009, 16:20
  3. Counter command
    By amateurtje in forum Proton Plus Compiler v3
    Replies: 3
    Last Post: 22nd August 2008, 06:00
  4. Pulse counter using capture interrupts
    By HelpMe! in forum Proton Plus Compiler v3
    Replies: 10
    Last Post: 30th November 2007, 15:37
  5. Counter command option
    By AlanR in forum Wish List / Product Feedback
    Replies: 6
    Last Post: 2nd January 2006, 01:02

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts