-
Teensy and the GY-91
12/22/2017 at 20:43 • 0 commentsAdding the GY-91 was easy, but oddly (read: my incomplete understanding of C), it would reports type conversion errors on:
int16_t mag_max[3] = {0x8000, 0x8000, 0x8000},
So after some research I changed it to:
int16_t mag_max[3] = {-32768, -32768, -32768},
And it compiled.
Then at then some point it starting giving me errors "undefined reference to `_kill`" and similar, and wouldn't compile, so after some Googling, I added this to my .ino:
extern "C" { int _getpid() { return -1;} int _kill(int pid, int sig) { return -1; } int _write() {return -1;} }
The LCD display lines are:
- acceleration values in milli-G's
- gyro values in degree/sec
- mag values in degree/sec
- yaw pitch roll
-
Teensy 3.5 & Nokia 5110 LCD sanity test
12/22/2017 at 20:12 • 0 commentsKinda glad for this excuse to finally try the Teensy. The Teensyduino installed easily, and the "button" to upload is easy and fast. I hadn't even realized the 3.5 had Digital Audio, CAN Bus, SD Card, and even ethernet support. Impressive!
Anyway, making the demo code work with it was easy, even with the Hardware SPI. -
A Spark, a D'oh!, a Surprise, and Data Sheets
12/21/2017 at 20:38 • 0 commentsSo SparkFun's documentation on it's "IMU Breakout - MPU-9250" (although it's lacking the BMP280 of GY-91, it's a start) looked good in it's Hookup Guide and it's SparkFun_MPU-9250_Breakout_Arduino_Library repo.
In no particular order:
- The Nokia 5110 display wasn't working because I didn't set `#define LCD true` which isn't documented (#AlwaysReadTheCode) but the Pro Mini seems just not quite up to running it ("30692 bytes (99%) of program storage space", "Global variables use 2089 bytes (102%) of dynamic memory". Perhaps I could rustle up those 41 bytes...?
- Turns out I have an MPU9255!, with a "Who am I" of 0x73. More about that below.
- The MPU9250 lib they include a fork of incorrectly defines the `WHO_AM_I_AK8963` register as 0x49, while it's actually at 0x00. The value is still 0x48 though.
- I saw a comment about pulling NCS (Chip Select) high, but that seems to be only for SPI?
The MPU9255:
The InvenSense MPU-9255 is a System in Package (SiP) that combines two chips: the MPU-6555, and the market leading, 3-axis digital compass [still seems to be the AK8963C] with an on-board Digital Motion Processor™ (DMP) capable of processing complex MotionFusion™ algorithms.
While the code now runs, I'm getting what seems like inaccurate/wildly fluctuating results - or so it seems to me - it stills motionless on my desk.
The MPU-925x code mentions being Teensy 3.1 compatible (that may only be because of the 3.3V of the module though) - which should be more than sufficient to run the display (so as to avoid being tethered to the laptop for the Serial Monitor), and I have a 3.5, so I guess I'll be converting the example to use that board, and install Teensyduino.
-
I tried another library and failed, time for a sanity check
12/21/2017 at 03:03 • 0 commentsA couple of the simpler-seeming (like from Sparkfun) assume 3.3v Pro Mini's so I ordered a couple, and hooked it all up including a Nokia 5110, burned the code... and nada.
After some fiddling I decided I needed to verify both the Pro Mini's and the 5110's were working. It took me a couple libraries to find one that worked. Not sure if it was the libs or the wiring - there seems to be a number of pin layouts for the 5110.
Probably not an obvious choice but this worked like a champ Nokia 5110 LCD, an Arduino Pro Mini 3.3V with 8MHz clock frequency
-
What are we dealing with here?
12/09/2017 at 03:05 • 0 commentsConfusingly, this module is a combo of two chips, and one of which is a combo of two chips.
The module is commonly referred to a the GY-91, which is a MPU-9250 (9 axis g/a/m sensor) chip, plus a BMP280 (absolute barometric pressure sensor) chip.
The MPU9250 is two dies in one package; from the Product Specs:
MPU-9250 is a multi-chip module (MCM) consisting of two dies integrated into a single QFN package. One die houses the 3-Axis gyroscope and the 3-Axis accelerometer. The other die houses the AK8963 3-Axis magnetometer from Asahi Kasei Microdevices Corporation. Hence, the MPU-9250 is a 9-axis MotionTracking device that combines a 3-axis gyroscope, 3-axis accelerometer, 3-axis magnetometer and a Digital Motion Processor™ (DMP)
https://www.invensense.com/wp-content/uploads/2015/02/PS-MPU-9250A-01-v1.1.pdf
I had Google a library before a fully grasped the above, and so tried to use this lib which is not the correct one. https://github.com/kriswiner/ESP32/tree/master/MPU9250_MS5637
Yeah, don't try that.