|
Post by Frisbone on Feb 3, 2014 6:20:50 GMT -5
So I wrote the code for the new accelerometer and turned the AMDriver class into a virtual base class as a parent to MMA8452 and ADXL345 child classes. I began the testing process trying to duplicate results for the MMA8452 to make sure everything was initializing correctly and got stuck there. Solved all my issues except for one.
I seem to be getting data - but its not what I'm expecting. I'm expecting a G number on the Z axis to change significantly when I have the HPF turned off - but it doesn't change. I did change the initialization procedures after reviewing the specs - a lot was being initialized that wasn't actually used (tap/orientation settings). So it could be initialization differences. Going to wait until I've been able to get original results and then non-zero results from the ADXL before I check anything in.
That superbowl was aweful.
|
|
|
Post by Frisbone on Feb 4, 2014 12:04:06 GMT -5
I finally found the bug. It was one of those insidious bugs where it pretends to behave while misbehaving and blaming it on something else. It was frustrating because a register value that needed to be set was not set - but the default value was close enough to produce results that looked valid. Anyway, its fixed and I've got the re-written code operating correctly with the MMA. Now I think I'm going to get the interrupt driven code working before I move on to the ADXL tests. Hoping the sampling will be a bit more reliable that way.
|
|
|
Post by lintball on Feb 4, 2014 21:59:47 GMT -5
Always a little bit here or there to cause trouble...and yes that Super Bowl was such a waste.
|
|
|
Post by Frisbone on Feb 4, 2014 22:07:30 GMT -5
Well, I ended up wiring it to gpio 7 - but it can be moved easily enough. I can get it to trigger - but I'm having some odd software hangs and aborts now. Some debugging required I guess. didn't think I'd have to worry too much about concurrence issues just yet, but maybe I have things set up differently than I thought and perhaps I've got competing data issues.
I might disable the interrupt tomorrow and check everything in so you have current code - at least I know that the SW interrupt was working OK.
|
|
|
Post by Frisbone on Feb 5, 2014 9:19:31 GMT -5
I did notice that my offset calculation (what I call AM calibration) had an error in that I was following the process for the MMA8451Q and not the 8452Q. After adjusting - it does appear that the expected 1G (with HPF turned off) is much closer to 1G than I had before. Also found the correct procedure for the ADXL - which is different.
Hoping to switch to the ADXL tonight after setting up a test for the MMA as I described in the email I sent. Will post the results if I have any.
|
|
|
Post by lintball on Feb 5, 2014 20:20:44 GMT -5
Yea I have been trying to think of another way to do your test or at least make it more consistent. The only thought I had was using a motor to pull it through. Maybe even just wrapping a line around the dremel bit. Though it might be too quick. My office is currently being borrowed as bedroom due to the weather, but maybe tomorrow I can start looking into it.
|
|
|
Post by Frisbone on Aug 24, 2015 7:36:32 GMT -5
|
|