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. My Project
  3. nRF5 action!

nRF5 action!

Scheduled Pinned Locked Moved My Project
1.9k Posts 49 Posters 631.1k Views 44 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
    #1040

    @d00616

    I want to transmit the shortest frame possible for my remote control packet, because that means the listen window on the receiver can be as short as possible, and that equals energy savings. To that end, looking at Figure 30: On-air packet layout in the datasheet (http://infocenter.nordicsemi.com/pdf/nRF52832_PS_v1.3.pdf), that would mean eliminating CRC, SO, LENGTH, S1, and the payload. What's left? Just an address. I could use one logical address to mean "ON", and a different logical address to mean "OFF".

    I had already eliminated CRC from the radiohead code, and it all worked fine. Now I'm converting over to the MySensors transport code, and I'm wondering: how should I approach getting rid of those extra bytes using the MySensors transport code as the starting point?

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

      I've had success in changing from sending one byte of payload to no payload at all by changing from

      NRF_RADIO->PCNF0=0x80108
      

      to

      NRF_RADIO->PCNF0=0x80008
      

      However, so far I haven't been able to shed S0 and/or S1 and still get the packet received, even if there's no payload.

      Interestingly enough, the smaller frame works better than the more bloated frame. I guess less chances for it to get corrupted over the air.

      1 Reply Last reply
      0
      • NeverDieN NeverDie

        @d00616

        I want to transmit the shortest frame possible for my remote control packet, because that means the listen window on the receiver can be as short as possible, and that equals energy savings. To that end, looking at Figure 30: On-air packet layout in the datasheet (http://infocenter.nordicsemi.com/pdf/nRF52832_PS_v1.3.pdf), that would mean eliminating CRC, SO, LENGTH, S1, and the payload. What's left? Just an address. I could use one logical address to mean "ON", and a different logical address to mean "OFF".

        I had already eliminated CRC from the radiohead code, and it all worked fine. Now I'm converting over to the MySensors transport code, and I'm wondering: how should I approach getting rid of those extra bytes using the MySensors transport code as the starting point?

        d00616D Offline
        d00616D Offline
        d00616
        Contest Winner
        wrote on last edited by d00616
        #1042

        @NeverDie said in nRF5 Bluetooth action!:

        @d00616
        I want to transmit the shortest frame possible for my remote control packet, because that means the listen window on the receiver can be as short as possible, and that equals energy savings.

        I think the best way to do this is using the Bit counter. Set a timer to stop the radio and with the bitcounter, you can stop this timer. With the BC, you don't loose the CRC or length information. The Bit counter counts the S0/S1 and Length information and all data bits.

        I use the bitcounter in the ESB-TX mode.

        NeverDieN JokgiJ 2 Replies Last reply
        1
        • d00616D d00616

          @NeverDie said in nRF5 Bluetooth action!:

          @d00616
          I want to transmit the shortest frame possible for my remote control packet, because that means the listen window on the receiver can be as short as possible, and that equals energy savings.

          I think the best way to do this is using the Bit counter. Set a timer to stop the radio and with the bitcounter, you can stop this timer. With the BC, you don't loose the CRC or length information. The Bit counter counts the S0/S1 and Length information and all data bits.

          I use the bitcounter in the ESB-TX mode.

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

          @d00616

          Since it appears now that there's no way to avoid sending S0, LENGTH, and S1 over-the-air in the course of a full packet transmission cycle (even if their values are zero), I'm having success using EVENTS_ADDRESS to remove them from the equation anyway by cutting short the full packet sending/receiving process just after the address is either sent or received. :)

          1 Reply Last reply
          0
          • NeverDieN NeverDie

            I received the following message from the Ebyte seller:

            Sorry that the two files are incorrect, please just ignore or delete them.
            We will send correct files later.
            
            Thank you!
            
            M Offline
            M Offline
            maniron
            wrote on last edited by
            #1044

            @NeverDie said in nRF5 Bluetooth action!:

            I received the following message from the Ebyte seller:

            Sorry that the two files are incorrect, please just ignore or delete them.
            We will send correct files later.
            
            Thank you!
            

            Hi, they sent you the right files? Can you share them?

            Thank you very much, great discussion

            NeverDieN 1 Reply Last reply
            0
            • M maniron

              @NeverDie said in nRF5 Bluetooth action!:

              I received the following message from the Ebyte seller:

              Sorry that the two files are incorrect, please just ignore or delete them.
              We will send correct files later.
              
              Thank you!
              

              Hi, they sent you the right files? Can you share them?

              Thank you very much, great discussion

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

              @maniron
              They never sent them. Would you be willing to try asking them too? Maybe if enough people do, they'll finally take some action.

              Unrelated, but I notice they've raised their prices.

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

                OK, so I've reduced the over-the-air transmission to one preamble byte and 5 address bytes, for a total of six bytes. The transmitter sends a packet to a different logical address depending on which button is pressed, and the receiver can determine which button was pressed depending on which logical address matches.

                So far, so good. The question now will be how many of those bytes I can eliminate before I start to get garbage packets.

                The other factor is the granularity of the RTC. The receive window will either be about 30us or 60us, and I believe (but haven't yet confirmed) that I'm already at around 60us. So, I may already be at the practical limit.

                JokgiJ 1 Reply Last reply
                0
                • NeverDieN NeverDie

                  OK, so I've reduced the over-the-air transmission to one preamble byte and 5 address bytes, for a total of six bytes. The transmitter sends a packet to a different logical address depending on which button is pressed, and the receiver can determine which button was pressed depending on which logical address matches.

                  So far, so good. The question now will be how many of those bytes I can eliminate before I start to get garbage packets.

                  The other factor is the granularity of the RTC. The receive window will either be about 30us or 60us, and I believe (but haven't yet confirmed) that I'm already at around 60us. So, I may already be at the practical limit.

                  JokgiJ Offline
                  JokgiJ Offline
                  Jokgi
                  wrote on last edited by
                  #1047

                  @NeverDie I would not go less then 3 address bytes or random noise may look like valid addresses. The more address Bytes the less chance of that happening.

                  NeverDieN 1 Reply Last reply
                  0
                  • d00616D d00616

                    @NeverDie said in nRF5 Bluetooth action!:

                    @d00616
                    I want to transmit the shortest frame possible for my remote control packet, because that means the listen window on the receiver can be as short as possible, and that equals energy savings.

                    I think the best way to do this is using the Bit counter. Set a timer to stop the radio and with the bitcounter, you can stop this timer. With the BC, you don't loose the CRC or length information. The Bit counter counts the S0/S1 and Length information and all data bits.

                    I use the bitcounter in the ESB-TX mode.

                    JokgiJ Offline
                    JokgiJ Offline
                    Jokgi
                    wrote on last edited by
                    #1048

                    @d00616 You may wish to count your retries as well. It is no use keeping the window narrow if you need to keep transmitting and receiving to get the same packet across. It may show that having a little wider window reduces the average current required by increasing the chance of picking up the packet first time. If you are using a timer to synchronize the RX and TX (TDMA) then you may be just fine.

                    1 Reply Last reply
                    0
                    • JokgiJ Jokgi

                      @NeverDie I would not go less then 3 address bytes or random noise may look like valid addresses. The more address Bytes the less chance of that happening.

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

                      @Jokgi said in nRF5 Bluetooth action!:

                      @NeverDie I would not go less then 3 address bytes or random noise may look like valid addresses. The more address Bytes the less chance of that happening.

                      @Jokgi said in nRF5 Bluetooth action!:

                      @NeverDie I would not go less then 3 address bytes or random noise may look like valid addresses. The more address Bytes the less chance of that happening.

                      According to the datasheet, it appears to force a minimum of 3 address bytes anyway: 2 base address bytes plus 1 prefix address byte. With no prefix byte, it would appear that's as low as the hardware will allow.

                      JokgiJ 1 Reply Last reply
                      0
                      • NeverDieN NeverDie

                        @Jokgi said in nRF5 Bluetooth action!:

                        @NeverDie I would not go less then 3 address bytes or random noise may look like valid addresses. The more address Bytes the less chance of that happening.

                        @Jokgi said in nRF5 Bluetooth action!:

                        @NeverDie I would not go less then 3 address bytes or random noise may look like valid addresses. The more address Bytes the less chance of that happening.

                        According to the datasheet, it appears to force a minimum of 3 address bytes anyway: 2 base address bytes plus 1 prefix address byte. With no prefix byte, it would appear that's as low as the hardware will allow.

                        JokgiJ Offline
                        JokgiJ Offline
                        Jokgi
                        wrote on last edited by Jokgi
                        #1050

                        @NeverDie I would not use a 2byte address for the reason I gave above. I was not including the preamble which is not really part of the address. 3 byte minimum is what I would recommend, not 2.

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

                          I can't make sense of the Packet configuration register 1 (PCNF1). Upon powering up, its value reads 0x262164, which doesn't really make any sense. I then try changing it to 0x22164. When i re-read it though, its value is then 0x139620, which is completely different. And this is 100% repeatable.

                          I can't make sense of this. What's going on with PCNF1? Why doesn't it keep the value that I set it to? why does it rapidly change over to the other number, and why that number in particular? I've tried setting it to other numbers also, but each time it doesn't stick and instead produces a puzzling number in its place. I've even confirmed that the radio is in a DISABLED state prior to making the change, but that doesn't seem to help either.

                          [Edit: mystery solved. I was accidently printing it as decimal instead of HEX. So, it works perfectly after all. :)].
                          .

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

                            Setting aside that mystery for the moment, the remote control presently is working very well, and the current draw during listen mode is now down to this:
                            0_1507236940156_NewFile1.png
                            which is certainly less than previously. Scale: 1mv=1ma.

                            It turns out that there's a minimum of 1 preamble byte. So, all told, there is a minimum of 4 bytes total that have to be transmitted: 1 preamble, 2 base address, 1 address prefix.

                            Eyeballing it, it does look as though the actual window of active listening is already around 30us, and unfortunately the granularity of the RTC prevents me from making it smaller than that. So, I suspect that, regarding power draw, this is already as good as it's possible to get. :)

                            JokgiJ 1 Reply Last reply
                            0
                            • NeverDieN NeverDie

                              Setting aside that mystery for the moment, the remote control presently is working very well, and the current draw during listen mode is now down to this:
                              0_1507236940156_NewFile1.png
                              which is certainly less than previously. Scale: 1mv=1ma.

                              It turns out that there's a minimum of 1 preamble byte. So, all told, there is a minimum of 4 bytes total that have to be transmitted: 1 preamble, 2 base address, 1 address prefix.

                              Eyeballing it, it does look as though the actual window of active listening is already around 30us, and unfortunately the granularity of the RTC prevents me from making it smaller than that. So, I suspect that, regarding power draw, this is already as good as it's possible to get. :)

                              JokgiJ Offline
                              JokgiJ Offline
                              Jokgi
                              wrote on last edited by
                              #1053

                              @NeverDie I would use 3 ADDRESS bytes, for the reason I gave before. The receiver could see noise as a valid packet and try to process it. and the fact you have no data packet and no CRC could cause you issues in a noisy 2.4Ghz environment. . Also be aware that if the radio is not already in receive or transmit mode the PLL takes about 130us to come up and settle. Crystal start and settle time will also depend on the CL value of the Crystal and not all manufactures use the same value. Conversely you can only transmit packets for 4ms before you need to bring down the transmitter and bring it back up again for the PLL to start and settle.

                              NeverDieN 2 Replies Last reply
                              2
                              • JokgiJ Jokgi

                                @NeverDie I would use 3 ADDRESS bytes, for the reason I gave before. The receiver could see noise as a valid packet and try to process it. and the fact you have no data packet and no CRC could cause you issues in a noisy 2.4Ghz environment. . Also be aware that if the radio is not already in receive or transmit mode the PLL takes about 130us to come up and settle. Crystal start and settle time will also depend on the CL value of the Crystal and not all manufactures use the same value. Conversely you can only transmit packets for 4ms before you need to bring down the transmitter and bring it back up again for the PLL to start and settle.

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

                                @Jokgi said in nRF5 Bluetooth action!:

                                Conversely you can only transmit packets for 4ms before you need to bring down the transmitter and bring it back up again for the PLL to start and settle.

                                Is that true for the nRF52832 as well? I had read it was true of the nRF24L01+, which is what led me to set it aside and go full bore on the nRF52832 instead.

                                JokgiJ 2 Replies Last reply
                                0
                                • NeverDieN NeverDie

                                  @Jokgi said in nRF5 Bluetooth action!:

                                  Conversely you can only transmit packets for 4ms before you need to bring down the transmitter and bring it back up again for the PLL to start and settle.

                                  Is that true for the nRF52832 as well? I had read it was true of the nRF24L01+, which is what led me to set it aside and go full bore on the nRF52832 instead.

                                  JokgiJ Offline
                                  JokgiJ Offline
                                  Jokgi
                                  wrote on last edited by Jokgi
                                  #1055

                                  @NeverDie Good catch!! The nRF52 series does not have this "feature". In other words, you don't have to bring the transmitter down to recalibrate the PLL..
                                  Only nRF51 and nRF24xx and nRF24L series legacy devices require it.

                                  1 Reply Last reply
                                  1
                                  • Nca78N Nca78

                                    @NeverDie said in nRF5 Bluetooth action!:

                                    Yes, but it made no difference. NCA78's post explains why. So, I guess that connector, which looks so promising, amounts to just marketing bait? i.e. in terms of practicality, it's little more than a decoration?

                                    I did the change on a PA LNA nrf24 from CDEByte, it was a real pain especially when the module was already soldered and surrounded by connectors. In the end I lost the cap somewhere on my desk and so I replaced it with a 0603 of the same capacity. Not looking great but much easier and it works better with the ipx antenna than with PCB.

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

                                    @Nca78 said in nRF5 Bluetooth action!:

                                    so I replaced it with a 0603 of the same capacity.

                                    Uh, what exactly is that capacitor value? I just had the same thing happen to me!

                                    Nca78N 1 Reply Last reply
                                    0
                                    • NeverDieN NeverDie

                                      @Jokgi said in nRF5 Bluetooth action!:

                                      Conversely you can only transmit packets for 4ms before you need to bring down the transmitter and bring it back up again for the PLL to start and settle.

                                      Is that true for the nRF52832 as well? I had read it was true of the nRF24L01+, which is what led me to set it aside and go full bore on the nRF52832 instead.

                                      JokgiJ Offline
                                      JokgiJ Offline
                                      Jokgi
                                      wrote on last edited by
                                      #1057

                                      @NeverDie the nRF52 pll comes up in about 40us....

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

                                        I received this from Amazon today and hooked an Ebyte nRF52832 (with the switched capacitor) into it:
                                        https://www.amazon.com/gp/product/B01B94U438/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1

                                        It actually does extend range. Not as well as I had hoped, but better than this high gain antenna, which I also received today and which, in comparison, I would call little better than a placebo:
                                        https://www.amazon.com/gp/product/B073SWWMRG/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1

                                        Soooo... With the bad news just received about the nRF51 (above) being limited to 4ms of Tx time at a time.... I guess it's time for this as Plan B on an nRF52832 gateway. Unless someone has a better idea. What I do like about it, given that it is a bolt-on, is that it senses when the nRF52832 begins to transmit, and only switches on the PA then. The rest of the time its in receive mode.

                                        U 1 Reply Last reply
                                        0
                                        • JokgiJ Jokgi

                                          @NeverDie I would use 3 ADDRESS bytes, for the reason I gave before. The receiver could see noise as a valid packet and try to process it. and the fact you have no data packet and no CRC could cause you issues in a noisy 2.4Ghz environment. . Also be aware that if the radio is not already in receive or transmit mode the PLL takes about 130us to come up and settle. Crystal start and settle time will also depend on the CL value of the Crystal and not all manufactures use the same value. Conversely you can only transmit packets for 4ms before you need to bring down the transmitter and bring it back up again for the PLL to start and settle.

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

                                          @Jokgi said in nRF5 Bluetooth action!:

                                          Also be aware that if the radio is not already in receive or transmit mode the PLL takes about 130us to come up and settle.

                                          Actually, maybe that's not so bad after all. So after Txing an nRF51 for up to 4ms, I can DISABLE it (which takes how long?), and then be back up for TXing for another 4ms after about 130us? If so, that's not as bad as I had feared.

                                          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