-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Random Crashes?? #8
Comments
Hard to say, I haven't seen this behavior. |
I am using an Ardunio UNO hooked up to Sparkfun's GPS Mouse that has one of these onboard (although their documentation doesn't say how to interface with it, it's there and on the SCL and SDA lines). |
Just for comparison, I have been using this code for on an Arduino Nano, Ardunio Mega, and Teensy-2.0 on a soldered circuit board with a short (centimeters) I2C bus with three devices (BMP-180, MPU-6050, QMC5883L), and haven't observed any hanging problems. For reference, I assume you are using this, right? It possible there is a problem in the QMC5883L driver. As a first debugging step, I would suggest adjusting your sketch to use It's also possible there is a problem in the hardware. From the picture in the datasheet, I am somewhat concerned about the length of the leads: I2C isn't really designed to be used as an off-board connection, although it can work sometimes. You may also need to add (or adjust or remove) the termination resistors on the bus: some devices have them built in, and some don't. Sometimes the termination needs to be adjusted depending on the bus voltage. And, just to eliminate all the possibilities, you might just try some other simple long running sketch (e.g. just print out the time once per second) and see if the board crashes. If that's the case, then you have some other underlying issue. Hope that helps, let me know what you find. |
I did some digging and it turns out I was using 5 volt logic to the chip, however it was being powered with 3.3v. Now that I added a level shifter, the chip wont even init which is annoying. I am a little over my head here |
This seems to be a pretty common arrangement -- the chip runs at 3.3v, but the board has a regulator (and sometimes) a level shifter for the signals, so it appears as a 5V device externally. |
Let's try to narrow down the source of the crash by eliminating some code.
|
The code above still crashes on my Wemos Mega after about 20 values have been printed. |
I moved the QMC5883L closer to the SCL,SDA pins on the Wemos Mega. |
😀I like spooky hardware, but for an engineer this smells like drawing current from an internal pull resistor. Are you sure nothing is shortning, or an LED perhaps? |
I swear by my mother's cold, dark grave. With the cable attached, I moved the sensor closer to the board. Values are still ticking out. I can move it, I can shake it, I can rattle it. |
Ok, I think we have established that it's a hardware problem. |
Are you sure you are using the right pullup resistors on both the SDA&SCL pins? See https://en.m.wikipedia.org/wiki/I%C2%B2C, physical layer: measure the line capacitance C and pick a high resistance R allowing a bitrate up to 1/RC |
Hello,
I am unsure why this is happening, but the example seems to crash at random times and hang the Arduino. This is repeatable on both the QMC588L's I have. Any idea why?
-Will
The text was updated successfully, but these errors were encountered: