{"id":155,"date":"2015-02-02T23:17:36","date_gmt":"2015-02-02T22:17:36","guid":{"rendered":"http:\/\/www.sevenwatt.com\/main\/?p=155"},"modified":"2015-03-02T23:01:28","modified_gmt":"2015-03-02T22:01:28","slug":"rfm69-ook-internal-sampling-rate","status":"publish","type":"post","link":"https:\/\/www.sevenwatt.com\/main\/rfm69-ook-internal-sampling-rate\/","title":{"rendered":"RFM69 OOK internal sampling rate"},"content":{"rendered":"<p>When the RFM69 is used in continuous OOK mode, the signal can be read from the RFM69 DATA (DIO2) pin. This can be done by polling this line with an ardiuno, jeenode, nucleo STM32 or other MCU. It can also be done interrupt driven by programming interrupts on the rasing and falling edge of the DATA signal. This way accurate timings can be measured. On the nucleo STM32 F103RB with ChibiOS I can measure pulse lengths of OOK signals with an accuracy of one or two microseconds.<\/p>\n<p>I decided to generate some OOK signal (and only noise) histograms to figure out how to deal with some high frequency noise in the OOK signals. I set the OOK bitrate in the RFM to 1000bps as the pulse durations are in the order of one millisecond in the signals I was working with. Then I found that pulse durations I measured were quite discrete. A saw peaks around 40\u00b5s, 80\u00b5s, etc. Further experimentation revealed that this discretisation internally in the RFM69 depends on the bitrate. With a bitrate of 2000, the peaks occured at 20\u00b5s intervals. So I concluded that the internal sampling of OOK signals happens at <strong><em>25 times the anticipated bitrate<\/em><\/strong> (chiprate). More aquirate measurements are required to detemrine the exact periodicity. It could also be 24 times or something like that.<\/p>\n<p>Below are two histograms where the bin size is 10\u00b5s, recorded for 30 seconds, with 1000 and 2000 bps.<\/p>\n<p><a href=\"http:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/02\/rfm69_ook_noise_pulse_dur_histo_2000bps.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-157\" src=\"http:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/02\/rfm69_ook_noise_pulse_dur_histo_2000bps.png\" alt=\"rfm69_ook_noise_pulse_dur_histo_2000bps\" width=\"970\" height=\"445\" srcset=\"https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/02\/rfm69_ook_noise_pulse_dur_histo_2000bps.png 970w, https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/02\/rfm69_ook_noise_pulse_dur_histo_2000bps-300x137.png 300w, https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/02\/rfm69_ook_noise_pulse_dur_histo_2000bps-624x286.png 624w\" sizes=\"auto, (max-width: 970px) 100vw, 970px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/02\/rfm69_ook_noise_pulse_dur_histo_1000bps.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-158\" src=\"http:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/02\/rfm69_ook_noise_pulse_dur_histo_1000bps.png\" alt=\"rfm69_ook_noise_pulse_dur_histo_1000bps\" width=\"970\" height=\"445\" srcset=\"https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/02\/rfm69_ook_noise_pulse_dur_histo_1000bps.png 970w, https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/02\/rfm69_ook_noise_pulse_dur_histo_1000bps-300x137.png 300w, https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/02\/rfm69_ook_noise_pulse_dur_histo_1000bps-624x286.png 624w\" sizes=\"auto, (max-width: 970px) 100vw, 970px\" \/><\/a>It can be clearly seen that with the lower bitrate also the measured noisy ONES (ON) and ZEORS (OFF) are detected at the 40\u00b5s., leaving three bins (nearly) empty in between. With longer durations it can be seen that the mismatch with the 40\u00b5s grid slightly increases. This can be due to either the factor of 25 not being accurate, but more likely it can be a mismatch between the RFM69 crystal clock and the nucleo internal oscillator, leading to slight clock differences between the two components.<\/p>\n<h2>Conclusion<\/h2>\n<p>Internally the RFM69 samples the RSSI at 25 times the programmed bitrate to detect ON or OFF OOK signal. This knowledge can be useful in figuring out the optimal OOK settings for reception of different OOK signals in various formats and bitrates. For example when using one reciever for a light switch control system such as KAKU and Oregon Scientific temerature sensors.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When the RFM69 is used in continuous OOK mode, the signal can be read from the RFM69 DATA (DIO2) pin. This can be done by polling this line with an ardiuno, jeenode, nucleo STM32 or other MCU. It can also be done interrupt driven by programming interrupts on the rasing and falling edge of the [&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":[32,28,33,58],"class_list":["post-155","post","type-post","status-publish","format-standard","hentry","category-ook","category-picos-arm","category-rfm69","tag-arduino","tag-jeenode","tag-nucleo","tag-ook"],"_links":{"self":[{"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/posts\/155","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=155"}],"version-history":[{"count":7,"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/posts\/155\/revisions"}],"predecessor-version":[{"id":342,"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/posts\/155\/revisions\/342"}],"wp:attachment":[{"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/media?parent=155"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/categories?post=155"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/tags?post=155"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}