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: kdowsett@rpms.ac.uk WWW: http://kd.rpms.ac.uk/index.html