You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yellow is pps (pulse per second), connect to GPIO4 (defined as PPS_PIN in main)
If use logic analyzer, need special grey USB with extra adaptor to connect to laptop USB on the other side
Running
build, then flash, then monitor to run
Testing
Leave GNSS by the window for clear view of sky
Connect GNSS to UART1 of board (above)
Wait to get good nmea sentences (need >= 4 connected satallites)
May need to leave running > 15 min to get signal
Testing pps
Can either connect GNSS pins to board or UART2USB adaptor (all except yellow pps pin)
Connect pps pin to logic analyzer interface analog 1, and connect manually ground in pair from analog 1 to ground of board or UART2USB adaptor
Run pulseview in Ubuntu
See output in A0 interface
Source code
Current description
app_main() flow
Configure UART1 of board to correct baud rate (9600)
install UART1 driver and set pins per global defines
Call configure_pps() to install isr handler for pps pulse and GPIO event queue
** (can't print in isr handler, need task (gpio_task_example())) to handle event from queue
Create gnss_task_read_nmeas() to read NMEA setences to ensure GNSS is connected
gnss_task_read_nmeas()
Just read and print NMEA strings when they come over UART interface
gpio_task_example()
Receive pps events from pps_isr_handler()
Currently just prints that received something
TODO Measure and store number of CPU cycles since last pps here!
TODO If > 2 second passed (maybe second hardware timer), output pulses based on timer to count up to the last stored number of CPU cycles in 1 second. Do this by creating a new output task and event queue.
TODO Determine the Timers available on the microcontroller, and what can be done with them, or what they can do (e.g. it can toggle a GPIO line) Select one.
pps_isr_handler()
Called when pps signal comes from GNSS rising edge
Add event to queue
TODO
Stop hardware timer since last pps received
Start new hardware timer
Send to gpio_task_example's event queue the number of cycles in last second