Shop OBEX P1 Docs P2 Docs Learn Events
motion sensoring — Parallax Forums

motion sensoring

ami85tami85t Posts: 1
edited 2014-03-13 09:19 in Accessories
Hi,
I have bought the MMA7455 3-Axis Accelerometer Module and I want to use it for a simple purpose
which is getting an indication that a movement of an object ( in which the Accelerometer is) has occurred upwards or downwards.
The Accelerometer needs to send the information to a PIC16f877. The thing is that the PIC is also
connected to another component which communicates only via SPI protocol.
can i communicate with both the components one after another? (twice SPI or SPI and I2C?)
what are the things that need to be done for enabling that?

Thanks, Amitai

Comments

  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2014-03-13 09:19
    ami85t,

    Welcome to the forums!!

    Since the PIC is a single threaded device you will need to communicate one after the other and hope that you don't miss a signal in between... i.e. if the PIC is talking to the other component with SPI, it may miss the Accelerometer data entirely.

    At around $5 for a single threaded PIC16f877 processor, why not use an $8 Propeller with effectively 8 processor threads with available libraries for I2C and SPI?

    Propeller reference:
    http://www.parallax.com/product/p8x32a-d40
Sign In or Register to comment.