MMA7455L accelerometer breakout board
From DP
Accelerometers measure orientation. The MMA7455L is an inexpensive accelerometer ($2 in 1s), with adjustable measurement resolution of 2/4/8g.
We used this chip in the USB POV Toy to sync the POV display to the speed of the user's hand motions. It only comes in a leadless LGA-14 package. It's a challenging chip to solder, so we though a inexpensive breakout board might be useful.
- 2/4/8g selectable
- 10bit or 8bit output
- force and pulse detection with interrupt
- I2C and SPI interface
- 3.3volts
Get the [MMA7455L breakout board for $15].
Read about the design below.
Contents |
Hardware
Click for a full size schematic image. Schematic and PCB were designed with the freeware version of Cadsoft Eagle.
- Download the latest schematic and PCB files.
MMA7455L
PCB
Click the picture for a full size placement image.
- PCB and placement notes
- soldering advise
Partlist
| Part | Quantity | Value | Package |
|---|---|---|---|
| C1, C3 | 2 | 10uF/6v tantalum | SMC_A |
| C2, C4 | 2 | 0.1uF | C805 |
| U1 | 1 | MMA7455L | LGA-14 |
SPI demo
The MMA7455L can operate in I2C or SPI mode. This section demonstrates the SPI mode with the Bus Pirate.
Connections
| Bus Pirate | Direction | MMA7455L | Description |
|---|---|---|---|
| MOSI | → | SDA/SDI | Master Out, Slave In |
| MISO | ← | SDO | Master In, Slave Out |
| CLK | → | SCL/SPC | Clock signal |
| CS | → | CS | Chip Select |
| +3.3V | → | 3.3V | Power supply |
| GND | ↔ | GND | Ground |
Bus Pirate setup
Connect the Bus Pirate to the chip as shown in the table.
HiZ>m<<<mode command
1. HiZ
...
5. SPI
...
(1)>5<<<SPI mode
Select output type:
1. Open drain (H=Hi-Z, L=GND)
2. Normal (H=3.3V, L=GND)
(1)>2<<<normal pinout
Ready
SPI>
Configure the Bus Pirate for SPI mode. Chose all the default settings except output type. Choose normal pin outputs.
SPI>W<<<enable power supplies
Power supplies ON
SPI>
The chip is powered by the Bus Pirate, enable the power supplies (W).
Interfacing
| Command | Description |
|---|---|
| 0x0D | I2C address |
| 0x16 | Mode control |
| 0x06 | 8bit accel X |
| 0x07 | 8bit accel Y |
| 0x08 | 8bit accel Z |
We'll cover these commands. The commands are sent after taking the CS pin to ground ([), transactions end by returning CS high (]).
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|
| r/w | A5 | A4 | A3 | A2 | A1 | A0 | x |
The first byte of SPI commands chooses the register to work with, and selects read or write access. The table shows how the byte is packed. The first bit selects read (0) or write (1) access, the next 6 bits are the register to access, the last bit doesn't matter.
SPI>=0x0d <<<find the binary equivalent
0x0D = 13 = 0b00001101
SPI>[0b00011010 r] <<<pack the address into the command
A quick way to find the command to access a register:
- Use the Bus Pirate to find the binary equivalent (= command)
- Pack the lower six bits of the register address into the command according to the table using the Bus Pirate binary number entry format
Check the connection
Register 0x0D contains the I2C address. This address isn't relevant to SPI mode, but we can grab it to make sure the connection to the chip is functioning.
SPI>[0b00011010 r]
/CS ENABLED
WRITE: 0x1A <<<read I2C address register
READ: 0x1D<<<read value from register
/CS DISABLED
SPI>
Lower chip select ([), then setup the register to access(0x1a), read a byte (r), and raise chip select (]). The reply is 0x1D, the default I2C address according to page 23 of the datasheet.
Setup the mode
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|
| access mode | x | x | x | x | x | HOLD disable | |
Read accel data
- Read X/Y/Z
- Read all at once
Tables
| D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 | Bit |
|---|---|---|---|---|---|---|---|---|
| - | DRPD | SPI3W | STON | GLVL[1] | GLVL[0] | MODE[1] | Mode[0] | Function |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | Default |
Configuring the g-Select for 8-bit output using Register $16 with GLVL[1:0] bits
| GLVL[1:0] | g-Range | Sensitivity |
|---|---|---|
| 00 | 8g | 16 LSB/g |
| 01 | 2g | 64 LSB/g |
| 10 | 4g | 32 LSB/g |
GLVL [1:0]
00: 8g is selected for measurement Range
10: 4g is selected for measurement Range
01: 4g is selected for measurement Range
STON 0:Self-test is not enabled 1:Self-test enabled
MODE[1:0] 00: Standby Mode 01:Measurement Mode 10: Level Detection Mode 11: Pulse Detection Mode
SPI3W 0: SPI is 4 wire mode 1: SPI is 3 wire mode
DRPD 0:Data ready status is output to INT1/DRDY PIN 1:Data ready status is not output to INT1/DRDY PIN
Configuring the Mode using Register $16 with MODE[1:0] bits
| MODE[1:0] | Function |
|---|---|
| 00 | Standby Mode |
| 01 | Measurement Mode |
| 10 | Level Detection Mode |
| 11 | Pulse Detection Mode |
I2C demo
Get one!
You can [get one for $00].
Your purchases at Seeed Studio keep the open source project coming, we sincerely appreciate your support!
Links
License
- CC-0, reference boards shouldn't be copyrighted!


