Giter Club home page Giter Club logo

sibo-sat_sync's Introduction

SIBO-Sat_Sync

Setting the system clock in Psion SIBO computers via an attached GPS


Series 3a Sync'd via GPS

Psion MC/Series 3/3a time setting via serially attached GPS receiver that outputs NMEA

Uses the CALL $058B to retrieve the "country data" structure - this includes UTC offset (in minutes) and "Summer Time" flag

NOTES: DATE IS NOT SET - ONLY TIME! FIX STATUS IS NOT CHECKED!

After opening the serial port we

  • get 255 bytes of NMEA
  • LOCate GPRMC, get GPS traceable UTC time from next 7-12 bytes
  • calc time (in seconds from 1/1/1970) from that and UTC offset and the Psion's "Summer Time" setting
  • Add a "delay processing time" fudge factor of ... 1s?
  • call OS function $038B to set the time

Time is expressed as:

1690166270 or $64BDE3F3 (32-bit number) - i.e. can be split into $64BD & $E3F3 as below

(as Hex $nnnnNNNN - split into hi & low part $nnnn & $NNNN or just by simple maths ;-) )

Tested working on the MC/Series 3/Series 3a

Assumes a GPS receiver attached to the serial port, running at 9600 8N1 Assumes the GPS has a valid fix

Assumes GPRMC or GPGGA sentences which contain UTC time after "GPRMC," or "GPGGA,"

$GPRMC,170805.000,A,5337.5945,N,00300.7381,W,0.00,281.17,250523,,,D7D $GPVTG,281.17,T,,M,0.00,N,0.01,K,D34 $PGTOP,11,36F $GPGGA,170806.000,5337.5945,N,00300.7381,W,2,9,1.13,4.2,M,49.5,M,0000,000040

The "GenGetCountryData" OS call may or may not be meaningless on the MC - certainly its clock has no concept of "Summer Time" like the 3/3a does. So stime% is set to 1 in the MC's OPL to get UTC to BST working (in summer!). Also (obviously!) all the graphics commands such as gAT, gPRINT, etc. are meaningless on the MC (I also removed them from the Series 3 code too).

I also had to change the sentence to search for to GPGGA rather than GPRMC on the S3 & MC, possibly something to do with serial overruns or maybe something else entirely...?

DISCLAIMER: THIS IS BARELY WORKING CODE! There is minimal error checking, lots of superflous variables & commented-out test code

USE AT YOUR OWN RISK!

Shared in the hope it might prove useful to someone. somewhere ;-)

:: Chris Farrow @zedstarr July 2023 ::

Series 3 sync'd via GPS

Even the old MC400 gets synchronised via GPS

sibo-sat_sync's People

Contributors

zedstarr avatar

Stargazers

 avatar

Watchers

 avatar

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.