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.

CC2640: I2C from Sensor Controller: Activate internal pull up?

Part Number: CC2640

Hy,

after switching from ARM controlled I2C to sensor controller I2C I observe two issues:

- The I2C Clk on sensor controller seems slightly slower

- The internal pull up seems not to be activated with sensor controller controlled I2C

Apparently, in my application, this causes issues with the I2C communication due to the slower rise times of SDA and SCL.

Is there a way of activating internal pull ups for I2C communication with sensor controller? I remember a similar question in this forum but can't find it.

Best regards

Harald

  • For I2C it's strongly recommended to use external pull-ups since the internal pull-ups have a fair bit of variation. Internal pull-ups are not enabled in the sensor controller I2C for this reason.
  • But you do activate internal pull ups for ARM I2C?
  • Yes, but it's strongly recommended to use external pull-ups in addition to get the correct impedance.
  • Well, this is going to be difficult, as we have 12.000 devices in the field, sealed with casting compound. This is part of a sw update, I need to make sure that the I2C has the same stability as before. Actually, I have found a solution:

    In the generated file scif.c there is a function scifTaskResourceInit. It assign

    HWREG((IOC_BASE + IOC_O_IOCFG0) + pAuxIoIndexToMcuIocfgOffsetLut[6]) |= IOC_IOCFG0_HYST_EN_M;
    scifInitIo(6, AUXIOMODE_OPEN_DRAIN_WITH_INPUT, -1, 1);

    I change this to

        scifInitIo(6, AUXIOMODE_OPEN_DRAIN_WITH_INPUT, 1, 1);
        HWREG((IOC_BASE + IOC_O_IOCFG0) + pAuxIoIndexToMcuIocfgOffsetLut[6]) |= IOC_IOCFG0_HYST_EN_M | IOC_IOCFG0_PULL_CTL_UP;
    

    Of course for both pins, SCL and SDA

    Drawback is, that I cannot generate the scif.c file automatically as recommended here

    Does that sound reasonable to you?

    Regards

    Harald

  • So finally, I changed the template file, delivered with sensor controller studio.

    In C:\Program Files (x86)\Texas Instruments\Sensor Controller Studio\resource_defs\i2c.red I alter the lines 107 -110 to

                    scifInitIo('SCL pin', AUXIOMODE_OPEN_DRAIN_WITH_INPUT, 1, 1);
                    HWREG((IOC_BASE + IOC_O_IOCFG0) + pAuxIoIndexToMcuIocfgOffsetLut['SCL pin']) |= IOC_IOCFG0_HYST_EN_M | IOC_IOCFG0_PULL_CTL_UP;
                    scifInitIo('SDA pin', AUXIOMODE_OPEN_DRAIN_WITH_INPUT, 1, 1);
                    HWREG((IOC_BASE + IOC_O_IOCFG0) + pAuxIoIndexToMcuIocfgOffsetLut['SDA pin']) |= IOC_IOCFG0_HYST_EN_M | IOC_IOCFG0_PULL_CTL_UP;
    

    then the changes are generated automatically into scif.c whenever I generate new sensor controller drivers. Hopefully I remember this change when I switch computers or update the sensor controller studio...

    What do you think about this?

    Regards

    Harald

  • Instead of placing the file at
    C:\Program Files (x86)\Texas Instruments\Sensor Controller Studio\resource_defs\i2c.red
    you can place the file here:
    C:\Users\<your user name>\Documents\Texas Instruments\Sensor Controller Studio\resource_defs

    Then you will avoid the file getting overwritten by an update.