On Wed, Jan 30, 2019 at 2:54 PM Thomas Remmert
<[email protected]> wrote:
>
> Hello,
> I have a contact closure switch connected to P8_14.  When the switch is 
> activated, P8_14 is brought to ground.  I need to apply a time stamp when 
> this occurs with millisecond accuracy.
>
> 1) I have an adafruit GPS with 1 pps output.  I see the NMEA strings and have 
> confirmed the 1 PPS is working.
>
> 2) I have NTP running with my local GPS and 1PPS source configured.  (Maybe 
> chrony is a better choice?)
>
> 3) Just for testing, I am using the following python code:
>
> import Adafruit_BBIO.GPIO as GPIO
> import time
> import datetime
>
> GPIO.setup("P8_14", GPIO.IN, pull_up_down=GPIO.PUD_UP)
>
> #GPIO.add_event_detect("P8_14", GPIO.RISING, callback=my_callback, 
> bouncetime=1000)
>
> while True:
>         GPIO.wait_for_edge("P8_14", GPIO.RISING)
>         ttime = datetime.datetime.now()
>         print(ttime)
>
>
> When I compare my time with a very expensive DAQ, my time stamp is always off 
> by 2-4ms and it is not a consistent offset.  Does anyone have any other 
> thoughts at to how I might approach this?  I am needing to get the timestamp 
> accurate to 1ms.

Use the pps driver, setup an overlay like shown:

https://github.com/beagleboard/bb.org-overlays/blob/master/src/arm/PB-UART4-TESEO-LIV3F.dts#L63-L71

Then you can use the pps/gps tools...

Regards,

-- 
Robert Nelson
https://rcn-ee.com/

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CAOCHtYhXrg5FUXpnqxXLY8a18Cmn2w-47SE86xXwQiXYWCjN%3DA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to