Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Hardware
  3. Everything nRF52840

Everything nRF52840

Scheduled Pinned Locked Moved Hardware
323 Posts 28 Posters 50.6k Views 33 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • NeverDieN Offline
    NeverDieN Offline
    NeverDie
    Hero Member
    wrote on last edited by NeverDie
    #16

    You can also improve range with data whitening, though I'm not sure by how much. To enable it, substitute this line into the above code examples:

      NRF_RADIO->PCNF1 = 0x2040101;  //Means: data whitening enbled, base address is 4 bytes long (possible range is 2 to 4) and max size of payload is 1,and 1 bytes of static length payload
    
    

    Then the hardware handles it automatically.

    1 Reply Last reply
    0
    • alowhumA Offline
      alowhumA Offline
      alowhum
      Plugin Developer
      wrote on last edited by alowhum
      #17

      @heinzv
      ST electronics has the dongle for 17 euros including shipping in the Netherlands/Europe.

      It's slowly getting cheaper on Aliexpress too. $25 here:
      https://www.aliexpress.com/item/nRF52840-Dongle-original-genuine/32922402227.html

      1 Reply Last reply
      0
      • H heinzv

        @neverdie I have ordered 10x nRF52832 and also 5x nRF52840. Two of theme are in the E73... modul which is not really easy to solder with it's additional pads in inner rows under the modul and the company has no plans to change it for private makers.

        I have ordered 2 but it looks like they have discontinued that or working on an upgrade?
        https://www.aliexpress.com/item/nRF52840-Bluetooth-5-0-240MHz-RF-Transceiver-CDSENET-E73-2G4M08S1C-8dbm-Ceramic-Antenna-BLE-4-2/32906661666.html?spm=a2g0s.9042311.0.0.50784c4dZJ6WSY

        I have seen the dongles but they are still quite expensive:
        https://www.aliexpress.com/item/NRF52840-Dongle-Original/32890524949.html?spm=2114.search0104.3.1.dfe53098heRtmA&ws_ab_test=searchweb0_0,searchweb201602_5_10065_10068_10547_10059_10548_10696_100031_5017615_10084_10083_10103_5017516_451_10618_452_10304_10307_5017416_10820_10821_10302_5017715,searchweb201603_60,ppcSwitch_4&algo_expid=c3e31797-40ab-4a13-b99e-df32e618cf5c-0&algo_pvid=c3e31797-40ab-4a13-b99e-df32e618cf5c&transAbTest=ae803_2&priceBeautifyAB=0

        This modul is also makers friendly and around 10-11us$ (4 pieces for around 40us$)
        https://www.aliexpress.com/item/New-product-NRF52840-Bluetooth-5-MESH-Bluetooth-low-power-module-ZIGBEE-GT840A01/32909273516.html?spm=2114.search0104.3.43.bf083dad4DLBft&ws_ab_test=searchweb0_0,searchweb201602_5_10065_10068_10547_10059_10548_10696_100031_5017615_10084_10083_10103_5017516_451_10618_452_10304_10307_5017416_10820_10821_10302_5017715,searchweb201603_60,ppcSwitch_4&algo_expid=2fb40cd9-604f-47a8-b9f1-61d13e35e3cd-6&algo_pvid=2fb40cd9-604f-47a8-b9f1-61d13e35e3cd&transAbTest=ae803_2&priceBeautifyAB=0
        0_1537102327744_77645b3c-f65e-48c8-ab21-9ade454a65d1-grafik.png

        I have also odered 3 nRF52840 dev boards from holyiot for 6us$ (which is quite ok).
        0_1537102018397_1f1e5b94-952b-4587-bc17-4fdce7ea3908-grafik.png
        0_1537102093205_e95dcd83-dcb1-46ad-8581-564e43181f21-grafik.png

        The question is, how far would be a reliable indoor distance which of course includes 3+ standard walls and how much difference is it compared to the nRF52832 (is the 840 really required)?
        And is/will there be a full protocoll support for BLE5.0 (or at least 4.2) or any other protocol which is good enoght to not require an additonal radio like LoRa?
        That would be great and very energy efficient for battery usage.

        At least it would solve my Flash/RAM problem for E-Paper (in comparison to the 328p) :-)
        Looking forward to the progress of this device/thread.

        NeverDieN Offline
        NeverDieN Offline
        NeverDie
        Hero Member
        wrote on last edited by NeverDie
        #18

        @heinzv said in Everything nRF52840:

        The question is, how far would be a reliable indoor distance which of course includes 3+ standard walls and how much difference is it compared to the nRF52832 (is the 840 really required)?

        I think the short answer is that yes, it should be able to get through 3+ standard walls. There is some directionality to these antennas, so that can be a factor. You may not succeed if you aim the trace antennas in opposite directions, for instance. Using an external omni antenna might make the setup easier.

        I think some of the claimed range for the nRF52840 is from coding gains added to the 125Kbps datarate. Without doing a lot of work, you might have to use bluetooth long-range to get those ranges. Not sure though.

        1 Reply Last reply
        0
        • scalzS scalz

          @heinzv yes, for the moment sandeep nrf5 core is not using latest softdevice (still s132). I don't remember about mbed (I imagine they use latest) but mysensors is not on mbed.
          Sure, subghz is not comparable with 2.4ghz. Like NeverDie said, there are many variables. The dongle have nice range when plugged in computer, it can be different if soldered on a different custom pcb, or using different software etc. Another point, is 2.4ghz can be crowded, depends where you live (no problem I live in rural area) but living in appartment in big cities I can imagine it's less quiet (coexistence&placement of wifi routers, phones, range extender, ble, zigbee, proprietary modes, more&more devices, not synced, channels overlap->selectivity&blocking etc..). Lot of variables for the real range.

          That said I'm not surprised that NeverDie has fun playing with this dongle. it looks sexy (although I decided to stop using nrf5).
          cool! keep the good work @NeverDie :+1:

          H Offline
          H Offline
          heinzv
          wrote on last edited by heinzv
          #19

          @scalz you stopped because of what reason? And you did not want to tell why and what you're now using? It might be worth for us to know!
          So far I plan to use ESP32 for most projects and trying to use the ultra low power nRF52 for battery powered devices. For the RF ranges I need to find out what is best. BLE or LoRa with RFM95 are my favorites now.
          In a pure ESP environment ESPnow is also very good (we have tested it sucssfully within a 120m2 flat).
          I have no better ideas so other HW devices far, but I'm always open for better ideas.

          @NeverDie I'm not from Germany but from Austria :-) I'll do testing with the 15 modules I will get in the next 2 weeks. Regarding the indorr range: Of yourse I read all the statements also from Nordic. I thought you have already some practical experience.

          In the battery wall sensors, I can only use a small sizes antenna and the gateway will have a better antenna.
          So the typical distance in a flat is around 15m but through at least up to 3+ walls
          Of course most todays flats/houses have many bluetooth and WLAN devices around.
          But we need an appropriate mysensors radio/protocol library for the nRF52's. Any yes we can play around with lower data rates to extend the range based on the signal range and transmissison stability.

          Looking forward to your experience and inputs.

          1 Reply Last reply
          0
          • NeverDieN Offline
            NeverDieN Offline
            NeverDie
            Hero Member
            wrote on last edited by NeverDie
            #20

            Here's a simple sketch I wrote for the nRF52840-DONGLE that turns on, one at a time, each of the 4 programmable LED's on the dongle:

            #include "mbed.h"
            
            #define BITMASK_LED1 64 //pin P0.06
            #define BITMASK_LED2R  256 //PIN P0.08
            #define BITMASK_LED2G  512 //PIN P1.09
            #define BITMASK_LED2B  4096 //PIN P0.12
            
            
            int main() {
                NRF_P0->PIN_CNF[6]=0x701;  //Configure pin P0.6 as an output pin with high-drive '0' and disconnect '1'
                NRF_P0->PIN_CNF[8]=0x701;  //Configure pin P0.8 as an output pin with high-drive '0' and disconnect '1'
                NRF_P0->PIN_CNF[12]=0x701;  //Configure pin P0.12 as an output pin with high-drive '0' and disconnect '1'
                NRF_P1->PIN_CNF[9]=0x701;  //Configure pin P1.09 as an output pin with high-drive '0' and disconnect '1'         
                NRF_P0->DIR=BITMASK_LED1|BITMASK_LED2R|BITMASK_LED2B;  //Set LED's as output pins
                NRF_P1->DIR=BITMASK_LED2G;  //set LED2G as an output pin.
                
                while (true) {
                  NRF_P0->OUT=BITMASK_LED2R|BITMASK_LED2B;  //turn-on LED1.  Turn-ff LED2R and LED2B.
                  NRF_P1->OUT=BITMASK_LED2G;  //Turn off LED2G
                  wait(0.5);  //wait 500ms
                  NRF_P0->OUT=BITMASK_LED1|BITMASK_LED2B; //turn on LED2R and turn off LED1 and LED2B
                  wait(0.5);  //wait 500ms            
                  NRF_P0->OUT=BITMASK_LED1|BITMASK_LED2R;  //Turn on LED2B and turn off LED1 and LED2R.
                  wait(0.5);  //wait 500ms
                  NRF_P0->OUT=BITMASK_LED1|BITMASK_LED2R|BITMASK_LED2B;  //turn off LED1 and LED2R and LED2B.
                  NRF_P1->OUT=0;  //Turn on LED2G
                  wait(0.5);  //wait 500ms
                }
            }
            

            The dongle per se isn't supported by mbed, which is why I'm doing it purely as register manipulations. Therefore, the code is completely portable and would transfer to whatever toolchain that you're using. I guess I'll write some support functions to make doing this easier in the future.

            1 Reply Last reply
            0
            • NeverDieN Offline
              NeverDieN Offline
              NeverDie
              Hero Member
              wrote on last edited by NeverDie
              #21

              Good news. I just noticed that Fanstel will have a couple of amplified nRF52840, called the nRF52840X or nRF52840XE. They just aren't yet in production with them. At least to me, this will likely make a big difference in my level of satisfaction. Judging from the datasheet, it will have both a PA and an LNA, so even just having it on the gateway would be a worthwhile improvement.

              H 1 Reply Last reply
              0
              • NeverDieN NeverDie

                Good news. I just noticed that Fanstel will have a couple of amplified nRF52840, called the nRF52840X or nRF52840XE. They just aren't yet in production with them. At least to me, this will likely make a big difference in my level of satisfaction. Judging from the datasheet, it will have both a PA and an LNA, so even just having it on the gateway would be a worthwhile improvement.

                H Offline
                H Offline
                heinzv
                wrote on last edited by
                #22

                @neverdie said in Everything nRF52840:

                nRF52840XE

                If BLE5 alone works sufficient, that would be great. Worst case, I will use the nRF52 with RFM95 for the battery devices and an ESP32 + RFM95 for the gateway.
                The new PCB's we plan with ranseyer will cover all possible combination and provides the mySX connector.

                1 Reply Last reply
                1
                • NeverDieN Offline
                  NeverDieN Offline
                  NeverDie
                  Hero Member
                  wrote on last edited by NeverDie
                  #23

                  Maybe by the time nRF52840X comes out (in 6 months to a year I'm guessing), maybe by then mbed will be fully supporting the nRF52840-DK. Or, maybe mbed never will. I need to find a tool chain different from mbed to adopt. I'm not sure whether mbed is nearly dead, slowly dying, or just slow, but I don't see a lot of activity on their forum given the vast scope of their projects. If they aren't on top of new developments,... it's just not a good sign. Also, I'm noticing that mbed comes with a large amount of code overhead (around 400Kbytes from what I've seen in my compilations on it), and although the nRF52840 can handle that and more...it seems strange given the small size of my test programs.

                  So, I'm open to suggestions on an alternate toolchain, provided that it's up to date with respect to nRF52840.

                  H 1 Reply Last reply
                  0
                  • NeverDieN NeverDie

                    Maybe by the time nRF52840X comes out (in 6 months to a year I'm guessing), maybe by then mbed will be fully supporting the nRF52840-DK. Or, maybe mbed never will. I need to find a tool chain different from mbed to adopt. I'm not sure whether mbed is nearly dead, slowly dying, or just slow, but I don't see a lot of activity on their forum given the vast scope of their projects. If they aren't on top of new developments,... it's just not a good sign. Also, I'm noticing that mbed comes with a large amount of code overhead (around 400Kbytes from what I've seen in my compilations on it), and although the nRF52840 can handle that and more...it seems strange given the small size of my test programs.

                    So, I'm open to suggestions on an alternate toolchain, provided that it's up to date with respect to nRF52840.

                    H Offline
                    H Offline
                    heinzv
                    wrote on last edited by heinzv
                    #24

                    @neverdie What speaks against platform.io with Visual Studio Code?
                    https://platformio.org/platforms/nordicnrf52
                    http://docs.platformio.org/en/latest/platforms/nordicnrf52.html (includes nRF52840 DK)
                    and what about that:
                    https://os.mbed.com/platforms/Nordic-nRF52-DK/
                    and that:
                    https://github.com/lpercifield/arduino-nRF5/tree/nrf52840

                    NeverDieN 1 Reply Last reply
                    0
                    • H heinzv

                      @neverdie What speaks against platform.io with Visual Studio Code?
                      https://platformio.org/platforms/nordicnrf52
                      http://docs.platformio.org/en/latest/platforms/nordicnrf52.html (includes nRF52840 DK)
                      and what about that:
                      https://os.mbed.com/platforms/Nordic-nRF52-DK/
                      and that:
                      https://github.com/lpercifield/arduino-nRF5/tree/nrf52840

                      NeverDieN Offline
                      NeverDieN Offline
                      NeverDie
                      Hero Member
                      wrote on last edited by NeverDie
                      #25

                      @heinzv said in Everything nRF52840:

                      and what about that:
                      https://os.mbed.com/platforms/Nordic-nRF52-DK/

                      The mbed compiler doesn't seem to even recognize that there are new GPIO pins on the nRF52840 that don't exist on the nRF52832. For instance, P1.00, which is one of the pins on the Fanstel nRF52840 module. Plus, I'm not sure that printf works with anything other than USB. I've tried setting it to other pins, and it just hangs. I've written some custom code to do my own sserial communications over P1_00 (to handle a PCB backward compatability issue with the nRF52840 Fanstel modules), but if mbed is only half baked, it's not helping me like it should.

                      Not sure about platform.io. Thanks for the lead. I'll look into it.

                      H 1 Reply Last reply
                      0
                      • NeverDieN NeverDie

                        @heinzv said in Everything nRF52840:

                        and what about that:
                        https://os.mbed.com/platforms/Nordic-nRF52-DK/

                        The mbed compiler doesn't seem to even recognize that there are new GPIO pins on the nRF52840 that don't exist on the nRF52832. For instance, P1.00, which is one of the pins on the Fanstel nRF52840 module. Plus, I'm not sure that printf works with anything other than USB. I've tried setting it to other pins, and it just hangs. I've written some custom code to do my own sserial communications over P1_00 (to handle a PCB backward compatability issue with the nRF52840 Fanstel modules), but if mbed is only half baked, it's not helping me like it should.

                        Not sure about platform.io. Thanks for the lead. I'll look into it.

                        H Offline
                        H Offline
                        heinzv
                        wrote on last edited by heinzv
                        #26

                        @neverdie take a look at platform.io, it supports al known SOC's. INstall it then from the Visual Studio Code IDE. Both together are a very professional IoT dev environment (also Web and other development).
                        I was doing very complex development like ESPurna project build you would not like to do in the Arduino IDE.
                        Let me know if you need further hints.
                        VSC and Platform.IO includes not only all SOC HW families but also all kind of libraries you know from Arduino and it can also import Arduino project (*.INO Files).
                        Give it a try and you will be suprrised once you get familar.
                        It does also the flashing (upload), includes GIT nativly, has a command window, debugging etc etc.

                        https://code.visualstudio.com/
                        https://marketplace.visualstudio.com/items?itemName=platformio.platformio-ide
                        https://marketplace.visualstudio.com/search?term=platform.io&target=VSCode&category=All categories&sortBy=Relevance

                        Platforms: Atmel AVR, Atmel SAM, Espressif 32, Espressif 8266, Freescale Kinetis, Infineon XMC, Intel ARC32, Intel MCS-51 (8051), Lattice iCE40, Maxim 32, Microchip PIC32, Nordic nRF51, Nordic nRF52, NXP LPC, RISC-V, Samsung ARTIK, Silicon Labs EFM32, ST STM32, Teensy, TI MSP430, TI Tiva, WIZNet W7500

                        Frameworks: Arduino, ARTIK SDK, CMSIS, Energia, ESP-IDF, libOpenCM3, mbed, Pumbaa, Simba, SPL, STM32Cube, WiringPi

                        1 Reply Last reply
                        1
                        • scalzS Offline
                          scalzS Offline
                          scalz
                          Hardware Contributor
                          wrote on last edited by scalz
                          #27

                          @heinzv platformio is nice for supporting lot of SOCs. But I think it still rely on sandeep arduino or mbed for nrf5, so, not sure if it adds stuff to the frameworks.. (regarding boards mapping, softdevices, etc). that's what NeverDie is searching I think.. an environment which allows to use all features of the SOC that he buy, ideally with myensors but we still can wait :)
                          regarding what you asked me previously, this is one of my reason. As missing core features is not what I'm calling fast/easy to market/production for smarter features!
                          That, and nrf is 2.4ghz only (area here is 9000m², few outbuildings with thick walls too), so increase of BOM&layout when using multiple modules (not a big problem for a gw, less nice for nodes). I don't want to use lora too..

                          H 1 Reply Last reply
                          1
                          • scalzS scalz

                            @heinzv platformio is nice for supporting lot of SOCs. But I think it still rely on sandeep arduino or mbed for nrf5, so, not sure if it adds stuff to the frameworks.. (regarding boards mapping, softdevices, etc). that's what NeverDie is searching I think.. an environment which allows to use all features of the SOC that he buy, ideally with myensors but we still can wait :)
                            regarding what you asked me previously, this is one of my reason. As missing core features is not what I'm calling fast/easy to market/production for smarter features!
                            That, and nrf is 2.4ghz only (area here is 9000m², few outbuildings with thick walls too), so increase of BOM&layout when using multiple modules (not a big problem for a gw, less nice for nodes). I don't want to use lora too..

                            H Offline
                            H Offline
                            heinzv
                            wrote on last edited by heinzv
                            #28

                            @scalz
                            That is what I found at the nordic docu for development
                            http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.gs%2Fdita%2Fgs%2Fgs.html&cp=1
                            https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF52-DK
                            They mention two dev environments

                            • nRF5 Series: Developing with SEGGER Embedded Studio
                            • nRF5 Series: Developing on Windows with ARM Keil MDK

                            Platform.IO support description for nRF52
                            framework-arduinonordicnrf5 Arduino Wiring-based Framework (Nordic NRF5 Core)
                            framework-mbed mbed Framework
                            tool-jlink SEGGER J-Link Software and Documentation Pack
                            tool-nrfjprog nRF5x command line tool
                            tool-openocd OpenOCD
                            tool-sreccat Merging tool
                            toolchain-gccarmnoneeabi gcc-arm-embedded

                            So what MCU's and radio/transmission are you using then ... ?

                            1 Reply Last reply
                            0
                            • NeverDieN Offline
                              NeverDieN Offline
                              NeverDie
                              Hero Member
                              wrote on last edited by NeverDie
                              #29

                              I don't see specific support in platformio for nRF52840. Also, it's support for nRF52 generally seems to rely on mbed:
                              https://github.com/platformio/platform-nordicnrf52/tree/master/examples?utm_source=platformio&utm_medium=docs

                              I suspect the only way to do this is to use Nordic's SDK and one of the tool chains that Nordic recognizes as working with it. I hope I can find one without a heavy learning curve. Either that or limp along with mbed, which is half baked but (so far) at least allows me to do direct registry manipulations. With mbed maybe it will turn out that the total amount of remedial code I have to write isn't huge. Not sure. I don't have much confidence in mbed's future though. I'm noticing that a lot of the posts on their forum go completely unanswered.

                              Nordic, on the other hand, seems much better about answering posted questions (well, 5 days a week anyway. Forget about weekends).

                              @heinzv We've come full circle on this. I previously posted a question on the Sandeep github as to whether it supported the nRF52840, and the answer was no, its SDK was too new, but that maybe I would have some success in programming it if I treated it like an nRF52832. https://github.com/sandeepmistry/arduino-nRF5/issues/310 Well, that's really no better than the current situation with mbed.

                              The only other thing on the horizon might be miropython. Not sure if micropython is fully deterministic enough for microcontroller work (e.g. might it garbage collect in the middle of a critical loop?), but maybe it's worth a shot. "Blinka & her new pal the nRF52840" https://learn.adafruit.com/circuitpython-on-the-nrf52

                              1 Reply Last reply
                              0
                              • H Offline
                                H Offline
                                heinzv
                                wrote on last edited by
                                #30

                                @NeverDie have you also checked this from my previous 3 posts agao
                                https://github.com/lpercifield/arduino-nRF5/tree/nrf52840

                                this is a fork from sandeeps Arduino-NRF5 project which explicitly adds nRF52840 (that was the reason for the fork) where people have been waiting for (and probably sandeep has not announced a support soon).
                                See also sandeeps respons to lpercifield's work
                                https://github.com/sandeepmistry/arduino-nRF5/issues/70

                                Softdevice in this project is at S132 and Nordic newest is S140 (full BLE5 stack). Don't know why is was not yet worked into and why there is not realy a big progress since 2 years.

                                At least there is a project with nRF52 and LoRa (SX1276/RFM95) :-)
                                https://github.com/gluedig/nrf52-lora

                                NeverDieN 1 Reply Last reply
                                1
                                • H heinzv

                                  @NeverDie have you also checked this from my previous 3 posts agao
                                  https://github.com/lpercifield/arduino-nRF5/tree/nrf52840

                                  this is a fork from sandeeps Arduino-NRF5 project which explicitly adds nRF52840 (that was the reason for the fork) where people have been waiting for (and probably sandeep has not announced a support soon).
                                  See also sandeeps respons to lpercifield's work
                                  https://github.com/sandeepmistry/arduino-nRF5/issues/70

                                  Softdevice in this project is at S132 and Nordic newest is S140 (full BLE5 stack). Don't know why is was not yet worked into and why there is not realy a big progress since 2 years.

                                  At least there is a project with nRF52 and LoRa (SX1276/RFM95) :-)
                                  https://github.com/gluedig/nrf52-lora

                                  NeverDieN Offline
                                  NeverDieN Offline
                                  NeverDie
                                  Hero Member
                                  wrote on last edited by NeverDie
                                  #31

                                  @heinzv Thanks for pointing that out. It sounds like lpercifield encountered the exact same problems as me, except two years earlier. But, then he hasn't touched his code in the 2 years afterward. Nordic's SDK has changed since then. I'm just not sure.

                                  I guess it's a question of whether these one person, piecemeal attempts are enough, or whether joining with a toolchain that has a lot more oomph behind it is preferable. I suspect the total amount of work involved is just too much for one person, in their spare time, to accomplish more than partial coverage. Again, not sure, but I can see what @scalz means.

                                  I don't think Nordic has any interest in Arduino IDE support per se. If anything, it probably means a costly support burden to them without revenues to support it. Instead, Nordic is clearly targeting big commercial buyers , like phone manufacturers or the like, who will buy millions of chips just to have the latest features/capabilities. So, with nothing to pay for it on the Arduino front, except maybe a tiny bit by Adafruit or Sparkfun, it's necessarily just a bunch of individual, ad hoc efforts, or so it seems to me. Those individuals will solve whatever matters to them personally, but leaving spotty coverage on everything else. It' is admittedly better than nothing. Maybe for what I'm doing it's good enough. More than a little frustrating though.

                                  1 Reply Last reply
                                  3
                                  • scalzS Offline
                                    scalzS Offline
                                    scalz
                                    Hardware Contributor
                                    wrote on last edited by scalz
                                    #32

                                    @NeverDie dilemma.
                                    maybe try: apache mynewt + plugin for visual studio code. that might pick your curiosity. I liked it when I tried. but you know.. :nerd_face:

                                    or zephyr but I don't know much about it.
                                    of course, these advanced toolchains are less easy to get started than arduino (setup or coding details). needs to port some arduino libs when you need it (makes sense). You won't get proprietary rf stack like MySensors out of the box too. It'll be BLE based in this case.
                                    But you'll be able to use your mcu as you wish.

                                    I hope you'll like it, else do like me :laughing:

                                    1 Reply Last reply
                                    2
                                    • NeverDieN Offline
                                      NeverDieN Offline
                                      NeverDie
                                      Hero Member
                                      wrote on last edited by NeverDie
                                      #33

                                      You can also increase range by increasing the number of preamble bytes. Today I upgraded to using 4 preamble bytes. Beyond that it's likely diminishing returns.

                                      To do the same on the nRF52840, use:

                                        NRF_RADIO->PCNF0=0x02000000;  //4 pre-amble bytes.  S0,LENGTH, and S1 are all zero bits long.
                                      

                                      @heinzv Another factor in range is how high off the ground your radio nodes are. This can have a huge effect, due to multipath fading from the ground. According to the Fanstel datasheet, for instance, even going from half a meter off the ground to 1.5 meters off the ground can almost triple your range. So, at the very least, try to put your gateway up as high as you can.

                                      H 1 Reply Last reply
                                      0
                                      • scalzS Offline
                                        scalzS Offline
                                        scalz
                                        Hardware Contributor
                                        wrote on last edited by scalz
                                        #34

                                        @NeverDie
                                        exactly.
                                        with infos below, you have everything for estimating the range (maybe that can interest others people too):

                                        • https://forum.mysensors.org/post/93384 simple but so true.
                                        • an excellent excel sheet made by.. TI! :) where you can pick absorption materials, set height of antenna, indoor/outdoor calc etc
                                          http://www.ti.com/tool/RF-RANGE-ESTIMATOR
                                          The doc for the sheet http://www.ti.com/lit/an/swra479a/swra479a.pdf , very interesting too with comparison about selectivity/blocking etc
                                          or the forum thread in case https://e2e.ti.com/support/wireless_connectivity/proprietary_sub_1_ghz_simpliciti/f/156/t/375556
                                          works ok, here, with excel 2010 viewer (else you can't use choice lists)
                                          As it targets TI mcu, it's explained in docs that you can try by using an "equivalent" TI mcu, then check datasheet values for your mcu and change what's needed in the excel sheet. Maybe cc2640r2f and nrf52840 has "same" rf perf at 125kbps, no idea about blocking level.

                                        Lot of variables, which also make a FCC module to become non-FCC when soldered on a custom board; all certified modules pass tests regarding a specific manufacturer design&usecase, they cannot certify that people won't degrade RF and emit bad stuff, thus that become non-FCC. Applicable to all RF devices though, rf laws rules (even when changing antenna for better gain, or different shape, on wifi router, it breaks certif in theory).
                                        Like you said, better pick a good antenna sure! There are antenna which are resistant to detuning, but most of antennas like "coiled" wire, meandered pcb trace (cdebyte 52832 type), or ceramic antennas are easily detuned by pcb layout, or once it's enclosed, or close to objects (stacked boards, metals, hands etc). Then, they need to be rematched to get best range.
                                        Good to know and interesting stuff ;)

                                        1 Reply Last reply
                                        2
                                        • NeverDieN Offline
                                          NeverDieN Offline
                                          NeverDie
                                          Hero Member
                                          wrote on last edited by NeverDie
                                          #35

                                          Well, interestingly, I just now tried the BLE Long Range preamble, which is 10 reptetitions of 0x3C, and it really does seem to make a noticeable improvement in coverage/range/reliability. Obviously the extra repetitions help, but I think maybe (?) it's also partly because the 4 byte preamble is the one specified by 802.11.15, which is 4 bytes of all zeros (which is pretty weird. Never seen that as the preferred choice before. Usually preambles are alternating high low signals instead).

                                          To set the preamble to BLE Long Range, use:

                                           NRF_RADIO->PCNF0=0x03000000;  //10 preamble bytes.  S0,LENGTH, and S1 are all zero bits long.
                                          

                                          .

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          16

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.0k

                                          Posts


                                          Copyright 2019 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • MySensors
                                          • OpenHardware.io
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular