Newbie Help Request.
beez
Posts: 8
Cant seem to get the MXD2125 working.
I've tried a bunch of stuff, and even though the Y axis shows good PWM on the scope, the X shows nothing.
I have two problems, that's the hardware side.
The software side is that all I get are zeros from the output.
I know I'm probably missing something obvious, thanks for the input.
Beez
I've tried a bunch of stuff, and even though the Y axis shows good PWM on the scope, the X shows nothing.
I have two problems, that's the hardware side.
The software side is that all I get are zeros from the output.
I know I'm probably missing something obvious, thanks for the input.
Beez
{{HelloMemsic.spin interface to the mems accelerometer IC and output serially }} CON _CLKMODE = XTAL1 + PLL16X _XINFREQ = 5_000_000 OBJ accel : "MXD2125 Simple" serial: "parallax serial terminal" PUB Main | status serial.startRxTx(31, 30, 0, 115_200 ) status := accel.start(2, 1) serial.str(string("accel start status = ")) serial.dec(status) serial.str(string(13)) repeat serial.dec(accel.x) serial.str(string(" ")) serial.dec(accel.y) serial.str(string(13))
Comments
115,200 Baud is a little fast. Until you get everything working, I suggest you limit the Baud to 19,200.
Thanks!
Chris
Oh, and I switched to 19.2k but no fix there.
I don't have any 220 Ohm resistors on hand, I have some 150 if that's worth a try, but I feel like it should be working without, the supplies and grounds of both chips are identical, I can measure the changing duty cycle at least on the Y axis.
Hmmh.
Thanks for the assistance!
CB
If you're getting valid PWM information on the Y-axis output, but not the X-axis output, you may have a damaged or defective accelerometer or some kind of wiring error.
I'll have to stick the scope on the prop pin to make sure the signal gets over there.
This is definitely perplexing.
Thanks!
Beez
I got it!
At first, I thought it was a power problem as my wall wart ( allegedly 7.5 volts ) was dipping significantly, and my 3.3v rail on the board was only 2.7. I threw the accelerometer module on a breadboard, and not only does it work fine at 2.7, it goes lower than that, and both X and Y are working fine!
I went back and re-examined my wiring on the prop proto board. I had initially installed a six pin IC socket for the accelerometer module, not realizing that those big pins won't go into an IC socket. In the process of reworking the board, I scratched the mask off o the ground plane near the X axis pin. When I soldered that wire, I got an intermittent short to ground. So, I cleaned up that wiring and now it works fine!
Thanks for all the help and pointing me in the right direction!
Now I"m wondering, the data looks kind of "jittery". I guess I should save up for viewport so I can graph it but subjectively, I"m going to be using this for a servo control and I think I need some low-pass filtering. Do you think a running average would work?
Thanks again!
Chris