1 2 3 Previous Next 30 Replies Latest reply on Feb 7, 2018 11:34 AM by e.pratt_1639216

    CYBLE-224110-00 battery level

    AndyMarder

      I have a custom board with a CYBLE-22410-00 .powered by the cr2032 battery

       

      Could you please help with the following

      1. I copied the ADC SAR  component from the BLE_Battery_Level01 project  (attached) into my project  but don't know how to connect the  J3 pin VREF. The  the project doc  says "The Vref analog input pin is locked to P3[0] and "Connect J2 pin P3[0] to J3 pin VREF" - but it has to be project specific

      2. What modifications (if any) are required in the sample code to make it work on  CYBLE-22411-00 ? I' m  referring to the MeasureBattery() function and the defines it uses ,i.e ADC_VREF_INTERNAL1024BYPASSED,ADC_SAR_CTRL_REG , etc

      3. The comment in the MeasureBattery function says that it converts the battery level voltage to percentage using values specific to the CR2033 battery. I could not find that info for the CR2032 .Any ideas where to find it? Or do these values apply to CR2032 as well?

      Thanks

      Andy

        • 1. Re: CYBLE-224110-00 battery level
          yliu

          1. You are right, it should be project/board specific, you can assign that pin properly based on your hardware, the desciption in the project doc is based on the PSoC4 BLE kit.

          2. You may just directly use it with CYBLE-22411-00, I remember the ADC of the two chips(the one used in the original project and the CYBLE-22411-00) is same.

          3.  I think these values apply to CR2032.

          • 2. Re: CYBLE-224110-00 battery level
            e.pratt_1639216

            3. The "percent battery charge" is based on the expected SoC for each voltage level for the CR2033 lithium battery. Unless it has different voltage ratings (I can't find the datasheet for the CR2033), then similar voltage and type of battery with only a small difference in the amount of total charge it stores should have a similar SoC to voltage correlation, which means that it should work. Basically, the percentage battery life is estimated from the voltage for the type of battery, and similar batteries will have a similar estimation.

            1 of 1 people found this helpful
            • 3. Re: CYBLE-224110-00 battery level
              AndyMarder

              Where can I find information what pin to use? I could not find it in the CYBLE-224110-00 data sheet

              Thanks

              • 4. Re: CYBLE-224110-00 battery level
                e.pratt_1639216

                The Pin P3[0] looks fine when I build your project; Are you expecting a certain pin for use by the ADC to get the Vref?

                The example project shows an external Capacitor wired to the Vref pin. If you are wanting to measure the battery voltage without external components, then see here: http://www.cypress.com/blog/psoc-hacker-blog/measuring-vdd-battery-volts-psoc4

                (If you directly reference the Vref, then on a comparison between battery voltage and the Vref, it will almost always come back with 100/100%)

                • 5. Re: CYBLE-224110-00 battery level
                  AndyMarder

                  I'm a bit confused with the terminology. By "external" do you mean a physical part that has to be connected to the PSoC ? Or is it a logical component? I started reading the article you mentioned and the same question applies. Thank you

                  • 6. Re: CYBLE-224110-00 battery level
                    e.pratt_1639216

                    When documentation for the PSoC chips uses "external" they generally mean a part or component that is NOT inside of the CYBLE module, or whatever chip you are using, and thus it would be a component that you need to wire to the pins on the cypress module using one of the IO pins, PCB traces, jumper wires, etc.

                    When they refer to "internal" they are generally referring to something already included, and within the cypress module/chip.

                     

                    For example, the ADC itself is internal to the cypress module, but the pin it reads from can be external.

                    In the top design schematics on PSoC schematics, the blue "penned" looking wires, resistors, capacitors, etc. all refer to documentation on externally wired components for the project. Thus, the article referenced is using an external resistor divider bridge to read the ADC values from. That means, that you would need to dedicate a pin for the use of measuring battery voltage level.

                     

                    Tl;Dr; Yes, external means a physical part that needs to be connected/wired to the PSoC.

                    • 7. Re: CYBLE-224110-00 battery level
                      AndyMarder

                      Thank you for clarifying, this is very helpful. I'm looking for a solution that does not require any external parts. Is there such a solution?

                      • 8. Re: CYBLE-224110-00 battery level
                        e.pratt_1639216

                        Not as far as I know, but someone else would probably know better.

                        Support for an internal VDD battery measurement with the ADC would require a different chip, or manufacturing changes afaik.

                        Sorry, but good luck

                        • 9. Re: CYBLE-224110-00 battery level
                          AndyMarder

                          Even more confused.

                          The article Measuring VDD (Battery Volts) in PSoC4 | Cypress Semiconductor

                          says

                          "We can implement the same VDD measurement in PSoC4 without using any external components.  Let us see how.

                          Note: The resistor and zener combination in the schematic above is just a representation of an external reference voltage."

                          This implies that no external parts are needed and everything can be set up in PSoC Creator

                          But then it says

                          "Following are the steps to measure VDD:

                          Connect an external bypass capacitor 1uF to P1[7]."

                          Which implies that an external part IS needed.

                          Could you please clarify?

                          Thanks

                           

                          • 10. Re: CYBLE-224110-00 battery level
                            e.pratt_1639216

                            Yeah, hence why I was thinking there is not a good way to measure it without external components. It could be that he is using the OpAmp buffer as replacement for the capacitor to hold the reference voltage for measuring, but without running it, I would not be confident in that. He also still refers to the P1[7] pin in his firmware code below it, so either that pin is used to get the internal reference voltage of 1.024 volts, or he really is using the external capacitor. :/

                             

                            I would recommend testing with the OpAmp buffer to see if it replaces the capacitor behavior, but otherwise I don't know

                            • 11. Re: CYBLE-224110-00 battery level
                              AndyMarder

                              The article is very confusing. In one sentence it says that on MCU's with internal ADC the measurement can be done without any external components , in the other says that it is required.

                              Can  anyone clarify?

                              If an external bypass cap is indeed required on CYBLE 224110 , what pin should it be wired to ? There is no P1.7 that the article refers to on the 224110

                              Thanks

                              • 12. Re: CYBLE-224110-00 battery level
                                e.pratt_1639216

                                Personally, we used the resistor divider to get the battery voltage reference, and compared it with the internal 1.024V reference on the ADC to get our own battery reading, but that is using external components...

                                • 13. Re: CYBLE-224110-00 battery level
                                  AndyMarder

                                  If using external components is a requirement that's ok. But it 's still unclear to me which pin of the CYBLE the external component should be wired to. I don't see P1.7 mentioned in the article in the  CYBLE-22110-00 project "Pins" section

                                  Thanks

                                  • 14. Re: CYBLE-224110-00 battery level
                                    e.pratt_1639216

                                    I think the intent of the article, is to use the OpAmp to buffer the battery voltage as an "internal capacitor", and then to switch the ADC to use the internal 1.024V reference to calculate the voltage from the OpAmp "capacitor" for measuring the battery voltage. I'm not seeing the P1[1] for the CYBLE-224110-00 device either, but it could be the exact pin doesn't matter?

                                     

                                    I tried to mimic/build the project in the article to help you out, but I don't have the board with me to test if it works.

                                    I think, using the internal OpAmp allows you to not need to use an external component; The pin that the board uses for the voltage reference buffering will be in use however.

                                    1 2 3 Previous Next