Quote Originally Posted by HenrikOlsson View Post
Hi,
If that's the only thing the PIC will do this may work:
Code:
GEIGER VAR PORTD.0
CNT VAR WORD
ADD VAR WORD
CONTROL VAR BYTE

Start:
  CNT = 0
  COUNT GEIGER, 5000, CNT     'Count pulses for 5 seconds, store in CNT.
  Gosub SaveData
Goto Start

SaveData:
  'Save data to EEPROM here
RETURN
/Henrik Olsson.
Assuming you don't get over 65,535 pulses...
What happens if you overflow too early? I've never tried, but does COUNT kick out before 5 seconds if it hits 65,535, does it roll over...
And don't forget, COUNT is entirely dependant upon the PICs oscillator speed and will only count low to high transitions (not that either of those should matter much).