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 637.2k 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 NeverDie

    So, I guess the way the code would read is:

    1. First check if the reset registers are already properly set.
    2. If so, then just move on to whatever is next.
      If not, then properly set the reset registers and invoke the system reset.

    Apparently a system reset doesn't change the values in the reset registers.

    Of course, none of this would be needed if the reset enable from the tools menu worked, so I'd still prefer to do it that way if at all possible.

    As I indicated earlier, the pin mapping on Rx and Tx did work using @d00616 new technique, so hurray for that. That much was an important victory in itself that's worth celebrating. :)

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

    @NeverDie said in nRF5 Bluetooth action!:

    Apparently a system reset doesn't change the values in the reset registers.

    The "Reset" menu was from my first approach creating user manageable boards for arduino-nrf5. I haven' tested it. With the reset menu I set the "-DCONFIG_GPIO_AS_PINRESET" option. This option should be processed in "cores/nRF5/SDK/components/toolchain/system_nrf52.c". If not the SystemInit() function is not processed in the startup code. This is a problem handling the chip errata. I have not time to check this at the moment.

    Here is a PR which want to enable reset as default: https://github.com/sandeepmistry/arduino-nRF5/pull/91

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

      Maybe the reset pin problem is hardware related? I say that because if I program the Ebyte module as a Nordic nRF52832 DK board, it still has the same issue. In contrast, the reset button on the actual nRF52832 DK board does work as expected.

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

        I've confirmed that connecting P0.21 to GND and then removing it again on the Nordic nRF52832 DK does act as a reset. So, at the moment I have no idea why doing so on the Ebyte nRF52832 that's been programmed to think it's an Nordic nRF52832 DK doesn't do the same. There must be some hardware difference, right?

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

          I've confirmed that on both the Ebyte Module and on the Nordic nRF52832 DK, there is continuity between the P0.21 pin on the chip and the P0.21 pin on the board pinout. So, there must be some other factor that accounts for the difference.

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

            Making no headway on the reset topic, so for now I'm going to punt and move on to other things.

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

              Success! I received some of these modules:
              https://www.aliexpress.com/item/nRF52832-Bluetooth-4-1-BLE-Module-M4-Transparent-Transmission-SMA-512K-FLASH-64K-RAM-pass-through/32798522093.html?spm=2114.search0104.3.10.osbQHP&ws_ab_test=searchweb0_0,searchweb201602_5_10152_10065_10151_10068_10130_10084_10083_10119_10080_10307_10082_10081_10110_10178_10137_10111_10060_10112_10113_10155_10114_10154_10056_10055_10054_10310_10312_10059_100031_10099_10078_10079_10103_10073_10102_10120_10052_10053_10142_10107_10050_10051-10120,searchweb201603_2,ppcSwitch_5&btsid=b9a0c3cb-cc2a-4254-b24f-94136c73def6&algo_expid=2a71f70b-4929-43a5-887a-2f7263250568-1&algo_pvid=2a71f70b-4929-43a5-887a-2f7263250568
              which I immediately programmed using the nRF52832 DK. This time, there was no need to first mass erase. Furthermore, this time P0.21 does indeed reset the module after it is pulled to ground and then released.

              So, from this I conclude there must be something peculiar to the Ebyte modules which prevents their resetting using P0.21.

              It's nice to have different modules to compare amongst. :)

              mfalkviddM 1 Reply Last reply
              1
              • NeverDieN NeverDie

                Success! I received some of these modules:
                https://www.aliexpress.com/item/nRF52832-Bluetooth-4-1-BLE-Module-M4-Transparent-Transmission-SMA-512K-FLASH-64K-RAM-pass-through/32798522093.html?spm=2114.search0104.3.10.osbQHP&ws_ab_test=searchweb0_0,searchweb201602_5_10152_10065_10151_10068_10130_10084_10083_10119_10080_10307_10082_10081_10110_10178_10137_10111_10060_10112_10113_10155_10114_10154_10056_10055_10054_10310_10312_10059_100031_10099_10078_10079_10103_10073_10102_10120_10052_10053_10142_10107_10050_10051-10120,searchweb201603_2,ppcSwitch_5&btsid=b9a0c3cb-cc2a-4254-b24f-94136c73def6&algo_expid=2a71f70b-4929-43a5-887a-2f7263250568-1&algo_pvid=2a71f70b-4929-43a5-887a-2f7263250568
                which I immediately programmed using the nRF52832 DK. This time, there was no need to first mass erase. Furthermore, this time P0.21 does indeed reset the module after it is pulled to ground and then released.

                So, from this I conclude there must be something peculiar to the Ebyte modules which prevents their resetting using P0.21.

                It's nice to have different modules to compare amongst. :)

                mfalkviddM Offline
                mfalkviddM Offline
                mfalkvidd
                Mod
                wrote on last edited by
                #421

                @NeverDie gotta catch them all :)

                1 Reply Last reply
                0
                • Nca78N Nca78

                  First nrf51822 module arrived already.
                  It's really small, here between an nrf24 SMD and the cdebyte 52832.
                  Soldering quality looks better than the pictures on AliExpress.
                  0_1501235779537_IMAG1846.jpg

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

                  @Nca78

                  Note sure how this fits into the comparative size of things, but it looks interesting:
                  https://www.aliexpress.com/item/NRF52832-Module-Core-Board-Wireless-Bluetooth-Transceiver-Module-Transparent-Transmission-Code-NRF51822-Migration-Guide/32797905798.html?spm=a2g0s.13010208.99999999.280.9VhQow

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

                    Anyone have a good sketch for measuring the battery supplied voltage on an nRF52? Some of the concepts from the old atmega328p may apply, but the specifics are going to be different, I'm sure.

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      Mike_Lemo
                      wrote on last edited by
                      #424

                      Check on adafruits feather reference they use two resistors as a voltage divider for that simple and effective.

                      NeverDieN 1 Reply Last reply
                      1
                      • M Mike_Lemo

                        Check on adafruits feather reference they use two resistors as a voltage divider for that simple and effective.

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

                        @Mike_Lemo said in nRF5 Bluetooth action!:

                        Check on adafruits feather reference they use two resistors as a voltage divider for that simple and effective.

                        I'm not finding it. Do you have a link?

                        M 2 Replies Last reply
                        0
                        • NeverDieN NeverDie

                          @Mike_Lemo said in nRF5 Bluetooth action!:

                          Check on adafruits feather reference they use two resistors as a voltage divider for that simple and effective.

                          I'm not finding it. Do you have a link?

                          M Offline
                          M Offline
                          Mike_Lemo
                          wrote on last edited by
                          #426

                          @NeverDie https://learn.adafruit.com/assets/39913

                          Top right corner of the schematic.

                          1 Reply Last reply
                          0
                          • NeverDieN NeverDie

                            @Mike_Lemo said in nRF5 Bluetooth action!:

                            Check on adafruits feather reference they use two resistors as a voltage divider for that simple and effective.

                            I'm not finding it. Do you have a link?

                            M Offline
                            M Offline
                            Mike_Lemo
                            wrote on last edited by
                            #427

                            @NeverDie but a much better but more expensive solution would be a lipo fuel guage from spark fun they use a Max chip for that.

                            1 Reply Last reply
                            0
                            • Nca78N Offline
                              Nca78N Offline
                              Nca78
                              Hardware Contributor
                              wrote on last edited by
                              #428

                              If supplied with less than 3.6V you can do it with ADC, 1.2V voltage reference and 1/3 prescaling.
                              But I've only looked at the theory yet.

                              Rules are Vdd+0.3V max at the pin, and max 2.4V as input of ADC (after prescaling)

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

                                Well, as you all know, on the atmega328p you can read the 1.1v gap voltage using the battery voltage as the reference voltage, by doing analogRead(A0), and from just that one measurement then calculate the battery voltage by doing a little bit of math. So, I'm just wondering what the code is to do the equivalent of that (using 1.2v instead of 1.1v) on the nRF52832.

                                1 Reply Last reply
                                0
                                • Nca78N Nca78

                                  If supplied with less than 3.6V you can do it with ADC, 1.2V voltage reference and 1/3 prescaling.
                                  But I've only looked at the theory yet.

                                  Rules are Vdd+0.3V max at the pin, and max 2.4V as input of ADC (after prescaling)

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

                                  @Nca78 said in nRF5 Bluetooth action!:

                                  If supplied with less than 3.6V you can do it with ADC, 1.2V voltage reference and 1/3 prescaling.
                                  But I've only looked at the theory yet.

                                  For this, you can use the implemented hwCPUVoltage() function. Reading the voltage costs nRF51: 260µA/20µs | nRF52: 700µA/3µs

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

                                    @d00616 said in nRF5 Bluetooth action!:

                                    hwCPUVoltage()

                                    I'm finally installing Visual Micro, because I hope it will help me quickly find where all these functions are defined. With all these new layers, the Arduino IDE is just no longer cutting it.

                                    NeverDieN scalzS TerrenceT 3 Replies Last reply
                                    1
                                    • NeverDieN NeverDie

                                      @d00616 said in nRF5 Bluetooth action!:

                                      hwCPUVoltage()

                                      I'm finally installing Visual Micro, because I hope it will help me quickly find where all these functions are defined. With all these new layers, the Arduino IDE is just no longer cutting it.

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

                                      LOL. Well, Visual Micro found it alright, but just in the wrong place. It found it in MyHwAVR.cpp

                                      1 Reply Last reply
                                      0
                                      • NeverDieN NeverDie

                                        @d00616 said in nRF5 Bluetooth action!:

                                        hwCPUVoltage()

                                        I'm finally installing Visual Micro, because I hope it will help me quickly find where all these functions are defined. With all these new layers, the Arduino IDE is just no longer cutting it.

                                        scalzS Offline
                                        scalzS Offline
                                        scalz
                                        Hardware Contributor
                                        wrote on last edited by
                                        #433

                                        @NeverDie said in nRF5 Bluetooth action!:

                                        @d00616 said in nRF5 Bluetooth action!:

                                        hwCPUVoltage()

                                        I'm finally installing Visual Micro, because I hope it will help me quickly find where all these functions are defined. With all these new layers, the Arduino IDE is just no longer cutting it.

                                        good choice :+1:
                                        for nrf5, the function is located in MyHwNRF5.cpp

                                        1 Reply Last reply
                                        1
                                        • d00616D d00616

                                          @Nca78 said in nRF5 Bluetooth action!:

                                          If supplied with less than 3.6V you can do it with ADC, 1.2V voltage reference and 1/3 prescaling.
                                          But I've only looked at the theory yet.

                                          For this, you can use the implemented hwCPUVoltage() function. Reading the voltage costs nRF51: 260µA/20µs | nRF52: 700µA/3µs

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

                                          @d00616 said in nRF5 Bluetooth action!:

                                          For this, you can use the implemented hwCPUVoltage() function.

                                          I tried this function call on an nRF52 DK, and it seems to work. I then tried it on an Ebyte module, treated as an nRF52 DK "board", and it reported zero voltage. So, probably I just need to do a pin mapping so that it reads the voltage on the proper pin. But which pin/mapping would it be? I thought that Vcc wouldn't really be mappable to anything but Vcc. I guess whichever analog pin (if that's what it is?) is connected to Vcc on the nRF52 DK is the pin I need to find and re-map to its equivalent pin on the Ebyte module. Hmmm.... I'll have to look into which one that would be.

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


                                          28

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.1k

                                          Posts


                                          Copyright 2025 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