{"id":27,"date":"2019-08-11T16:27:47","date_gmt":"2019-08-11T21:27:47","guid":{"rendered":"http:\/\/localhost\/~bskrentny\/wp\/?page_id=27"},"modified":"2019-08-18T22:16:59","modified_gmt":"2019-08-19T03:16:59","slug":"archive","status":"publish","type":"page","link":"https:\/\/n9loo.com\/wp\/archive\/","title":{"rendered":"Archive &#8211; Old stuff"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>GPS Project Pics<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-gallery columns-3 is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\"><li class=\"blocks-gallery-item\"><figure><a href=\"https:\/\/n9loo.com\/wp\/wp-content\/uploads\/2019\/08\/MVC-108E.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"320\" height=\"240\" src=\"https:\/\/n9loo.com\/wp\/wp-content\/uploads\/2019\/08\/MVC-108E.jpg\" alt=\"\" data-id=\"36\" data-link=\"https:\/\/n9loo.com\/wp\/archive\/mvc-108e\/\" class=\"wp-image-36\" srcset=\"https:\/\/n9loo.com\/wp\/wp-content\/uploads\/2019\/08\/MVC-108E.jpg 320w, https:\/\/n9loo.com\/wp\/wp-content\/uploads\/2019\/08\/MVC-108E-300x225.jpg 300w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/a><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><a href=\"https:\/\/n9loo.com\/wp\/wp-content\/uploads\/2019\/08\/MVC-110E.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"320\" height=\"240\" src=\"https:\/\/n9loo.com\/wp\/wp-content\/uploads\/2019\/08\/MVC-110E.jpg\" alt=\"\" data-id=\"37\" data-link=\"https:\/\/n9loo.com\/wp\/archive\/mvc-110e\/\" class=\"wp-image-37\" srcset=\"https:\/\/n9loo.com\/wp\/wp-content\/uploads\/2019\/08\/MVC-110E.jpg 320w, https:\/\/n9loo.com\/wp\/wp-content\/uploads\/2019\/08\/MVC-110E-300x225.jpg 300w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/a><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><a href=\"https:\/\/n9loo.com\/wp\/wp-content\/uploads\/2019\/08\/MVC-111E.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"320\" height=\"240\" src=\"https:\/\/n9loo.com\/wp\/wp-content\/uploads\/2019\/08\/MVC-111E.jpg\" alt=\"\" data-id=\"38\" data-link=\"https:\/\/n9loo.com\/wp\/archive\/mvc-111e\/\" class=\"wp-image-38\" srcset=\"https:\/\/n9loo.com\/wp\/wp-content\/uploads\/2019\/08\/MVC-111E.jpg 320w, https:\/\/n9loo.com\/wp\/wp-content\/uploads\/2019\/08\/MVC-111E-300x225.jpg 300w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/a><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><a href=\"https:\/\/n9loo.com\/wp\/wp-content\/uploads\/2019\/08\/MVC-112E.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"320\" height=\"240\" src=\"https:\/\/n9loo.com\/wp\/wp-content\/uploads\/2019\/08\/MVC-112E.jpg\" alt=\"\" data-id=\"39\" data-link=\"https:\/\/n9loo.com\/wp\/archive\/mvc-112e\/\" class=\"wp-image-39\" srcset=\"https:\/\/n9loo.com\/wp\/wp-content\/uploads\/2019\/08\/MVC-112E.jpg 320w, https:\/\/n9loo.com\/wp\/wp-content\/uploads\/2019\/08\/MVC-112E-300x225.jpg 300w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/a><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><a href=\"https:\/\/n9loo.com\/wp\/wp-content\/uploads\/2019\/08\/MVC-113E.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"320\" height=\"240\" src=\"https:\/\/n9loo.com\/wp\/wp-content\/uploads\/2019\/08\/MVC-113E.jpg\" alt=\"\" data-id=\"40\" data-link=\"https:\/\/n9loo.com\/wp\/archive\/mvc-113e\/\" class=\"wp-image-40\" srcset=\"https:\/\/n9loo.com\/wp\/wp-content\/uploads\/2019\/08\/MVC-113E.jpg 320w, https:\/\/n9loo.com\/wp\/wp-content\/uploads\/2019\/08\/MVC-113E-300x225.jpg 300w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/a><\/figure><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>PIC Microcontroller<\/strong><\/h2>\n\n\n\n<p class=\"has-background has-drop-cap has-pale-cyan-blue-background-color\"> I have been involved with the PIC microcontrollers by <a href=\"http:\/\/www.microchip.com\/\">Microchip Technology, Inc<\/a>. since early 1999.\u00a0 I got interested using the PIC after using the Basic Stamp II by <a href=\"http:\/\/www.parallaxinc.com\/\">Parallax, Inc<\/a>.\u00a0  I wrote several clock programs using the BSII and wanted to move the  code over to the PIC instead of tying up my BSII module.\u00a0 I then was  interested in being able to compile my BSII programs for the PIC so I  didn&#8217;t have to spend much time learning assembly language.\u00a0 That&#8217;s when I  found the PicBasic Pro Compiler by <a href=\"http:\/\/www.melabs.com\/\">microEngineering Labs, Inc<\/a>.<br><br><strong><em>Note<\/em><\/strong> &#8211; The two editors I used for programming were <em>Programmers File Editor<\/em> and <em>PicMatePro<\/em> (no longer available).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"> <strong>First Project<\/strong><\/h3>\n\n\n\n<p class=\"has-background has-drop-cap has-very-light-gray-background-color a:link { color: royalblue; }\">My first &#8216;real&#8217; PIC project was a remote GPS display.\u00a0 I mainly wanted  to have a compass heading, but I also included the time and a MPH  reading.\u00a0 As you can see in these pictures, I have enclosed the project in an old floppy disk case. \u00a0 I used a 4&#215;20 serial LCD display (<a href=\"http:\/\/www.seetron.com\/bpp420_1.htm\">BPP-420L<\/a>) from <a href=\"http:\/\/www.seetron.com\/\">Scott Edwards Electronics, Inc.<\/a>\u00a0  Since the backlight is software selectable, I have a momentary  push-button that toggles the backlight on and off.\u00a0 I wired the DB-9  connector to provide external power for normal operation in the  vehicle.\u00a0 I also have installed a 9-volt battery to provide &#8216;remote&#8217;  operation.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Source Code<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>'PROGRAM: eagle_gps7bl.pbp\n'\n'Modified by Brian Skrentny, December 1999\n'Modified last on June 27, 2000\n'https:\/\/n9loo.com\/\n'previously published at http:\/\/bskrentny.com\/\n'\n'Program to read position data from a Eagle Explorer GPS and display it on\n'a Scott Edwards 4 X 20 LCD display at 9600 baud using PIC 16C558.\n'\n'Original program written by Decade Engineering\n'to work with the Garmin and LCD display.\n'\n'\n' *****  Scott Edwards 4X20 LCD control codes  *****\n\n'Home_Cursor  \tCON 01 \t\t\t'Home the display cursor\nBigchr  \tCON 02 \t\t\t'Start big number display\n'Blank_Cursor \tCON 04 \t\t\t'Turn off cursor\n'Underline_Cursor CON 05 \t\t'Underline cursor\n'Blink_Blk_Cursor CON 06 \t\t'Blinking block cursor\n'Back_Space  \tCON 08 \t\t\t'Back space the cursor\n'Line_Feed  \tCON 10 \t\t\t'Move down one row\n'Vertical_Tab \tCON 11 \t\t\t'Move up one row\nClear_Screen \tCON 12 \t\t\t'Clear the screen (Form feed)\n'Carriage_Return CON 13 \t\t'Return to start of next line\nblon\t\tCON 14 \t\t\t'Turn backlight on\nbloff\t\tCON 15 \t\t\t'Turn backlight off\npcurs\t\tCON 16 \t\t\t'Position cursor at xxx\n'Clear_Column \tCON 17 \t\t\t'Clear a column\ndpin\t\tCON 6 \t\t\t'LCD display pin, PIC pin 12\nN9600   \tCON 6\t\t\t'LCD Baudrate (9600,n,8,1)\nN29600   \tCON $4054\t\t'LCD Baudrate (9600,n,8,1)\nGPS_Pin  \tCON 0\t\t\t'GPS data input pin, PIC pin 6 (PORTB.0)\nN4800   \tCON 16572\t\t'GPS baudrate (4800)\ntz\t\tCON 5\t\t\t'Time zone (4=EST,5=CST,6=MST,7=PST) - st flag adds 1\n\nDEFINE \tCHAR_PACING\t2500\t\t'2500 microsecond delay for LCD\n\ntime\tvar byte(4) \t'Unformatted time: 4533= XX:45:33 UTC\nhr\tvar byte\t'Hour in CST or CDT - set using tz\nCse\tvar word\t'Whole number course (no decimal)\ncmp\tvar byte(2)\t'Course direction\nSpd\tvar word\t'Whole number speed in kts.(no decimal)\nSpdt\tvar byte\t'Tenths position\nSpeed\tvar byte\t'Speed in MPH\ngpsfix  var byte\t'GPS status, A = good data, V = bad data\nupdate\tvar bit\t\t'status flag\nindent\tvar bit\t\t'indent flag\nst\tvar bit\t\t'standard time flag\nbl\tvar bit\t\t'backlight flag\n'\n'-----------------------------------------------------------------------------\ninit:\n pause 2000\n bl = 0\n'-----------------------------------------------------------------------------\n'\n'-----------------------------------------------------------------------------\nif PORTB.1 then\t\t'check switch\/jumper if Standard or Daylight savings time\n\tst = 1\t\t'switch\/jumper off - standard time\nelse\n\tst = 0\t\t'switch\/jumper on - daylight savings time\nendif\n'\n'-----------------------------------------------------------------------------\n'\nid:\n gosub clrscr\t\t\t\t'Clear display\n serout dpin,N9600,[pcurs,71,\"N9LOO\"]\n update = 1 : indent = 0\t\t'reset flags\n'\n'-----------------------------------------------------------------------------\n'\nget_data:\n if PORTB.2 = 0 then blight\t\t'Check for backlight button (PIC pin 8)\n serin2 GPS_Pin,N4800,2100,no_data,[wait(\"RMC,\"),dec2 hr,str time\\4,skip 1,gpsfix,wait(\"W,\"),dec Spd,dec Spdt,dec Cse]\n if update = 0 then id\n if gpsfix=\"A\" then good_fix\n if gpsfix=\"V\" then bad_fix\ngoto get_data\n'\n'-----------------------------------------------------------------------------\n'\nbad_fix:\n gosub clrscr\t\t\t\t\t\t'Clear display\n serout dpin,N9600,[pcurs,88,\"PLEASE WAIT\"]\t\t'data not reliable\n serout dpin,N9600,[pcurs,107,\"WHILE POSITION\"]\n serout dpin,N9600,[pcurs,125,\"IS BEING ACQUIRED\"]\n update = 0\n goto get_data\n'\n'-----------------------------------------------------------------------------\n'\ngood_fix:\n Spd = (Spd * 10) + Spdt\t\t'Multiply Knots by 10 (includes tenths for accuracy)\n Speed = (Spd *\/ $0127) \/ 10\t\t'Multiply by 1.151 to convert Knots to MPH and \/ 10\n if hr > ((tz - 1) + st) then\t\t'check if next day (UTC)\n\thr = hr - (tz + st)\t\t'subtract hr's according to time zone (5=CDT, 6=CST)\n else\n\thr = 24 - ((tz + st) - hr)\t'subtract hr's from previous day\n endif\n\n if cse &lt; 23 then north\t\t\t\t'determine heading\n if cse &lt; 68 then northeast\n if cse &lt; 113 then east\n if cse &lt; 158 then southeast\n if cse &lt; 203 then south\n if cse &lt; 248 then southwest\n if cse &lt; 293 then west\n if cse &lt; 338 then northwest\n if cse &lt; 361 then north\n\nnorth:\n cmp(0) = \"N\" : cmp(1) = \" \" : indent = 1\t'N\ngoto dsp_cmphd\n\nnortheast:\n cmp(0) = \"N\" : cmp(1) = \"E\"\t\t\t'NE\ngoto dsp_cmphd\n\neast:\n cmp(0) = \"E\" : cmp(1) = \" \" : indent = 1\t'E\ngoto dsp_cmphd\n\nsoutheast:\n cmp(0) = \"S\" : cmp(1) = \"E\"\t\t\t'SE\ngoto dsp_cmphd\n\nsouth:\n cmp(0) = \"S\" : cmp(1) = \" \" : indent = 1\t'S\ngoto dsp_cmphd\n\nsouthwest:\n cmp(0) = \"S\" : cmp(1) = \"W\"\t\t\t'SW\ngoto dsp_cmphd\n\nwest:\n cmp(0) = \"W\" : cmp(1) = \" \" : indent = 1\t'W\ngoto dsp_cmphd\n\nnorthwest:\n cmp(0) = \"N\" : cmp(1) = \"W\"\t\t\t'NW\n\ndsp_cmphd:\n if indent = 0 then skip_indent\n serout dpin,N9600,[pcurs,64,bigchr,\"   \",pcurs,67,bigchr,cmp(0)] : indent = 0\ngoto dsp_time\n'\n'-----------------------------------------------------------------------------\n'\nskip_indent:\n serout dpin,N9600,[pcurs,64,bigchr,cmp(0),cmp(1)]\n\ndsp_time:\n serout2 dpin,N29600,[pcurs,74,\" \",dec2 hr,\":\",time(0),time(1),\":\",time(2),time(3)]\n\ndsp_speed:\n serout2 dpin,N29600,[pcurs,116,dec Speed,\" MPH \"]\ngoto get_data\n\nno_data:\n gosub clrscr\n serout dpin,N9600,[pcurs,67,\"NO SERIAL DATA\"]\n serout dpin,N9600,[pcurs,105,\"PLEASE CONNECT GPS\"]\n serout dpin,N9600,[pcurs,128,\"AT 4800 BAUD\"]\n' update = 0\t\t\t\t\t'Never gets to ID since check is skipped, but ok\ngoto get_data\t\t\t\t\t'Need to add pause and goto id if desired\n'\n'-----------------------------------------------------------------------------\n'\nclrscr:\n serout dpin,N9600,[Clear_Screen]\t\t'Clear display\n pause 250\n return\n'\n'-----------------------------------------------------------------------------\n'\nblight:\n\t'pause 250\t\t\t\t'needed to move since slow checking\n\tbranch bl, [bln, blff]\nbln:\n\tserout dpin,N9600, [blon]\n\tbl = 1 : pause 500\t\t\t'debounce switch\n\tgoto get_data\nblff:\n\tserout dpin,N9600, [bloff]\n\tbl = 0 : pause 500\t\t\t'debounce switch\n\tgoto get_data<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>GPS Project Pics PIC Microcontroller I have been involved with the PIC microcontrollers by Microchip Technology, Inc. since early 1999.\u00a0 I got interested using the PIC after using the Basic Stamp II by Parallax, Inc.\u00a0 I wrote several clock programs using the BSII and wanted to move the code over [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-27","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/n9loo.com\/wp\/wp-json\/wp\/v2\/pages\/27","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/n9loo.com\/wp\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/n9loo.com\/wp\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/n9loo.com\/wp\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/n9loo.com\/wp\/wp-json\/wp\/v2\/comments?post=27"}],"version-history":[{"count":17,"href":"https:\/\/n9loo.com\/wp\/wp-json\/wp\/v2\/pages\/27\/revisions"}],"predecessor-version":[{"id":245,"href":"https:\/\/n9loo.com\/wp\/wp-json\/wp\/v2\/pages\/27\/revisions\/245"}],"wp:attachment":[{"href":"https:\/\/n9loo.com\/wp\/wp-json\/wp\/v2\/media?parent=27"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}