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.
  • scalzS scalz

    @nca78 said in nRF5 Bluetooth action!:

    @scalz said in nRF5 Bluetooth action!:

    @NeverDie @Nca78
    then buy a fresh mcu on Mouser and you'll see by yourself etc ;)
    You don't get what I meant, I'm not talking about a specific module design, but in general. the mcu can be accessed by jlink no matter, else how would you program it in first place ..

    Yes, but when there's a firmware it can be locked, so you must unlock it and erase it to remove softdevice and be able to write something.

    are you sure it's locked? I thought neverdie suggested to erase it with jlink.
    well, you should choose a better module than funky design modules.. just my opinion, for saving?? 2bucks!

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

    @scalz Well, what do you think he should use instead? Bare chips? That's not as easy to solder.

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

      By the way, any update as to when Nordic will be shipping final silicon on the nRF52840? Seems overdue. I just checked Digikey, and still all they have are the ancient PDK's.

      scalzS 1 Reply Last reply
      0
      • scalzS scalz

        @nca78 said in nRF5 Bluetooth action!:

        @scalz said in nRF5 Bluetooth action!:

        @NeverDie @Nca78
        then buy a fresh mcu on Mouser and you'll see by yourself etc ;)
        You don't get what I meant, I'm not talking about a specific module design, but in general. the mcu can be accessed by jlink no matter, else how would you program it in first place ..

        Yes, but when there's a firmware it can be locked, so you must unlock it and erase it to remove softdevice and be able to write something.

        are you sure it's locked? I thought neverdie suggested to erase it with jlink.
        well, you should choose a better module than funky design modules.. just my opinion, for saving?? 2bucks!

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

        @scalz said in nRF5 Bluetooth action!:

        well, you should choose a better module than funky design modules.. just my opinion, for saving?? 2bucks!

        Well I was about to complain about my limited choice on Arrow (others ask 75$ shipping :o ), but after checking (again) I see that Arrow now has the Fanstel modules, so I have no reason to complain anymore :D
        Too bad the BT832F is not in stock, but BT832 at 4.6$ is great, with the XE version in the gateway to compensate the lower range.

        1 Reply Last reply
        2
        • NeverDieN NeverDie

          By the way, any update as to when Nordic will be shipping final silicon on the nRF52840? Seems overdue. I just checked Digikey, and still all they have are the ancient PDK's.

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

          @neverdie said in nRF5 Bluetooth action!:

          @scalz Well, what do you think he should use instead? Bare chips? That's not as easy to solder.

          Frankly, I'm lazy answering to this question, same for technical stuff. sometimes I feel people miss what I'm trying to explain even if they haven't xp, and I keep repeating it... And the same for my designs, I'm wondering if it's worth the effort when i hear people trying to save 2-5bucks (not rewarding for time&money spent, not asking money btw), or want to reinvent cheaper&less quality variants (why not teamworking, not interested in infinite challenge, waste money&time) or complaining it's too hard to solder, did you read my many redondant advice in the forum, I don't handsolder tiny dfn, I reflow them, far far easier&quicker.
          So that's settled, this is why I delayed my releases, until i change my mind, and I'm playing with software.
          Sorry I don't want to look pedantic, not targeted against you especially, just tired ;)

          @Nca78 cool

          NeverDieN Nca78N 2 Replies Last reply
          0
          • scalzS scalz

            @neverdie said in nRF5 Bluetooth action!:

            @scalz Well, what do you think he should use instead? Bare chips? That's not as easy to solder.

            Frankly, I'm lazy answering to this question, same for technical stuff. sometimes I feel people miss what I'm trying to explain even if they haven't xp, and I keep repeating it... And the same for my designs, I'm wondering if it's worth the effort when i hear people trying to save 2-5bucks (not rewarding for time&money spent, not asking money btw), or want to reinvent cheaper&less quality variants (why not teamworking, not interested in infinite challenge, waste money&time) or complaining it's too hard to solder, did you read my many redondant advice in the forum, I don't handsolder tiny dfn, I reflow them, far far easier&quicker.
            So that's settled, this is why I delayed my releases, until i change my mind, and I'm playing with software.
            Sorry I don't want to look pedantic, not targeted against you especially, just tired ;)

            @Nca78 cool

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

            @scalz For comparison, I feel like the nRF24L01 is also pretty much a waste of time, given that better performing alternatives exist, and yet it's the most popular radio on the mysensors forum, possibly because it's so cheap and easy to wire up.
            You have unusually high skills. A lot of people on this forum just want a list of throughole parts from Aliexpress that they can connect together using dupont wires. So, there's quite a range of skill levels. The biggest barrier I see is people not wanting to hand solder (let alone reflow) SMD parts onto a custom PCB. I think that's partly why the openhardware thing hasn't gotten much traction.

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

              @scalz said in nRF5 Bluetooth action!:

              @neverdie said in nRF5 Bluetooth action!:

              @scalz Well, what do you think he should use instead? Bare chips? That's not as easy to solder.

              Frankly, I'm lazy answering to this question, same for technical stuff. sometimes I feel people miss what I'm trying to explain even if they haven't xp, and I keep repeating it... And the same for my designs, I'm wondering if it's worth the effort when i hear people trying to save 2-5bucks (not rewarding for time&money spent, not asking money btw), or want to reinvent cheaper&less quality variants (why not teamworking, not interested in infinite challenge, waste money&time) or complaining it's too hard to solder, did you read my many redondant advice in the forum, I don't handsolder tiny dfn, I reflow them, far far easier&quicker.
              So that's settled, this is why I delayed my releases, until i change my mind, and I'm playing with software.
              Sorry I don't want to look pedantic, not targeted against you especially, just tired ;)

              Reflow is nice and easy when you know how to do it, but not everyone has the space and money for it, and is willing to spend the necessary time to learn how to do it well. You need oven (that you usually need to modify), you need to buy stencils, you need to buy solder paste and keep it fresh in a separate fridge if you don't want to intoxicate your family when putting it in the kitchen fridge, you need to test/tune the process etc etc It's not for everyone. I tried, I have bought a hotplate (oven is too big and too expensive) and hot air gun, I ordered stencils to make some tests, but I can't get decent quality solder paste. Local shops sold me stuff that was way too old, when it comes from AliExpress it's low quality and it spent weeks at 30+ degrees, at Arrows it's either 50-100$ (that will end mostly wasted because I have no space for dedicated fridge), unavailable (maker paste) or "hazmat" so only sent by ground meaning not available for me. Life is hard :D

              About the price I dont think everyone is ready to sacrifice quality to save a few $, I see people buying NModule PCBs at 25$ or more through openhardware.io for example, when they could buy much cheaper when ordering directly. I don't think those people will cry if components on a board cost 15-20$ instead of 10-15 but offer better range or reliability, lower power consumption etc.

              About the "funky modules", yes they are not high quality but they still do the job (and way better than atmega + nrf24 clone), and when I first bought them I had no good alternative to get such a compact module, I would have bought them even if more expensive because compact modules on AliExpress or Ebay were either much bigger or with chip antenna, Arrow only had a Rigado module with LGA pins and other reputable shops have rip off shipping costs. Now I see Fanstel modules nearly as small, with better quality, FCC registration, low EMI etc etc at Arrow it would be stupid to continue, so of course I will not buy them anymore and redesign my board for the Fanstel. And if I make it public then I can provide a reliable source for the module, everyone can order from them with no shipping costs and 100% reliability. Way worth the few extra $.

              And it's not always about reinventing things, it's about making things yourself and learning, too. I want to learn about ARM processors, bluetooth etc so to avoid having to learn anything at the same time I leave the reflowing, antenna tuning etc aside at the moment and use modules. If in the middle of this process I make a board that people with basic soldering skills can make themselves then how is it negative ? Those who take the MySensors hobby seriously will still favor your board because of the top notch quality and components used, there will also be a bunch of people interested in the complete board, but I think it's also great if people with lower technical skills but thirst for DIY can have something, too, even if "lower quality". Of course that won't be my "22" board, that's why I was thinking about a "33" version with more space to put bigger components (big SMDs or sensor breakout boards) and extension via MySX connector. Not sure if I will ever make it, and I hope it's not part of what is making you lose your motivation to release AEOS, because I'm waiting for it and it would be a good occasion to retry reflow soldering ;)

              NeverDieN 1 Reply Last reply
              1
              • Nca78N Nca78

                @scalz said in nRF5 Bluetooth action!:

                @neverdie said in nRF5 Bluetooth action!:

                @scalz Well, what do you think he should use instead? Bare chips? That's not as easy to solder.

                Frankly, I'm lazy answering to this question, same for technical stuff. sometimes I feel people miss what I'm trying to explain even if they haven't xp, and I keep repeating it... And the same for my designs, I'm wondering if it's worth the effort when i hear people trying to save 2-5bucks (not rewarding for time&money spent, not asking money btw), or want to reinvent cheaper&less quality variants (why not teamworking, not interested in infinite challenge, waste money&time) or complaining it's too hard to solder, did you read my many redondant advice in the forum, I don't handsolder tiny dfn, I reflow them, far far easier&quicker.
                So that's settled, this is why I delayed my releases, until i change my mind, and I'm playing with software.
                Sorry I don't want to look pedantic, not targeted against you especially, just tired ;)

                Reflow is nice and easy when you know how to do it, but not everyone has the space and money for it, and is willing to spend the necessary time to learn how to do it well. You need oven (that you usually need to modify), you need to buy stencils, you need to buy solder paste and keep it fresh in a separate fridge if you don't want to intoxicate your family when putting it in the kitchen fridge, you need to test/tune the process etc etc It's not for everyone. I tried, I have bought a hotplate (oven is too big and too expensive) and hot air gun, I ordered stencils to make some tests, but I can't get decent quality solder paste. Local shops sold me stuff that was way too old, when it comes from AliExpress it's low quality and it spent weeks at 30+ degrees, at Arrows it's either 50-100$ (that will end mostly wasted because I have no space for dedicated fridge), unavailable (maker paste) or "hazmat" so only sent by ground meaning not available for me. Life is hard :D

                About the price I dont think everyone is ready to sacrifice quality to save a few $, I see people buying NModule PCBs at 25$ or more through openhardware.io for example, when they could buy much cheaper when ordering directly. I don't think those people will cry if components on a board cost 15-20$ instead of 10-15 but offer better range or reliability, lower power consumption etc.

                About the "funky modules", yes they are not high quality but they still do the job (and way better than atmega + nrf24 clone), and when I first bought them I had no good alternative to get such a compact module, I would have bought them even if more expensive because compact modules on AliExpress or Ebay were either much bigger or with chip antenna, Arrow only had a Rigado module with LGA pins and other reputable shops have rip off shipping costs. Now I see Fanstel modules nearly as small, with better quality, FCC registration, low EMI etc etc at Arrow it would be stupid to continue, so of course I will not buy them anymore and redesign my board for the Fanstel. And if I make it public then I can provide a reliable source for the module, everyone can order from them with no shipping costs and 100% reliability. Way worth the few extra $.

                And it's not always about reinventing things, it's about making things yourself and learning, too. I want to learn about ARM processors, bluetooth etc so to avoid having to learn anything at the same time I leave the reflowing, antenna tuning etc aside at the moment and use modules. If in the middle of this process I make a board that people with basic soldering skills can make themselves then how is it negative ? Those who take the MySensors hobby seriously will still favor your board because of the top notch quality and components used, there will also be a bunch of people interested in the complete board, but I think it's also great if people with lower technical skills but thirst for DIY can have something, too, even if "lower quality". Of course that won't be my "22" board, that's why I was thinking about a "33" version with more space to put bigger components (big SMDs or sensor breakout boards) and extension via MySX connector. Not sure if I will ever make it, and I hope it's not part of what is making you lose your motivation to release AEOS, because I'm waiting for it and it would be a good occasion to retry reflow soldering ;)

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

                @nca78 said in nRF5 Bluetooth action!:

                you need to buy solder paste and keep it fresh in a separate fridge if you don't want to intoxicate your family when putting it in the kitchen fridge

                Yikes! I didn't know there was a risk of that happening.

                1 Reply Last reply
                0
                • scalzS scalz

                  @neverdie said in nRF5 Bluetooth action!:

                  @scalz Well, what do you think he should use instead? Bare chips? That's not as easy to solder.

                  Frankly, I'm lazy answering to this question, same for technical stuff. sometimes I feel people miss what I'm trying to explain even if they haven't xp, and I keep repeating it... And the same for my designs, I'm wondering if it's worth the effort when i hear people trying to save 2-5bucks (not rewarding for time&money spent, not asking money btw), or want to reinvent cheaper&less quality variants (why not teamworking, not interested in infinite challenge, waste money&time) or complaining it's too hard to solder, did you read my many redondant advice in the forum, I don't handsolder tiny dfn, I reflow them, far far easier&quicker.
                  So that's settled, this is why I delayed my releases, until i change my mind, and I'm playing with software.
                  Sorry I don't want to look pedantic, not targeted against you especially, just tired ;)

                  @Nca78 cool

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

                  @neverdie said in nRF5 Bluetooth action!:

                  @nca78 said in nRF5 Bluetooth action!:

                  you need to buy solder paste and keep it fresh in a separate fridge if you don't want to intoxicate your family when putting it in the kitchen fridge

                  Yikes! I didn't know there was a risk of that happening.

                  Well it's probably not a real problem, but I don't want to take risks with my 4yo chidren.

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

                    I do think a lot of people really underestimate the toxicity of getting solder paste onto their hands. I always use disposable neoprene gloves when handling it, and try to throw away anything that comes into contact with it. You definitely don't want to run the risk of unintentionally ingesting that stuff. AFAIK, the neurotoxicity is permanent damage.

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

                      By the way, I never got to the point where reflow was "nice and easy" with tiny pad chips. But that's just me. Operator error, I'm sure. It ended up taking so long to get a good outcome that I just decided it wasn't worth the time. Maybe I'll revisit it at a future date.

                      Anyway, everyone has their limits. I mean reflowing the gazillion tiny components on a HopeRF module, for instance. That doesn't look easy to me, even if I knew what I was doing.

                      @scalz Anyway, it's great that you are doing it. You're an inspiration for us all.

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

                        @Nca78
                        Here's the board settings that I use:
                        0_1520447247882_board.png

                        Nca78N 1 Reply Last reply
                        1
                        • korttomaK Offline
                          korttomaK Offline
                          korttoma
                          Hero Member
                          wrote on last edited by korttoma
                          #1445

                          Like NeverDie I am also having some trouble getting started with the NRF5 programming.

                          Here is my setup:
                          0_1520490115123_34a8da45-4d3b-4909-aaf7-3ded3b98590e-image.png

                          0_1520490137522_9ec65e79-3f29-4b9d-b503-925df3f590bb-image.png

                          The problem "No valid JTAG Interface Configured":
                          0_1520490174588_f762683c-2c6d-42ce-ae83-f3baf5f38a7e-image.png

                          Did I miss some step to configure the J-Link somewhere?

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

                            I've always used the IDC connector. I'm not sure that it works if you don't.

                            NeverDieN 1 Reply Last reply
                            0
                            • korttomaK korttoma

                              Like NeverDie I am also having some trouble getting started with the NRF5 programming.

                              Here is my setup:
                              0_1520490115123_34a8da45-4d3b-4909-aaf7-3ded3b98590e-image.png

                              0_1520490137522_9ec65e79-3f29-4b9d-b503-925df3f590bb-image.png

                              The problem "No valid JTAG Interface Configured":
                              0_1520490174588_f762683c-2c6d-42ce-ae83-f3baf5f38a7e-image.png

                              Did I miss some step to configure the J-Link somewhere?

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

                              @korttoma I have the same problem with the official jlink drivers. So I drag/drop the hex file from output directory to the Jlink drive at the moment.

                              korttomaK 1 Reply Last reply
                              0
                              • Nca78N Nca78

                                @korttoma I have the same problem with the official jlink drivers. So I drag/drop the hex file from output directory to the Jlink drive at the moment.

                                korttomaK Offline
                                korttomaK Offline
                                korttoma
                                Hero Member
                                wrote on last edited by korttoma
                                #1448

                                @nca78 :D that worked! thank you thank you thank you!

                                My first NFR5 node is ALIVE!

                                • Tomas
                                1 Reply Last reply
                                1
                                • NeverDieN NeverDie

                                  I've always used the IDC connector. I'm not sure that it works if you don't.

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

                                  @neverdie said in nRF5 Bluetooth action!:

                                  I've always used the IDC connector.

                                  i.e. the 10-pin connector.

                                  1 Reply Last reply
                                  0
                                  • NeverDieN NeverDie

                                    @Nca78
                                    Here's the board settings that I use:
                                    0_1520447247882_board.png

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

                                    @neverdie thank you for pointing to the power problem. I had one jumper left for my adapter to connect GND to GND and "as usual" it had a contact problem, I just replaced it and I can see the module in nRFgo Studio, even without external power.

                                    1 Reply Last reply
                                    1
                                    • O Offline
                                      O Offline
                                      Omemanti
                                      wrote on last edited by
                                      #1451

                                      Question;

                                      I've been using the Ebyte modules and I'm making progress. But somehow the energy consumption is far too much. 11,7 mA when I use a clean sketch with hwSleep().

                                      When I change to "Normal" Sleep() I get 0.1mA.

                                      which one should be the right one to use, keeping in mind, I would like to wake up from an interrupt.

                                      mfalkviddM 1 Reply Last reply
                                      0
                                      • O Omemanti

                                        Question;

                                        I've been using the Ebyte modules and I'm making progress. But somehow the energy consumption is far too much. 11,7 mA when I use a clean sketch with hwSleep().

                                        When I change to "Normal" Sleep() I get 0.1mA.

                                        which one should be the right one to use, keeping in mind, I would like to wake up from an interrupt.

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

                                        @omemanti sleep. See https://www.mysensors.org/download/sensor_api_20#sleeping for details.

                                        1 Reply Last reply
                                        0
                                        • korttomaK korttoma

                                          @toyman sure do LINK

                                          korttomaK Offline
                                          korttomaK Offline
                                          korttoma
                                          Hero Member
                                          wrote on last edited by
                                          #1453

                                          @Mika what is your experience regarding battery consumption on these?

                                          LINK

                                          I put together a sketch witch seems to work fine but one CR2032 just lasts a couple of days.

                                          Sketch:

                                          /**
                                           * The MySensors Arduino library handles the wireless radio link and protocol
                                           * between your home built sensors/actuators and HA controller of choice.
                                           * The sensors forms a self healing radio network with optional repeaters. Each
                                           * repeater and gateway builds a routing tables in EEPROM which keeps track of the
                                           * network topology allowing messages to be routed to nodes.
                                           *
                                           * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
                                           * Copyright (C) 2013-2015 Sensnology AB
                                           * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
                                           *
                                           * Documentation: http://www.mysensors.org
                                           * Support Forum: http://forum.mysensors.org
                                           *
                                           * This program is free software; you can redistribute it and/or
                                           * modify it under the terms of the GNU General Public License
                                           * version 2 as published by the Free Software Foundation.
                                           *
                                           *******************************
                                           */
                                          
                                          // Enable debug prints to serial monitor
                                          //#define MY_DEBUG 
                                          
                                          // Define a static node address, remove if you want auto address assignment
                                          //#define MY_NODE_ID 26                                                          // Kök
                                          #define MY_NODE_ID 27                                                          // Test device
                                                                                            
                                          
                                          // Enable and select radio type attached
                                          
                                          #define MY_RADIO_NRF5_ESB
                                          
                                          #include <MySensors.h>
                                          
                                          #define SN "NRF5 Scene"
                                          #define SV "1.0"
                                          
                                          #define CHILD_ID_SCENE 1
                                          
                                          // PIN for the buttons
                                          byte buttonOne = 28;
                                          
                                          //Bounce debouncer[NUMBUTTONS];
                                          int buttonOneoldValue;
                                          
                                          
                                          // Pin definitions
                                          #define DIGITAL_INPUT_INT 28   // The digital input you attached your interrupt  (Only 2 and 3 generates interrupt!)
                                          
                                          
                                          // Sensor messages
                                          MyMessage msgOn(CHILD_ID_SCENE, V_SCENE_ON);
                                          
                                          // Global settings
                                          uint16_t SceneOne = 0;
                                          uint16_t SceneTwo = 1;
                                          
                                          
                                          void blinkityBlink(uint8_t repetitions) {
                                            for (int x=0;x<repetitions;x++) {
                                              digitalWrite(LED_BUILTIN,HIGH);
                                              wait(20);
                                              digitalWrite(LED_BUILTIN,LOW);
                                              wait(100);
                                              digitalWrite(LED_BUILTIN,HIGH);
                                              wait(20);
                                              digitalWrite(LED_BUILTIN,LOW);    
                                              if (x<(repetitions-1)) {  //skip waiting at the end of the final repetition
                                                wait(500);
                                              }
                                            }
                                          }
                                          
                                          
                                          /****************************************************
                                           *
                                           * Setup code 
                                           *
                                           ****************************************************/
                                           
                                          void setup() {
                                            
                                            hwPinMode(LED_BUILTIN,OUTPUT_D0H1);
                                            blinkityBlink(2);  //signify power-up and start of operations
                                          
                                            NRF_CLOCK->INTENSET=B11;  //enable interrupts for EVENTS_HFCLKSTARTED and  EVENTS_LFCLKSTARTED
                                            NRF_CLOCK->TASKS_HFCLKSTART=1;  //start the high frequency crystal oscillator clock
                                            while (!(NRF_CLOCK->EVENTS_HFCLKSTARTED)) {} //wait until high frequency crystal oscillator clock is up to speed and working
                                                                                          
                                            hwPinMode(DIGITAL_INPUT_INT, INPUT_PULLUP);
                                              
                                              /// Make input & enable pull-up resistors on switch pins
                                            hwPinMode(buttonOne, INPUT_PULLUP);
                                            buttonOneoldValue = -1;
                                            
                                          
                                            sendBattLevel();
                                            
                                          
                                          }
                                          
                                          void presentation()  {
                                            sendSketchInfo(SN, SV);
                                            //present the scene controller to gateway
                                            wait(10);
                                            present(CHILD_ID_SCENE, S_SCENE_CONTROLLER);
                                                
                                            wait(10);
                                          }
                                          
                                          
                                          /***********************************************
                                           *
                                           *  Main loop function
                                           *
                                           ***********************************************/
                                          void loop() {
                                            
                                            // Check for button activity
                                               
                                            int value = digitalRead(buttonOne);
                                              
                                            if (value != buttonOneoldValue)
                                              {
                                                // Send in the new value
                                                if (value == LOW)                                                      
                                                {
                                                  send(msgOn.set(SceneOne));
                                                  
                                                  wait(20);
                                          
                                                  send(msgOn.set(SceneTwo));
                                          
                                                  sendBattLevel();
                                                        
                                          
                                                }
                                                buttonOneoldValue = value;
                                              }
                                              
                                            sleep(digitalPinToInterrupt(DIGITAL_INPUT_INT), CHANGE, 0);  
                                            
                                          }
                                          
                                          
                                          
                                          
                                          /********************************************
                                           *
                                           * Sends battery information (battery percentage)
                                           *
                                           * Parameters
                                           * - force : Forces transmission of a value
                                           *
                                           *******************************************/
                                          void sendBattLevel()
                                          {
                                              long vcc = hwCPUVoltage();
                                            
                                              // Calculate percentage
                                          
                                              vcc = vcc - 1800; // subtract 1.9V from vcc, as this is the lowest voltage we will operate at
                                              
                                              long percent = vcc / 14.0;
                                              sendBatteryLevel(percent);    
                                            
                                          }
                                          

                                          I noticed that the chip sais:
                                          N51822
                                          QFABC0
                                          1646UU

                                          QFAB translates to 16kB RAM, 128kB flash and I can not even select this option in the arduino IDE. Can this be the problem?

                                          @d00616 refer to his document for some high current consumption issue but I'm not sure what to do with the info.

                                          Is there something wrong with my sketch or is there just an old crappy chip on the device??

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


                                          15

                                          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