@@ -14,13 +14,31 @@ sentences on startup. An optional read-write driver is provided for
14
14
MTK3329/MTK3339 chips as used on the above board. This enables the device
15
15
configuration to be altered.
16
16
17
+ ###### [ Main README] ( ../README.md )
18
+
17
19
## 1.1 Overview
18
20
19
21
The ` AS_GPS ` object runs a coroutine which receives GPS NMEA sentences from the
20
22
UART and parses them as they arrive. Valid sentences cause local bound
21
23
variables to be updated. These can be accessed at any time with minimal latency
22
24
to access data such as position, altitude, course, speed, time and date.
23
25
26
+ ### 1.1.1 Wiring
27
+
28
+ These notes are for the Adafruit Ultimate GPS Breakout. It may be run from 3.3V
29
+ or 5V. If running the Pyboard from USB it may be wired as follows:
30
+
31
+ | GPS | Pyboard |
32
+ | :---:| :----------:|
33
+ | Vin | V+ or 3V3 |
34
+ | Gnd | Gnd |
35
+ | Tx | X2 (U4 rx) |
36
+ | Rx | X1 (U4 tx) |
37
+
38
+ This is based on UART 4 as used in the test programs; any UART may be used. The
39
+ X1-Rx connection is only necessary if using the read/write driver to alter the
40
+ GPS device operation.
41
+
24
42
## 1.2 Basic Usage
25
43
26
44
In the example below a UART is instantiated and an ` AS_GPS ` instance created.
@@ -315,6 +333,15 @@ packets to GPS modules based on the MTK3329/MTK3339 chip. These include:
315
333
316
334
* ` as_rwGPS.py ` Supports the ` GPS ` class. This subclass of ` AS_GPS ` enables
317
335
writing a limited subset of the MTK commands used on many popular devices.
336
+ * ` ast_pbrw.py ` Test script which changes various attributes. This will pause
337
+ until a fix has been achieved. After that changes are made for about 1 minute,
338
+ then it runs indefinitely reporting data at the REPL and on the LEDs. It may
339
+ be interrupted with ` ctrl-c ` when the default baudrate will be restored.
340
+ LED's:
341
+ * Red: Toggles each time a GPS update occurs.
342
+ * Green: ON if GPS data is being received, OFF if no data received for >10s.
343
+ * Yellow: Toggles each 4s if navigation updates are being received.
344
+ * Blue: Toggles each 4s if time updates are being received.
318
345
319
346
## 3.2 Constructor
320
347
@@ -352,7 +379,8 @@ The args presented to the fix callback are as described in
352
379
* ` baudrate ` Arg: baudrate. Must be 4800, 9600, 14400, 19200, 38400, 57600 or
353
380
115200 . See below.
354
381
* ` update_interval ` Arg: interval in ms. Default 1000. Must be between 100 and
355
- 10000 .
382
+ 10000 . If the rate is to be increased see
383
+ [ notes on timing] ( ./README.md#6-notes-on-timing ) .
356
384
* ` enable ` Determine the frequency with which each sentence type is sent. A
357
385
value of 0 disables a sentence, a value of 1 causes it to be sent with each
358
386
received position fix. A value of N causes it to be sent once every N fixes.
@@ -410,6 +438,8 @@ in the event that the program terminates due to an exception or otherwise.
410
438
Particular care needs to be used if a backup battery is employed as the GPS
411
439
will then remember its baudrate over a power cycle.
412
440
441
+ See also [ notes on timing] ( ./README.md#6-notes-on-timing ) .
442
+
413
443
## 3.4 Public bound variables
414
444
415
445
These are updated when a response to a command is received. The time taken for
@@ -472,6 +502,19 @@ the leading '$' character removed.
472
502
It should return ` True ` if the sentence was successfully parsed, otherwise
473
503
` False ` .
474
504
505
+ # 6. Notes on timing
506
+
507
+ At the default baudrate of 9600 I measured a time of 400ms when a set of GPSV
508
+ messages came in. This time could be longer depending on data. So if an update
509
+ rate higher than the default 1 second is to be used, either the baudrate must
510
+ be increased or the satellite information messages should be disabled.
511
+
512
+ The PPS signal (not used by this driver) on the MTK3339 occurs only when a fix
513
+ has been achieved. The leading edge always occurs before a set of messages are
514
+ output. So, if the leading edge is to be used for precise timing, 1s should be
515
+ added to the ` timestamp ` value (beware of possible rollover into minutes and
516
+ hours).
517
+
475
518
[ MicroPython ] :https://micropython.org/
476
519
[ frozen module ] :https://learn.adafruit.com/micropython-basics-loading-modules/frozen-modules
477
520
[ NMEA-0183 ] :http://aprs.gids.nl/nmea/
0 commit comments