PDA

View Full Version : Memsic 2125 Education Request



Brianmcm
07-04-2009, 05:53 AM
I'm experimenting with the Memsic 2125 accelerometer with the ultimate goal of doing a balance bot similar to the one constructed by Robert Wagoner, featured in Robot Magazine. To get data I used the Memsic Object created by Beau Swabe and created what I thought would be a simple program to observe the output of the chip in different angles using the Parallax Serial Terminal

CON
· _clkmode = xtal1 + pll16x
· _xinfreq = 5_000_000
OBJ
· Debug·· : "FullDuplexSerialPlus"
· acc···· : "memsic2125"
PUB ReadingMemsic
· acc.start(0, 1)
·
· Debug.start(31, 30, 0, 57600)
· waitcnt(clkfreq*2 + cnt)
· Debug.tx(Debug#CLS)
· Debug.str(String("The X-Value =", Debug#CR))
· Debug.str(String("----------------", Debug#CR))
· repeat
··· Debug.tx(Debug#CRSRX)
··· Debug.tx(0)
··· Debug.Dec(acc.Mx)
··· waitcnt(clkfreq/1000 + cnt)

I wanted to see the values for "X"·change as the angle of the chip changed. When I ran the program with no power to the chip, my "X" value was a 6 digit number with the first 4 digits constantly changing so fast that I couldn't see what the values were, but the last two digits changed at·a much lower pace. When I applied power to the Memsic chip the 6 digit number was a constantly changing number even with the accelerometer·sitting on a flat surface not moving. The values for the number varied in the first digit from 1 to 8, best as I could tell. I verified that I had the chip connected per the Parallax document.
I would think with the power off the Memsic chip, the value would be some number, maybe 0"?", that wouldn't change. With the power on the value would fluxuate slightly as the chip remained at a constant angle, and then when that angle changed it would vary accordingly. What am I missing?
Thanks for the help.
Brian