{"id":1836,"date":"2025-04-14T08:19:05","date_gmt":"2025-04-14T08:19:05","guid":{"rendered":"https:\/\/webprojects.cloud\/wordpress\/splatco\/?post_type=spl_knowledgebase&#038;p=1836"},"modified":"2025-06-10T08:37:53","modified_gmt":"2025-06-10T08:37:53","slug":"example-advanced-motor-control-with-spice10213","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\/","title":{"rendered":"Example: Advanced motor control with SPice10213"},"content":{"rendered":"\n<p>This example provides sophisticated control. It implements speed-up and slow-down buttons, a stop\/start button and a forward\/reverse button. Unlike in the previous example, the direction button is honored at all times. If the motor is running it gets slowed to a stop, reversed and re-accelerated back up to speed. One simple code modification selects between gradual slow-down or sudden dynamic braking when the motor is to stop or reverse direction.<\/p>\n\n\n\n<p>The program is written as a full multitasking application with 3 separate tasks. The programming techniques are fully explained in the\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-examples\/tutorial-multitasking-superseded\/\">multitasking tutorial<\/a>. You will need to fully understand that material if this example is going to make sense to you.<\/p>\n\n\n\n<p>The 3 tasks are:<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Drive task<\/h6>\n\n\n\n<p>This task is responsible for controlling the output PWM in order to ramp the motor up or down to the desired speed.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Speed task<\/h6>\n\n\n\n<p>This task simply monitors the speed buttons and generates a target speed value.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Motor Sequencer task<\/h6>\n\n\n\n<p>This is the main control function which decides what is to be done. It primarily takes care of sequencing operations to take place in the right order whenever a button is pressed, irrespective of when it is pressed. The SPLatMap (state diagram) for the sequencer is described in the next section.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This example provides sophisticated control. It implements speed-up and slow-down buttons, a stop\/start button and a forward\/reverse button. Unlike in the previous example, the direction&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1832,"menu_order":3,"template":"","class_list":["post-1836","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: Advanced motor control with SPice10213 - 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: Advanced motor control with SPice10213 - SPLat Controls\" \/>\n<meta property=\"og:description\" content=\"This example provides sophisticated control. It implements speed-up and slow-down buttons, a stop\/start button and a forward\/reverse button. Unlike in the previous example, the direction...\" \/>\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\/\" \/>\n<meta property=\"og:site_name\" content=\"SPLat Controls\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-10T08:37:53+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=\"1 minute\" \/>\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\/\",\"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\/\",\"name\":\"Example: Advanced motor control with SPice10213 - SPLat Controls\",\"isPartOf\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website\"},\"datePublished\":\"2025-04-14T08:19:05+00:00\",\"dateModified\":\"2025-06-10T08:37:53+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\/#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\/\"]}]},{\"@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\/#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\"}]},{\"@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: Advanced motor control with SPice10213 - 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: Advanced motor control with SPice10213 - SPLat Controls","og_description":"This example provides sophisticated control. It implements speed-up and slow-down buttons, a stop\/start button and a forward\/reverse button. Unlike in the previous example, the direction...","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\/","og_site_name":"SPLat Controls","article_modified_time":"2025-06-10T08:37:53+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"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\/","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\/","name":"Example: Advanced motor control with SPice10213 - SPLat Controls","isPartOf":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website"},"datePublished":"2025-04-14T08:19:05+00:00","dateModified":"2025-06-10T08:37:53+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\/#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\/"]}]},{"@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\/#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"}]},{"@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\/1836","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\/1832"}],"wp:attachment":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/media?parent=1836"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}