[SOLVED !] Pulse counter using COUNTER command

# Thread: Pulse counter using COUNTER command – 154 days old

1. 1

## 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. 0

## 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. 1

## Re: Pulse counter using COUNTER command

Not able to understand code.

4. 1

## 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. 0

## Re: Pulse counter using COUNTER command

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

6. 0

## 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. 0

## Re: Pulse counter using COUNTER command

Hi Henk,

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

8. 0

## 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.

9. 0

## Re: Pulse counter using COUNTER command

Thanks Joseph,

My code is
Ewrite 00,[x]

Is this correct?

10. 0

## Re: Pulse counter using COUNTER command

11. Got my work done .thanks

Page 1 of 4 123 ... Last