{"id":3314,"date":"2025-04-18T04:48:04","date_gmt":"2025-04-18T04:48:04","guid":{"rendered":"https:\/\/webprojects.cloud\/wordpress\/splatco\/?post_type=spl_knowledgebase&#038;p=3314"},"modified":"2025-06-10T09:24:07","modified_gmt":"2025-06-10T09:24:07","slug":"multitrack-advanced-accuracy-of-supertimers","status":"publish","type":"spl_knowledgebase","link":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-multitrack\/multitrack-advanced-accuracy-of-supertimers\/","title":{"rendered":"MultiTrack (Advanced): Accuracy of SuperTimers"},"content":{"rendered":"\n<p>The SuperTimer mechanism has been designed to avoid problems of cumulative timing errors due to program latency when using MultiTrack.<\/p>\n\n\n\n<p>The following program illustrates the point. If you run this in an MMi201 (or earlier) as it is, the 1 second flasher will manage just 58 flashes in a minute. In a more recent controller this will become closer to 59 flashes, because the processor is faster. By comparison, if you remove the very first line and let Flash1S run as a MultiTrack task, the flasher produces as close to 60 flashes per second as can reasonably checked with a watch.<\/p>\n\n\n\n<p><a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/cutting-and-pasting-code-from-the-splat-knowledge-base\/\">(Click here<\/a>\u00a0for some tips for working around problems with copy and paste out of Internet Explorer and HTML-help\u00a0<code>(.chm)<\/code>\u00a0files)<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">        GoTo            Flash1S\n        LaunchTask      Flash1S\n        RunTasksForever\n\nFlash1S\n        On              7\n        GoSub           SlowIt\n        Pause           5\n        Off             7\n        fRecallW        fCounter\n        fInc\n        fStore          fCounter\n        OBLCD_SetCur    0,0\n        OBLCD_fDispW    5,0\n        Pause           95\n        GoTo            Flash1S\n\nSlowIt\n        fLoadW          1.111111\n        fLoadQ          0.00001\n        SetMem          Counter,100\nSAA1\n        fAdd\n        DMGNZ           Counter,SAA1\n        Return\n\nCounter         defBYTE\nfCounter        defFLOAT<\/pre>\n\n\n\n<p>So, what is happening????<\/p>\n\n\n\n<p>The subroutine&nbsp;<code>SlowIt<\/code>&nbsp;has been designed simply to waste time, about 40mS in an MMi201. If&nbsp;<code>Flash1S<\/code>&nbsp;is run outside the MultiTrack task queue, that 40mS adds directly to the 50mS generated by&nbsp;<code>Pause 5<\/code>, giving a total output ON time of 90mS. So, instead of 1000mS total period we get 1040mS, or 57.6 flashes per minute.<\/p>\n\n\n\n<p>When we change the program so Flash1S is a MultiTrack task, our super timer magic comes into effect. The SuperTimer is generated via a system timer that counts up 10mS ticks. That timer runs all the time, and is used for any timing outside the task queue. Inside the task queue, however, it is different. Each time the task queue is to be run, the system timer is copied to a separate buffer register, and that same, static value is used for all SuperTimer calculations. It is as if time stands still during each run of the task queue. It then jumps forward at the start of the next run, when the buffer register is again updated from the system timer. When the&nbsp;<code>Pause 5<\/code>&nbsp;is first encountered the termination time is calculated starting from the time captured in the buffer.<\/p>\n\n\n\n<p>This scheme would fail to work if subroutine&nbsp;<code>SlowIt<\/code>&nbsp;took more than 50mS, because&nbsp;<code>SlowIt<\/code>&nbsp;won&#8217;t complete until after the&nbsp;<code>Pause 5<\/code>&nbsp;should have completed.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The SuperTimer mechanism has been designed to avoid problems of cumulative timing errors due to program latency when using MultiTrack. The following program illustrates the&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3299,"menu_order":11,"template":"","class_list":["post-3314","spl_knowledgebase","type-spl_knowledgebase","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>MultiTrack (Advanced): Accuracy of SuperTimers - 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=\"MultiTrack (Advanced): Accuracy of SuperTimers - SPLat Controls\" \/>\n<meta property=\"og:description\" content=\"The SuperTimer mechanism has been designed to avoid problems of cumulative timing errors due to program latency when using MultiTrack. The following program illustrates the...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-multitrack\/multitrack-advanced-accuracy-of-supertimers\/\" \/>\n<meta property=\"og:site_name\" content=\"SPLat Controls\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-10T09:24:07+00:00\" \/>\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=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-multitrack\/multitrack-advanced-accuracy-of-supertimers\/\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-multitrack\/multitrack-advanced-accuracy-of-supertimers\/\",\"name\":\"MultiTrack (Advanced): Accuracy of SuperTimers - SPLat Controls\",\"isPartOf\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website\"},\"datePublished\":\"2025-04-18T04:48:04+00:00\",\"dateModified\":\"2025-06-10T09:24:07+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-multitrack\/multitrack-advanced-accuracy-of-supertimers\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-multitrack\/multitrack-advanced-accuracy-of-supertimers\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-multitrack\/multitrack-advanced-accuracy-of-supertimers\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tutorials, application notes and white papers\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Tutorial: MultiTrack\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-multitrack\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"MultiTrack (Advanced): Accuracy of SuperTimers\"}]},{\"@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":"MultiTrack (Advanced): Accuracy of SuperTimers - 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":"MultiTrack (Advanced): Accuracy of SuperTimers - SPLat Controls","og_description":"The SuperTimer mechanism has been designed to avoid problems of cumulative timing errors due to program latency when using MultiTrack. The following program illustrates the...","og_url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-multitrack\/multitrack-advanced-accuracy-of-supertimers\/","og_site_name":"SPLat Controls","article_modified_time":"2025-06-10T09:24:07+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-multitrack\/multitrack-advanced-accuracy-of-supertimers\/","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-multitrack\/multitrack-advanced-accuracy-of-supertimers\/","name":"MultiTrack (Advanced): Accuracy of SuperTimers - SPLat Controls","isPartOf":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website"},"datePublished":"2025-04-18T04:48:04+00:00","dateModified":"2025-06-10T09:24:07+00:00","breadcrumb":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-multitrack\/multitrack-advanced-accuracy-of-supertimers\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-multitrack\/multitrack-advanced-accuracy-of-supertimers\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-multitrack\/multitrack-advanced-accuracy-of-supertimers\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/"},{"@type":"ListItem","position":2,"name":"Tutorials, application notes and white papers","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/"},{"@type":"ListItem","position":3,"name":"Tutorial: MultiTrack","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-multitrack\/"},{"@type":"ListItem","position":4,"name":"MultiTrack (Advanced): Accuracy of SuperTimers"}]},{"@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\/spl_knowledgebase\/3314","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/spl_knowledgebase"}],"about":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/types\/spl_knowledgebase"}],"author":[{"embeddable":true,"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/users\/1"}],"up":[{"embeddable":true,"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/spl_knowledgebase\/3299"}],"wp:attachment":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/media?parent=3314"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}