12 Replies Latest reply on Mar 2, 2015 5:57 AM by MaJiayao

    Edison i2c lost arbitration when enable any 2 devices

    MaJiayao
      • we try to enable 2 i2c devices to Edison. It works if only connecting with one device.
      • However,when we connect 2 devices to i2c6. We get following error:

        • i2cdetect -y -r 6

      0 1 2 3 4 5 6 7 8 9 a b c d e f

      00: -- -- -- -- -- -- -- -- -- -- -- -- --

      10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

      20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

      30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

      40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

      50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

      60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

      70: -- -- -- -- -- -- -- --

        • dmesg

      i2c-designware-pci 0000:00:09.1: i2c_dw_handle_tx_abort: lost arbitration

      `     can anyone help us?

        • 1. Re: Edison i2c lost arbitration when enable any 2 devices
          JPMontero_Intel

          Hi MaJiayao,

           

          Remember when you user multiple devices to the I2C bus you need to add pull up resistors, also make sure the devices are connected correctly to the bus. Take a look at this site http://www.robot-electronics.co.uk/acatalog/I2C_Tutorial.html. Let me know if it helps.

           

          Regards,
          JPMontero_Intel

          • 2. Re: Edison i2c lost arbitration when enable any 2 devices
            MaJiayao

            Hi JPMontero,

            Finally we found that Edison i2c  usually accpect  1.8v logic.but our sensors are 3.3v logic.we use levelshifter between sensors and Edison,then problem solve.

            Thank you for your help!

            • 3. Re: Edison i2c lost arbitration when enable any 2 devices
              freshbird

              but ,  Edison Arduino kit also had the same problem...and i know that this board had levelshift(BSS138 and pull up resistors),so what's wrong?i test two sensor(mpu9150 & bmp085).and they can work well in Arduino UNO.

              • 4. Re: Edison i2c lost arbitration when enable any 2 devices
                MaJiayao

                Hi freshbird

                1.my test is on Edison breakout board ,and my levelshift is TXS0102.

                For i don't know much about ediosn arduino kit and BSS138. Maybe you can compare and find some differences.

                 

                2.Some advices

                make sure your sensors can work well seperately.

                make sure levelshift works well,oscilloscope can help a lot.

                if pull up sensors are already in the levelshift  there is no need to add extra  pull up resistors for sensors in my case.

                 

                let me know if it helps~

                 

                Regards

                ma jiayao

                • 5. Re: Edison i2c lost arbitration when enable any 2 devices
                  freshbird

                  yeah. can you give the link of levelshift module??

                  or only use the chip,built the peripheral circuit by yourself.if in this case, maybe you can give the The principle diagram of the circuit.

                  this is my email : tww19900416@gmail.com

                   

                  by the way, the sensors can work well seperately..

                   

                  reagards.

                  freshbird

                  • 6. Re: Edison i2c lost arbitration when enable any 2 devices
                    freshbird

                    Hi JPMontero,

                         i had saw the test the multiple sensors in Edison Arduino kit.and the result is same to:

                    • we try to enable 2 i2c devices to Edison. It works if only connecting with one device.
                    • However,when we connect 2 devices to i2c6. We get following error:
                      • i2cdetect -y -r 6

                    0 1 2 3 4 5 6 7 8 9 a b c d e f

                    00: -- -- -- -- -- -- -- -- -- -- -- -- --

                    10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

                    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

                    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

                    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

                    50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

                    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

                    70: -- -- -- -- -- -- -- --

                      • dmesg

                    i2c-designware-pci 0000:00:09.1: i2c_dw_handle_tx_abort: lost arbitration


                    and i know that arduino kit already had the levelshift (BSS138 & 4.7K pull up resistor),so maybe the levelshift is wrong?should use the TXS0102?

                    • 7. Re: Edison i2c lost arbitration when enable any 2 devices
                      MaJiayao

                      hi freshbird

                      1.the datasheet of txs0102 can be found on TI‘s official website.

                      http://www.ti.com.cn/cn/lit/ds/symlink/txs0102.pdf

                      2.peripheral circuit followins the typical application of datasheet.

                       

                      Regards

                      Ma jiayao

                      • 8. Re: Edison i2c lost arbitration when enable any 2 devices
                        JPMontero_Intel

                        Hi freshbird,

                         

                        Let us know if MaJiayao suggestion help you to fix this issue.

                         

                        Regards,
                        JPMontero_Intel

                        • 9. Re: Edison i2c lost arbitration when enable any 2 devices
                          freshbird

                          HiMaJiayaoJPMontero_IntelMaJiayao

                          I had test the TXS0108 module(8 channels),but it can't work well either.

                          i had see the waveform by oscilloscope, and the output of the module is 3.3V.


                          the below is the mesage about kernel:

                           

                          root@edison:/etc# i2cdetect -y -r 6

                               0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f

                          00:          [  488.228772] i2c-designware-pci 0000:00:09.1: ===== REGISTER DUMP (i2c) =====

                          [  488.228874] i2c-designware-pci 0000:00:09.1: DW_IC_CON:               0x65

                          [  488.228958] i2c-designware-pci 0000:00:09.1: DW_IC_TAR:               0x3

                          [  488.229037] i2c-designware-pci 0000:00:09.1: DW_IC_SS_SCL_HCNT:       0x2f8

                          [  488.229118] i2c-designware-pci 0000:00:09.1: DW_IC_SS_SCL_LCNT:       0x37b

                          [  488.229198] i2c-designware-pci 0000:00:09.1: DW_IC_FS_SCL_HCNT:       0x87

                          [  488.229277] i2c-designware-pci 0000:00:09.1: DW_IC_FS_SCL_LCNT:       0x10a

                          [  488.229357] i2c-designware-pci 0000:00:09.1: DW_IC_INTR_STAT:         0x0

                          [  488.229435] i2c-designware-pci 0000:00:09.1: DW_IC_INTR_MASK:         0x246

                          [  488.229515] i2c-designware-pci 0000:00:09.1: DW_IC_RAW_INTR_STAT:     0x10

                          [  488.229594] i2c-designware-pci 0000:00:09.1: DW_IC_RX_TL:             0x20

                          [  488.229674] i2c-designware-pci 0000:00:09.1: DW_IC_TX_TL:             0x20

                          [  488.229753] i2c-designware-pci 0000:00:09.1: DW_IC_ENABLE:            0x1

                          [  488.229831] i2c-designware-pci 0000:00:09.1: DW_IC_STATUS:            0x2

                          [  488.229909] i2c-designware-pci 0000:00:09.1: DW_IC_TXFLR:             0x1

                          [  488.229988] i2c-designware-pci 0000:00:09.1: DW_IC_RXFLR:             0x0

                          [  488.230066] i2c-designware-pci 0000:00:09.1: DW_IC_TX_ABRT_SOURCE:    0x0

                          [  488.230144] i2c-designware-pci 0000:00:09.1: DW_IC_DATA_CMD:          0x0

                          [  488.230221] i2c-designware-pci 0000:00:09.1: ===============================

                          [  488.230332] CPU: 0 PID: 270 Comm: i2cdetect Tainted: G        W  O 3.10.17-poky-edison+ #1

                          [  488.230337] Hardware name: Intel Corporation Merrifield/BODEGA BAY, BIOS 466 2014.06.23:19.20.05

                          [  488.230344] task: f5d8fa60 ti: f6e28000 task.ti: f6e28000

                          [  488.230405] Stack:

                          [  488.230474] Call Trace:

                          [  488.230898] Code: b3 ff ff 89 f8 09 d0 80 ce 04 83 ff 02 0f 44 c2 8b 15 54 ab b0 c1 89 82 00 b3 ff ff f7 c6 00 02 00 00 74 14 e8 67 f7 0a 00 56 9d <83> c4 04 5b 5e 5f 5d c3 90 8d 74 26 00 56 9d e8 51 f3 0a 00 83

                          [  488.230922] CPU: 1 PID: 0 Comm: swapper/1 Tainted: G        W  O 3.10.17-poky-edison+ #1

                          [  488.230927] Hardware name: Intel Corporation Merrifield/BODEGA BAY, BIOS 466 2014.06.23:19.20.05

                          [  488.230936] task: f6c83d30 ti: f6e1c000 task.ti: f6e1c000

                          [  488.230996] Stack:

                          [  488.231064] Call Trace:

                          [  488.231269] Code: 8b 42 08 a8 08 75 24 31 c9 8d 42 08 89 ca 0f 01 c8 0f ae f0 89 f6 89 e0 25 00 e0 ff ff 8b 40 08 a8 08 75 07 b1 01 89 f0 0f 01 c9 <85> 1d 58 fd b3 c1 75 0d 8d 55 f0 b8 05 00 00 00 e8 8d 34 d9 ff

                          [  488.361068] i2c-6: recovery ignore

                           

                          Regards

                          Freshbird

                          • 10. Re: Edison i2c lost arbitration when enable any 2 devices
                            freshbird

                            is there any setup about gpio??i had driver mpu9150 well before.(use BSS138)

                            • 11. Re: Edison i2c lost arbitration when enable any 2 devices
                              MaJiayao

                              it seems that there is no need to setup gpio.

                              • 12. Re: Edison i2c lost arbitration when enable any 2 devices
                                MaJiayao

                                sensor  i2c SDA <--->level shift <---> (1.8 V) i2c SDA Edison

                                sensor  i2c SCL <--->level shift <---> (1.8 V) i2c SCL Edison

                                 

                                 

                                could you provide more imformation about

                                • have you get 1.8v logic on the side of Edison?
                                • when you add level shift, does the sensor also work well separately.
                                • once you detect i2c ,what does the wave on the oscilloscope look like?does it look nice?for example,whether the rising edge looks sharp or not?