This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Adding an external sensor to TI SensorTag using I2C

Other Parts Discussed in Thread: CC2541

Hello,

We are looking to interface an additional Sensor to the SensorTag (CC2541) though I2C as a slave. Can we modify the firmware to map the pins on the P1 header to physically connect to the slave and allow I2C master-slave communication? Are there any specific configurations that we need to do on the TI SensorTag firmware that can help us do this (ie. Where can we set the new sensor's slave address)? We already have the TI debugger and IAR workbench. We are able to modify the code and upload a new firmware on the SensorTag.

  • Hello. The only pins which can be used for I2C on the CC2541 are the SCL and SDA pins (pins 2 and 3).  Therefore, you must use the pins.

    Note that the sensor tag project configures I2C as a master in order to talk with the various sensors so you will not be able to talk to these sensors if you configure I2C as a slave instead.

    Another option is to use SPI to communicate with your sensor if this is possible.

  • Hi Tim,

    Thanks for your response. As per the I2C, soldering pins 2 and 3 seems very risky so I assume we will just move forward with the SPI configuration by using the P1 Header on the board (SensorTag as SPI Slave).

    As I was looking through the BLE stack 1.4.0, I noticed that the hal_uart_spi.c/.h files are not included in the CC2541ST folder for the TI SensorTag project. I have tried copying these two files from the CC2540EB folder and included it in the SensorTag workspace project and when I build it, I get errors. I would like to be able to use HalUARTInitSPI() function and others in order to read data from another Master SPI.

    I look forward to hearing some suggestions as to how we can move forward with our project.

    Thank you!

  • Hi,

    Request to  post the error messages that you are observing.

    Also, please mention the IAR version and stack version that you use.

    Will help us support you better.

    Regards,

    Vijay

  • Hello,

    The version of IAR embedded workbench we are using is 8.30.3, and the version of BLE stack is 1.4.

    After applying the SPI package patch on the wiki, we get the following warning message and no more error messages. Can the following warning message be resolved?

    Warning[w52]: More than one definition for the byte at address 0x6b in common segment INTVEC. It is defined in module "hal_uart" as well as in module "hal_interrupt"

    Thanks