Searching \ for 'Counter + Timer' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/timers.htm?key=time
Search entire site for: 'Counter + Timer'.

Truncated match.
PICList Thread
'Counter + Timer'
1997\04\02@074744 by OU=COMPUGROUP_CN=RECIPIENTS_CN=EHE

flavicon
face
Hi.

Does anyone know how to count impulses and simultaneously count real
time ?
I want to use a 16C84 to measure the impulses from my Geiger-Mueller
counter
and display the rate on a LCD.

Sincerely
     Erik Hermann

1997\04\02@083837 by Keith Dowsett

flavicon
face
At 13:32 02/04/97 +0100, you wrote:
>Hi.
>
>Does anyone know how to count impulses and simultaneously count real
>time ?
>I want to use a 16C84 to measure the impulses from my Geiger-Mueller
>counter
>and display the rate on a LCD.
>
>Sincerely
>      Erik Hermann

It depends a little on your count rate.

If the count rate is low it's no problem. You can use the timer to generate
an interrupt every few milliseconds which is used to keep real time. The
time spent in the interrupt service routine is very small so the change of
missing a count is also small. The counts are fed into RB0 and that
interrupt  incrementc the counter.

Your main program simply watches the timer and every second it zeroes the
counter and updates the LCD.

For count rates over 5000 c.p.s. it's not so easy. You spend a significant
part of your time processing counts so the chances of missing one reach
several percent. For high count rates I would add a 4-bit TTL counter which
you can read and clear. This allows much higher count rates.

Fortunately most g.m. tubes have a paralysis time of several microseconds,
to the count rate will not exceed 100 kHz. This is well within the limits
for TTL.

Hope this helps,

Keith.
==========================================================
Keith Dowsett         "Variables won't; constants aren't."

E-mail: spam_OUTkdowsettTakeThisOuTspamrpms.ac.uk
  WWW: http://kd.rpms.ac.uk/index.html

1997\04\02@100429 by Bob Fehrenbach

picon face
"Hermann, Erik" wrote:
>I want to use a 16C84 to measure the impulses from my Geiger-Mueller
>counter

This can work if the count rate is low.

Typical pulses from a Geiger-Mueller tube are narrow so you may want to
trigger an external flip-flop with the Geiger-Mueller pulse, poll the
flip-flop output and reset it if a pulse is detected.



If the rate is too high for simple polling, I would use a part that had
multiple timers such as a 16C62 and use one of the counters to count the
pulses directly.  You can then poll the counter from within your timer
interrupt routine.

I have used this technique in conjunction with a V/F converter and also
in a tachometer application.  Works like a champ.


--
Bob Fehrenbach     Wauwatosa, WI     .....bfehrenbKILLspamspam@spam@execpc.com

1997\04\02@230615 by John Payson

picon face
> Typical pulses from a Geiger-Mueller tube are narrow so you may want to
> trigger an external flip-flop with the Geiger-Mueller pulse, poll the
> flip-flop output and reset it if a pulse is detected.

This approach isn't too great, in that a pulse that arrives simultaneously
with the reset may be missed even if there were no other pulses near it.  A
somewhat better approach is to have an output from the PIC feed the data in
of the latch, and the output of the latch feed a PIC input.  If the latch
output is inverting and the pins are RA1 and RA0 respectively, the latch may
be read and reset "atomically" with [assuming no other outputs on PORTA are
important, or that PORTA just contains another such "pair" on RA3 and RA2].

       rrf     PORTA,w
       movwf   PORTA
       xorwf   LastA,w
       xorwf   LastA
       ; Now "A" holds a 1 in bit 0 if there was a change, zero if not.  If
       ; there was another pair of inputs on RA3/RA2, bit 2 of A will show
       ; whether there was a change on that pair.

1997\04\02@230815 by John Payson

picon face
> For count rates over 5000 c.p.s. it's not so easy. You spend a significant
> part of your time processing counts so the chances of missing one reach
> several percent. For high count rates I would add a 4-bit TTL counter which
> you can read and clear. This allows much higher count rates.

As a rule, I like to avoid resetting counters.  It's usually much better to
let them free-run and "reset" them by keeping track of the old position.  By
doing this, the software may read and [logically] reset the count atomically,
with no risk of missing a poorly-timed count signal.

1997\04\03@043038 by efoc

flavicon
face
Why not approch the problem from a different angle and use the edge
triggered interupt...... Use the timer to give you a "window" of say .5
sec and use the inturupt to read another register incremented by the
inturupt triggered by the edge dectection. This way you can count the
number of pulses in a given time frame. Using this method also free's up
you main program loop to do things like update the LCD display Etc.



Cheers Peter ..........

Mailto:efocspamKILLspamcyberstop.net
+=================================+
| Listen to the Nothing, child,   |
| Listen to the Don'ts            |
| Listen to the Never Haves       |
| The Shouldn'ts, and the Won'ts  |
|                                 |
| Listen to Impossible            |
| then listen close to me:        |
|                                 |
| Anything can happen, child,     |
| ANYTHING can be.                |
|                                 |
| Poem by Sal Silverstein         |
+=================================+

More... (looser matching)
- Last day of these posts
- In 1997 , 1998 only
- Today
- New search...