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!