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.5k 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.
  • Nca78N Nca78

    @NeverDie said in nRF5 Bluetooth action!:

    By switching to a Windows 10 computer, I was able to get J-link working over USB from windows.

    Can you explain the steps you used for that ?
    Did you use a jlink clone or the version included in the DK ?

    Nca78N Offline
    Nca78N Offline
    Nca78
    Hardware Contributor
    wrote on last edited by
    #411

    @Nca78 said in nRF5 Bluetooth action!:

    @NeverDie said in nRF5 Bluetooth action!:

    By switching to a Windows 10 computer, I was able to get J-link working over USB from windows.

    Can you explain the steps you used for that ?
    Did you use a jlink clone or the version included in the DK ?

    Well you can forget about my questions.
    I tried to use the JLink tools to make the mass erase but it didn't want to connect to the module.
    But then I have replaced the driver with Zadig and configured Arduino for NRF5 and it uploaded the LightSensor sketch, I can see it in the log of the controller. No mass erase needed, nor any unlock or related command.
    Just plug and program for me :D

    I have some strange error messages but I guess they come from (very) dated firmware on my Segger clone

    ** Programming Started **
    auto erase enabled
    Info : nRF51822-QFN48(build code: B00) 512kB Flash
    Warn : not enough working area available(requested 32)
    Warn : no working area available, falling back to slow memory writes
    wrote 28672 bytes from file C:\Users\Nicolas\AppData\Local\Temp\arduino_build_723618/LightSensor.ino.hex in 6.715397s (4.170 KiB/s)
    ** Programming Finished **
    ** Verify Started **
    Warn : not enough working area available(requested 52)
    verified 27432 bytes in 0.279278s (95.923 KiB/s)
    ** Verified OK **
    ** Resetting Target **
    shutdown command invoked
    
    1 Reply Last reply
    1
    • Nca78N Nca78

      @NeverDie said in nRF5 Bluetooth action!:

      By switching to a Windows 10 computer, I was able to get J-link working over USB from windows.

      Can you explain the steps you used for that ?
      Did you use a jlink clone or the version included in the DK ?

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

      @Nca78 said in nRF5 Bluetooth action!:

      Did you use a jlink clone or the version included in the DK ?

      I used the j-link Segger clone to do the mass erase, and then I switched to the DK to do the programming. However, today I was able to do the programming from the Segger clone on the Windows 10 computer, and the setup is less arduous than for programming an external chip using the DK (because with the Segger I didn't have to power the target chip independently during the programming).

      1 Reply Last reply
      0
      • NeverDieN NeverDie

        I guess it wouldn't be that simple, because I just now read that it requires a system reset after writing to those registers: https://devzone.nordicsemi.com/question/157603/can-i-enable-and-disable-nrf52832-reset-pin-when-code-is-running/ for it to take effect.

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

        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 1 Reply Last reply
        0
        • Nca78N Offline
          Nca78N Offline
          Nca78
          Hardware Contributor
          wrote on last edited by Nca78
          #414

          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 1 Reply Last reply
          1
          • 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
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          13

                                          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