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.

LAUNCHXL-CC26X2R1: How to add I2C support to PROJECT ZERO

Part Number: LAUNCHXL-CC26X2R1
Other Parts Discussed in Thread: CC2640, CC2650, LMP91000

Hi...

In a related discussion I was asking about porting an older project based on the 8051 to the cc2640/cc2650.

So where we went with that is to go new development totally and so we ordered a LMP91000 eval board so we could plug our 3-prong sensor into it..

I was able to get the I2C project working on the CC2640 and was able to program the LMP91000 and actually measure gas changes on the sensor..

However I am trying to integrate the I2C project which is TIRTOS based woth the BLE PROJECT ZERO..

and I have issues.. I stay away from calls to the GPIOs GPIO_init() as that totally causes the PROJECT ZERO to lock up.

I added I2C_init() 

However while this kinda works then other things dont work.. like I think the BLE stilll gets messed up..

How do I integrate I2C into the BLE projects (like project zero)

and I will also need to add to read from the ADC also...

(everything can be polled for now)

I2C project is I2Ctmp_CC2640R2_LAUNCHXL_trtos_ccs..  (I basically only changed the I2C messages to the temp sensor to be the ones I need for the LMP91000.. that work great...

the BLE is the stock project ZERO.

John

  • Hi John,

    Thank you for reaching out. We will take a look and get back to you as soon as possible. In the meantime, could you provide the SDK version you are using?

    Best Regards,

    Jan

  • Currently I am using a cc5640 lauchpad (but want to move to the cc5650 and I have two of those now)

    SDK is simplelink_cc2640r2_sdk_5_30_00_03

    ccs version : 12.6.0.00008

  • Hi John,

    Could you give me more details on the issues you are facing and on what you are doing.

    • Where did you add I2C_init() and what others modifications have you done to the code ?
    • Could you confirm that I2C is working as expected or do you have any issue with it?
    • Could you describe the issue you have with BLE?

    Regards,

    Tanguy

  • Well having me walk through the code I see that I have the MODE set to blocking...

    I want to do that because this is a one time thing.. but looks like the system is not setup to do that...

    If I set the MODE to CALLBACK and provide a callback the system does not hang... But I will now have to deal with the callback and main thread interactions if I cant use BLOCKING ??

  • Hmm.. I thing maybe because I am making the I2C_transfer outside a thread context.... Let me look at that..

  • OK... Found the problem... I had the I2C read/write routines too far down and the calls were messing up with the BLE threads.. I moved it before the project zero init funciton and now it is working..

    Now to figure out how to poll read the ADC and replace button zero with that.. I have already changed the button zero GATT to be a 2byte integer and tested that I can read from it both bytes.

    JBP