{"id":1074,"date":"2013-07-18T00:29:19","date_gmt":"2013-07-18T00:29:19","guid":{"rendered":"http:\/\/xronosclock.com\/home\/?p=1074"},"modified":"2019-02-15T11:46:30","modified_gmt":"2019-02-15T11:46:30","slug":"time-via-gps","status":"publish","type":"post","link":"http:\/\/xronosclock.com\/home\/?p=1074","title":{"rendered":"Time via GPS"},"content":{"rendered":"<p><a href=\"http:\/\/xronosclock.com\/home\/wp-content\/uploads\/2013\/07\/20130718_0921101.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-1081\" alt=\"20130718_092110\" src=\"http:\/\/xronosclock.com\/home\/wp-content\/uploads\/2013\/07\/20130718_0921101.jpg\" width=\"622\" height=\"484\" srcset=\"http:\/\/xronosclock.com\/home\/wp-content\/uploads\/2013\/07\/20130718_0921101-300x233.jpg 300w, http:\/\/xronosclock.com\/home\/wp-content\/uploads\/2013\/07\/20130718_0921101.jpg 1024w\" sizes=\"(max-width: 622px) 100vw, 622px\" \/><\/a><\/p>\n<p>I don&#8217;t remember if I mentioned this, but I&#8217;m building a &#8220;MEGA Xronos Wall Clock&#8221; for myself, which will have four 24&#215;16 LED matrix displays, tons of sensors and other goodies \ud83d\ude42\u00a0 One thing I wanted it to do was automatically sync time. After doing some research simplest way seems to be via GPS receiver.\u00a0 Time library supports it so it was decided, and I ordered <a href=\"http:\/\/www.adafruit.com\/products\/746\">Ultimate GPS breakout module<\/a> from Adafruit!<br \/>\nIt arrived today in the &#8220;kit&#8221;, but there was virtually nothing to solder, just battery holder and some headers. I opted out to use my favorite polarized headers, and soldered 4 pin header to VIN,GND,RX and TX pins on the module.<br \/>\nUnfortunately I didn&#8217;t realize that this GPS &#8220;requires&#8221; SoftSerial mode, which basically doesn&#8217;t work with my ATMega1284p and 644p processors.<br \/>\nContinued after break&#8230;<\/p>\n<p><!--more--><br \/>\n<a href=\"http:\/\/xronosclock.com\/home\/wp-content\/uploads\/2013\/07\/ultimate_gps.jpg\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-1075\" alt=\"ultimate_gps\" src=\"http:\/\/xronosclock.com\/home\/wp-content\/uploads\/2013\/07\/ultimate_gps-300x260.jpg\" width=\"300\" height=\"260\" \/><\/a><\/p>\n<p>So first thing I did was to connect it to a PC via FTDI Serial to USB dongle.\u00a0 Of course I had to be creative with wires, because pinouts doesn&#8217;t exactly match.\u00a0 Anyway I fired serial monitor program (i.e. <a href=\"http:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/download.html\">Putty <\/a>or <a href=\"http:\/\/realterm.sourceforge.net\/\">RealTerm<\/a>) configured it to 9600 baud (default rate for this module) and voila I can see spitting out some text, a lot of it!<br \/>\nIt took about 10 minutes to get satellite fix, but it worked!\u00a0 I found <a href=\"http:\/\/www.visualgps.net\/visualgps\/\">Visual GPS Survey<\/a> program online that parses NMEA format text coming to from serial to meaningful information. Everything worked, I got Latitude, Longitude, etc.<\/p>\n<p>Not it was time to get my Xronos board to talk to the GPS. I immediately dismissed Adarfuits GPS library, it just seemed to complex for what I needed, and used interrupts, and other complex stuff \ud83d\ude42<br \/>\nFortunately Time library used <a href=\"http:\/\/arduiniana.org\/libraries\/tinygps\/\">TinyGPS library<\/a>, which is indeed very lightweight and straightforward.<br \/>\nIt also &#8220;requires&#8221; SoftwareSerial, however I was able to bypass it and use second serial UART on my chip. Unfortunately there are 2 issues with it. TX1 and RX1 pins are D10 and D11, but D11 is where I had my Infrared remote header connected.\u00a0\u00a0 But I really needed just D10, alas it was not connected to any headers. What&#8217;s worse it&#8217;s used by RFM12B module!<br \/>\nFor now I soldered a wire to IC&#8217;s pin 16 (D10) and connected it to the GPS TX pin.\u00a0 I also moved IR receiver to next available pin.<\/p>\n<p>Good news it works!\u00a0 I&#8217;m able to get time from Satellites and update RTC clock.\u00a0 Bad news RFM12B won&#8217;t work now \ud83d\ude41\u00a0 I&#8217;ve attempted to use regular serial pins (RX0\/TX0), but for some reason it didn&#8217;t work. I can&#8217;t tell what&#8217;s wrong because I cannot monitor serial output.\u00a0 Something for me to figure out in the future&#8230;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I don&#8217;t remember if I mentioned this, but I&#8217;m building a &#8220;MEGA Xronos Wall Clock&#8221; for myself, which will have [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1081,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[12],"tags":[],"class_list":["post-1074","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-work-in-progress"],"_links":{"self":[{"href":"http:\/\/xronosclock.com\/home\/index.php?rest_route=\/wp\/v2\/posts\/1074","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/xronosclock.com\/home\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/xronosclock.com\/home\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/xronosclock.com\/home\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/xronosclock.com\/home\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1074"}],"version-history":[{"count":7,"href":"http:\/\/xronosclock.com\/home\/index.php?rest_route=\/wp\/v2\/posts\/1074\/revisions"}],"predecessor-version":[{"id":3922,"href":"http:\/\/xronosclock.com\/home\/index.php?rest_route=\/wp\/v2\/posts\/1074\/revisions\/3922"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/xronosclock.com\/home\/index.php?rest_route=\/wp\/v2\/media\/1081"}],"wp:attachment":[{"href":"http:\/\/xronosclock.com\/home\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1074"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/xronosclock.com\/home\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1074"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/xronosclock.com\/home\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1074"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}