This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Connect ADXL345 with nRF52832

I want to connect Connect ADXL345 with nRF52832 to read movement of ADXL345. I am using example code ADXL375_I2C.zip 

1. Please let me know the wired connection diagram between ADXL345 and nRF52832.

2. In this code I am seeing

#define TWI_SCL_M 3 //!< Master SCL pin

#define TWI_SDA_M 4 //!< Master SDA pin

I hope TWI_SCL_M & TWI_SDA are referring to nRF52832 pins. Can I use the same pin numbers if no please let me know which pin number I need to assign for TWI_SCL_M & TWI_SDA_M from nRF52832.

const nrf_drv_twi_config_t config =
    {
       .scl                = TWI_SCL_M,
       .sda                = TWI_SDA_M,
       .frequency          = NRF_TWI_FREQ_400K,
       .interrupt_priority = APP_IRQ_PRIORITY_HIGH
    };

Parents
  • It looks like you are using a Fanstel EV-BT832 devlopment kit? 

    Both the Fanstel and Nordic nRF5x DK kits allow you to attach Arduino form factor shields to them. That is why the kits are designed this particular way and why some pins are labeled SCL, SDA, A0, etc:
    "Universal" Arduino pinout:

    Fanstel:

    Nordic:

    Anyway, as  says, you are free to use whatever GPIOs you like for TWI, as long as the pin is not used for something else. Just match the pin values in your code with how you wire it up.  

Reply
  • It looks like you are using a Fanstel EV-BT832 devlopment kit? 

    Both the Fanstel and Nordic nRF5x DK kits allow you to attach Arduino form factor shields to them. That is why the kits are designed this particular way and why some pins are labeled SCL, SDA, A0, etc:
    "Universal" Arduino pinout:

    Fanstel:

    Nordic:

    Anyway, as  says, you are free to use whatever GPIOs you like for TWI, as long as the pin is not used for something else. Just match the pin values in your code with how you wire it up.  

Children
No Data
Related