{"id":4602,"date":"2021-07-14T09:19:19","date_gmt":"2021-07-14T09:19:19","guid":{"rendered":"https:\/\/www.enocean.com\/?post_type=enocean_faq&#038;p=4602"},"modified":"2021-07-15T09:11:10","modified_gmt":"2021-07-15T09:11:10","slug":"overflow-and-underflow-of-analog-measurements-against-references","status":"publish","type":"enocean_faq","link":"https:\/\/www.enocean.com\/en\/faq-knowledge-base\/overflow-and-underflow-of-analog-measurements-against-references\/","title":{"rendered":"Overflow and Underflow of analog measurements against references"},"content":{"rendered":"\n<section class=\"wp-block-uagb-section uagb-section__wrap uagb-section__background-undefined uagb-block-0b42da11\"><div class=\"uagb-section__overlay\"><\/div><div class=\"uagb-section__inner-wrap\">\n<h1 class=\"wp-block-heading\">Overflow and Underflow of analog measurements against references<\/h1>\n\n\n<style>.wp-block-kadence-spacer.kt-block-spacer-_4f876c-1d .kt-block-spacer{height:20px;}.wp-block-kadence-spacer.kt-block-spacer-_4f876c-1d .kt-divider{border-top-width:1px;height:1px;border-top-color:#eee;width:80%;border-top-style:solid;}<\/style>\n<div class=\"wp-block-kadence-spacer aligncenter kt-block-spacer-_4f876c-1d\"><div class=\"kt-block-spacer kt-block-spacer-halign-center\" style=\"height:20px\"><\/div><\/div>\n\n\n\n<p><strong>This article applies to:<\/strong><br>Dolphin based modules performing analog measurements<\/p>\n\n\n<style>.wp-block-kadence-spacer.kt-block-spacer-_9a3291-d5 .kt-block-spacer{height:20px;}.wp-block-kadence-spacer.kt-block-spacer-_9a3291-d5 .kt-divider{border-top-width:1px;height:1px;border-top-color:#eee;width:80%;border-top-style:solid;}<\/style>\n<div class=\"wp-block-kadence-spacer aligncenter kt-block-spacer-_9a3291-d5\"><div class=\"kt-block-spacer kt-block-spacer-halign-center\" style=\"height:20px\"><\/div><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><a class=\"ek-link\">QUESTION<\/a><\/h3>\n\n\n<style>.wp-block-kadence-spacer.kt-block-spacer-_bed409-1f .kt-block-spacer{height:20px;}.wp-block-kadence-spacer.kt-block-spacer-_bed409-1f .kt-divider{border-top-width:1px;height:1px;border-top-color:#eee;width:80%;border-top-style:solid;}<\/style>\n<div class=\"wp-block-kadence-spacer aligncenter kt-block-spacer-_bed409-1f\"><div class=\"kt-block-spacer kt-block-spacer-halign-center\" style=\"height:20px\"><\/div><\/div>\n\n\n\n<p>What will happen with my analog measurements result value after scaling, when the value was under the negative reference or above the positive reference?<br><\/p>\n\n\n<style>.wp-block-kadence-spacer.kt-block-spacer-_829af9-5f .kt-block-spacer{height:20px;}.wp-block-kadence-spacer.kt-block-spacer-_829af9-5f .kt-divider{border-top-width:1px;height:1px;border-top-color:#eee;width:80%;border-top-style:solid;}<\/style>\n<div class=\"wp-block-kadence-spacer aligncenter kt-block-spacer-_829af9-5f\"><div class=\"kt-block-spacer kt-block-spacer-halign-center\" style=\"height:20px\"><\/div><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><a class=\"ek-link\">ANSWER<\/a><\/h3>\n\n\n<style>.wp-block-kadence-spacer.kt-block-spacer-_e18c8d-8e .kt-block-spacer{height:20px;}.wp-block-kadence-spacer.kt-block-spacer-_e18c8d-8e .kt-divider{border-top-width:1px;height:1px;border-top-color:#eee;width:80%;border-top-style:solid;}<\/style>\n<div class=\"wp-block-kadence-spacer aligncenter kt-block-spacer-_e18c8d-8e\"><div class=\"kt-block-spacer kt-block-spacer-halign-center\" style=\"height:20px\"><\/div><\/div>\n\n\n\n<p>The behavior of the scaling function is that:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>underflow will result in values increasing again 1,2,3&#8230;. (the value is lower then the negative reference, the result is the absolute value of -1,-2,-3 -&gt; 1, 2, 3 )<\/li><li>overflow will do the same e.g. for 8bit 256,257,258 (after trunk to 8 bit) -&gt; 1,2,3&#8230;<\/li><\/ul>\n\n\n\n<p>Overflow and underflow should be not a common application scenario, therefore please plan your references carefully so this state will not occur. Altough there might be situation where this can happen, so it is good at least detecting this situation so the application will not provide wrong measurements. In Dolphin you can detect this state by simply comparing the unscaled measurements.<\/p>\n\n\n<style>.wp-block-kadence-spacer.kt-block-spacer-_84b105-44 .kt-block-spacer{height:20px;}.wp-block-kadence-spacer.kt-block-spacer-_84b105-44 .kt-divider{border-top-width:1px;height:1px;border-top-color:#eee;width:80%;border-top-style:solid;}<\/style>\n<div class=\"wp-block-kadence-spacer aligncenter kt-block-spacer-_84b105-44\"><div class=\"kt-block-spacer kt-block-spacer-halign-center\" style=\"height:20px\"><\/div><\/div>\n\n\n<style>.wp-block-kadence-spacer.kt-block-spacer-_c65bc1-ad .kt-block-spacer{height:20px;}.wp-block-kadence-spacer.kt-block-spacer-_c65bc1-ad .kt-divider{border-top-width:1px;height:1px;border-top-color:#eee;width:80%;border-top-style:solid;}<\/style>\n<div class=\"wp-block-kadence-spacer aligncenter kt-block-spacer-_c65bc1-ad\"><div class=\"kt-block-spacer kt-block-spacer-halign-center\" style=\"height:20px\"><\/div><\/div>\n\n\n\n<pre class=\"wp-block-preformatted\">     sint16 s16negref;\n     sint16 s16posref;\n     sint16 s16adio1value;\n     uint16 u16adio1value;\n\n     io_enableAnalog(1); \/\/ configuring hardware for analog measurement no VGA, increase current to Analog current\n     io_ulpMeasAnalog(RVDD, &amp;s16posref); \/\/ measure positive reference against internal voltage\n     io_ulpMeasAnalog(RVSS, &amp;s16negref); \/\/ measure negative reference against internal voltage\n     io_ulpMeasAnalog(GPIO1_ADIO_1, &amp;s16adio1value); \/\/ measure ADIO_1 against internal voltage\n     io_enableAnalog(0); \/\/ restoring previous configuration for radio functionality and reduce current to CPU current\n     \n     if(s16posref&lt;s16adio1value)\n     {\n         \/\/ error handling for overflow\n     }\n     else if (s16negref&gt;s16adio1value)\n     {\n         \/\/ error handling for underflow\n     }\n     else\n     {\n         \/\/ all is ok\n         io_ulpScaleAnalog(s16posref, s16negref, s16adio1value, s16negref, 8, &amp;u16adio1value); \/\/ scale and calculate result for ADIO_1\n         ....\n     } <\/pre>\n<\/div><\/section>\n","protected":false},"featured_media":0,"template":"","faq_category":[103],"class_list":["post-4602","enocean_faq","type-enocean_faq","status-publish","hentry","faq_category-software"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Overflow and Underflow of analog measurements against references - EnOcean<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.enocean.com\/en\/faq-knowledge-base\/overflow-and-underflow-of-analog-measurements-against-references\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Overflow and Underflow of analog measurements against references - EnOcean\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.enocean.com\/en\/faq-knowledge-base\/overflow-and-underflow-of-analog-measurements-against-references\/\" \/>\n<meta property=\"og:site_name\" content=\"EnOcean\" \/>\n<meta property=\"article:modified_time\" content=\"2021-07-15T09:11:10+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:\/\/www.enocean.com\/en\/faq-knowledge-base\/overflow-and-underflow-of-analog-measurements-against-references\/\",\"url\":\"https:\/\/www.enocean.com\/en\/faq-knowledge-base\/overflow-and-underflow-of-analog-measurements-against-references\/\",\"name\":\"Overflow and Underflow of analog measurements against references - EnOcean\",\"isPartOf\":{\"@id\":\"https:\/\/www.enocean.com\/en\/#website\"},\"datePublished\":\"2021-07-14T09:19:19+00:00\",\"dateModified\":\"2021-07-15T09:11:10+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.enocean.com\/en\/faq-knowledge-base\/overflow-and-underflow-of-analog-measurements-against-references\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.enocean.com\/en\/faq-knowledge-base\/overflow-and-underflow-of-analog-measurements-against-references\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.enocean.com\/en\/faq-knowledge-base\/overflow-and-underflow-of-analog-measurements-against-references\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Startseite\",\"item\":\"https:\/\/www.enocean.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"FAQ\",\"item\":\"https:\/\/www.enocean.com\/en\/faq-knowledge-base\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Overflow and Underflow of analog measurements against references\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.enocean.com\/en\/#website\",\"url\":\"https:\/\/www.enocean.com\/en\/\",\"name\":\"EnOcean\",\"description\":\"EnOcean Relaunch\",\"publisher\":{\"@id\":\"https:\/\/www.enocean.com\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.enocean.com\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.enocean.com\/en\/#organization\",\"name\":\"EnOcean\",\"url\":\"https:\/\/www.enocean.com\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.enocean.com\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.enocean.com\/wp-content\/uploads\/Logos\/1-1.png\",\"contentUrl\":\"https:\/\/www.enocean.com\/wp-content\/uploads\/Logos\/1-1.png\",\"width\":500,\"height\":500,\"caption\":\"EnOcean\"},\"image\":{\"@id\":\"https:\/\/www.enocean.com\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.linkedin.com\/company\/enocean\/\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Overflow and Underflow of analog measurements against references - EnOcean","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.enocean.com\/en\/faq-knowledge-base\/overflow-and-underflow-of-analog-measurements-against-references\/","og_locale":"en_US","og_type":"article","og_title":"Overflow and Underflow of analog measurements against references - EnOcean","og_url":"https:\/\/www.enocean.com\/en\/faq-knowledge-base\/overflow-and-underflow-of-analog-measurements-against-references\/","og_site_name":"EnOcean","article_modified_time":"2021-07-15T09:11:10+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.enocean.com\/en\/faq-knowledge-base\/overflow-and-underflow-of-analog-measurements-against-references\/","url":"https:\/\/www.enocean.com\/en\/faq-knowledge-base\/overflow-and-underflow-of-analog-measurements-against-references\/","name":"Overflow and Underflow of analog measurements against references - EnOcean","isPartOf":{"@id":"https:\/\/www.enocean.com\/en\/#website"},"datePublished":"2021-07-14T09:19:19+00:00","dateModified":"2021-07-15T09:11:10+00:00","breadcrumb":{"@id":"https:\/\/www.enocean.com\/en\/faq-knowledge-base\/overflow-and-underflow-of-analog-measurements-against-references\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.enocean.com\/en\/faq-knowledge-base\/overflow-and-underflow-of-analog-measurements-against-references\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.enocean.com\/en\/faq-knowledge-base\/overflow-and-underflow-of-analog-measurements-against-references\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Startseite","item":"https:\/\/www.enocean.com\/en\/"},{"@type":"ListItem","position":2,"name":"FAQ","item":"https:\/\/www.enocean.com\/en\/faq-knowledge-base\/"},{"@type":"ListItem","position":3,"name":"Overflow and Underflow of analog measurements against references"}]},{"@type":"WebSite","@id":"https:\/\/www.enocean.com\/en\/#website","url":"https:\/\/www.enocean.com\/en\/","name":"EnOcean","description":"EnOcean Relaunch","publisher":{"@id":"https:\/\/www.enocean.com\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.enocean.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.enocean.com\/en\/#organization","name":"EnOcean","url":"https:\/\/www.enocean.com\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.enocean.com\/en\/#\/schema\/logo\/image\/","url":"https:\/\/www.enocean.com\/wp-content\/uploads\/Logos\/1-1.png","contentUrl":"https:\/\/www.enocean.com\/wp-content\/uploads\/Logos\/1-1.png","width":500,"height":500,"caption":"EnOcean"},"image":{"@id":"https:\/\/www.enocean.com\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.linkedin.com\/company\/enocean\/"]}]}},"taxonomy_info":{"faq_category":[{"value":103,"label":"Software"}]},"featured_image_src_large":false,"author_info":[],"comment_info":"","uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"Jose Salek","author_link":"https:\/\/www.enocean.com\/en\/author\/"},"uagb_comment_info":0,"uagb_excerpt":null,"_links":{"self":[{"href":"https:\/\/www.enocean.com\/en\/wp-json\/wp\/v2\/enocean_faq\/4602","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.enocean.com\/en\/wp-json\/wp\/v2\/enocean_faq"}],"about":[{"href":"https:\/\/www.enocean.com\/en\/wp-json\/wp\/v2\/types\/enocean_faq"}],"version-history":[{"count":0,"href":"https:\/\/www.enocean.com\/en\/wp-json\/wp\/v2\/enocean_faq\/4602\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.enocean.com\/en\/wp-json\/wp\/v2\/media?parent=4602"}],"wp:term":[{"taxonomy":"faq_category","embeddable":true,"href":"https:\/\/www.enocean.com\/en\/wp-json\/wp\/v2\/faq_category?post=4602"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}