Shop OBEX P1 Docs P2 Docs Learn Events
Newbie Help Request. — Parallax Forums

Newbie Help Request.

beezbeez Posts: 8
edited 2009-06-17 20:41 in Propeller 1
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

{{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

  • Mike GreenMike Green Posts: 23,101
    edited 2009-06-14 04:37
    Can't tell from the information you've provided. The code you've listed looks correct, so there must be something wrong with how you've got it wired.

    115,200 Baud is a little fast. Until you get everything working, I suggest you limit the Baud to 19,200.
  • beezbeez Posts: 8
    edited 2009-06-15 22:05
    Ok, thanks for that! I have both grounds (pins 4 and 5) hooked up to Vss, pin 6 hooked up to VDD, pins 2 and 5 to propeller pins 1 and 2 with no resistors. I've since noticed an app note from Parallax that shows 220 ohm resistors between the outputs of the chip and the inputs of the propeller. Maybe that omission is my problem? Are those necessary? Have I likely damaged the chip?
    Thanks!
    Chris
  • Mike GreenMike Green Posts: 23,101
    edited 2009-06-15 22:21
    The 220 Ohm resistors are necessary if you use a Propeller with the MDX2125 powered from 5V. They also protect the Propeller and the MDX2125 from programming errors where pins 1 and 2 would accidentally be set to outputs rather than inputs. I assume Vdd is the Propeller's Vdd (+3.3V).
  • beezbeez Posts: 8
    edited 2009-06-15 22:39
    Yep, it's powered by the 3V same as the prop. Is there a case ( say during boot ) where the prop pins would not be tri-stated, outputs, and thus cause a problem?

    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
  • Mike GreenMike Green Posts: 23,101
    edited 2009-06-15 22:44
    You would have problems without the series resistors in the case of a programming error, not under normal circumstances.

    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.
  • beezbeez Posts: 8
    edited 2009-06-16 00:06
    OK, well I'll assume the X-axis is bad, but I'm still flummoxed about the lack of good data on Y.
    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
  • beezbeez Posts: 8
    edited 2009-06-17 20:24
    smilewinkgrin.gif
    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
  • Mike GreenMike Green Posts: 23,101
    edited 2009-06-17 20:41
    Try it. It's simple and might work.
Sign In or Register to comment.