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.

LMP91000 Write problem

Other Parts Discussed in Thread: LMP91000, CC2650

hi I am using a cc2650 to interface with LMP91000. I am having trouble writing to the registers of the LMP.

I can write without any errors to the Lock register. but when I want to write to the TIACN or MODECN register I get a Data not acknowledge error.

Thanks

Mustahsin

Code:

 while (1) {

       Task_sleep((UInt)arg0);

       I2C_init();

       I2C_Handle handle;

                       I2C_Params i2cParams;

                       I2C_Transaction i2cTrans;

                       uint8_t rxBuf[32];      // Receive buffer

                       uint8_t txBuf[32];      // Transmit buffer

                       // Configure I2C parameters.

                    // I2C_Params.I2C_TransferMode=I2C_MODE_CALLBACK;

                       I2C_Params_init(&i2cParams);

                       // Initialize master I2C transaction structure

                       I2CCC26XX_I2CPinCfg pinCfg;

                       pinCfg.pinSDA = Board_I2C0_SDA0;

                       pinCfg.pinSCL = Board_I2C0_SCL0;

                      i2cParams.custom = &pinCfg;

                       handle = I2C_open(Board_I2C, &i2cParams);

                       I2C_open(Board_I2C, &i2cParams);//



                       i2cTrans.writeCount   = 2;

                       i2cTrans.writeBuf     = txBuf;

                               txBuf[1]=0x00;



txBuf[10]=0x00;

/*

uint32_t i = 0;

 for (i; i < 10; i++)

{

txBuf[9] = 1;

}

*/

i2cTrans.readCount    = 0;

                       i2cTrans.readBuf      = rxBuf;

                       i2cTrans.slaveAddress = 0x48;

                       I2C_transfer(handle, &i2cTrans);//

                       uint16_t  register_status[10] ;

                       uint16_t count = 0;

                       for (count;count <10; count++)

                       {

                       register_status[count]=rxBuf[count];

                       }



                      // uint16_t  register_status_1 = rxBuf[1];

                       //  uint8_t a ;

                       if (I2C_transfer(handle, &i2cTrans) == I2C_STATUS_SUCCESS) {

                        PIN_setOutputValue(ledPinHandle, Board_LED0, 1);

                          // System_flush();

                       }

                     I2C_close(handle);

                       Task_sleep((UInt)1000);