1 2 Previous Next 17 Replies Latest reply on Sep 16, 2015 3:49 AM by user_14586677

    I2C component current

    dale.kramer

      I am adding an I2C component to my project and I can not figure out why it draws so much current in my project which uses Deep Sleep.

         

      My I2C component is setup up as a Master at 400khz.  With the component simply Enabled (not even started), my current draw increases by 800ua to 1950ua.  It does not seem to let the Deep Sleep mode be entered, I even tried I2C_Sleep(); before the Deep Sleep command.

         

      Attached are two scope captures of the voltage across my ammeter, which show that the current increase.

         

      Any ideas why?

        • 1. Re: I2C component current
          user_1377889

          Have a look into the schematics, one I2C is connected to the KitProg (PSoC5) on the PRoC dongle. Be sure to take the other instance

             

           

             

          Bob

          • 2. Re: I2C component current
            dale.kramer

            Bob,

               

            Sorry, did not specify configuration.

               

            These are currents from my 3.6v lithium cell that is powering my own pcb which has an EZ-BLE on it.  Not sure how a second I2C component could be involved.

               

            Dale

            • 3. Re: I2C component current
              user_14586677

              You seeing the pullup current ? Normally in idle state pullups are

                 

              not drawing current.

                 

               

                 

              Regards, Dana.

              • 4. Re: I2C component current
                dale.kramer

                Dana

                   

                That makes some sense, never considered it would take that much current for 2 data lines that aren't even being used.

                   

                How do I confirm this?

                   

                Can I turn the pullups off somehow before I enter Deep Sleep (I2C_Stop() doesn't change things)?

                   

                Dale

                • 5. Re: I2C component current
                  dale.kramer

                  What syntax to set SDA and SCL back to high impedance in code if they are only ever assigned pins with I2C component?

                  • 6. Re: I2C component current
                    dale.kramer

                    So, I tried this right before going to deep sleep and got even higher current :)  (and that CY_SYS command was really hard for me to find, see this topic :)

                       

                            I2C_Stop();
                            I2C_Sleep();

                       

                            CyGlobalIntDisable;

                       

                            //sda is p[1]4
                            //scl is p[1]5
                            CY_SYS_PINS_SET_DRIVE_MODE(CYREG_GPIO_PRT1_PS,4,CY_SYS_PINS_DM_ALG_HIZ);
                            CY_SYS_PINS_SET_DRIVE_MODE(CYREG_GPIO_PRT1_PS,5,CY_SYS_PINS_DM_ALG_HIZ);

                       

                            CyGlobalIntEnable;

                    • 7. Re: I2C component current
                      user_14586677

                      When you start I2C, but do not send any data, it should be in idle

                         

                      state, both clk and data high, just use a scope to look at pins.

                         

                       

                         

                      If either or both pins low, then pullups will be drawing current.

                         

                       

                         

                      Regards, Dana.

                      • 8. Re: I2C component current
                        dale.kramer

                        I also have my I2C slave device connected to SDA and SCL.

                           

                        SCL and SDA are low all the time, with and without I2C component enabled.

                           

                        I never do a I2C_Start(), I simply enable the I2C component to get this excess current, my above code was to try to turn I2C off and disable it/pullups to reduce current to where it was before I enabled it by its component properties on .cysch

                           

                        I believe this is unrelated but I never know, if I plug my 5 inch programming cable onto my pcb and do not even plug the other end into the BLE Pioneer Board, my board current fluctuates from an unplugged current of 1150ua to as high as 3000ua.  If I unplug it, current goes back to a steady 1150ua.  Also, I am able to program my EZ-BLE without errors but I can not debug it because the connection is lost as soon as code starts to execute.  I attribute this to issues with SWD lines but was going to look into this next.

                        • 9. Re: I2C component current
                          user_14586677

                          To code the pins just write a 1 to the pin, which should turn off the open drain low

                             

                          which is pulling down the pullup.

                             

                           

                             

                          As far as current fluctuation sounds like a floating digital input possible culprit ?

                             

                           

                             

                          Regards, Dana.

                          • 10. Re: I2C component current
                            dale.kramer

                            Still SDA and SCL stay low when I tried setting the SCL and SDA pins high just before Deep Sleep with :

                               

                            I2C_Stop();

                               

                            I2C_Sleep();

                               

                            //sda is p[1]4

                               

                            //scl is p[1]5

                               

                            CY_SYS_PINS_SET_PIN(CYREG_GPIO_PRT1_PS,4);

                               

                            CY_SYS_PINS_SET_PIN(CYREG_GPIO_PRT1_PS,5);

                               

                            RE: current fluctuation, my 5 inch cable leads only connect to +,GND, swd_clk and swd_data when the current starts to fluctuate, I don't know of any external components recommended on the SWD lines and it really is a pain not to be able to debug my board. Any ideas?

                            • 11. Re: I2C component current
                              dale.kramer

                              I just ordered a MiniProg3 so I can try to lower the SWD clock during debugging, hope it helps.

                                 

                              AND, I decided to try to communicate with my I2C device even though there is this mystery current when I simply enable the I2C component.

                                 

                              So first thing in main(), I start with:

                                 

                                  I2C_Start();
                                  CyGlobalIntEnable;

                                 

                                  uint32 status = I2C_I2CMasterSendStart(0x39u,0); //0x39 is slave 7 bit address and 0 is write

                                 

                              When I run this and monitor SCL and SDA (they both start LOW) with trigger on SCL, NO activity is captured.

                                 

                              The value of status is set to 0x08, which is I2CM_I2C_MSTR_BUS_BUSY and it means that bus is not free.

                                 

                              Wow, this is getting tedious again, time to start a case.

                              • 12. Re: I2C component current
                                user_14586677

                                CASE yes, dying to know why pins in idle state not high, that's not meeting

                                   

                                standard. Nor is it power conscious.

                                   

                                 

                                   

                                Same goes for why GPIO reg write not directing pin.

                                   

                                 

                                   

                                Regards, Dana.

                                • 13. Re: I2C component current
                                  kris.p

                                  I2C master in PSoC or PRoC BLE device doesn't have an internal pull up. I'm assuming you have an external pull up on your board, is that correct?

                                     

                                  If the SCL/SDATA lines are kept low, it is also possible that the slave device is holding the bus down.. Did you isolate the slave and measured current? When you pace the I2C component in your schematic, the default pin drive state is set to open drain and that shouldn't ideally be consuming any current.

                                     

                                   

                                     

                                  3. Looking at the scope capture, it looks like the 

                                  • 14. Re: I2C component current
                                    kris.p

                                    I2C master in PSoC or PRoC BLE device doesn't have an internal pull up. I'm assuming you have an external pull up on your board, is that correct?

                                       

                                    If the SCL/SDATA lines are kept low, it is also possible that the slave device is holding the bus down.. Did you isolate the slave and measured current? When you pace the I2C component in your schematic, the default pin drive state is set to open drain and that shouldn't ideally be consuming any current.

                                       

                                     

                                       

                                    3. Looking at the scope capture, it looks like the 

                                    1 2 Previous Next