Is anyone knows about how to interface two accelerometers using PSoC 4? I want to access two MMA7455L.Thank you
Is anyone knows about how to interface two accelerometers using PSoC 4? I want to access two MMA7455L.Thank you
Hi Yakub,
I have not heard of anyone needing more than one accelerometer, but I am assuming you are talking about a standard 3-axis chip.
If you want to use more than one 3-axis chip, then I am very curious about your application/idea.
Conceptually, all you need is enough A/D ports on your PSOC to do the basic interface. As I recall, there are at least twelve on the board, so you should be able to make it work.
DAB
The MMA7455L has both I2C and SPI outputs. I would recommend using SPI. Connect MISO, MOSI and CLK lines together. Then use two different select signals, and control them manually (via a control register) in your code. With that setup, you can use a single SPI master component, and select manually which one to talk to.
Hi DAB,
in this design I connected 7 gyro's and 7 accelerometers to one microcontroller:)
I used SPI for that, with chip selects.
The reason for choosing SPI was that we needed to get the data within a certain time after a synchronisation trigger, and SPI is much faster than I2C. The MMA455L has an address pin, so you could easily connect two of these to one I2C bus.
Hi Victor,
Thanks for the update.
I have to admit, this is an area that I only spent a limited time working on projects. So in my mind, one accelerometer was plenty, but now I can see a much larger world where they could be employed. Its always a good day to learn something new.
DAB
Hi Yakub,
The MMA7455L seems to be an I2C/SPI accelerometer.
The PSoC 4 has a SCB (serial communication block) that can have 2 x I2C/SPI/UART on it. These alone can get you talking to 2 accelerometers.
Additionally, you can run a UDB-based SPI or I2C for a 3rd one in case you need it.
See this as an example: PSoC 4 Pioneer Kit Community Project#035 – UART, I2C, and SPI Joystick Example
Since SPI is a bus, there is no need to use multiple masters. Multiple chip-select signals are enough (and save pins that way). Different masters are only needed when the SPI configuration (CPOL / CPHA) are needed.
Hi DAB,
Thank you for your answer. In this case, I want to show in PC about 8 direction movement (like direction of the wind, e.g: N, NE, E, SE, S, SW, W, NW) using two accelerometer
I can't see why you'd need two accelerometers for that... Please look into 2- or 3-axis accelerometers, they can give you 2-axis information in a single package!
Hi Yakub,
I agree with Victor, you should only need to use one accellerometer to get a full 360 by 360 movement direction.
If you have a good MCU, the trigonometry is pretty basic to work out the direction from which the force is being applied to the sensor.
DAB
Hi vsluiter,
Could you introduce more about the project you mentioned with 7 gyro's and 7 accelerometers? Like what sensors and what microcontroller?
I have a project which needs 3 gyro's and 3 accelerometers. This is my first project related to hardware thing. Could you help me through? Thanks,
SoFun