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.

WIFI crashes when a sensor is connected

Other Parts Discussed in Thread: CC3200MOD

Hello,

I have made an application that get data from sensors and display it on a WEB page;

but when a particular sensor (BME280) is connected with other sensors, WIFI connection crashes (CC3200MOD in AP mode).

Immediately after I disconnected the BME280 sensor, WIFI is ON again and everything is ok.

To display the data on the WEB page I use the Token system, base on httpServer example.

The idea is as on the following picture :

My question is : Is it a problem from the sensor or could it be a problem in the C code that handle Tokens ? 

Regards,

Yoann

  • Yoann,

    This seems to be related to a power supply issue. Can you monitor the 3.3V with a oscilloscope to check for any transients? Can you temporarily replace the battery and LDO with a higher capacity bench power supply?
  • Hi Lenio,

    I tested it with an external battery, the problem still exist.

    The BME280 is accessed by I2C and On Board LaunchpadXL sensors are also connected to I2C bus,
    could it be a collision problem on the I2C bus ?

    Yoann
  • It could, however I would still verify the 3.3V with a scope if possible.

    Depending on how the software is structured, a pending acknowledgment could cause the master to wait indefinitely. If you believe that is the case, simply remove the I2C routines while still maintaining the sensor powered and connected. 

  • Hi,

    sorry for not having respond sooner I didn't have noticed your reply.

    The problem is solved. It appeared that the program were stuck in an endless loop in I2C_IF.c / function Transac() and that BME280 sensor kept SDA line to a low level.

    I have resolved it by putting a timout in the endless loop and by forcing the I2C slave (BME280 sensor) to give back the I2C master (CC3200MODXL) the control of SDA line by toggling the clock on SCL line.

    I put the code below in case someone have a similar problem :

    /*********************************************/
    /******GETTING OUT OF ENDLESS LOOP******/
    IN I2C_IF.c :

    static int
    I2CTransact(unsigned long ulCmd)
    {
    ....
    //
    // Wait until the current byte has been transferred.
    // Poll on the raw interrupt status.
    //
    int i=0;
    while((MAP_I2CMasterIntStatusEx(I2C_BASE, false)
    & (I2C_INT_MASTER | I2C_MRIS_CLKTOUT)) == 0)
    {
    //Report("STUCK : count = %d\n\r",i);
    MAP_UtilsDelay(30000);
    i++;
    if(i>3){break;}
    }
    i=0;
    ....
    }


    /*********************************************/
    /*****SETTING SDA LINE TO HIGH AGAIN*****/
    //RECATIVATE SDA LINE WHEN BME280 KEEPS IT IN LOW STATE
    //HAVE ALSO TO ADD A TIMEOUT IN ENDLESS LOOP IN I2C_TRANSAC FUNCTION IN I2C_IF.c
    void i2cbme280PB(void){
    int i=0;
    PRCMPeripheralClkEnable(PRCM_GPIOA1, PRCM_RUN_MODE_CLK);
    PinTypeGPIO(PIN_01, PIN_MODE_0, false);
    GPIODirModeSet(GPIOA1_BASE, 0x4, GPIO_DIR_MODE_OUT); // SCL as IO_OUT

    PinTypeGPIO(PIN_02, PIN_MODE_0, false);
    GPIODirModeSet(GPIOA1_BASE, 0x8, GPIO_DIR_MODE_IN); //SDA as IO_IN

    int j=0;
    while(j<100){
    GPIO_IF_Set(PIN_01, GPIOA1_BASE, 0x4, 0);
    MAP_UtilsDelay(1);//for (i=0;i<50;i++);
    GPIO_IF_Set(PIN_01, GPIOA1_BASE, 0x4, 1);
    j++;
    }

    PinTypeI2C(PIN_01, PIN_MODE_1);
    PinTypeI2C(PIN_02, PIN_MODE_1);
    I2C_IF_Open(I2C_MASTER_MODE_FST);
    }

    To avoid any problem I call i2cbme280PB() before and after every I2C transaction, this is kind of brutal but it works, like below :

    i2cbme280PB();
    GetBME280Temp(dataBuffTemp);
    i2cbme280PB();

    Yoann
  • Thanks for the update Yoann.

    -/Praneet