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.

RTOS: CC2650EM_7ID + SmartRF06 Evaluation Board: Sensor Controller Studio and I2C

Other Parts Discussed in Thread: CC2650

Tool/software: TI-RTOS

Hi,

I'm working with CC2650EM_7ID + SmartRF06 Evaluation Board and use it to communicate with peripheral sensors using I2C, initially I was using the drivers from driverlib but without success, now i'm trying to use the sensor controller through Sensor Controller Studio. The first test for Evaluation Board was to use the Analog Light Sensor example and it works, than I want to use the I2C to communicate to a humidity sensor (SI7006_A20), so I configure the SmartRF06 PINs to DIO6 (SCL) and DIO7 (SDA), remove the jumper and as the slave address is 0x40 with the low bit for Read/Write, I used the sugestion to *** it one bit. 

// Configure and start the next measurement
i2cStart();
i2cTx(I2C_OP_WRITE | (ALS_I2C_ADDR << 1));
i2cTx(SI_TMP_CFG);

// If successful ...
//if (state.i2cStatus == 0x0000) {
i2cRepeatedStart();
i2cTx(I2C_OP_READ | (ALS_I2C_ADDR <<1 ));
i2cRxAck(output.value);
//}
i2cStop();

My execution code is simple. When i'm running the program, my i2cStatus variable is 0x0001 (NACK), if I don't have the sensor connected is 0x0002 and already happen to be 0x0003.

Thank you,

Miguel

  • Hi Miguel,

    I think I'm missing your question - could you clarify what you're asking for? (I may be totally missing it, apologies)

    Regards,
    Rebel
  • Hi Rebel,

    You are right, I just explain my problem, but didn't ask any question. I would like to know if you know with I'm always getting a NACK on my i2cStatus (0x0001). The sensor that i'm using was already tested on other MCU and it works. If you need more information, feel free to ask.

    Thank you,
    Miguel
  • Hi Miguel,

    Could you get a logic analyzer and get captures of a working MCU against what the CC2650 is sending out?

    It's probably just driver a configuration issue - the above would confirm this.

    Regards,
    Rebel
  • Hi Rebel,

    The photo below is from a working MCU SCL PIN using a analog oscilloscope.

      

    Than, I tried to use the analog scope to "see" the signal on SCL using the cc2650, but without success. Fortunately, I could use a good digital scope and saw the clock signal.

      

    The good news are that the signal is there, the bad news are that I'm always obtaining a NACK and I don't know why, any suggestion?

    Thank you for your time,

    Miguel Vieira

  • Hi Miguel,

    You're going to want to capture both the clk and data signals between the working MCU and the Sensor as well as CC2650 and the Sensor.

    Then you could see where the differences are - this should help us pin point what the issues are.

    See if you can use both the channels of the better oscilloscope (or a digital logic analyzer).

    Regards,
    Rebel
  • Hi Rebel, 

    I will post some photos and my code. 

      

    The figure above represents the i2cStatus and a variable output.hr, as you can see the i2cstatus is oscilatting between 0x001 and 0x002. Some time a get a big peak on output.hr.

    U16 resultH;
    U16 resultL;
    U16 result;
    
    i2cStart();
    i2cTx((ALS_I2C_ADDR << 1) | I2C_OP_WRITE);
    i2cTx(SI_HR_CFG);
    
    i2cRepeatedStart();
    i2cTx((ALS_I2C_ADDR <<1) | I2C_OP_READ);
    i2cRxAck(resultH);
    i2cRxNack(resultL);
    
    result = resultH | resultL;
    output.hr = result;
    
    i2cTx((ALS_I2C_ADDR << 1) | I2C_OP_WRITE);
    i2cTx(SI_TMP_CFG);
    i2cRxAck(resultH);
    i2cRxNack(resultL);
    
    result = resultH | resultL;
    output.tmp = result; //((175.72*result)/65536)-46.45;
    
    i2cStop();

    I post my code to help you understand my situation. Finally, the signal on SCL and SDA are presented below.

      

    The channel 1 represents SCL (top signal) and channel 2 SDA (bottom signal)

    Thank you for your time

    Best Regards,

    Miguel