How to use I2C and SPI
(Description of ST-MEMS-DQ-EVAL)
Schematic: Description of PINs
Connection of I2C and SPI:
Signal (on MEMS) |
I2C (on uPSD) |
SPI (on uPSD) |
SCL_SPC |
P3.7 |
P4.4 |
SDO |
NC |
P4.5 |
SDA_SDI |
P3.6 |
P4.6 |
CS |
NC |
P4.7 |
How to use I2C:
+ It's recommended to have assembled R36 & R37 pull-up resistors (4k7)
+ It's good to have assembled the resistor R34 (10k) although uPSD has internal pull-up about 100k and it's normally enough.
+ Because SCL_SPC and SDA_SDI are used for I2C and SPI together be carefull and follow instructions:
+ First, disable SPI and set SPI pins as floating inputs (IMPORTANT!).
+ Set P4.7 (CS) as GPIO output and write 1 to activate I2C on MEMS chip.
+ Enable I2C on your micro and start your communication.
How to use SPI:
+ It's recommended NOT to assemble R36, R37
+ It's good to have assembled the resistor R34 (10k) although uPSD has internal pull-up about 100k and it's normally enought.
+ Because SCL_SPC and SDA_SDI are used for I2C and SPI together be careful and follow instructions:
+ First, disable I2C and set I2C pins as floating inputs (IMPORTANT!).
+ Activate your SPI, P4.7 is a part of SPI and should be 0, otherwise
set P4.7 (CS) as GPIO output and write 0 directly to say use SPI to
MEMS chip.
+ Start your communication.