Today 23:30
Forum: Proton Plus Compiler v3
Starter: xldaedalus
Views: 0
Replies: 20
Today 13:13
Forum: The Lounge
Starter: craig
Views: 0
Replies: 25
Go to last post By: Mellbreak
Today 11:30
Forum: Proton Plus Compiler v3
Starter: joesaliba
Views: 0
Replies: 6
Today 10:27
Forum: Timer Modules
Starter: See_Mos
Views: 0
Replies: 2
+ Reply to Thread
Page 1 of 4 123 ... LastLast
Results 1 to 10 of 34

Thread: Pulse counter using COUNTER command92 days old

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

    1 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
    Senior Member Henk57's Avatar
    Join Date
    Jan 2014
    Posts
    401
    Thumbs Up
    Received: 40
    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
    51
    Thumbs Up
    Received: 34
    Given: 4
    Total Downloaded
    5.95 MB

    1 Not allowed!

    Default Re: Pulse counter using COUNTER command

    Not able to understand code.

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

    1 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
    51
    Thumbs Up
    Received: 34
    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
    Senior Member Henk57's Avatar
    Join Date
    Jan 2014
    Posts
    401
    Thumbs Up
    Received: 40
    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
    51
    Thumbs Up
    Received: 34
    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,346
    Thumbs Up
    Received: 84
    Given: 23
    Total Downloaded
    3.86 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
    51
    Thumbs Up
    Received: 34
    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
    51
    Thumbs Up
    Received: 34
    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