Giter Club home page Giter Club logo

usb-gps's Introduction

Build environment:

summon-arm-toolchain - https://github.com/esden/summon-arm-toolchain.git
perl on PC with the perl modules "Inline::C" and "Moose"

use "make" to build the STM32F4 code.  Flash with st-link utility (I've had the best success with their windows tool)


Hardware setup:

STM32F4 discovery board
Fastrax UP501 GPS
some 3.3V power source
20x4 LCD display connected via i2c gpio expander (I used sainsmart's)

wire GPS PPS pin to PA1 on the STM32F4 board
wire GPS serial to STM32F4's UART: GPS RX=STM32F4 PA2, GPS TX=STM32F4 PA3
wire power of GPS to a 3.3V supply (STM32F4 "3V" is 2.9V, and will not work)
connect STM32F4's USB port to PC
power STM32F4 via its debug USB port or via the 5V pin
wire LCD display to PA8=scl, PC9=sda and use external pull-up resistors to 5V

NTP setup:

The STM32F4 will show up as /dev/ttyACM0 (or some number other than 0) on the linux host.  Check dmesg to see:
[697103.547376] usb 2-1.1: Product: STM32 Virtual ComPort in FS Mode
[697103.574835] usb 2-1.1: Manufacturer: STMicroelectronics
[697103.601224] usb 2-1.1: SerialNumber: 00000000050C
[697103.627691] usb 2-1.1: adding 2-1.1:1.0 (config #1, interface 0)
[697103.627726] cdc_acm 2-1.1:1.0: This device cannot do calls on its own. It is not a modem.
[697103.657570] cdc_acm 2-1.1:1.0: ttyACM0: USB ACM device

Add to /etc/ntp.conf:
server 127.127.28.0 minpoll 4 maxpoll 4
fudge 127.127.28.0 time1 0.000 refid GPS stratum 0

Run as root (from this directory):
./ntp-shm </dev/ttyACM0

Verify NTP is getting data with "ntpq -p":
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*SHM(0)          .GPS.            0 l    9   16  377    0.000    0.006   0.008

(the reach column should be non-zero, and then "when" column will tell you the time of the last sample)


Source code:

(stm32f4) start by looking through src/main.c, src/pps.c, src/mytimer.c, src/uart.c
(PC) see the file ntp-shm


Results:

see http://dan.drown.org/stm32/

usb-gps's People

Contributors

ddrown avatar

Stargazers

Pieter du Preez avatar  avatar Royce Williams avatar Paul G avatar

Watchers

James Cloos avatar  avatar

Forkers

idaohang

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.