Re: Memsic 2125 and embedded Linux

I'd like to interface a Memsic 2125 dual axis accelerometer to an

>embedded Linux system that has some GPIO pins. So in essence, >I'd like to emulate the Basic Stamp's pulsin function. > >However, the part needs to measure a PWM duty cycle with resolution >of (at least) 1ms from 0 to 20. > >Does anyone have ideas on doing that? nanosleep() and friends >appear to have good granularity, but they, and other Linux timers >are constrained by the kernel's tick time (10ms typical).

Get a small PIC or AVR and interface it to the accelerometer. Use the serial port to get the data.

You could also use a basic stamp as the interface chip and use its serial commands to talk to linux. This isn't the cheapest solutions, but it would work.

Reply to
Ed LeBouthillier
Loading thread data ...

I'm using the Analog ADXL202 and 311, which are similar to the Memsic but have both the PWM and analog voltage output. I found that measuring the PWM output was resource consuming to get accurate results and that it performed poorly in high-vibration environments.

Instead, I'm using an analog low pass filter to remove the engine vibration from the signal, a 4.7 X gain to increase the output to rail-to-rail, and then simply feeding it into the ADC on the AVR. This removes most of the problems and is far easier to implement.

However, this would require a different accelerometer (either the Analog products of the MXA2500 series) and an ADC. My embedded Linux system doesn't have any ADC ports, so I'm usng an external microcontroller for all the real-world interfacing.

Trammell

Reply to
Tramm Hudson

Shane -

I am using a PIC with a 4 MHz crystal and using the on-board counter/timer which therefore has a "granularity" of 1 microsecond. So, I get somewhere between 3000 to 6000 counts when my accelerometer output duty cycle is about 8 milliseconds (I am measuring the intervals where the pulse is both "high" an "low.") This resolution is better than 1 part in a thousand. I then send the data to an LED driver and on to a multidigit

7-segment LED display. Sending it to an LCD would be easier. I have also used the analog output MEMSICs and put the outputs right into the PICs ADC inputs, with comparable results, but needed to average more than I would like to. Even without removing the accelerometer DC offset and boosting the gain to take advantage of more of the 10-bits of the PIC ADC, the resolution was quite acceptable. I only need to measure very low frequencies, however. And note that the MEMSIC frequency response is quite low - maybe 25 to 30 Hz if I rememeber correctly.

BIll

Reply to
Bill Turnip

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.