{"id":127,"date":"2015-01-11T18:39:27","date_gmt":"2015-01-11T17:39:27","guid":{"rendered":"http:\/\/www.sevenwatt.com\/main\/?p=127"},"modified":"2016-01-10T14:50:27","modified_gmt":"2016-01-10T13:50:27","slug":"rfm69-afc-failure-with-ook","status":"publish","type":"post","link":"https:\/\/www.sevenwatt.com\/main\/rfm69-afc-failure-with-ook\/","title":{"rendered":"RFM69 AFC failure with OOK"},"content":{"rendered":"<p>I observed two issues with automatic frequency correction (AFC) and OOK reception:<\/p>\n<ul>\n<li>The AFC value does not get cleared by switching to sleep mode and back to receive<\/li>\n<li>AFC in continuous OOK mode can yield extreme values, setting the receiver totally off-band.<\/li>\n<\/ul>\n<div id=\"graphdiv5\" style=\"height: 300px;\"><\/div>\n<p><script type=\"text\/javascript\" src=\"\/\/www.sevenwatt.com\/data\/dygraph-combined.js\"><\/script><script type=\"text\/javascript\">\ng1 = new Dygraph(document.getElementById(\"graphdiv5\"),\"\/\/www.sevenwatt.com\/data\/rfm69\/433Freq-BW-VAR-AFC.csv\",{title: 'AFC failure 433.81MHz signal shifted by -1.29MHz', xlabel: 'f \/ MHz',\nunderlayCallback: function(canvas, area, g) {\n              var bottom_left = g.toDomCoords(433.71, -20);\n              var top_right = g.toDomCoords(433.91, +20);\n              var left = bottom_left[0];\n              var right = top_right[0];\n              canvas.fillStyle = \"rgba(255, 255, 102, 1.0)\";\n              canvas.fillRect(left, area.y, right - left, area.h);\n            }\n});\n<\/script><br \/>\nAFC should not be used in continuous OOK receive mode. I am not sure whether it is designed to work in this mode (I doubt it). When signal is detected by a high RSSI, an controlled AFC may very well be to late for the OOK pulse. But even not enabling AFC in OOK imposses a risk.<\/p>\n<p>When switching between FSK-packet mode for communication with the sensor network, and receiving external OOK signals, the AFC does not get resetted to zero. It can only be done by a HW-reset or power cycle, Or by explicitely clearing the AFC Value:<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\ntemplate&lt; typename SPI &gt;\r\nvoid RF69A&lt;SPI&gt;::setThd (uint8_t thd) {\r\n    this-&gt;writeReg(REG_AFCFEI, (1&lt;&lt;1));\r\n    this-&gt;setMode(MODE_SLEEP);\r\n    this-&gt;writeReg(REG_OOKFIX, thd);\r\n    chThdSleepMilliseconds(400);\r\n    this-&gt;setMode(MODE_RECEIVE);\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I observed two issues with automatic frequency correction (AFC) and OOK reception: The AFC value does not get cleared by switching to sleep mode and back to receive AFC in continuous OOK mode can yield extreme values, setting the receiver totally off-band. AFC should not be used in continuous OOK receive mode. I am not [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[7,27,15],"tags":[6,29,33,58],"class_list":["post-127","post","type-post","status-publish","format-standard","hentry","category-ook","category-picos-arm","category-rfm69","tag-868mhz","tag-chibios","tag-nucleo","tag-ook"],"_links":{"self":[{"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/posts\/127","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/comments?post=127"}],"version-history":[{"count":15,"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/posts\/127\/revisions"}],"predecessor-version":[{"id":594,"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/posts\/127\/revisions\/594"}],"wp:attachment":[{"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/media?parent=127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/categories?post=127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/tags?post=127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}