{"id":3592,"date":"2025-04-21T04:39:03","date_gmt":"2025-04-21T04:39:03","guid":{"rendered":"https:\/\/webprojects.cloud\/wordpress\/splatco\/?post_type=spl_knowledgebase&#038;p=3592"},"modified":"2025-06-10T11:58:58","modified_gmt":"2025-06-10T11:58:58","slug":"example-identifying-spicex-inputs","status":"publish","type":"spl_knowledgebase","link":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-using-spicex-for-large-i-o-counts\/spicex-programming-examples\/example-identifying-spicex-inputs\/","title":{"rendered":"Example: Identifying SPiceX inputs"},"content":{"rendered":"\n<p>This example program is handy for familiarizing yourself with the mapping of the\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/glossary-of-terms\/#o368\">SPiceX<\/a>\u00a0inputs.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">;IDENTIN.SPT : Sample program to identify which inputs get<br>;reflected in which bytes\/bits of U when using the<br>;SPxTxfr instruction.<br><br>;The program senses just one expansion input turned on <br>;at a time. It reads in up to 8 bytes of input data using SPxTxfrU<br>;and saves them in <a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/glossary-of-terms\/#o414\">RAM<\/a>. It then inspects the RAM to find a set bit.<br>;Finally it displays the byte\/bit number in onboard outputs<br>; 0-7. Bits 3-6 contain the byte number. Bits 0-2 contain the<br>;bit number within that byte. Bit 7 is BLINKed to signal the presence of data<br>;(otherwise byte 0, bit 0 would show nothing).<br><br>;You can also inspect the raw data using SPLatLink (The SL button<br>;in the Module window of SPLat\/PC). <br>;Data is in locations 0 up, inverted. Click the Format button in the <br>;Data memory window to get binary formatting.<br><br>****************************************************************<br>;Set the following constant to reflect the number of bytes of <br>;data being shifted in.<br>;<br>;       XBIO16          2 bytes<br>;       MBIO16          2 bytes<br>;       XIRO16          1 byte<br>;       HIO16           1 byte<br>;       FP16            1 byte<br><br><br>ShiftLength     EQU             8       ;Minimum 5 with standard expansion boards!<br><br>**** NOTE ****<br>;SPiceX mode works only with standard XPice expansion boards when<br>;there are more than 4 bytes of data. For less than that the<br>;automatic detection will sense the boards and map them as<br>;regular I\/O. <br>;With custom expansion boards it may work with fewer than 5 bytes,<br>;depending on the design of the board. Please consult the board documentation.<br>****************************************************************<br><br>                SPxMode         6<br>                SetV            ShiftLength     ;Will henceforth control how<br>                                                ;many bytes get transferred<br>;Back here when no inputs are detected<br>Nothing:<br>                LoadX           0       ;Data<br>                LoadX           255     ;Bit select mask for OutputM<br>                OutputM         0       ;Clear result display<br>NextRead:<br>                ClrU                    ;Don't want any output data<br>                SPxTxfrU        0       ;Reads the inputs<br>                UVToMem         0,0     ;Copy V bytes from U to memory<br><br>;Identify the first non-zero byte. I is used as a counter\/pointer<br>                LoadI           ShiftLength<br>ByteLoop:<br>                ItoX                    ;Check the counter\/pointer<br>                Push<br>                GoIfZ           Nothing ;Exhausted all bytes<br>                DecX                    ;Bump the pointer<br>                XtoI<br>                iRecall         0       ;Get byte pointed to by I<br>                notm                    ;Raw input data is inverted<br>                GoIfZ           ByteLoop<br><br>;Fall down here if we found a NZ byte<br>                ItoX                    ;Byte number<br>                LoadX           7       ;Select 3 bits of byte number<br>                OutputM         3       ;Display<br><br>;Identify the first NZ bit within the byte. We know the<br>;byte is NZ, so there's no need to defend against not finding<br>;a bit set.<br>                iRecall         0       ;Get back the byte pointed to by I<br>                notm                    ;Raw input data is inverted<br>                LoadI           0       ;Use I as a counter<br>BitLoop:<br>                Push<br>                LoadX           1       ;a mask<br>                AndM                    ;select bit 0<br>                GoIfNZ          FoundBit<br>                IncI<br>                RORM<br>                GoTo            BitLoop<br><br>FoundBit:<br>                ItoX<br>                LoadX           7<br>                OutputM         0<br>                Blink           7<br><br>                GoTo            NextRead<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This example program is handy for familiarizing yourself with the mapping of the\u00a0SPiceX\u00a0inputs. ;IDENTIN.SPT : Sample program to identify which inputs get;reflected in which bytes\/bits&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3590,"menu_order":1,"template":"","class_list":["post-3592","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>Example: Identifying SPiceX inputs - 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=\"Example: Identifying SPiceX inputs - SPLat Controls\" \/>\n<meta property=\"og:description\" content=\"This example program is handy for familiarizing yourself with the mapping of the\u00a0SPiceX\u00a0inputs. ;IDENTIN.SPT : Sample program to identify which inputs get;reflected in which bytes\/bits...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-using-spicex-for-large-i-o-counts\/spicex-programming-examples\/example-identifying-spicex-inputs\/\" \/>\n<meta property=\"og:site_name\" content=\"SPLat Controls\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-10T11:58:58+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-using-spicex-for-large-i-o-counts\/spicex-programming-examples\/example-identifying-spicex-inputs\/\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-using-spicex-for-large-i-o-counts\/spicex-programming-examples\/example-identifying-spicex-inputs\/\",\"name\":\"Example: Identifying SPiceX inputs - SPLat Controls\",\"isPartOf\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website\"},\"datePublished\":\"2025-04-21T04:39:03+00:00\",\"dateModified\":\"2025-06-10T11:58:58+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-using-spicex-for-large-i-o-counts\/spicex-programming-examples\/example-identifying-spicex-inputs\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-using-spicex-for-large-i-o-counts\/spicex-programming-examples\/example-identifying-spicex-inputs\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-using-spicex-for-large-i-o-counts\/spicex-programming-examples\/example-identifying-spicex-inputs\/#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: Using SPiceX for large I\/O counts\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-using-spicex-for-large-i-o-counts\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"SPiceX: Programming examples\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-using-spicex-for-large-i-o-counts\/spicex-programming-examples\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Example: Identifying SPiceX inputs\"}]},{\"@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":"Example: Identifying SPiceX inputs - 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":"Example: Identifying SPiceX inputs - SPLat Controls","og_description":"This example program is handy for familiarizing yourself with the mapping of the\u00a0SPiceX\u00a0inputs. ;IDENTIN.SPT : Sample program to identify which inputs get;reflected in which bytes\/bits...","og_url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-using-spicex-for-large-i-o-counts\/spicex-programming-examples\/example-identifying-spicex-inputs\/","og_site_name":"SPLat Controls","article_modified_time":"2025-06-10T11:58:58+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-using-spicex-for-large-i-o-counts\/spicex-programming-examples\/example-identifying-spicex-inputs\/","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-using-spicex-for-large-i-o-counts\/spicex-programming-examples\/example-identifying-spicex-inputs\/","name":"Example: Identifying SPiceX inputs - SPLat Controls","isPartOf":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website"},"datePublished":"2025-04-21T04:39:03+00:00","dateModified":"2025-06-10T11:58:58+00:00","breadcrumb":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-using-spicex-for-large-i-o-counts\/spicex-programming-examples\/example-identifying-spicex-inputs\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-using-spicex-for-large-i-o-counts\/spicex-programming-examples\/example-identifying-spicex-inputs\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-using-spicex-for-large-i-o-counts\/spicex-programming-examples\/example-identifying-spicex-inputs\/#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: Using SPiceX for large I\/O counts","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-using-spicex-for-large-i-o-counts\/"},{"@type":"ListItem","position":4,"name":"SPiceX: Programming examples","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-using-spicex-for-large-i-o-counts\/spicex-programming-examples\/"},{"@type":"ListItem","position":5,"name":"Example: Identifying SPiceX inputs"}]},{"@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\/3592","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\/3590"}],"wp:attachment":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/media?parent=3592"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}