@@ -811,11 +811,15 @@ These tests allow NMEA parsing to be verified in the absence of GPS hardware:
811
811
812
812
# 7. Notes on timing
813
813
814
- At the default baudrate of 9600 I measured a transmission time of 400ms when a
815
- set of GPSV messages came in. This time could be longer depending on data. So
816
- if an update rate higher than the default 1 second is to be used, either the
817
- baudrate should be increased or satellite information messages should be
818
- disabled.
814
+ At the default 1s update rate the GPS hardware emits a PPS pulse followed by a
815
+ set of messages. It then remains silent until the next PPS. At the default
816
+ baudrate of 9600 the UART continued receiving data for 400ms when a set of GPSV
817
+ messages came in. This time could be longer depending on data. So if an update
818
+ rate higher than the default 1 second is to be used, either the baudrate should
819
+ be increased or satellite information messages should be disabled.
820
+
821
+ The accuracy of the timing drivers may be degraded if a PPS pulse arrives while
822
+ the UART is still receiving. The update rate should be chosen to avoid this.
819
823
820
824
The PPS signal on the MTK3339 occurs only when a fix has been achieved. The
821
825
leading edge occurs on a 1s boundary with high absolute accuracy. It therefore
@@ -854,26 +858,27 @@ Sources of variable error:
854
858
* Inaccuracy in the ` ticks_us ` timer (significant over 1 second).
855
859
856
860
With correct usage when the PPS interrupt occurs the UART will not be receiving
857
- data (this can affect ISR latency). Consequently, on the Pyboard, variations in
858
- interrupt latency are small. Using an osciloscope a normal latency of 15μs was
859
- measured with the ` time ` test in ` as_GPS_time.py ` running. The maximum observed
860
- was 17μs.
861
+ data (this can substantially affect ISR latency variability ). Consequently, on
862
+ the Pyboard, variations in interrupt latency are small. Using an osciloscope a
863
+ normal latency of 15μs was measured with the ` time ` test in ` as_GPS_time.py `
864
+ running. The maximum observed was 17μs.
861
865
862
866
The test program ` as_GPS_time.py ` has a test ` usecs ` which aims to assess the
863
867
sources of variable error. Over a period it repeatedly uses ` ticks_us ` to
864
868
measure the time between PPS pulses. Given that the actual time is effectively
865
869
constant the measurement is of error relative to the expected value of 1s. At
866
- the end of the measurement period it calculates some simple statistics on the
867
- results. On targets other than a 168MHz Pyboard this may be run to estimate
870
+ the end of the measurement period the test calculates some simple statistics on
871
+ the results. On targets other than a 168MHz Pyboard this may be run to estimate
868
872
overheads.
869
873
870
- Assuming the timing function has a similar latency to the ISR there is likely
871
- to be a 30μs lag coupled with ~ +-35μs (SD) jitter largely caused by inaccuracy
872
- of ` ticks_us ` over a 1 second period. Note that I have halved the jitter time
873
- on the basis that the timing method is called asynchronously to PPS: the
874
- interval will centre on 0.5s. The assumption is that inaccuracy in the
875
- ` ticks_us ` timer measured in μs is proportional to the duration over which it
876
- is measured.
874
+ The timing method ` get_t_split ` measures the time when it is called, which it
875
+ records as quickly as possible. Assuming this has a similar latency to the ISR
876
+ there is likely to be a 30μs lag coupled with ~ +-35μs (SD) jitter largely
877
+ caused by inaccuracy of ` ticks_us ` over a 1 second period. Note that I have
878
+ halved the jitter time on the basis that the timing method is called
879
+ asynchronously to PPS: the interval will centre on 0.5s. The assumption is that
880
+ inaccuracy in the ` ticks_us ` timer measured in μs is proportional to the
881
+ duration over which it is measured.
877
882
878
883
[ MicroPython ] :https://micropython.org/
879
884
[ frozen module ] :https://learn.adafruit.com/micropython-basics-loading-modules/frozen-modules
0 commit comments