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.

MSP430FR5969: MS430 FR 5969 I2C driverlib SCL clock Spike issue

Part Number: MSP430FR5969

HI,

I am using MSP430FR5969 Launchpad and Trying to configure the MSP430 as I2C master and connect to slave device . I am using the Driverlib  I2C driver "eusci_b_i2c.c - Driver for the eusci_b_i2c Module"  and my configuration are below

        EUSCI_B_I2C_initMasterParam param;
        param.selectClockSource=EUSCI_B_I2C_CLOCKSOURCE_SMCLK;
        param.i2cClk=CS_getSMCLK();
        param.dataRate=EUSCI_B_I2C_SET_DATA_RATE_400KBPS;
        param.byteCounterThreshold=0x0;
        param.autoSTOPGeneration=EUSCI_B_I2C_NO_AUTO_STOP;

        EUSCI_B_I2C_initMaster(EUSCI_B0_BASE,&param);

What I observe is the I2C clock line frequently has a spike  of about "80ns pulse " between a 1 clock cycle . Have attached the snippet of the same below

I am not sure why this spike is seen . sometimes I write are treated as Read commands because of spike becoming a valid clock pulse

  • Hi Chandrashekar,

    What DriverLib code example are you sourcing from? What happens if you change the SMCLK frequency or I2C data rate? Can this behavior be replicated without a slave device connected or can you confirm that the slave device does not cause the pulse? And this pulse does disrupt I2C communication?

    Regards,
    Ryan
  • Hi Ryan,

    I am not able to find the version of driverlib . But I have attached the same for reference .

    I tried changing the I2C data rate ,but had the same issue [ 100khz and even lesser also ].  I can try to replicate without slave connected and confirm .

    The pulse does not interrupt the communicated, but the transaction and data is misinterpreted  like write command is interpreted as read command and  data also .

    eusci_b_i2c.c
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    /* --COPYRIGHT--,BSD
    * Copyright (c) 2014, Texas Instruments Incorporated
    * All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * * Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * * Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the distribution.
    *
    * * Neither the name of Texas Instruments Incorporated nor the names of
    * its contributors may be used to endorse or promote products derived
    * from this software without specific prior written permission.
    *
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
    * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
    * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
    * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
    * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
    * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    * --/COPYRIGHT--*/
    //*****************************************************************************
    //
    // eusci_b_i2c.c - Driver for the eusci_b_i2c Module.
    //
    //*****************************************************************************
    //*****************************************************************************
    //
    //! \addtogroup eusci_b_i2c_api eusci_b_i2c
    //! @{
    //
    //*****************************************************************************
    #include "inc/hw_regaccess.h"
    #include "inc/hw_memmap.h"
    #ifdef __MSP430_HAS_EUSCI_Bx__
    #include "eusci_b_i2c.h"
    #include <assert.h>
    void EUSCI_B_I2C_initMaster(uint16_t baseAddress,
    EUSCI_B_I2C_initMasterParam *param)
    {
    uint16_t preScalarValue;
    //Disable the USCI module and clears the other bits of control register
    HWREG16(baseAddress + OFS_UCBxCTLW0) = UCSWRST;
    //Configure Automatic STOP condition generation
    HWREG16(baseAddress + OFS_UCBxCTLW1) &= ~UCASTP_3;
    HWREG16(baseAddress + OFS_UCBxCTLW1) |= param->autoSTOPGeneration;
    //Byte Count Threshold
    HWREG16(baseAddress + OFS_UCBxTBCNT) = param->byteCounterThreshold;
    /*
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Chandrashekar,

    I am not interested in the I2C library driver file for eUSCI_B but rather your application setup code. However I would recommend that you upgrade to the latest DriverLib version if you have not already done so. I will be interested to see the I2C behavior without the slave connected. Make sure you are using the correct pull-up resistances as recommended by the slave's datasheet.

    Regards,
    Ryan

**Attention** This is a public forum