8 Replies Latest reply on Aug 9, 2016 11:04 AM by Intel Corporation

    i2c programmable pull-ups

    Flo1991

      Hi,

      I am working on a custom board for the edison. So for the I2C communication I want to know if the edison uses its programmable pull-ups.

      Refering to the module guide there are different programmable pull-ups available. (http://download.intel.com/support/edison/sb/edisonmodule_hg_331189004.pdf )

      Are these pull-ups used if I programm the I2C Interface using mraa?

      Are different pull-ups used depending on the bus speed?

      Are pull-ups used if I use the I2C Interface using system commands?

       

      Thanks for your help.

       

      Flo1991

        • 1. Re: i2c programmable pull-ups
          xbolshe

          Hi,

          Are these pull-ups used if I programm the I2C Interface using mraa?

          As I remember for Edison Arduino board and Edison Miniboard pull-ups for I2C are disabled after I2C interface initialization using MRAA.

           

          I strongly recommend to setup a pull-up configuration after I2C bus initialization.

           

          You may change it as you need by using mraa_gpio_mode function after I2C initialization.

          Are different pull-ups used depending on the bus speed?

          It is possible to configure pull-ups as you need after changing a bus speed.

          Are pull-ups used if I use the I2C Interface using system commands?

          Yes, they are used in the state selected before you use system commands.

          If you do not configure a pull-up state, a previous state is used.

           

          BR,

          xbolshe

          • 2. Re: i2c programmable pull-ups
            Flo1991

            Can you tell me what is the default state if I use the I2C interface?

            I am working on a custom board and realized that external pull-ups must be a few kilos, also if I chose the high speed mode (which normally uses a pull-up around 1k ohm)

            So it would be interesting if an external pull-up should be used, or if the internal values should be used depending on the bus speed.

             

            Flo1991

            • 3. Re: i2c programmable pull-ups
              xbolshe

              Can you tell me what is the default state if I use the I2C interface?

              About MRAA I have written above. In the general case just power your board off,

              power on and check states of GPIO 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 208, 209, 210, 211, 212, 213.

               

              BR,

              xbolshe

              • 4. Re: i2c programmable pull-ups
                Flo1991

                Thanks for your help, can you please tell me how to check these states?

                Btw. GP216 and so on are not available at the edison module (are they used internally? what are they used for?)

                 

                Flo1991

                • 5. Re: i2c programmable pull-ups
                  xbolshe

                  May you provide an output of the following commands?

                   

                  # cat < /sys/kernel/debug/gpio
                  # uname -a
                  

                   

                  BR,

                  xbolshe

                  • 6. Re: i2c programmable pull-ups
                    Intel Corporation
                    This message was posted on behalf of Intel Corporation

                    Do you still need help with this thread?

                    -Sergio
                     

                    • 7. Re: i2c programmable pull-ups
                      Flo1991

                      Sorry for the late reply, I have been working on another important aspect of the board...

                      here is the command output:

                      root@Edison3Antenna:~# cat < /sys/kernel/debug/gpio

                      GPIOs 0-191, pci/0000:00:0c.0, 0000:00:0c.0:

                      gpio-61  (SW1UI4              ) in  hi

                      gpio-64  (bcm43xx_irq         ) in  hi

                      gpio-71  (bcm_bt_lpm          ) out hi

                      gpio-77  (sd_cd               ) in  hi

                      gpio-96  (vwlan               ) out hi

                      gpio-124 (hsu                 ) in  lo

                      gpio-125 (hsu                 ) out lo

                      gpio-126 (hsu                 ) in  hi

                      gpio-127 (hsu                 ) out hi

                      gpio-128 (hsu                 ) in  hi

                      gpio-129 (hsu                 ) in  hi

                      gpio-130 (hsu                 ) in  hi

                      gpio-131 (hsu                 ) in  hi

                      gpio-132 (hsu                 ) in  lo

                      gpio-133 (hsu                 ) out lo

                      gpio-134 (hsu                 ) in  hi

                      gpio-184 (bcm_bt_lpm          ) out lo

                      gpio-185 (bcm_bt_lpm          ) in  lo

                      root@Edison3Antenna:~# uname -a

                      Linux Edison3Antenna 3.10.17-poky-edison+ #2 SMP PREEMPT Wed Jun 15 11:13:10 CEST 2016 i686 GNU/Linux

                       

                      With this output no external pull-ups are connected.

                      If you look at this: Exploring Edison - Beyond mraa

                      you can see that there are different onboard pull-ups that can be programmed. I suppose mraa does not use this option, does it?

                       

                      Flo1991

                      • 8. Re: i2c programmable pull-ups
                        Intel Corporation
                        This message was posted on behalf of Intel Corporation

                        If you look at the link you shared, at the beginning of the “Controlling the GPIO Mode”, there’s a note that says that not all the possibilities of changing GPIOs are available with MRAA.

                        There’s a thread with a similar discussion here https://communities.intel.com/thread/56312

                        -Sergio