Open antonro1 opened 8 years ago
Hi @antonro1, I can't understand what is happening here; you are sending a string every 20 milliseconds to the Due without reading it, right? The XBee is not used at all so it should not break anything. I've tested with an I2C accelerometer and your sketch (more or less) and nothing is breaking. Can you post here a simplified PC program which triggers the lock?
Note, the board is the Zero and Leonardo , not the Due. Which accelerometer did you test with? This is specifically the MPU6050 I haven't tried with any other IMU. I'll update with the full .Net code for the serial output later.
Sorry, I meant the Zero, I was testing another issue in the meanwhile and confused the boards :smile: The IMU I have tested is the LSM9DS0
Here's the .Net code. Dies pretty quickly using this.
class Program
{
static void Main(string[] args)
{
SerialPort serial = new SerialPort("COM4", 57600);
serial.Open();
while (true)
{
serial.WriteLine(string.Format("B:{0:F0}", 50));
Thread.Sleep(20);
}
}
}
FYI the MPU6050 board I'm using is this one:
http://www.robotshop.com/uk/6-dof-gyro-accelerometer-imu-mpu6050.html
I have been able to consistently reproduce a problem using an arduino zero, MPU6050 and XBee. MPU6050 is connected via I2C and XBee on pins 0 &1.
Using the following sketch I am able to get the I2C to lockup when sending data to the XBee from the PC. Note the XBee serial port has not been opened. I2C can lockup at "B" or "R":
To generate serial data from the PC I am using a simple .Net application which is basically on a timer sending a few bytes of data:
Arduino SDK version 1.6.7. The issue will occur using just the I2CDev library as well - but that just calls Wire anyway. I have also reproduced this on a Leonardo.
As far as I can tell, without sending any data to the XBee port from the PC, the code will run indefinitely.