wasserwiesel
Well-known member
Hi there,
My teensy 4.1 is connected to the mpu9250 over SPI1.
I found out that when I use a CPU Speed of 150mhz it works. It doesn't work at any other speed.
The security of my project is a top priority and when I consider that there are still bugs in this area, it makes me a little nervous. Is it even safe then, with 150Mhz?
I actually wanted to order my own PCB with an SPI connection to the IMU.
Should I use i2C or is there a quick fix?
I would be happy if someone could help me.
Here is my Code:
My teensy 4.1 is connected to the mpu9250 over SPI1.
I found out that when I use a CPU Speed of 150mhz it works. It doesn't work at any other speed.
The security of my project is a top priority and when I consider that there are still bugs in this area, it makes me a little nervous. Is it even safe then, with 150Mhz?
I actually wanted to order my own PCB with an SPI connection to the IMU.
Should I use i2C or is there a quick fix?
I would be happy if someone could help me.
Here is my Code:
Code:
#include "MPU9250.h"
// SPI
#define PIN_MISO1 39
#define PIN_MOSI1 26
#define PIN_SCK1 27
#define PIN_CS1 38
MPU9250 IMU(SPI1, PIN_CS1);
int status;
void setup() {
Serial.begin(115200);
while (!Serial) {}
SPI1.setMISO(PIN_MISO1);
SPI1.setCS(PIN_CS1);
pinMode (PIN_CS1, OUTPUT);
digitalWrite(PIN_CS1, HIGH);
status = IMU.begin();
if (status < 0) {
Serial.println("IMU initialization unsuccessful");
Serial.println("Check IMU wiring or try cycling power");
Serial.print("Status: ");
Serial.println(status);
while (1) {}
}
}