MPU 6000 SPI works with 5v but not with 3.3 ?

Hi there!

I have some problems with a mpu6000 breakout board, the cjmcu-84 to be more precise.
It is suppose to run with a teensy 3.6 (180 MHZ and 3.3v ).

I did have some issues getting any response at first and was almost ready to throw the device away for good.
After finally realizing i had to connect the cs pin to GND to enable I2C protocol I had the response, the 0x68 of the whoamI register, i was looking for. But still no chance to get any SPI response,

Knowing the device was infact working, I kept looking and found someone mentioning that the voltage regulator on the breakout board could impact the 3.3 v input and mess with the SPI.

So i tried out the same wiring and the same code on an arduino uno and... it works like a charm. :o
At least after setting the SPI clockSpeed down from the recommended 1.000.000 to 950.000 HZ the result was correct 100% of the time and not only like 80%.

The teensy runs perfectly well with other devices and the same SPI wiring and code.
I use the SPI.h library and choose the Speed and Mode via this code

  SPI.beginTransaction(SPISettings(950000, MSBFIRST, SPI_MODE0));
  digitalWrite(csb, LOW);
  dump = SPI.transfer(MPU6000_WHO_AM_I | 0x80);     
  result = SPI.transfer(0x00);
  digitalWrite(csb, HIGH);
  SPI.endTransaction();

So to sum it up: I2C works with both a 3.3v 180MHZ and a 5v 16MHZ mcu, SPI only on the 5v device.

I see 3 possible roots of this problem:

1. The voltage regulator on the breakout, sadly saving the infact 3.3v wanting mpu from 3.3v input reducing it to 3.1 or 3.2 and somehow mess with SPI.
2. The teensy clockspeed is not decreased enough somehow?
3. Its just some wrong wiring / stupid mistake on my side.

Since option 3 is usually the way to go i kept looking into the code and the wiring again and again turning up empty.

So i decided to ask the allmighty internet for help and here we are..

Has anyone any guesses, ideas or even solutions? Or has anyone encountered a simular problem?

i really really would appreciate it!

The MPU is a 3.3V device and requires level shifters to work with 5V CPUs, especially using the SPI bus.

If it has been connected via the SPI pins to a 5V processor without level shifters, it has probably been damaged, although it may work for a while.

thx 4 your reply !

maybe i was a little bit unclear before. But the mpu is still working! The Labeling on the vin pin even says +5v.

*For the test with 5v uno i used bidirectional level shifter for the 4 SPI connections!

At the moment I use it with I2C and the teensy (3.3v) but in short tests the SPI connection which doesn't work with 3.3v works well with a 5v arduino uno and the same code.

I wanted to know why and if there is any fix to it.

Most of those MPU modules have an on board voltage regulator that converts 5V to 3.3V, which is why 5V is OK for Vin.

However, most of the boards do not have level shifters and if you search through this forum, you will see lots of posts complaining about communications failures.

SPI should work fine with a 3.3V processor, but there are four different SPI modes. If it doesn't work, perhaps the wrong mode is default, so try the others. Make sure that the appropriate pin is connected and used for SS.

I've never used a Teensy, so google for possible Teensy-specific problems.

I went down as low as 100KHZ. Still receiving only "0" with the 3.3v mcu.

So there is no way the 3.3v from the teensy is somehow not sufficiant after the onboard voltage regulator at vin?

thx again!

Did you try all four SPI modes?

If the given SPI MODE worked on the Uno, shouldn't it be the same with the teensy?

and yes, i just tried all four modes anyway. No luck.

From what I am reading, you are supplying 3.3V to run a 5V MPU6050, which does not work, your MPU6050 module is a 3.3V device with a voltage regulator, built in, to lower the voltage to 3.3 volts, has also been stated, and you want to run the MPU6050 off of a 3.3V supply.

On the MPU6050 is a 3 terminal package (4 including the heatsink) used as the voltage regulator that coverts 5V to 3.3V. The voltage regulator needs 5 volts to supply the module with 3.3 volts and supplying 3.3V to the 5V regulator on the module makes the MPU605 not work so well. Find the voltage regulator, on the MPU6050 module, and short the input to the regulator to the output. Once shorted, apply 3.3V power to the module and all should be well and you'll not require level shifters.

You may, looking at the module, find two tiny pads near the regulator that, when a blob of solder is placed over it shorts the regulator.

the module i'm using

Not sure my soldering and general electronics knowledge skills will allow me to short the onboard voltage regulator as suggested :frowning:

Also I'm still not sure the voltage regulator is or even could be the problem. Did anyone ever had the problem that a regulator renders a 3.3v input useless if the processor infact needs 3.3v by unintentionaly lowering it further?

Could i connect the arduino 5v (or any other 5v source) to the mpu vin and the miso/mosi/clock/cs to the 3.3 teensy?
How would I have to wire that up? How to close the circuit and ground it?

thx 4 all the replies so far!

For 3.3V MPU (MMU), I am using a LSM9DS1.

Also I'm still not sure the voltage regulator is or even could be the problem.

It certainly could be. All voltage regulators introduce a voltage drop which can be quite large, depending on type (2 V for some types, 200 mV for others).

If the manufacturer states "5 V power" then you are not entitled to assume that the board will work with 3.3V.

If you don't want to remove the regulator, use the conditions under which the sensor works and move on with the project. I would guess that I2C works because of the external pullup resistors on the clock and data lines.