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.

MSP430FR2633: I2C issue talking to MSP430FR2633 with clock streching problem

Part Number: MSP430FR2633

hi,

I am facing strange issue making MSP430FR2633 to work with Sensirion SCD30 via eUSCI_B0, I2C Master. 

The following is the issue i found: 

1. Initially the MSP430 I2C port P1.2 (SDA) and P1.3(SCL) work correctly by having both pull-up to +3.3V. This is before the SCD30 sensor plug in.

2. Next, i just supplied +3.3V to SCD30 Co2 sensor without plug into MCU i2C port. Measured SDA and SCL are both +3.0V

3. Next, I plug in both I2C lines from SCD30 to MSP430FR2633 P1.2 and P1.3. Measured both lines +3.3V.

Everything seems to be alright. However, after i execure my code as per attached, Initially all I2C command write and read is only able to run for 1 round. then thing start to get wrong. 

After executing my code, i found SCL line permanently pull LOW. SDA still high. Even if i reset the MCU, (i am using MSP430FR2633 CAPTIVATE sense EVM), i noticed SCL still permanently LOW. 

4118.scd30_testing.zip

Sensirion_CO2_Sensors_SCD30_Interface_Description.pdf

Sensirion_CO2_Sensors_SCD30_Datasheet.pdf

I am checking with you if you can help me to check on my code to see if this issue is due to clock stretching issue.

Below is the example code for using STM, i have problem convert it to TI MCU format. Any help will helpful. I have no clue why sometime, SCL and SDA both stuck at LOW. 

Sensirion_CO2_Sensors_SCD30_Sample_Code_STM32VLDISCOVER_STM32F100.zip 

Best Regards,

Kpk

  • Hello Poh,

    your code has very, very poor quality.
    It is so buggy that it cannot be analyzed.
    Please, modify your code to eliminate all the following warnings:

    "../main.c", line 295: warning #169-D: argument of type "uint8_t *" is incompatible with parameter of type "uint8_t"
    "../main.c", line 302: warning #169-D: argument of type "uint8_t *" is incompatible with parameter of type "uint8_t"
    "../main.c", line 304: warning #121-D: return value type does not match the function type
    "../main.c", line 311: warning #121-D: return value type does not match the function type
    "../main.c", line 320: warning #121-D: return value type does not match the function type
    "../main.c", line 330: warning #169-D: argument of type "int" is incompatible with parameter of type "uint8_t *"
    "../main.c", line 330: warning #154-D: conversion of nonzero integer to pointer
    "../main.c", line 332: warning #121-D: return value type does not match the function type
    "../main.c", line 341: warning #121-D: return value type does not match the function type
    "../main.c", line 352: warning #169-D: argument of type "uint8_t *" is incompatible with parameter of type "uint8_t"
    "../main.c", line 363: warning #121-D: return value type does not match the function type
    "../main.c", line 399: warning #121-D: return value type does not match the function type
    "../main.c", line 400: warning #121-D: return value type does not match the function type
    "../main.c", line 427: warning #141-D: too many arguments in function call
  • Hello Kpk,

    Thanks for your posting.
    We are looking into this issue and will get back to you ASAP.

    Thanks,
    Ling
  • From the Interface Description (sec 1.1):
    > Clock stretching is necessary to start the microcontroller and might occur before every ACK. I2C master clock
    > stretching needs to be implemented according to the NXP specification. The boot-up time is < 2 s.
    This suggests that the SCD30 may hold SCL low for up to 2 seconds when it starts up. As it is, stretching for 12ms (1200 I2C clocks) is already pretty long.

    > SCD30 does not support repeated start condition.
    Your code appears to use Repeated Start.
  • This looks very similar to:

    e2e.ti.com/.../736525
    and maybe:
    e2e.ti.com/.../736056

**Attention** This is a public forum