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.

CCS/LDC1041EVM: Issue with MSP432

Part Number: LDC1041EVM

Tool/software: Code Composer Studio

Hi,

My issue with the MSP432 and the LDC1041 wasn't resolved. Do you have a sample of code that could help me manage to use the LDC1041? I didn't change anything on the sensor : I kept the coil and the PCB of the LDC1041 evaluation board, just connected the MSP432 where the MSP430 was. And so I used the same parameters than the one given by the software "sensing solutions evm gui".

Thank you

  • What is the issue? Can you share the relevant MSP430 code and the MSP432 code?
  • Hi Keith,

    Thank you for your answer.
    My issue and all the code can be found here : e2e.ti.com/.../669125

    I already posted it, but no one could help me.

    Thank you

    Sylvain
  • Sylvain,
    I do not have any examples. I am reaching out to various contacts that I have, but one of them will not be available until the 16th of July.

    Regards,
    Chris
  • Hello Chris,

    Thank you for your help!

    I'm waiting for your answer, so.

    Sylvain

  • hello Sylvain,
    I have reached out to the product owner and he pointed me to this: www.ti.com/.../snac059 . But looking through the material, I do not find an MSP432 example. I will keep looking and provide another response by the 16th.

    Chris
  • Hello Sylvain,

    My understanding of the issue you are having is that you are getting all 0s in the Frequency Output registers of the LDC1041; is that correct?

    If my understanding of the issue is correct, I suspect that you may be applying a reference frequency that is too low - we usually use a reference frequency >4MHz. With an extremely low reference frequency, if the device is configured for a high sample rate, it is possible no ticks of the reference were captured during the sample window.

    Can you provide a scope short of the sensor signal from INA or INB to ground?

    Regards,

    Chris O

  • Hello Chris,

    Thank you for your answer.

    I will do it as soon as possible. But I'm pretty sure to have tested to input a frequency higher than 4MHz. Anyway, I will test it again soon.

    Thank you

    Sylvain

  • Sylvain,

       I have been able to discuss with my colleague but unfortunately the example he has is for the LDC2114.   Looking back on this and the prior thread, I believe the issue is with the chip select (CSB).  The four-wire mode provided by the MSP432 uses a concept of slave transmit enable (STE), which is not the same as a chip select.  I have attached a snippet on how you could write to the spi with chip select.

    Chris

    /* --COPYRIGHT--,BSD
     * Copyright (c) 2017, 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--*/
    /******************************************************************************
     * MSP432 SPI - 3-wire Master Incremented Data
     *
     * This example shows how SPI master talks to SPI slave using 3-wire mode.
     * Incrementing data is sent by the master starting at 0x01. Received data is
     * expected to be same as the previous transmission.  eUSCI RX ISR is used to
     * handle communication with the CPU, normally in LPM0. Because all execution 
     * after LPM0 is in ISRs, initialization waits for DCO to stabilize against 
     * ACLK.
     *
     * Note that in this example, EUSCIB0 is used for the SPI port. If the user
     * wants to use EUSCIA for SPI operation, they are able to with the same APIs
     * with the EUSCI_AX parameters.
     *
     * ACLK = ~32.768kHz, MCLK = SMCLK = DCO 3MHz
     *
     * Use with SPI Slave Data Echo code example.
     *
     *                MSP432P401
     *              -----------------
     *             |                 |
     *             |                 |
     *             |                 |
     *             |             P1.6|-> Data Out (UCB0SIMO)
     *             |                 |
     *             |             P1.7|<- Data In (UCB0SOMI)
     *             |                 |
     *             |             P1.5|-> Serial Clock Out (UCB0CLK)
     *******************************************************************************/
    /* DriverLib Includes */
    #include <ti/devices/msp432p4xx/driverlib/driverlib.h>
    
    /* Standard Includes */
    #include <stdint.h>
    #include <stdbool.h>
    
    uint8_t TXData[2];
    
    //![Simple SPI Config]
    /* SPI Master Configuration Parameter */
    const eUSCI_SPI_MasterConfig spiMasterConfig =
    {
            EUSCI_B_SPI_CLOCKSOURCE_SMCLK,             // SMCLK Clock Source
            3000000,                                   // SMCLK = DCO = 3MHZ
            500000,                                    // SPICLK = 500khz
            EUSCI_B_SPI_MSB_FIRST,                     // MSB First
            EUSCI_B_SPI_PHASE_DATA_CHANGED_ONFIRST_CAPTURED_ON_NEXT,    // Phase
            EUSCI_B_SPI_CLOCKPOLARITY_INACTIVITY_HIGH, // High polarity
            EUSCI_B_SPI_3PIN                           // 3Wire SPI Mode
    };
    //![Simple SPI Config]
    
    int main(void)
    {
        /* Halting WDT  */
        WDT_A_holdTimer();
    
        //![Simple SPI Example]
        /* Selecting P1.5 P1.6 and P1.7 in SPI mode */
        GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P1,
                GPIO_PIN5 | GPIO_PIN6 | GPIO_PIN7, GPIO_PRIMARY_MODULE_FUNCTION);
    
        /* Configuring SPI in 3wire master mode */
        SPI_initMaster(EUSCI_B0_BASE, &spiMasterConfig);
    
        /* Enable SPI module */
        SPI_enableModule(EUSCI_B0_BASE);
    
        TXData[0] = 0x01;
        TXData[1] = 0x02;
    
        /*
         * Send instruction with chip select
         */
    
        /* Polling to see if the TX buffer is ready */
        while (!(SPI_getInterruptStatus(EUSCI_B0_BASE,EUSCI_B_SPI_TRANSMIT_INTERRUPT)));
    
        /* Set Chip select here */
    
        /* Transmitting data to slave, the eUSCI is buffered so two writes can be made*/
        SPI_transmitData(EUSCI_B0_BASE, TXData[0]);
        SPI_transmitData(EUSCI_B0_BASE, TXData[1]);
    
        while (!(SPI_getInterruptStatus(EUSCI_B0_BASE,EUSCI_B_SPI_TRANSMIT_INTERRUPT)));
        SPI_clearInterruptFlag(EUSCI_B0_BASE,EUSCI_B_SPI_RECEIVE_INTERRUPT);
        
        /* do not clear the chip select until after the last byte is transmitted.  The
         * TX IFG indicates that the transmit buffer is free and can be loaded.  The
         * RX IFG indicates that the byte has been actually transmitted - actually 
         * in order to receive the transmit buffer needs to be loaded to generate clock
         * pulses.
         */
     
        while (!(SPI_getInterruptStatus(EUSCI_B0_BASE,EUSCI_B_SPI_RECEIVE_INTERRUPT)));
    
        /* Clear Chip select here */
    
        /* Continue code */ 
    }
    
    
    

**Attention** This is a public forum