{"id":4750,"date":"2025-05-08T08:00:33","date_gmt":"2025-05-08T08:00:33","guid":{"rendered":"https:\/\/webprojects.cloud\/wordpress\/splatco\/?page_id=4750"},"modified":"2025-05-08T08:00:34","modified_gmt":"2025-05-08T08:00:34","slug":"ec1-easysteps","status":"publish","type":"page","link":"https:\/\/webprojects.cloud\/wordpress\/splatco\/ec1-easysteps\/","title":{"rendered":"EC1 EasySteps"},"content":{"rendered":"\n<p><strong>This EasyStep will show you how to set the time in your EC1 from the time in your PC. It&#8217;s quick and it&#8217;s easy. You will also learn how to incorporate the tiny bit of required SPLat code into your own SPLat programs.<\/strong><\/p>\n\n\n\n<p>It should take you no more than an hour to go through this, providing you already understand the fundamentals of SPLat programming.<\/p>\n\n\n\n<p>The EC1 is unique among very low cost microcontroller boards in that it has an onboard calendar\/clock, often called RealTime Clock (RTC). The RTC provides a full calendar and time of day clock, as well as advanced features like programmable events that can be set to go off at specified times on selected days of the week. In short, the RTC has enough features to let you program elaborate time-clock functionality into your EC1-based project.<\/p>\n\n\n\n<p>Note: Don&#8217;t confuse the RTC with the basic ability to generate time intervals. SPLat has a rich set of interval related instructions like&nbsp;Pause, which handle the passage of time. These don&#8217;t exist as native functions in most other microcontroller boards. The RTC takes it to a higher level again by knowing what the date and time are.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">What you will need<\/h6>\n\n\n\n<ul class=\"wp-block-list\">\n<li>An EC1 all ready to plug into your PC via USB;<\/li>\n\n\n\n<li>SPLat\/PC installed and running, and the basic skills to enter and download programs.<\/li>\n<\/ul>\n\n\n\n<p>Before starting on this, please be sure to have completed the EasyStep\u00a0Connecting a battery to your EC1 for the realtime clock<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Overview<\/h6>\n\n\n\n<p><a>The RTC setting capability is contained within the\u00a0<\/a>SimpleHMI\u00a0client in SPLat\/PC.\u00a0The SimpleHMI has a button next to the SimpleHMI screen. When clicked it will set the date and time to a connected EC1. If the EC1 is running a tiny bit of special code, the result will be that the RTC in the EC1 is set to the time and date in your PC.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"673\" height=\"265\" src=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/05\/easystep_32.gif\" alt=\"\" class=\"wp-image-4753\"\/><\/figure>\n\n\n\n<h6 class=\"wp-block-heading\">The bare bones<\/h6>\n\n\n\n<p>If you include the following two lines of code in your program, near the top (and definitely before a&nbsp;RunTasksForever), your program will be able to have the time set by cicking the Set RTC button illustrated above. As with all hash commands and functions, this requires your program to be running MultiTrack.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Open_Serial User(38400, 8, N)  ;Goes to SimpleHMI in the PC (inside SPLat\/PC or standalone version)\t\n# HMI SetRTCEvent()<\/pre>\n\n\n\n<p>The first line opens the default communications port, which is the USB programming port, and makes it available for use by your program. There is a 10 second delay before that comes into effect (the reason for that delay should be clear shortly).<\/p>\n\n\n\n<p>The second line causes a whole pile of under-the-hood code to be activated, which provides the capability of receiving a time-setting message from the SimpleHMI device (in this case the PC) and updating the onboard RTC with time and date.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">A more elaborate template program<\/h6>\n\n\n\n<p>The above two lines of code have one drawback: SPLat\/PC, and the SimpleHMI client that you can run from inside SPLat\/PC, are two quite separate entities. Once the communications port has been opened for SimpleHMI use by the running application, it is no longer available to SPLat\/PC for programming the board. The only away to give control back to SPLat\/PC is to restart the program and the hit the Stop button in the SPLat\/PC Module window within 10 seconds. There are two ways to restart the program:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Cycle the power, by unplugging and re-plugging the USB (assuming you are powering the board off USB). Then hit the Stop button within 10 seconds. This method is inconvenient. Also, the USB drivers in Windows get upset by unplugging, and it may be difficult to get the PC to re-activate the port within 10 seconds;<\/li>\n\n\n\n<li>Do a bit of skullduggery in the SPLat program so it can be forced to crash. This always forces a restart of the program.<\/li>\n<\/ul>\n\n\n\n<p>The following program does a number of things<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>At startup it turns on both LEDs and waits for you to press the button on the EC1. While both LEDs are on you can click the Stop or Connect buttons on the SPLat\/PC Module window, and get connected to the board;<br><img loading=\"lazy\" decoding=\"async\" width=\"168\" height=\"55\" src=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/05\/easystep_28.gif\" alt=\"\"><\/li>\n\n\n\n<li>The green LED flashes to tell you the program is running (&#8220;heart beat&#8221;). This will not happen until 10s after the program started\u00a0<em>and<\/em>\u00a0the EC1 button has been pressed;<\/li>\n\n\n\n<li>Any subsequent short press on the EC1 push button forces the RTC to be updated from the SimpleHMI client in SPLat\/PC;<\/li>\n\n\n\n<li>A click of the Set RTC button on the SimpleHMI window in SPLat\/PC also forces the RTC to be updated;<\/li>\n\n\n\n<li>The red LED flashes briefly when the RTC time and date are sent from SimpleHMI;<\/li>\n\n\n\n<li>A long (2s) press on the EC1 push button deliberately crashes the program (Kill switch function). The program restarts, turns on both LEDs and will respond to the Stop or Connect buttons on the SPLat\/PC Module window;<\/li>\n<\/ul>\n\n\n\n<p>The full program is listed below, with extensive annotations. To show\/hide the program listing\u00a0click here. There are pop-ups for each major functional block of code, and clickable links on individual instructions that take you to the formal descriptions of the instructions.<\/p>\n\n\n\n<p>The block annotations are marked like this:<a>;[&#8230;]<\/a><\/p>\n\n\n\n<p>Place your mouse over that line to see a pop-up describing the overall logic of the block.<\/p>\n\n\n\n<p>Many instruction also have clickable links to the formal definition online. (Tip: Click the link with your mouse wheel to open in a new browser tab)<\/p>\n\n\n\n<p><em>Please<\/em>\u00a0invest some time studying\u00a0the program. Even if you don&#8217;t understand all the details, try to at least get the general drift of what the major blocks are all about.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Take back control<\/h6>\n\n\n\n<p>When you have explored everything the program can do, you need to stop it running and give control of the EC1 back to SPLat\/PC.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Press and hold the EC1 button for 2 seconds. Both LEDs should come on. You have just triggered the killswitch function, and the program has restarted. Click the Stop button on the Module window of SPLat\/PC (or the Connect button, if it is showing)<br><img loading=\"lazy\" decoding=\"async\" width=\"168\" height=\"55\" src=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/05\/easystep_28.gif\" alt=\"\">The Module window should expand, and stay expanded.<br><img loading=\"lazy\" decoding=\"async\" width=\"168\" height=\"285\" src=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/05\/easystep_9.gif\" alt=\"\"><\/li>\n\n\n\n<li>You will get a pop-up error message. This happens because the killswitch deliberately crashes the program. Dismiss the error message.<\/li>\n<\/ul>\n\n\n\n<p>You have successfully stopped the program and given SPLat\/PC control of the board, ready to change the program.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This EasyStep will show you how to set the time in your EC1 from the time in your PC. It&#8217;s quick and it&#8217;s easy. You&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-4750","page","type-page","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>EC1 EasySteps - SPLat Controls<\/title>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"EC1 EasySteps - SPLat Controls\" \/>\n<meta property=\"og:description\" content=\"This EasyStep will show you how to set the time in your EC1 from the time in your PC. It&#8217;s quick and it&#8217;s easy. You...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/ec1-easysteps\/\" \/>\n<meta property=\"og:site_name\" content=\"SPLat Controls\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-08T08:00:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/05\/easystep_32.gif\" \/>\n\t<meta property=\"og:image:width\" content=\"673\" \/>\n\t<meta property=\"og:image:height\" content=\"265\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/gif\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/ec1-easysteps\/\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/ec1-easysteps\/\",\"name\":\"EC1 EasySteps - SPLat Controls\",\"isPartOf\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/ec1-easysteps\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/ec1-easysteps\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/05\/easystep_32.gif\",\"datePublished\":\"2025-05-08T08:00:33+00:00\",\"dateModified\":\"2025-05-08T08:00:34+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/ec1-easysteps\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webprojects.cloud\/wordpress\/splatco\/ec1-easysteps\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/ec1-easysteps\/#primaryimage\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/05\/easystep_32.gif\",\"contentUrl\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/05\/easystep_32.gif\",\"width\":673,\"height\":265},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/ec1-easysteps\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"EC1 EasySteps\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/\",\"name\":\"SPLat Controls\",\"description\":\"OEM Embedded Machine Controllers\",\"publisher\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization\",\"name\":\"SPLat Controls\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg\",\"contentUrl\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg\",\"caption\":\"SPLat Controls\"},\"image\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"EC1 EasySteps - SPLat Controls","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"EC1 EasySteps - SPLat Controls","og_description":"This EasyStep will show you how to set the time in your EC1 from the time in your PC. It&#8217;s quick and it&#8217;s easy. You...","og_url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/ec1-easysteps\/","og_site_name":"SPLat Controls","article_modified_time":"2025-05-08T08:00:34+00:00","og_image":[{"width":673,"height":265,"url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/05\/easystep_32.gif","type":"image\/gif"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/ec1-easysteps\/","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/ec1-easysteps\/","name":"EC1 EasySteps - SPLat Controls","isPartOf":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/ec1-easysteps\/#primaryimage"},"image":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/ec1-easysteps\/#primaryimage"},"thumbnailUrl":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/05\/easystep_32.gif","datePublished":"2025-05-08T08:00:33+00:00","dateModified":"2025-05-08T08:00:34+00:00","breadcrumb":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/ec1-easysteps\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webprojects.cloud\/wordpress\/splatco\/ec1-easysteps\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/ec1-easysteps\/#primaryimage","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/05\/easystep_32.gif","contentUrl":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/05\/easystep_32.gif","width":673,"height":265},{"@type":"BreadcrumbList","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/ec1-easysteps\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/"},{"@type":"ListItem","position":2,"name":"EC1 EasySteps"}]},{"@type":"WebSite","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/","name":"SPLat Controls","description":"OEM Embedded Machine Controllers","publisher":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webprojects.cloud\/wordpress\/splatco\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization","name":"SPLat Controls","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg","contentUrl":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg","caption":"SPLat Controls"},"image":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/pages\/4750","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/comments?post=4750"}],"version-history":[{"count":1,"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/pages\/4750\/revisions"}],"predecessor-version":[{"id":4755,"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/pages\/4750\/revisions\/4755"}],"wp:attachment":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/media?parent=4750"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}