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.

Compiler/CC2541: CC2541 I2C with Humidity/Temperature sensor

Part Number: CC2541

Tool/software: TI C/C++ Compiler

Good Day All,

I am currently working on a project with CC2541 with SimpleBLEperipheral as a base project. Now i want to use its I2C function with Si7021-A20 Humidity/Temperature sensor which as i check, is almost identical with SHT21 which the project "sensorTag" is using. I tried copying all the functions ( HalHumiReadData(), HalHumiWriteData(), HalHumiSelect(), HalHumiReadMeasurement(), HalHumiExecMeasurementStep(), readHumData()) and event within the sensorTag for the SHT21 sensor to my project. The only difference is the event is already running in boot-up and did SetParameter for the hData so that it will automatically notify the readings. No problems encountered with the compilation since i included necessary header files, etc. But i can't seem to make it work, i read zero values in the hData.

Thanks.

  • If you use oscilloscope to check I2C SCK and SDA lines, do you see signal on it when you do sensor reading?
  • Hello,

    As of now, i do not have an access to an oscilloscope, but i did try to set a pin high if the conditions within the HalHumiExecMeasurementStep() function is met (at case: 1, if (success){ Set pin with LED to high}.... the "success = HalHumiWriteCmd(0xF3);" is at case: 0). If my observation is correct, the conditions in case: 0 was not "success". Does that mean no signal at SDA was received by the sensor?
  • Hello Again,

    I manage to read the SDA and SDC of the CC2541 using logic analyzer and notice that the frequency of the SDC/SDA are always high when the sensor is not connected. But when the device is connected, a regular pulse is being produce in the SDC and i also noticed there was no change in its frequency (around 1250Hz only) even if i adjusted the i2cClock. It's very confusing.
  • I have a follow up question, just for troubleshooting the cc2541.
    Should I expect a signal already at the SDA and SCL even if there is nothing connected to it, assuming the i2c was already running and commands are already being sent and clock is set? And also, if ever there was a signal in SCL, should i expect a period of "1/i2cClock_xxxKHZ"?
    Thanks.