8000 gps/README.md Add timing notes and wiring. · ubIQio/micropython-async@8b67270 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8b67270

Browse files
committed
gps/README.md Add timing notes and wiring.
1 parent bf9caac commit 8b67270

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

HD44780/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
This driver is for displays based on the Hitachi HD44780 driver: these are
44
widely available, typically in 16 character x 2 rows format.
55

6+
###### [Main README](../README.md)
7+
68
# 2. Files
79

810
* `alcd.py` Driver, includes connection details.

gps/README.md

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,31 @@ sentences on startup. An optional read-write driver is provided for
1414
MTK3329/MTK3339 chips as used on the above board. This enables the device
1515
configuration to be altered.
1616

17+
###### [Main README](../README.md)
18+
1719
## 1.1 Overview
1820

1921
The `AS_GPS` object runs a coroutine which receives GPS NMEA sentences from the
2022
UART and parses them as they arrive. Valid sentences cause local bound
2123
variables to be updated. These can be accessed at any time with minimal latency
2224
to access data such as position, altitude, course, speed, time and date.
2325

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+
2442
## 1.2 Basic Usage
2543

2644
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:
315333

316334
* `as_rwGPS.py` Supports the `GPS` class. This subclass of `AS_GPS` enables
317335
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.
318345

319346
## 3.2 Constructor
320347

@@ -352,7 +379,8 @@ The args presented to the fix callback are as described in
352379
* `baudrate` Arg: baudrate. Must be 4800, 9600, 14400, 19200, 38400, 57600 or
353380
115200. See below.
354381
* `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).
356384
* `enable` Determine the frequency with which each sentence type is sent. A
357385
value of 0 disables a sentence, a value of 1 causes it to be sent with each
358386
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.
410438
Particular care needs to be used if a backup battery is employed as the GPS
411439
will then remember its baudrate over a power cycle.
412440

441+
See also [notes on timing](./README.md#6-notes-on-timing).
442+
413443
## 3.4 Public bound variables
414444

415445
These are updated when a response to a command is received. The time taken for
@@ -472,6 +502,19 @@ the leading '$' character removed.
472502
It should return `True` if the sentence was successfully parsed, otherwise
473503
`False`.
474504

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+
475518
[MicroPython]:https://micropython.org/
476519
[frozen module]:https://learn.adafruit.com/micropython-basics-loading-modules/frozen-modules
477520
[NMEA-0183]:http://aprs.gids.nl/nmea/

0 commit comments

Comments
 (0)
0