1 2 Previous Next 27 Replies Latest reply on Oct 18, 2016 1:13 PM by Intel Corporation

    I²C not pulled all the way low

    nemrod

      Hi,

      I have the Intel Edison on the MBB hooked up to an MPU9250 breakout board (this one, though I've used another with same results) via a bog standard logic level converter (this in this case, but have tried a different one from Drotek with remarkably even worse results, though in a different way and perhaps in that case attributable to the LLC). My issue is that the I²C lines aren't driven all the way low under certain circumstances.

       

      Here's an oscilloscope screencap after resetting the sensor and just running i2cdetect:

      NewFile1.png

      As you can see it works just fine, the addresses (0x68 and 0x77) shows up, and I can do this multiple times with no issue (apart from the less-than-optimal waveform/rise time, but it's good enough and I just want it to work at all at this point).

       

      However as soon as I run a program communicating with the sensor it immediately glitches out somehow. On the high side of the level shifter the whole waveform is simply "moved up" instead of being from 0-3.3V, presumably since the low isn't low enough. Below is a shot from running a program showing when it goes wrong (immediately after running), followed by a close-up of SCL in the faulty state.

      NewFile3.png

      NewFile2.png

      As I've mentioned I've tried multiple sensor breakout boards, multiple level converters, and various pull-up configurations... The pull-ups will affect the waveform slightly but so far I haven't been able to fix the main issue. A theory I have is that the collective pull-up resistance is too low so the Edison is unable to pull it low, but even disabling the internal pull-ups and de-soldering the bridge marked "pull-up" on the breakout board leaving only the resistors on the LLC doesn't seem to help.

       

      I'm not an electrical engineer or even very well-versed in this so any insight is helpful.

       

      Thanks!

      Anders

        • 1. Re: I²C not pulled all the way low
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          Hi,

          One option to force the I2C to be driven low is using an Amp Op. You can use the differential amplifier configuration. This circuit lets you subtract a voltage signal from another. So the idea would be to subtract the DC value you want to remove from the original AC signal. In a differential amplifier VO=V2-V1 in the case where the gain of the amplifier is A=1. V2 would be the analog signal from the I2C and V1 would be the DC value you want to correct and remove from the I2C signal.

          Try using this approach and let us know your results.

          Sergio
           

          • 2. Re: I²C not pulled all the way low
            Intel Corporation
            This message was posted on behalf of Intel Corporation

            Do you still have this issue with I2C? Please keep us updated on your process.

            Sergio
             

            • 3. Re: I²C not pulled all the way low
              nemrod

              Hi Sergio,

              Thanks for the reply! I've read up on opamps (differential amplifiers as suggested) and I think I get how it works. So in practice I can feed the opamp the I²C signal on one input, 0.32V on the other (before the level shifter) and get a range of 0-1.56 out instead of 0.32 to 1.88 as shown in the oscilloscope shot? Does this work for I²C which is bidirectional though? I might be missing something due to my EE inexperience/ignorance. Do changes to the opamp output also change the input (in the original voltage range)? Or would I need some additional circuitry?

               

              Thanks again!

              Anders

              • 4. Re: I²C not pulled all the way low
                Intel Corporation
                This message was posted on behalf of Intel Corporation

                Basically yes, if you subtract a DC signal from an AC signal using the differential amplifier configuration you’d be removing the offset of the AC signal. The Op Amp won’t change the input if the gain of the circuit is A=1, as mentioned before. You can set A=1 if you use the correct resistor values. Some differential amplifier configurations inverse the signal. Look for the configuration that doesn’t reverse the signal so you just have to deal with the offset.

                Sergio
                 

                • 5. Re: I²C not pulled all the way low
                  nemrod

                  Can you clarify whether it works for a bidirectional digital signal like I²C (remember I'm an EE newbie)? You didn't seem to address the question in your reply. I want to get it right because of limited funds (it's for a university thesis, self-funded) and not having a store nearby so I have to order online, pay exorbitantly for shipping and wait a week... Thanks for your patience!

                   

                  Meanwhile, any ideas as to why/what actually happens in the first place? It's such a common circuit (Edison - level shifter - sensor breakout) that it clearly shouldn't exhibit this kind of behaviour or need extra circuitry in the form of a differential amplifier in the first place.

                  • 6. Re: I²C not pulled all the way low
                    Intel Corporation
                    This message was posted on behalf of Intel Corporation

                    The Op Amp doesn’t work in a bi directional way. The easiest way to do this is still using pull up resistors. You say in your original post that the pull up resistors you’re using are too low. What resistor values are you using? If the value used is too low the pull up configuration will not work.

                    When you measured the i2C line in the first post were you using a level translator? What do you see if you don’t use the level translator and just measure the I2C lines? In another picture, still not using a level translator, connect an I2C device to the I2C lines. Make sure this I2C device is 5V so that you don’t need to use a level translator. The Arduino 1 can be used as this I2C device. This will prove if the issue is caused by the Edison itself or because of the external components used.

                    Sergio
                     

                    • 7. Re: I²C not pulled all the way low
                      nemrod

                      I'm using the mini breakout board which uses 1.8V logic so I have to use a level shifter, and yes, the screencaps are all using a level shifter and the circuit is exactly the same for all of the shots. Unfortunately I have no 1.8V I²C devices to try, nor an Arduino break-out board to use with 5V. Just running it not connected to anything shows perfectly normal I²C values if I recall correctly and I've now tried to connect an Arduino Nano to the Edison via the same level shifter and it seems to work; but it's just getting a request and sending a few bytes of data back, much less complex than the sensor I'm connected to otherwise.

                       

                      I say the pull-ups is a theory I have; but it's just conjecture. My reasoning is that if the resistance to VCC is too low the Edison "isn't powerful enough" to drive the line all the way low. I haven't added any pull-ups 'manually'; the Edison has an internal pull-up that's configurable by software (20k standard IIRC, 1-50k options), the level shifter has SMD resistors on both ends marked 103 (so 10k) and the sensor break-out board has built-in pull-ups which I think are also 10k. As I mention I've tried disabling the one on the breakout board and the Edison internal ones but still have the issue. The waveforms change slightly, as they should, so it really is changing the resistance in some way or form. Perhaps the pull-ups aren't the issue at all, I stress that it's just a theory from a relative novice.

                       

                      So since I²C is bidirectional the op amp suggestion won't work? That's too bad, but thanks! (and I learned something, so that's a win)

                      • 8. Re: I²C not pulled all the way low
                        Vincenze

                        Why do you use a level shifter?

                         

                        Check the D.C. Electrical Characteristics table in the datasheet of MPU9250 https://store.invensense.com/datasheets/invensense/MPU9250REV1.0.pdf

                        VDDIO can be 1.8V. Just connect the VDDIO pin to the 1.8V pin of the Edison.

                         

                        When you use a level shifter, pullup resistors must be used on both sides of the level shifter.

                        • 9. Re: I²C not pulled all the way low
                          nemrod

                          Thanks for the suggestion Vincenze, but VDDIO isn't exposed on any of the three different MPU9250/MPU6050 boards I have access to and I don't really have the tools, time or experience to create my own. I'm not particularly keen on soldering wires straight to the MPU9250 as it's a tiny 24 lead QFN package, but I guess I could try to mess around with the breakout board to break some paths and get wires on in the relevant places. It's not a first option though, since really, it should just work with a level shifter. If it's what I have to resort to then I guess I will have to look into if it's feasible on one of the boards. The level shifter does indeed have pull-ups on both sides.

                          • 10. Re: I²C not pulled all the way low
                            Vincenze

                            Apparently, your level shifter doesn't work well.

                            Try to change the pullup resistors to 50-100k ones.

                             

                            There are many specialized chips for I2C level converting like this one:

                            SparkFun Level Translator Breakout - PCA9306 - BOB-11955 - SparkFun Electronics

                            • 11. Re: I²C not pulled all the way low
                              nemrod

                              Apparently. I've used two different ones that both claim to work just fine with I²C though, and this one does seem to work until all of a sudden it doesn't (second oscilloscope shot). I can't find a breakout board with a chip specialised for I²C without $20+ shipping (and a week long wait) in the EU... At some point it'll be cheaper and faster to just get the equipment to make my own PCB. It's a very well-known and common sensor chip, bog-standard level converter (looks exactly like the SparkFun Logic Level Converter - Bi-Directional, though it's not Sparkfun) and the Edison. I don't get how this is happening when it seems to me it should just work. Quite frustrating. Appreciate the feedback though, I'll try to look around a bit more for something specialised for I²C, might have missed some store.

                              • 12. Re: I²C not pulled all the way low
                                Intel Corporation
                                This message was posted on behalf of Intel Corporation

                                Hi nemrod,

                                Have you find any specialized chips for I2C such as the one recommended by Vincenze? Keep us updated on your progress.

                                Sergio
                                 

                                • 13. Re: I²C not pulled all the way low
                                  nemrod

                                  Sergio,

                                  I did find a distributor in my country last night (of the specific Sparkfun board Vincenze linked to, incidentally), it's ordered but will take a few days for shipping with the weekend and all. I'll report back when it arrives and I can test it.

                                   

                                  Have a nice weekend,

                                  Anders

                                  • 14. Re: I²C not pulled all the way low
                                    nemrod

                                    I've received the PCA9306 and tried it with no luck. As expected it's still not driven low, and not only that but it's even higher with this module (with a nicer waveform though).

                                    NewFile4.png

                                    As you can see low is a full 0.8v. This is from i2cdetect, which worked before and looks reasonable now except too high. When I instead run the test program that actually does stuff, this is what I get:

                                    NewFile6.png

                                    It seems barely able to drive it low at all from a high state. Not sure what else could make it look like that.

                                     

                                    That's four different types of level converters tried, all of which should have worked. The root issue must lie either with the Edison or with the sensor, but I've tried three different sensor boards with identical results (although all ultimately using Invensense IMUs, though they are very common and I've seen nothing about this issue). Is there some mysterious incompatibility between the Invensense IMUs and the Edison, is my particular Edison broken somehow, or is there something faulty with the Edison design?

                                     

                                    Any suggestions on how to make the sensors work in light of this?

                                     

                                    Thanks,

                                    Anders

                                    1 2 Previous Next