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

No TWI connection with s100, Dev Kit and BLE

Dear all,

I'm trying to connect the NRF51-DK (PCA10028) with a LSM330DLC accelerometer over TWI (I2C). I'm using the ble_app_uart example, included the twi_master.h file and selected the twi_master (software) in the Run-Time environment.

I call twi_master_init() in the main function. I used the i2c.c wrapper I found here on the forum and using its readI2cReg i'm trying to read a register from the LSM330DLC in order to verify the connection. However, the first twi_master_transfer function returns false, indicating that no data was transferred successfully. I get no further errors and the UART demo still works correctly while running the application.

Can someone please point me in the right direction? Without a clear error I find it very difficult to look in the right place. I added the KEIL5 folder to the post if someone wants to check out the files: ble_app_uart.zip

Parents
  • Alex, I think I did. Default pins according to twi_master_config.h are 24U for Clock Pin and 25U for Data pin. However, on the development board pin 24 is used for the LED so I changed twi_master_config.h to make sure that Clock pin is now 25U and Data pin is 28U. These pins are connected to the LSM. Do I need to change / declare these pins anywhere else?

Reply
  • Alex, I think I did. Default pins according to twi_master_config.h are 24U for Clock Pin and 25U for Data pin. However, on the development board pin 24 is used for the LED so I changed twi_master_config.h to make sure that Clock pin is now 25U and Data pin is 28U. These pins are connected to the LSM. Do I need to change / declare these pins anywhere else?

Children
No Data
Related