Hi all,
i've got a question for you,
I've a Geiger-Muller Tube, an instrument for measuring radiations, which gives me an output in the form of a pulse of minimum 90uS,
i need to measure the number of pulses per second with the minimal possible error,
cause the pulse is minimum 90uS every second i can have at max
1.000.000uS / 90uS = 11.111 CPS (Counts Per Second)
this means that every 5 seconds i have to store the variable in an I2C memory (To be downloaded in a PC)
i was thinking to something like a loop to check for the pulses and store them in a RAM word-sized variable and use an interrupt that every 5 seconds store the variable into the I2C mem,
like this:
GEIGER VAR PORTD.0
CNT VAR WORD
ADD VAR WORD
CONTROL VAR BYTE
CONTROL = $A0
ADD = 0
CheckLoop:
IF GEIGEG THEN
CNT = CNT + 1
ENDIF
GOTO CheckLoop
IntHand:
I2CWRITE SDA,SCL,CONTROL,ADD,[CNT]
ADD = ADD + 1
CNT = 0
RESUME
Do you think it would suit me? (I don't know a lot about pic timing...)
there would be a better way to count or to check for the pulse? (i'm not interested in the pulse lenght)
(Please ignore the missing TMR or INTCONT)
Thank you,
Luca



(In the other topic)

Bookmarks