Dec-20-2018, 01:05 AM
I have done this type of thing many times in the past, and that's my problem, it's sort of faded as exactly what has to be done.
I think there is plenty of documentation on how to use a timer with pi, google 'raspberry pi timer' brings up quite a bit.
I think it's a lot easier now then when I was doing similar work (but on TI msp430 or Microchip PIC).
I recall setting up registers on the timer, prior to starting, then first rising edge on GPIO triggers the timer to start, then next GPIO signal triggers timer to stop, the register of the timer can then be read to get the time.
Sorry so vague, take a look at the docs, also another moderator with more recent knowledge may pick up here.
I think there is plenty of documentation on how to use a timer with pi, google 'raspberry pi timer' brings up quite a bit.
I think it's a lot easier now then when I was doing similar work (but on TI msp430 or Microchip PIC).
I recall setting up registers on the timer, prior to starting, then first rising edge on GPIO triggers the timer to start, then next GPIO signal triggers timer to stop, the register of the timer can then be read to get the time.
Sorry so vague, take a look at the docs, also another moderator with more recent knowledge may pick up here.