{"id":1755,"date":"2025-04-14T05:25:45","date_gmt":"2025-04-14T05:25:45","guid":{"rendered":"https:\/\/webprojects.cloud\/wordpress\/splatco\/?post_type=spl_knowledgebase&#038;p=1755"},"modified":"2025-06-10T08:19:21","modified_gmt":"2025-06-10T08:19:21","slug":"spice-10204-programming","status":"publish","type":"spl_knowledgebase","link":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/spice10204-current-transformer\/spice-10204-programming\/","title":{"rendered":"SPice 10204: Programming"},"content":{"rendered":"\n<p>Once installed on a SPLat controller, the SPice10204 appears as 3 regular analog input points. The following table shows the mappings for the inputs on the board. Numbers in parenthesis are the numeric analog channel numbers used with\u00a0<code><a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/analog-instructions\/fanin-c-d18\/\">fAnIn<\/a><\/code>.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th>&nbsp;<\/th><th>Cnctr pin<\/th><th>SLXXX<\/th><th>MMiXXX<\/th><th>MS12<\/th><th>&nbsp;<\/th><\/tr><tr><th>Current transformer<\/th><th>4<\/th><td>AnInC (2)<\/td><td>AnInE (4)<\/td><td>AnInC (2)<\/td><td>&nbsp;<\/td><\/tr><tr><th>Potentiometer 1<\/th><th>5<\/th><td>AnInD (3)<\/td><td>AnInF (5)<\/td><td>AnInD (3)<\/td><td>&nbsp;<\/td><\/tr><tr><th>Potentiometer 2<\/th><th>6<\/th><td>AnInE (4)<\/td><td>AnInG (6)<\/td><td>AnInE (4)<\/td><td>&nbsp;<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h6 class=\"wp-block-heading\">initializing the\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/glossary-of-terms\/#o366\">SPice<\/a>\u00a0connector<\/h6>\n\n\n\n<p>Because the pins of the SPice connector, to which the SPice10204 is connected, can be configured for different functions (analog\/digital, input\/output), you need to have some code in your program that configures them to the correct settings for the SPice10204.<\/p>\n\n\n\n<p>The following section of code should be run by your program just once, at the beginning, before your program attempts to do anything else with the SPice10204.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">         <a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/splat-expansion-framework-generic-instructions\/clru\/\">ClrU<\/a><br>         <a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/splat-expansion-framework-generic-instructions\/setu-ni\/\">setu<\/a>         0,3         ;set spice connector pin 4 as analog input<br>         setu         1,3         ;set spice connector pin 5 as analog input<br>         setu         2,3         ;set spice connector pin 6 as analog input<br>         <a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/splat-expansion-framework-generic-instructions\/spiceconfigu\/\">SpiceConfigU<\/a><\/pre>\n\n\n\n<h6 class=\"wp-block-heading\">Programming the current transformer<\/h6>\n\n\n\n<p>The current transformer appears as analog input C on an SL99 and E on an\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/glossary-of-terms\/#o364\">MMi99<\/a>. It has a full scale range of 0 to 5A. The following MMi99 program will display the current on the LCD (if fitted)<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">         ClrU                     ;clear U\n         setu         0,3         ;set spice connector pin 7 as analog input\n         setu         1,3         ;set spice connector pin 8 as analog input\n         setu         2,3         ;set spice connector pin 9 as analog input\n         SpiceConfigU\n\nloop\n         oblcd_setcur 0,0         ;Position the LCD cursor\n         oblcd_text   \"I=\"        ;Show a heading\n         AnInE                    ;Read the CT\n         Float                    ;Convert to floating point\n         fLoadQ       1.960784E-2 ;Scale factor for 5A FS\n         fMul\n         OBLCD_fDispW 4,2         ;Display\n         GoTo     Loop            ;Repeat forever<\/pre>\n\n\n\n<h6 class=\"wp-block-heading\">Programming the potentiometers<\/h6>\n\n\n\n<p>There are a myriad of possible uses for the potentiometers. Once the board has been initialized, the actual act of reading a potentiometer is a simple matter of executing an\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/analog-instructions\/anin\/\">AnIn<\/a>\u00a0instruction. The following example shows how you could perform a\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/glossary-of-terms\/#o364\">SPLatWare<\/a>\u00a0calibration of the current transformer. In this case, in an MMi99\/200, potentiometer 1 is used to provide \u00b15% adjustment of the CT reading. This involves generating a calibration factor of between 0.95 (-5%) and 1.05 (+5%) for potentiometer readings between 5 and 250 (allowing for a few possible missing codes either end). The mid-point reading of the potentiometer is 127.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">         ClrU                     ;clear U\n         setu         0,3         ;set spice connector pin 7 as analog input\n         setu         1,3         ;set spice connector pin 8 as analog input\n         setu         2,3         ;set spice connector pin 9 as analog input\n         SpiceConfigU\n\nloop\n         AnInF                    ;Read potentiometer 1\n         Float\n         fLoadQ       -127        ;Mid-point\n         fAdd                     ;Now scaled -127 to +128\n         fLoadQ       4.1E-4      ; = 0.05\/123\n         fMul                     ;now scaled -0.05 to +0.05\n         fLoadQ       1\n         fAdd                     ;now have 0.95 to 1.05 = cal factor\n         fLoadQ       1.960784E-2 ;Scale factor for 5A FS\n         fMul                     ;Composite scale and calibration factors\n         fSwap                    ;Save it away in Q\n         oblcd_setcur 0,0         ;Position the LCD cursor\n         oblcd_text   \"I=\"        ;Show a heading\n         AnInE                    ;Read the CT\n         Float                    ;Convert to floating point\n         fMul                     ;The scale\/cal factor already in Q\n         OBLCD_fDispW 4,2         ;Display\n         GoTo     Loop            ;Repeat forever<\/pre>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table class=\"has-fixed-layout\"><tbody><tr><td>Note: For experimentation, if you don&#8217;t have a 5A AC current source handy, change the AnInE to AnInG, and use potentiometer 2 in lieu of the CT.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Note that during debug with SPLat the SPice board may not show up correctly in the I\/O window unless the board has run the initialize code. You can fix this by translating and running the above initialization sequence in the board. Add a line<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">a     goto    a<\/pre>\n\n\n\n<p>at the end to prevent translation and runtime errors.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Once installed on a SPLat controller, the SPice10204 appears as 3 regular analog input points. The following table shows the mappings for the inputs on&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1746,"menu_order":6,"template":"","class_list":["post-1755","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>SPice 10204: Programming - 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=\"SPice 10204: Programming - SPLat Controls\" \/>\n<meta property=\"og:description\" content=\"Once installed on a SPLat controller, the SPice10204 appears as 3 regular analog input points. The following table shows the mappings for the inputs on...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/spice10204-current-transformer\/spice-10204-programming\/\" \/>\n<meta property=\"og:site_name\" content=\"SPLat Controls\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-10T08:19:21+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=\"3 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\/product-documentation\/product-documentation-spice-add-on-boards\/spice10204-current-transformer\/spice-10204-programming\/\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/spice10204-current-transformer\/spice-10204-programming\/\",\"name\":\"SPice 10204: Programming - SPLat Controls\",\"isPartOf\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website\"},\"datePublished\":\"2025-04-14T05:25:45+00:00\",\"dateModified\":\"2025-06-10T08:19:21+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/spice10204-current-transformer\/spice-10204-programming\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/spice10204-current-transformer\/spice-10204-programming\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/spice10204-current-transformer\/spice-10204-programming\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Product documentation\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Product documentation: SPice add-on boards\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"SPice10204 &#8211; Current transformer\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/spice10204-current-transformer\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"SPice 10204: Programming\"}]},{\"@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":"SPice 10204: Programming - 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":"SPice 10204: Programming - SPLat Controls","og_description":"Once installed on a SPLat controller, the SPice10204 appears as 3 regular analog input points. The following table shows the mappings for the inputs on...","og_url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/spice10204-current-transformer\/spice-10204-programming\/","og_site_name":"SPLat Controls","article_modified_time":"2025-06-10T08:19:21+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/spice10204-current-transformer\/spice-10204-programming\/","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/spice10204-current-transformer\/spice-10204-programming\/","name":"SPice 10204: Programming - SPLat Controls","isPartOf":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website"},"datePublished":"2025-04-14T05:25:45+00:00","dateModified":"2025-06-10T08:19:21+00:00","breadcrumb":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/spice10204-current-transformer\/spice-10204-programming\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/spice10204-current-transformer\/spice-10204-programming\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/spice10204-current-transformer\/spice-10204-programming\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/"},{"@type":"ListItem","position":2,"name":"Product documentation","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/"},{"@type":"ListItem","position":3,"name":"Product documentation: SPice add-on boards","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/"},{"@type":"ListItem","position":4,"name":"SPice10204 &#8211; Current transformer","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/spice10204-current-transformer\/"},{"@type":"ListItem","position":5,"name":"SPice 10204: Programming"}]},{"@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\/1755","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\/1746"}],"wp:attachment":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/media?parent=1755"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}