Thursday, February 05, 2009

MSP430 + FC30 (Orientation Sensor)

Recently, I had purchased a few "orientation sensors" (the STMicro FC30 -- basically a dumbed down 3 axis accelerometer) from Sparkfun. Its a very tiny surface mount (LGA-14 3x5x0.9mm
SMD) package and there is no breakout board yet :-(

Hmmm, I thought: I have a small tip (0.016") for my OKi soldering station, so... well, why not?

So, after a few false starts (and a couple of ruined FC30s later), I decided to mount the chip on the bottom of one of my trusty MSP430F2012 EZ430 boards (3 for $10)

So, I used a dab of 5-minute epoxy to hold it in place and began to solder jumpers between the EZ430 and the FC30. Wire-wrap wire (30 AWG) proved to be to thick (and heavy), so I used individual strands of wire from an old test lead cable.

I used a 5 Diopter Luxo magnifier lamp so I could see what I was doing (Oh, those are so nice but pricey. But they are worth it. You position them and they don't move! I have a "low end" KFM1A).

It took a couple of nights (fora total of 2 hours) and I checked for bridges using my son's microscope at 40X. It didn't look pretty, but it held.

Since I was using bare wire strands, I had to be careful not to short them together, so I "layered" epoxy between wires that crossed each other.

I was very careful not to cover the contacts (yet) with epoxy in case I had to rework the solder. When I got all of the pins soldered (I basically ran the interrupt lines to P1.1, P1.3 and P1.4 on the MSP430) I did a quick continuity check to make sure nothing was shorted. Next, I wrote a little app to detect orientation and tested it in the IAR debugger. Things were looking good!

(At this point, I must admit that I have prior experience with this sensor -- with help I managed to kludge a similar wiring job but to a 1 inch protoboard, not directly onto an EZ430. So, I was already familiar with how the FC30 works.)

Once everything looked good, a added a liberal dollop of epoxy to the bottom of the MSP430, and now I have a nice little development board to play around with orientation sensing.

Breakout board? We don't need no stinkin Breakout board. (Yeah, right...)

This was an exercise inspired by the amazing Willard Wigan.

7 comments:

  1. Anonymous10:21 AM

    did you make breakout board for FC30 now? I am thinking to make one in case we do not have it. reach me at nisheethg AT gmail DOT com

    ReplyDelete
  2. Anonymous8:41 PM

    Could you post your debug code or what output you received? This little chip has me rather frustrated.

    ReplyDelete
  3. The most frustrating thing about this chip is... the spec sheet has a horrible error in it. PD (pin 11) should be HIGH when you want to read the interrupt pins and LOW to power down the chip.

    This contrived example, samples the FC30 every second:


    #define SIGN (1<<0)
    #define LC (1<<2)
    #define PC (1<<3)
    #define PD (1<<1)

    void
    main(void)
    {
    WDTCTL = WDTPW + WDTHOLD; // Stop WDT

    BCSCTL1 = CALBC1_1MHZ;
    DCOCTL = CALDCO_1MHZ; // 1Mhz DCO clock

    WDTCTL = WDT_ADLY_1000;
    IE1 |= WDTIE;


    P1DIR = 0xFF;
    P1OUT = 0xFF;
    P1DIR &= ~ (SIGN + LC + PC);
    P1OUT = P1IN;
    P1OUT &= ~PD;

    /* sleep */
    __bis_SR_register(LPM3_bits + GIE);

    }

    #pragma vector=WDT_VECTOR
    __interrupt void INTERVAL_TIMER_ISR(void) {
    P1OUT |= PD; // Turn on FC30
    __delay_cycles(5000); // Time to settle...
    // Do something with P1IN pins...
    P1OUT &= ~PD; // Turn off FC30
    }

    ReplyDelete
  4. Anonymous12:07 AM

    Thank you, you've saved what is left of my hair. One more question for you, do you know if the output from lc, pc, and sign is a pulse or is it held high?

    ReplyDelete
  5. Anonymous10:57 AM

    FC30 breakout boards are available at g-centric.com/gstore/gstore.html

    ReplyDelete
  6. The Inertial Sensors Are Able in order to Perform High-Risk Tasks

    pleade visit this page

    What is orientation sensor

    ReplyDelete