8 Replies Latest reply on Nov 11, 2019 2:35 AM by PY_21

    Advertising period setup and power consumption

    SuMa_296631

      I am obviously not understanding the advertising setup for my CYBLE-416045-02.

      What I want is for the advertisement packet to be sent every 5 seconds or so and have the device deep sleep in between if nothing responds.

       

      Part 1:

      I have set the 'Discovery Mode' to "Limited", the 'Fast Advertising interval' to "Minimum" of 5000ms, maximum of 5100ms and a timeout of 30 seconds. With that configuration I see on a scanning program I have written (on a separate device) the advertising packet is picked up, a connection made and the data transferred, and the connection dropped - all as expected. The scanning program only checks every 15 seconds or so (hence why I want the advertising period to be 5 seconds) but if the timing is just a bit out, 30 seconds after the last connection, everything stops (see later for how I can tell).

      I want the advertising to continue ad infinitum. Therefore I tried using the 'General' discovery mode and no timeout. This works the same but without the timeout (which is as expected I suppose.

      Questions:

      Is the last configuration the one I want? If not then how should I set the various options?

      What is the purpose of the 'fast' vs the 'slow' advertising period?

       

      Part 2:

      I have an ammeter in the supply line between the miniprog 3 and my circuit as I want to make sure that the current draw while the processors are in deep sleep is minimal (this is a battery driven device so current draw must be minimal). I'm using the code as generated for CM0 and for CM4 I do into 'deep sleep' when there are no events.

      The ammeter shows about 8.6mA while programming and then sits at 10.8mA for most of the time. When a connection is made it jumps to 11.4mA during the connection (my DVM could be missing the peak current - the point is that it does increase the current draw during the connection as I would expect). It then drops back to 10.8mA.

      If the 'timeout' is in use, the current drops to about 6.4mA and never changes from there.

      I'm happy (relatively!) with the current draw during the connection period. However my expectation is that the current draw should be in the uA range while both processors as in deep sleep, only jumping up for the advertising burst (ms at most) and perhaps a bit linger if the advertisement results in a connection.

      Questions:

      Is my expectation wrong? If so what should I expect?

      How should I adjust things to that the deep sleep results in a current draw the is more in line with that of the data sheet for deep sleep operation?

      Susan

        • 1. Re: Advertising period setup and power consumption
          PY_21

          Hello Susan,

           

          1. To configure the BLE low power mode, please make sure that the low power mode is enabled in the BLE component and watch crystal oscillator is enabled and properly configured. When the design enables BLE low-power mode, the CPU enters low-power mode (using Cy_SysPm_DeepSleep() API) only if the BLE stack is ready for low-power operation. The BLESS interrupt (that triggers every Advertisement/Connection interval) is a Deep Sleep interrupt and is capable of waking up the cores from Deep Sleep. Please refer to this KBA for more information Setting Cores to Deep Sleep Mode while BLE Function is Enabled on PSoC® 6 – KBA223291.

          2. Could you please let me know the Scanning interval and window values on your Central device? During scanning, the device will scan on channel 37, channel 38, and channel 39 respectively and in that order on every scanning interval for the length of time defined by the scanning window as shown in attached image. Also, please check the Advertising channel map selected (in the BLE component) on your peripheral device.

          3. Fast advertisement interval results in faster LE Connection. The BLE_PDL Component uses this interval value when the connection time is between the specified minimum and maximum values of the interval. The minimum and maximum adv interval range is from 20ms to 10240ms. Whereas, Slow advertising is an optional parameter which, if enabled, allows to implement advertising with a lower duty cycle to save battery life. The Slow advertising interval parameters are applied to the device after the internal fast advertising interval timeout occurs. The minimum and maximum values(valid range is from 1000ms to 10240ms) defined using this parameter allow the BLE Stack to expect the advertising to happen within these intervals.

          4. Could you please let me know how much current you are drawing when the device is in advertising state and connection state? BLE Device Current consumption value depends on the advertising and connection interval values. When these adv/conn intervals are more, current consumption will be less and vice-versa. During connection, Central will decides the connection parameters.

          Please refer to the Power saving techniques section 4 in "PSoC 6 MCU Low-Power Modes and Power Reduction Techniques" datasheet for more information. Also, please refer to the section 4.1 Implementing Low-Power BLE Design in AN215671.

           

          Thanks,

          P Yugandhar.

          • 2. Re: Advertising period setup and power consumption
            SuMa_296631

            Thank you for the information.

            Is it possible to use the ILO or PILO instead of the WCO as the oscillator - I'm trying to use the least components possible and would prefer not to have to add a watch crystal to the design?

            The central device is an ESP32 programmed using the ESP-IDF framework. The scanning lasts for 10 seconds and the scan interval is 80 (0x50) and the scan window is 48 (0x30).

            I *think* I have already given the current draws that I'm seeing in the 2nd part of my question: if I've understood the operation correctly then it draws about 10.8mA during advertising and about 11.4mA. However the part that triggered of the question is that when it is supposed to go into deep sleep, the current draw is about 6.4mA.

            Susan

            • 3. Re: Advertising period setup and power consumption
              PY_21

              Hello Susan,

               

              PSoC 6 MCU with BLE supports crystal-less mode of operation using Precision ILO (PILO), which can be used for BLE low-power mode timing. Please refer to this KBA for more information PSoC 6 MCU with Bluetooth Low Energy (BLE) Connectivity FAQ – KBA220700

               

              Could you please refer to "PSoC 6 Find me" code example from PSoC Creator or "CE212736 - PSoC 6 MCU with Bluetooth Low Energy (BLE) Connectivity - Find Me" example project from the link, where it has implemented with BLE low power mode. If possible, could you please share your project so that we can check at our end.

               

              Thanks,

              P Yugandhar.

              • 4. Re: Advertising period setup and power consumption
                SuMa_296631

                Thanks for the additional information - using the PILO sounds exactly what I want. I have a free Sunday coming up (grandchildren otherwise occupied!) so I'll try this out.

                I note there is an option on the BLE design module on the advanced tab that refers to the low power option using the 'watch crystal oscillator' (in parentheses). By default this seems to be set. What is the correct setting for this when using the PILO?

                I'll try to archive and upload the project in the next few days.

                Susan

                • 5. Re: Advertising period setup and power consumption
                  SuMa_296631

                  (Can't edit my last post)

                  I've just managed to get a copy of the "Bluetooth Low Energy (BLE_PDL)" component datasheet V2.1 (Document 002-23707 Rev. **) and done a search for "PILO". The only reference is in the "Component Changes" section on page 85 where it says

                  Updated the Use BLE Low-Power Mode subsection. Removed the PILO from the list of supported LFCLK sources for the BLE LowPower mode.

                  Does this mean that the "Question 12" in the KB article you reference is now out of date?

                  Also I've just seen the "LFCLK" section on Page 12 (not sure why I didn't see this before - sigh) that only if the WCO clock is chosen (and not ILO) does deep sleep become available.

                  Susan

                  • 6. Re: Advertising period setup and power consumption
                    PY_21

                    Hello Susan,

                     

                    Thank you for pointing out, we will update Question 12 in the KBA. If the low-power mode support is required for the BLE_PDL Component please use WCO only as the LFCLK source in the Design-Wide Resources Clock Editor. Where, PILO is removed from the list of supported LFCLK sources for the BLE Low Power mode.

                     

                    Thanks,

                    P Yugandhar.

                    • 7. Re: Advertising period setup and power consumption
                      SuMa_296631

                      I have tried to isolate a few things to see make sure that the deep sleep was working on its own. Therefore I've created a separate project that only has the MCWDT device that triggers an interrupt every 10 seconds or so, and a delay for about 1 second. I've archived the project and attached it here. (The original version that I saved was actually on the CY8CPROTO-063-BLE board, hence the commented out lines for the LEDs.)

                      When I run this on my circuit and using my DMM to measure the current from the miniprog3, I get about 7mA during the programming, 6.4mA while 'sleeping' and 13.6AmA while 'awake'. My DMM might be a bit out - using a bench PSU, it registers 3mA while asleep and 8mA while awake. Either way, the deep sleep current seems to be a lot more than what it should be.

                      I've also attached the schematic of the circuit I'm using. The 'SWD' connector is for when I use the miniprog3 and also powering the circuit from the bench PSU. The other connector is the one that I'll be using within the solar powered light but nothing is connected there at the moment.

                      SO, any ideas on why the deep sleep current appears to be so high?

                      Is there something wrong with the programming? Have I not done something I should have?

                      Susan

                      • 8. Re: Advertising period setup and power consumption
                        PY_21

                        Hello Susan,

                         

                        Apologize for the late response. I had tested the project with CYBLE-416045-EVAL board where I got the current consumption of 13uA during Deep sleep(removed one second delay). Could you please refer to "PSoC 6 Find me" code example from PSoC Creator or "CE212736 - PSoC 6 MCU with Bluetooth Low Energy (BLE) Connectivity - Find Me" example project which has implemented with BLE low power mode and check the current consumption values.

                         

                        Thanks,

                        P Yugandhar.

                        1 of 1 people found this helpful