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.4k 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.
  • d00616D d00616

    @Nca78 said in nRF5 Bluetooth action!:

    Does that mean I have to go the long hard way with a bluepill as programmer and openocd ? Anyone has other ideas to unlock and erase the device ?

    Select in to Tools menu "None" Softdevice and then "Burn Bootloader". This raises an error but the device is erased completely.

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

    @d00616 said in nRF5 Bluetooth action!:

    Select in to Tools menu "None" Softdevice and then "Burn Bootloader". This raises an error but the device is erased completely.

    I'm happy to report this also worked when, just now, I programmed a new Ebyte module. Like d00616 said earlier, it's a much faster way to do a mass erase. :)

    Unfortunately, and in contrast with the nRF52 DK, the new Ebyte module I just programmed is behaving the same as the Ebyte I've been experimenting with. No change.

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

      I will test tomorrow with the Ebyte module I have soldered, and the reset pin too.

      NeverDieN 1 Reply Last reply
      1
      • d00616D d00616

        @Mike_Lemo said in nRF5 Bluetooth action!:

        I want to define the enforcer for the pins within their dedicated sketches without running around to the internal arduino files and change the pin assignment for each upload to each board.
        How'd I do that? I assume you'd have to do some thing like that in the upper side of the personal code.
        #define SDL...(Something else I don't know ) 11
        #define SDA...(Something else I don't know ) 12

        You have to install the "MySensors nRF5 Boards" package. In the examples section for this package, you can find two files (MyNRF5Board.h + MyNRF5Board.cpp). Add these files to your sketch and compile it using "MyNRF5Board nRF52822" as you board.

        @Mike_Lemo said in nRF5 Bluetooth action!:

        Well apperantly this function uses a PWM pin at 50% duty but the frequency varies according to the functiong user parameter now I just know how to active a PWM pin at 50% duty but not how to acces the NRF52 registers to change the frequency of the PWM.

        The registers are documented in the Infocenter and the bitfields.

        I don't realy know how to access the registers you see at the product's PDF and the other process.

        To access the registers, you have to add '#include <nrf.h>' to your code. Mostly the hardware is accesses by NRF_HWNAME->REGISTER

        Doing PWM is a little bit complex. The code is different for nRF51 and nRF52. Look into wiring_analog_nRF51.c and (wiring_analog_nRF51.c)[https://github.com/sandeepmistry/arduino-nRF5/blob/c98a190eb34c0247eb8e0764a6367c7f9e51d2fc/cores/nRF5/wiring_analog_nRF52.c#L214]

        If you clone this code, for nRF52 you have to use another timer, like TIMER2, because you can't define the interrupt routine twice.

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

        @d00616 said in nRF5 Bluetooth action!:

        MySensors nRF5 Boards

        Thanks for the caring replay.

        I couldn't find that exact "MySensors nRF5 Boards" library you were talking about also what is the purpose of this library anyways?

        Do you know where can the arduino library folder be found with all the arduino functions?

        Nca78N d00616D 2 Replies Last reply
        0
        • M Mike_Lemo

          @d00616 said in nRF5 Bluetooth action!:

          MySensors nRF5 Boards

          Thanks for the caring replay.

          I couldn't find that exact "MySensors nRF5 Boards" library you were talking about also what is the purpose of this library anyways?

          Do you know where can the arduino library folder be found with all the arduino functions?

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

          @Mike_Lemo it is here :
          https://github.com/mysensors/ArduinoHwNRF5

          Scroll up in this thread for more details, or read the documentation there.

          1 Reply Last reply
          1
          • M Mike_Lemo

            @d00616 said in nRF5 Bluetooth action!:

            MySensors nRF5 Boards

            Thanks for the caring replay.

            I couldn't find that exact "MySensors nRF5 Boards" library you were talking about also what is the purpose of this library anyways?

            Do you know where can the arduino library folder be found with all the arduino functions?

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

            @Mike_Lemo said in nRF5 Bluetooth action!:

            I couldn't find that exact "MySensors nRF5 Boards" library you were talking about also what is the purpose of this library anyways?

            Follow the instructions for ArduinoBoards and ArduinoHwNRF5

            Do you know where can the arduino library folder be found with all the arduino functions?

            The arduino-nrf5 port only implements functionality documented in the official Arduino Reference but mostly not more functionality available for SAMD :-(. Additional functionality like BLE or using included hardware must come from external libraries like MySensors.

            A good way to implement the tone commands is to fork the arduino-nRF5 repository at github. Change what you need and create an pull request with reference to the Arduino reference. If you inform me about your PR I comment it to increase the chance for acceptance otherwise it's time to maintain an separate fork of this repository.

            1 Reply Last reply
            1
            • Nca78N Nca78

              I will test tomorrow with the Ebyte module I have soldered, and the reset pin too.

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

              @Nca78 said in nRF5 Bluetooth action!:

              I will test tomorrow with the Ebyte module I have soldered, and the reset pin too.

              That would be great! :) Please try the BatteryPoweredSensor sketch when you do. I'm very curious if you will have the same or different result as what I'm getting.

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

                @d00616 said in nRF5 Bluetooth action!:

                @Mike_Lemo said in nRF5 Bluetooth action!:

                I couldn't find that exact "MySensors nRF5 Boards" library you were talking about also what is the purpose of this library anyways?

                Follow the instructions for ArduinoBoards and ArduinoHwNRF5

                Do you know where can the arduino library folder be found with all the arduino functions?

                The arduino-nrf5 port only implements functionality documented in the official Arduino Reference but mostly not more functionality available for SAMD :-(. Additional functionality like BLE or using included hardware must come from external libraries like MySensors.

                A good way to implement the tone commands is to fork the arduino-nRF5 repository at github. Change what you need and create an pull request with reference to the Arduino reference. If you inform me about your PR I comment it to increase the chance for acceptance otherwise it's time to maintain an separate fork of this repository.

                that actually caused more trouble won't even let me compile the blank included example code.

                NeverDieN 1 Reply Last reply
                0
                • M Mike_Lemo

                  @d00616 said in nRF5 Bluetooth action!:

                  @Mike_Lemo said in nRF5 Bluetooth action!:

                  I couldn't find that exact "MySensors nRF5 Boards" library you were talking about also what is the purpose of this library anyways?

                  Follow the instructions for ArduinoBoards and ArduinoHwNRF5

                  Do you know where can the arduino library folder be found with all the arduino functions?

                  The arduino-nrf5 port only implements functionality documented in the official Arduino Reference but mostly not more functionality available for SAMD :-(. Additional functionality like BLE or using included hardware must come from external libraries like MySensors.

                  A good way to implement the tone commands is to fork the arduino-nRF5 repository at github. Change what you need and create an pull request with reference to the Arduino reference. If you inform me about your PR I comment it to increase the chance for acceptance otherwise it's time to maintain an separate fork of this repository.

                  that actually caused more trouble won't even let me compile the blank included example code.

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

                  @Mike_Lemo said in nRF5 Bluetooth action!:

                  that actually caused more trouble won't even let me compile the blank included example code.

                  Are you talking about the MyNRF5Board example? Arduino IDE compiles it for me without any complaints.

                  M 1 Reply Last reply
                  0
                  • NeverDieN NeverDie

                    @Mike_Lemo said in nRF5 Bluetooth action!:

                    that actually caused more trouble won't even let me compile the blank included example code.

                    Are you talking about the MyNRF5Board example? Arduino IDE compiles it for me without any complaints.

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

                    @NeverDie When choosing "MyNRF5Board nrf52832"?

                    NeverDieN 1 Reply Last reply
                    0
                    • M Mike_Lemo

                      @NeverDie When choosing "MyNRF5Board nrf52832"?

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

                      @Mike_Lemo said in nRF5 Bluetooth action!:

                      @NeverDie When choosing "MyNRF5Board nrf52832"?

                      Yup.

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

                        At some point, I had to re-arrange the libraries though (don't remember which files or which ones) to get all this stuff working. Before that, it wasn't finding the files. Actually, I think this would be a good topic for discussion, to make sure we're all doing it the same way. If we're doing it differently, it might make cross-checking each others attempts more difficult. Also, maybe there's a better way than the brute-force way that I did it.

                        If anyone has interest, I can post how my libraries are currently structured. If nothing else, it would be a starting point for discussion on what to do (or not to do).

                        M 1 Reply Last reply
                        0
                        • NeverDieN NeverDie

                          At some point, I had to re-arrange the libraries though (don't remember which files or which ones) to get all this stuff working. Before that, it wasn't finding the files. Actually, I think this would be a good topic for discussion, to make sure we're all doing it the same way. If we're doing it differently, it might make cross-checking each others attempts more difficult. Also, maybe there's a better way than the brute-force way that I did it.

                          If anyone has interest, I can post how my libraries are currently structured. If nothing else, it would be a starting point for discussion on what to do (or not to do).

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

                          @NeverDie said in nRF5 Bluetooth action!:

                          At some point, I had to re-arrange the libraries though (don't remember which files or which ones) to get all this stuff working. Before that, it wasn't finding the files. Actually, I think this would be a good topic for discussion, to make sure we're all doing it the same way. If we're doing it differently, it might make cross-checking each others attempts more difficult. Also, maybe there's a better way than the brute-force way that I did it.

                          If anyone has interest, I can post how my libraries are currently structured. If nothing else, it would be a starting point for discussion on what to do (or not to do).

                          Dunno that whole arduino BRF52832 programming thing seems too complicated just started to learn how to use the nordic SDK with eclipse until a proper solution is found.

                          NeverDieN d00616D 2 Replies Last reply
                          0
                          • M Mike_Lemo

                            @NeverDie said in nRF5 Bluetooth action!:

                            At some point, I had to re-arrange the libraries though (don't remember which files or which ones) to get all this stuff working. Before that, it wasn't finding the files. Actually, I think this would be a good topic for discussion, to make sure we're all doing it the same way. If we're doing it differently, it might make cross-checking each others attempts more difficult. Also, maybe there's a better way than the brute-force way that I did it.

                            If anyone has interest, I can post how my libraries are currently structured. If nothing else, it would be a starting point for discussion on what to do (or not to do).

                            Dunno that whole arduino BRF52832 programming thing seems too complicated just started to learn how to use the nordic SDK with eclipse until a proper solution is found.

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

                            @Mike_Lemo said in nRF5 Bluetooth action!:

                            Dunno that whole arduino BRF52832 programming thing seems too complicated just started to learn how to use the nordic SDK with eclipse until a proper solution is found.

                            It hasn't been easy, I'll grant you that. I get the impression d00616 probably does most of his work in Linux, and so some of the disconnect with the Windows IDE probably stems from that. Once we get the basics ironed out, though, I expect things will go more smoothly. In fact, I think we're almost there. A lot of the work for sleeping, measuring source voltage, etc., has already been done, which is far better than starting from scratch. And there's even example code, which helps tremendously.

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

                              Good news! Interestingly enough, the MockMySensors sketch seems to work fine when I load it onto the Ebyte. What a relief! So, I may try hijacking that sketch to convey voltage measurements instead of the BatteryPoweredSensor sketch that mysteriously hasn't been working on my Ebyte modules.

                              1 Reply Last reply
                              0
                              • M Mike_Lemo

                                @NeverDie said in nRF5 Bluetooth action!:

                                At some point, I had to re-arrange the libraries though (don't remember which files or which ones) to get all this stuff working. Before that, it wasn't finding the files. Actually, I think this would be a good topic for discussion, to make sure we're all doing it the same way. If we're doing it differently, it might make cross-checking each others attempts more difficult. Also, maybe there's a better way than the brute-force way that I did it.

                                If anyone has interest, I can post how my libraries are currently structured. If nothing else, it would be a starting point for discussion on what to do (or not to do).

                                Dunno that whole arduino BRF52832 programming thing seems too complicated just started to learn how to use the nordic SDK with eclipse until a proper solution is found.

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

                                @Mike_Lemo said in nRF5 Bluetooth action!:

                                Dunno that whole arduino BRF52832 programming thing seems too complicated just started to learn how to use the nordic SDK with eclipse until a proper solution is found.

                                The Nordic SDK is more complete than Arduino-nrf5 at the moment, but there is no compatibility with MySensors.

                                The good news, with SDK 13 the 'Nordic Semiconductor ASA' License was changed. The old ASA was the reason for me to rewrite the complete ESB protocol. Now the license is much less restrictive. I think now the way is open to integrate SDK code into arduino-nrf5 or provide SDK based arduino-libraries.

                                @NeverDie said in nRF5 Bluetooth action!:

                                It hasn't been easy, I'll grant you that. I get the impression d00616 probably does most of his work in Linux, and so some of the disconnect with the Windows IDE probably stems from that.

                                I can't change the way of Windows driver handling, but when there are Windows specific issues then they bust be fixed.

                                M 1 Reply Last reply
                                1
                                • d00616D d00616

                                  @Mike_Lemo said in nRF5 Bluetooth action!:

                                  Dunno that whole arduino BRF52832 programming thing seems too complicated just started to learn how to use the nordic SDK with eclipse until a proper solution is found.

                                  The Nordic SDK is more complete than Arduino-nrf5 at the moment, but there is no compatibility with MySensors.

                                  The good news, with SDK 13 the 'Nordic Semiconductor ASA' License was changed. The old ASA was the reason for me to rewrite the complete ESB protocol. Now the license is much less restrictive. I think now the way is open to integrate SDK code into arduino-nrf5 or provide SDK based arduino-libraries.

                                  @NeverDie said in nRF5 Bluetooth action!:

                                  It hasn't been easy, I'll grant you that. I get the impression d00616 probably does most of his work in Linux, and so some of the disconnect with the Windows IDE probably stems from that.

                                  I can't change the way of Windows driver handling, but when there are Windows specific issues then they bust be fixed.

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

                                  @d00616 said in nRF5 Bluetooth action!:

                                  @Mike_Lemo said in nRF5 Bluetooth action!:

                                  Dunno that whole arduino BRF52832 programming thing seems too complicated just started to learn how to use the nordic SDK with eclipse until a proper solution is found.

                                  The Nordic SDK is more complete than Arduino-nrf5 at the moment, but there is no compatibility with MySensors.

                                  The good news, with SDK 13 the 'Nordic Semiconductor ASA' License was changed. The old ASA was the reason for me to rewrite the complete ESB protocol. Now the license is much less restrictive. I think now the way is open to integrate SDK code into arduino-nrf5 or provide SDK based arduino-libraries.

                                  .

                                  You mean way more complete every thing is accesable there and there is an example for everything and I didn't use my sensors anyways

                                  d00616D 1 Reply Last reply
                                  0
                                  • M Mike_Lemo

                                    @d00616 said in nRF5 Bluetooth action!:

                                    @Mike_Lemo said in nRF5 Bluetooth action!:

                                    Dunno that whole arduino BRF52832 programming thing seems too complicated just started to learn how to use the nordic SDK with eclipse until a proper solution is found.

                                    The Nordic SDK is more complete than Arduino-nrf5 at the moment, but there is no compatibility with MySensors.

                                    The good news, with SDK 13 the 'Nordic Semiconductor ASA' License was changed. The old ASA was the reason for me to rewrite the complete ESB protocol. Now the license is much less restrictive. I think now the way is open to integrate SDK code into arduino-nrf5 or provide SDK based arduino-libraries.

                                    .

                                    You mean way more complete every thing is accesable there and there is an example for everything and I didn't use my sensors anyways

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

                                    @Mike_Lemo said in nRF5 Bluetooth action!:

                                    You mean way more complete every thing is accesable there and there is an example for everything and I didn't use my sensors anyways

                                    No. I mean if you want to use the Nordic MCU with BLE and you want to access the whole hardware without developing drivers, then the Nordic SDK is an option. For special requirements like tone() you have to develop your own routine for Arduino or SDK.

                                    If you want write code which is compatible with other Vendors or want use MySensors then the SDK isn't the best choice.

                                    The arduino-nrf5 targets to provide the Arduino language. I think this is mostly complete. MySensors brings additional support for enhanced pin output modes and the random number generator (no SoftDevice support here).

                                    Accessing the internal MCU hardware must be added via Arduino libraries. With the new SDK license I think it's possible to put parts of the SDK into libraries supporting Hardware which is not specified in the Arduino reference.

                                    If you want to develop BLE applications with portable code, there are open source implementations like http://mynewt.apache.org/ which are designed to be portable.

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

                                      Good news! The hwCPUVoltage() function measures the Vcc voltage on the Ebyte module in millivolts. I'm able to send that as a barometer reading using the mocksensors sketch, and it arrives all the way into Domoticz, where it is logged and graphed. So, obviously I need to streamline that a bit, but the proof of concept works. :)

                                      NeverDieN 1 Reply Last reply
                                      1
                                      • NeverDieN NeverDie

                                        Good news! The hwCPUVoltage() function measures the Vcc voltage on the Ebyte module in millivolts. I'm able to send that as a barometer reading using the mocksensors sketch, and it arrives all the way into Domoticz, where it is logged and graphed. So, obviously I need to streamline that a bit, but the proof of concept works. :)

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

                                        Quantization error on the hwCpuVoltage() function appears to about 14 millivolts, which is a nice little improvement over the atmega328p. Measurement accuracy appears to be well within those bounds.

                                        Next step is to measure voltage on an analog pin using an AnalogRead. Not sure if the reference voltage is Vcc (as it typically is with the atmega328p) or something else for those measurements.

                                        NeverDieN 1 Reply Last reply
                                        1
                                        • T Offline
                                          T Offline
                                          Toyman
                                          wrote on last edited by
                                          #501

                                          Given new Arduino Primo contains a buzzer connected to nrf52, we might expect tone() function to be compatible with nrf52 very soon

                                          https://www.arduino.cc/en/uploads/Main/ARDUINO_PRIMO-V022_SCH.pdf

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


                                          18

                                          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