Hii,
I am using adxl345 and Arduino mega 2560. i want to use the SPI connection. what should be the pin connection for that if anyone can help me. i have connected like this
VCC - 5V
GND - GND
SDA - 20
SCL - 21
CS - 19
SDO - 22
Hii,
I am using adxl345 and Arduino mega 2560. i want to use the SPI connection. what should be the pin connection for that if anyone can help me. i have connected like this
VCC - 5V
GND - GND
SDA - 20
SCL - 21
CS - 19
SDO - 22
VCC - 5V
The chip pin is called Vs. As you have a Vcc pin I guess you don't use the chip but some breakout board. But you failed to provide a link to it.
I recommend to use the ICSP header to connect the SPI pins as this is the preferred method for shields too.
if you could elaborate it would be beneficial
SPI uses the SCK, MOSI, MISO and CS (or SS) pins. Those pins are 52, 51, 50 and 53 (defalut) on a Mega. Those pins are also available on the ICSP connector.
shahpurvin8:
Hii,I am using adxl345 and Arduino mega 2560. i want to use the SPI connection. what should be the pin connection for that if anyone can help me. i have connected like this
VCC - 5V
GND - GND
SDA - 20
SCL - 21
CS - 19
SDO - 22
Those aren't the SPI pins on the Mega. 50/51/52/53 are the SPI pins.
SDA and SCL are nothing to do with SPI, those are I2C pins. SPI is MISO/MOSI/SLK/CS
OP is on a 7 day holiday until he READS THIS
Please take a few moments to Learn and Use the Forum.
Hello, Welcome to the Arduino Forum. This guide explains how to get the best out of this forum. Please read and follow the instructions below. Being new here you might think this is having rules for the sake of rules, but that is not the case. If you don’t follow the guidelines all that happens is there is a long exchange of posts while we try to get you to tell us what we need in order to help you, which is frustrating for you and frustrating for us. The people who try to help with your project.
It will help you get the very best out of the forum in the future.
COMMON ISSUES
COMPUTER RELATED
ARDUINO SPECIFIC BOARDS
CREATE editor install locations.
Performing the above actions may help resolve your problem without further help.
Language problem ?
Try a language closer to your native language:
Thanks to all those who helped and added to this list.
Bob.
MISO should be connected to MOSI and vice versa..
Not true.
See here:
https://learn.sparkfun.com/tutorials/serial-peripheral-interface-spi/all
and
jackrobot:
MISO should be connected to MOSI and vice versa..
If you understood what those acronyms stand for, you wouldn't make that mistake. If you checked your facts before posting that would be good too.