{"id":1839,"date":"2025-04-14T08:21:38","date_gmt":"2025-04-14T08:21:38","guid":{"rendered":"https:\/\/webprojects.cloud\/wordpress\/splatco\/?post_type=spl_knowledgebase&#038;p=1839"},"modified":"2025-06-10T08:38:57","modified_gmt":"2025-06-10T08:38:57","slug":"program-code","status":"publish","type":"spl_knowledgebase","link":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/spice10213-dc-motor-control\/spice10213-programming\/example-advanced-motor-control-with-spice10213\/program-code\/","title":{"rendered":"Program code"},"content":{"rendered":"\n<p>The program code is reproduced below. You should master the\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-examples\/tutorial-multitasking-superseded\/\">Multitasking tutorial<\/a>\u00a0before attempting to understand this code!<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">;mdrv2.spt   Example motor drive program using SPice10213<br>;This program is written for an <a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/glossary-of-terms\/#o364\">MMi99<\/a>\/200 with LCD, but can easily<br>;be ported to an MS12<br><br>;The program uses front panel push button inputs as follows:<br><br>;    Input  Function<br>;       12      + speed<br>;       11      - speed<br>;       10      Stop\/Start<br>;        9      Forward\/Reverse<br>;        8      Not used<br><br>;The program consists of 3 tasks:<br><br>;SPD    (Speed) Simply monitors the + and - buttons and generates a target speed value<br>;DRV    (Drive) Ramps the motor speed (PWM) towards the target speed<br>;MSQ    (Motor sequencer) Master sequencer for stop\/start, forward\/reverse. Uses DRV<br>;                       for actual PWM generation.<br><br>;The 3 tasks are written as independent tasks witin a multitasking structure.<br>;You need to understand the material in the multitasking tutorial to make sense of this<br><br>;=============== Constants ====================<br>SPD_Increment   EQU             10      ;Inc\/Dec speed by this amount for each button push<br>StopTime        EQU             10      ; x 10mS. Time allowed for motor to stop with dynamic braking<br><br>;============== I\/O allocations ==============<br>;Alter for MS12<br>;----------- Inputs ----------------<br>iSPeedUp        iEQU            12<br>iSpeedDn        iEQU            11<br>iStopStart      iEQU            10<br>iFwdRev         iEQU            9<br><br>;----------- Outputs ---------------<br>oDirection      oEQU            16<br><br>;========= <a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/glossary-of-terms\/#o414\">RAM<\/a> ==============<br>;-------- Semaphores (1-bit variables) in 1st 8 bytes ---------------<br>Direction       sEQU            0<br>DRV_Accelerate  sEQU            1<br>Tick10          sEQU            2<br>MSQ_DirFWD      sEQU            3<br>MSQ_RevFlag     sEQU            4       <br><br>;-------- Other RAM ------------<br>MSQ_Addr        mEQU            20      ;2 bytes. <a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-examples\/tutorial-multitasking-superseded\/\">Suspend address<\/a> for MSQ<br>SPD_Target      mEQU            22      ;Target PWM<br>DRV_Addr        mEQU            23      ;2 bytes. Suspend address for DRV<br>DRV_PWM         mEQU            25      ;Current PWM value <br>SPD_Count       mEQU            26<br>MSQ_Count       mEQU            27<br>MSQ_State       mEQU            28<br><br>;-------------------------------------------------------------<br><br>Start:<br>                setu            0,1             ;set spice connector pin 4 as DO<br>                setu            3,1             ;set spice connector pin 7 as DO        <br>                setu            4,4             ;set spice connector pin 8 as PWM output<br>                setu            5,4             ;set spice connector pin 9 as PWM output<br>                SpiceConfigU<br><br>                GoSub           SPD_Init        ;Initialize tasks<br>                GoSub           DRV_Init<br>                GoSub           MSQ_Init<br><br>MainLoop:<br>                <a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/timing-instructions\/gettick10-d12\/\">GetTick10<\/a>                       ;Generate 10mS heartbeat<br>                <a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/index-register-instructions\/stores-ssbb-d12\/\">StoreS<\/a>          Tick10<br>                GoSub           SPD_UpDate      ;Run task<br>                GoSub           DRV_UpDate      ;Run task<br>                GoSub           MSQ_UpDate      ;Run task<br><br>;Debug: Display the MSQ state number<br>                OBLCD_SetCur    1,13<br>                OBLCD_UDecDispMFW       MSQ_State<br><br>                GoTo            MainLoop<br><br>;====================================================================<br>;----------- Motor sequencer ---------------------<br><br>;Short name     MSQ<br><br>;Entry points<br>;               MSQ_Init        Initialize<br>;               MSQ_Update      Update<br><br><br>MSQ_UpDate:<br>                <a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/callback-instructions\/resume-mm-d12-15\/\">Resume<\/a>          MSQ_Addr<br><br>MSQ_Init:<br><br>;State 0 is the idle state.<br>MSQ_Set0:<br>                SetMem          MSQ_State,0             ;For debugging monitor<br>MSQ_0:<br>                <a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/callback-instructions\/suspend-mm-d12-15\/\">Suspend<\/a>         MSQ_Addr<br>                GoIfInK         iStopStart,MSQ_Set1     ;Test stop\/start button<br>                GoSub           MSQ_ReadFR              ;Test and process F\/R<br>                GoTo            MSQ_0<br><br>;In state 1 we set the relay for the correct direction, then wait for it to settle<br>;prior to starting up the PWM drive<br>MSQ_Set1:<br>                SetMem          MSQ_State,1             ;For debugging monitor<br>                RecallS         MSQ_RevFlag             ;Set direction relay ...<br>                Output          oDirection              ;... according to direction flag<br><br>;Here we mark off two timer ticks to ensure at least a 10mS pause while the relay settles.<br>MSQ_1:<br>                Suspend         MSQ_Addr<br>                GoIfSF          Tick10,GenRet           ;Sync to timer tick<br>                Suspend         MSQ_Addr<br>                GoIfInK         iStopStart,MSQ_Set0     ;Test stop\/start button<br>                GoIfSF          Tick10,GenRet           ;Wait for next tick<br><br>;State 2 is the run state. the DRV task may well be accelerating, but that does<br>;not concern us one way or the other here.<br>MSQ_Set2:<br>                SetMem          MSQ_State,2             ;For debugging monitor<br>                GoSub           DRV_Run                 ;Start ramping up speed<br>MSQ_2:<br>                Suspend         MSQ_Addr<br>                GoIfInK         iStopStart,MSQ_Set3     ;Test stop\/start button<br>                GoSub           MSQ_ReadFR              ;Test and process F\/R<br>                GoIfF           MSQ_2                   ;G\/ not pressed<br><br>;State 6 is decellerating prior to reversing direction.<br>MSQ_Set6:<br>                SetMem          MSQ_State,6             ;For debugging monitor<br>                GoSub           DRV_Stop                ;Commence stop process<br>MSQ_6:<br>                Suspend         MSQ_Addr<br>                GoIfInK         iStopStart,MSQ_Set8     ;Test stop\/start button<br>                GoSub           DRV_Get_ZPWM            ;Test if PWM is zero<br>                GoIfT           MSQ_Set7<br>                GoSub           MSQ_ReadFR              ;Test and process F\/R<br>                GoIfF           MSQ_6                   ;G\/ not pressed<br>                GoTo            MSQ_Set2<br>        <br>;State 3 is decellerating prior to stopping     <br>MSQ_Set3:<br>                SetMem          MSQ_State,3             ;For debugging monitor<br>                GoSub           DRV_Stop<br>MSQ_3:<br>                Suspend         MSQ_Addr<br>                GoIfInK         iStopStart,MSQ_Set2     ;Test stop\/start button<br>                GoSub           DRV_Get_ZPWM<br>                GoIfT           MSQ_Set4<br>                GoSub           MSQ_ReadFR              ;Test and process F\/R<br>                GoIfF           MSQ_3                   ;G\/ not pressed<br><br>;State 5 is if F\/R is pushed while decellerating for a stop<br>MSQ_Set5:<br>                SetMem          MSQ_State,5             ;For debugging monitor<br>MSQ_5:<br>                Suspend         MSQ_Addr<br>                GoIfInK         iStopStart,MSQ_6        ;Test stop\/start button<br>                GoSub           DRV_Get_ZPWM<br>                GoIfT           MSQ_Set4<br>                GoSub           MSQ_ReadFR              ;Test and process F\/R<br>                GoIfF           MSQ_5                   ;G\/ not pressed<br>                GoTo            MSQ_3<br><br>;State 8 is if Stop\/start is hit while decelleration prior to reversing<br>MSQ_Set8:<br>                SetMem          MSQ_State,8             ;For debugging monitor<br>MSQ_8:<br>                Suspend         MSQ_Addr<br>                GoIfInK         iStopStart,MSQ_6        ;Test stop\/start button<br>                GoSub           DRV_Get_ZPWM<br>                GoIfT           MSQ_Set4<br>                GoTo            MSQ_8           <br><br>;State 4 is timing the dynamic braking interval after a stop.<br>MSQ_Set4:<br>                SetMem          MSQ_State,4             ;For debugging monitor<br>                InputO          oDirection              ;Read back direction relay<br>                NOT<br>                Output          oDirection<br>                SetMem          MSQ_Count,StopTime<br>MSQ_4:<br>                Suspend         MSQ_Addr<br>                GoSub           MSQ_ReadFR              <br>                GoIfSF          Tick10,MSQ_4<br>                DMGNZ           MSQ_Count,MSQ_4<br>                GoTo            MSQ_Set0<br><br>;State 7 is timing the dynamic braking interval foir stopping during reversal<br>MSQ_Set7:<br>                SetMem          MSQ_State,7             ;For debugging monitor<br>                RecallS         MSQ_RevFlag<br>                Output          oDirection<br>                SetMem          MSQ_Count,StopTime<br>MSQ_7:<br>                Suspend         MSQ_Addr<br>                GoSub           MSQ_ReadFR              <br>                GoIfSF          Tick10,MSQ_7<br>                DMGNZ           MSQ_Count,MSQ_7<br>                GoTo            MSQ_Set2<br><br>;----- Read and process F\/R button. Return True if pressed      <br>MSQ_ReadFR:<br>                InputK          iFwdRev<br>                Push<br>                RetIfF<br>                RecallS         MSQ_RevFlag<br>                NOT<br>                StoreS          MSQ_RevFlag<br>                Return<br><br>;----------- Drive Task --------------------------<br>;This task is responsible for ramping the PWM up and down to the target speed<br>;(when enabled). In essence it simply makes the actual PWM track the target PWM,<br>;with ramping. There is a coding option for sudden stop or smooth stop.<br><br>;Short name     DRV<br><br>;Uses lcd 1,0 through 1,3<br><br>;Entry points<br><br>;               DRV_Init        Initialize<br>;               DRV_Update      Update. <br>;               DRV_Run         Start ramping up. Simply updates DRV_Accelerate semaphore<br>;               DRV_Stop        Start ramping down. Simply updates DRV_Accelerate semaphore<br>;               DRV_Get_ZPWM    Return true if PWM=0<br><br>DRV_Get_ZPWM:<br>                Recall          DRV_PWM<br>                Push<br>                OR<br>                NOT<br>                Return<br><br>DRV_Update:<br>                Resume          DRV_Addr<br><br>DRV_Init:<br>DRV_Set0:<br>                SetMem          DRV_PWM,0<br>                GoSub           DRV_PWMOut<br>DRV_0:<br>                Suspend         DRV_Addr<br>                GoIfST          DRV_Accelerate,DRV_Set1 ;Test for RUN command<br>                GoTo            DRV_0<br><br>DRV_Set1:               ;Here on RUN command<br>                Suspend         DRV_Addr<br><br>;Which of the following 2 code lines determines whether the controller<br>;executes sudden stops, with dynamic braking, or smooth stop (ramping down the speed)<br>;<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/glossary-of-terms\/#o3465\">Comment out<\/a> the line you don't want.<br><br>;This line for sudden stop:<br>                GoIfSF          DRV_Accelerate,DRV_Set0 ;Test for STOP command<br>;This line for smooth stop:<br>                GoIfSF          DRV_Accelerate,DRV_Set2 ;Test for STOP command<br><br><br>                GoIfSF          Tick10,DRV_Set1         ;wait for time tick<br>                GoSub           SPD_GetSpeed            ;Target PWM<br>                Recall          DRV_PWM                 ;Actual PWM<br>                CompareR                                ;Compare Target to actual<br>                BranchR                                 ;Test result<br>                Target          DRV_Set1                ;On target<br>                Target          DRV_1_Dec               ;PWM too high<br>                Target          DRV_1_Inc               ;PWM too low<br><br>DRV_1_Dec:              ;Here to decrement PWM<br>                DecM            DRV_PWM<br>                GoSub           DRV_PWMOut<br>                GoTo            DRV_Set1<br><br>DRV_1_Inc:              ;Here to increment PWM<br>                IncM            DRV_PWM                 ;<br>                GoSub           DRV_PWMOut<br>                GoTo            DRV_Set1<br><br>DRV_Set2:               ;Here on stop command<br>                Suspend         DRV_Addr<br>                GoIfST          DRV_Accelerate,DRV_Set1 ;Test for RUN command<br>                GoIfSF          Tick10,DRV_Set2         ;wait for time tick<br>                GoIfMZ          DRV_PWM,DRV_Set0<br>                DecM            DRV_PWM<br>                GoSub           DRV_PWMOut<br>                GoTo            DRV_Set2<br><br><br>DRV_Run:<br>                SetS            DRV_Accelerate<br>                Return<br><br>DRV_Stop:<br>                ClrS            DRV_Accelerate<br>                Return<br><br>DRV_PWMOut:             ;Output the PWM<br>                Recall          DRV_PWM<br>                AnOutJ                          ;Alter for MS12<br>                OBLCD_SetCur    1,0<br>                OBLCD_UDecDispMFW       DRV_PWM<br>                Return<br>                <br><br>;----------- Speed task ---------------------------<br>;This task maintains the target speed.<br>;Short name     SPD<br><br>;Uses lcd 0,0 through 0,3<br><br>;Entry points<br><br>;               SPD_Init        Initialize<br>;               SPD_UpDate      Service push buttons, update target accordingly<br>;               SPD_Get_Speed   return current target speed in <a href=\"https:\/\/www.splatco.com\/skb\/352.htm#o3808\">X<\/a><br><br>SPD_Init:<br>                Return<br><br>SPD_GetSpeed:<br>                Recall          SPD_Target<br>                Return<br><br>SPD_UpDate:<br>                GoIfInK         iSpeedUp,SPD_Up<br>                GoIfInK         iSpeedDn,SPD_Dn<br>GenRet: Return<br><br>SPD_Dn:<br>                SetMem          SPD_Count,SPD_Increment<br>SPD_DnA:<br>                GoIfMZ          SPD_Target,SPD_Show<br>                DecM            SPD_Target<br>                DMGNZ           SPD_Count,SPD_DnA<br>                <br><br>SPD_Show:<br>                OBLCD_SetCur    0,0<br>                OBLCD_UDecDispMFW       SPD_Target<br>                Return<br><br>SPD_Up:<br>                SetMem          SPD_Count,SPD_Increment<br>SPD_UpA:<br>                GoIfMEQ         SPD_Target,255,SPD_Show<br>                IncM            SPD_Target<br>                DMGNZ           SPD_Count,SPD_UpA<br>                GoTo            SPD_Show<\/pre>\n\n\n\n\n","protected":false},"excerpt":{"rendered":"<p>The program code is reproduced below. You should master the\u00a0Multitasking tutorial\u00a0before attempting to understand this code! ;mdrv2.spt Example motor drive program using SPice10213;This program is&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1836,"menu_order":2,"template":"","class_list":["post-1839","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>Program code - 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=\"Program code - SPLat Controls\" \/>\n<meta property=\"og:description\" content=\"The program code is reproduced below. You should master the\u00a0Multitasking tutorial\u00a0before attempting to understand this code! ;mdrv2.spt Example motor drive program using SPice10213;This program is...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/spice10213-dc-motor-control\/spice10213-programming\/example-advanced-motor-control-with-spice10213\/program-code\/\" \/>\n<meta property=\"og:site_name\" content=\"SPLat Controls\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-10T08:38:57+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=\"6 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\/spice10213-dc-motor-control\/spice10213-programming\/example-advanced-motor-control-with-spice10213\/program-code\/\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/spice10213-dc-motor-control\/spice10213-programming\/example-advanced-motor-control-with-spice10213\/program-code\/\",\"name\":\"Program code - SPLat Controls\",\"isPartOf\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website\"},\"datePublished\":\"2025-04-14T08:21:38+00:00\",\"dateModified\":\"2025-06-10T08:38:57+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/spice10213-dc-motor-control\/spice10213-programming\/example-advanced-motor-control-with-spice10213\/program-code\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/spice10213-dc-motor-control\/spice10213-programming\/example-advanced-motor-control-with-spice10213\/program-code\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/spice10213-dc-motor-control\/spice10213-programming\/example-advanced-motor-control-with-spice10213\/program-code\/#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\":\"SPice10213: DC motor control\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/spice10213-dc-motor-control\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"SPice10213: Programming\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/spice10213-dc-motor-control\/spice10213-programming\/\"},{\"@type\":\"ListItem\",\"position\":6,\"name\":\"Example: Advanced motor control with SPice10213\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/spice10213-dc-motor-control\/spice10213-programming\/example-advanced-motor-control-with-spice10213\/\"},{\"@type\":\"ListItem\",\"position\":7,\"name\":\"Program code\"}]},{\"@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":"Program code - 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":"Program code - SPLat Controls","og_description":"The program code is reproduced below. You should master the\u00a0Multitasking tutorial\u00a0before attempting to understand this code! ;mdrv2.spt Example motor drive program using SPice10213;This program is...","og_url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/spice10213-dc-motor-control\/spice10213-programming\/example-advanced-motor-control-with-spice10213\/program-code\/","og_site_name":"SPLat Controls","article_modified_time":"2025-06-10T08:38:57+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/spice10213-dc-motor-control\/spice10213-programming\/example-advanced-motor-control-with-spice10213\/program-code\/","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/spice10213-dc-motor-control\/spice10213-programming\/example-advanced-motor-control-with-spice10213\/program-code\/","name":"Program code - SPLat Controls","isPartOf":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website"},"datePublished":"2025-04-14T08:21:38+00:00","dateModified":"2025-06-10T08:38:57+00:00","breadcrumb":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/spice10213-dc-motor-control\/spice10213-programming\/example-advanced-motor-control-with-spice10213\/program-code\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/spice10213-dc-motor-control\/spice10213-programming\/example-advanced-motor-control-with-spice10213\/program-code\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/spice10213-dc-motor-control\/spice10213-programming\/example-advanced-motor-control-with-spice10213\/program-code\/#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":"SPice10213: DC motor control","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/spice10213-dc-motor-control\/"},{"@type":"ListItem","position":5,"name":"SPice10213: Programming","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/spice10213-dc-motor-control\/spice10213-programming\/"},{"@type":"ListItem","position":6,"name":"Example: Advanced motor control with SPice10213","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-spice-add-on-boards\/spice10213-dc-motor-control\/spice10213-programming\/example-advanced-motor-control-with-spice10213\/"},{"@type":"ListItem","position":7,"name":"Program code"}]},{"@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\/1839","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\/1836"}],"wp:attachment":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/media?parent=1839"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}