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.

MSP430FR6047: -

Part Number: MSP430FR6047
Other Parts Discussed in Thread: MSP430FR6043, , EVM430-FR6047

Hello.I want to add print of LEA information in console. But LEA hasn`t values from SDHC(ADC of MCU module USS). I can`t understand why it is happening. Registers work correct and test by Water Flow Meter Quick Start Guide successfully.

  • Hi,

    If you'd like to see the ADC values after a capture, you can get the pointers to the upstream and downstream capture buffers that the LEA uses with the following:

    uint8_t* pUPSCap = (uint8_t*)(USS_getUPSPtr(&gUssSWConfig));
    uint8_t* pDNSCap = (uint8_t*)(USS_getDNSPtr(&gUssSWConfig));

    Is this what you are looking for?

    BR,
    Leo

  • I use msp430fr6043_sdhs_01__ program. It`s example from TI site. Code have in LEA array "result". Information of up/downstream megerment is written there. I think I don`t read this data corectly or could use another way to display. 

    Please, write your answer more deployed..

  • I add printf in int (main) code for LEA data and register`s data. But I have only two types of data: F800 and 7FF, I mean that is not correct, because source send unsimular voltage value. If use formula by example code, mean of voltage don`t match mean of LEA data.

  • msp430fr6043_sdhs_01__.c
    /* --COPYRIGHT--,BSD_EX
     * 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.
     *
     *******************************************************************************
     *
     *                       MSP430 CODE EXAMPLE DISCLAIMER
     *
     * MSP430 code examples are self-contained low-level programs that typically
     * demonstrate a single peripheral function or device feature in a highly
     * concise manner. For this the code may rely on the device's power-on default
     * register values and settings such as the clock configuration and care must
     * be taken when combining code from several examples to avoid potential side
     * effects. Also see www.ti.com/grace for a GUI- and www.ti.com/msp430ware
     * for an API functional library-approach to peripheral configuration.
     *
     * --/COPYRIGHT--*/
    //******************************************************************************
    //   MSP430FR60xx Demo - SDHS sampling at 8MSPS and DTC transfer results to RAM
    //
    //   Description: Configure the SDHS for stand-alone use (register mode) at 8MSPS.
    //   Use the DTC to transfer the results to an array in RAM named "results" (located
    //	 in LEA RAM at 0x5000). Convert array back to input voltage using: 
    //   V = (adc_code * (f_s/2))/(gain*7FF) + Bias
    //   where,adc_code is the ADC result(16-Bit Signed Int),f_s = .755V(Full-scale voltage),
    //   gain = 10^(0.1/20)) = approximately 1, Bias = .9V, 7FF = 2047 
    //
    //   ***NOTE: On TS-Board, remove JP14, put SIG on inner pin and GND to outer pin.
    //            Valid input range is 600mV - 1200mV, as configured.***
    //           MSP430FR6043
    //         ---------------
    //     /|\|               |
    //      | |               |
    //      --|RST            |
    //        |           P1.0|---> LED
    //        |               |-USSXTIN
    //        |               |-USSXTOUT
    //        |         CH0_IN|<--- input signal
    //
    //   Gary Gao & Matt Calvo
    //   Texas Instruments Inc.
    //   February 2018
    //   Built with IAR Embedded Workbench V7.10 & Code Composer Studio V7.3
    //******************************************************************************
    #include <msp430.h>
    
    #define OSCTYPE__CRYSTAL OSCTYPE_0
    
    void HSPLL_init(void);
    
    #if defined(__TI_COMPILER_VERSION__)
    #pragma DATA_SECTION(results, ".leaRAM")
    #pragma RETAIN(results)
     int results[1024] = {0};
    #elif defined(__IAR_SYSTEMS_ICC__)
    #pragma location=0x5000
    __no_init  int results[1024];
    #pragma required = results
    #elif defined(__GNUC__)
     int results[1024] __attribute__ ((section (".leaRAM"), used));
    #else
    #error Compiler not supported!
    #endif
    
    int main(void)
    {
    
    
        WDTCTL = WDTPW | WDTHOLD;               // Stop WDT
    
        // Configure P1.0 as output for LED
        P1OUT &= ~BIT0;
        P1DIR |= BIT0;
    
        // Disable the GPIO power-on default high-impedance mode to activate
        // previously configured port settings
        PM5CTL0 &= ~LOCKLPM5;
    
        // Configure one FRAM waitstate as required by the device datasheet for MCLK
        // operation beyond 8MHz _before_ configuring the clock system.
        FRCTL0 = FRCTLPW | NWAITS_1;
    
    
        // Clock System Setup
        CSCTL0_H = CSKEY_H;                     // Unlock CS registers
        // Per Device Errata(CS12) set divider to 4 before changing frequency to
        // prevent out of spec operation from overshoot transient
        CSCTL3 = DIVA__4 | DIVS__4 | DIVM__4;   // Set all corresponding clk sources to divide by 4 for errata(CS12)
        CSCTL1 = DCOFSEL_4 | DCORSEL;           // Set DCO to 16MHz
        // Delay by ~10us to let DCO settle. 60 cycles = 20 cycles buffer + (10us / (1/4MHz))
        __delay_cycles(60);
        CSCTL3 = DIVA__1 | DIVS__1 | DIVM__1;   // Set all dividers to 1 for 16MHz operation
        CSCTL3 = DIVA__1 | DIVS__1 | DIVM__1;   // MCLK = SMCLK = 16MHz
        CSCTL0_H = 0;                           // Lock CS registers
    
        //Setup SAPH Bias Register Controlled
        SAPHKEY = KEY;
        SAPHBCTL &= ~ASQBSC;
        SAPHBCTL |= CPDA;
        SAPHICTL0 = 0;
        SAPHKEY = KEY+1;
    
        //Setup the SDHS with register mode
        SDHSCTL0 = TRGSRC_0 | AUTOSSDIS_1 | DFMSEL_0;// Software trigger,Left, 2s complement format
        SDHSCTL1 = OSR_0;                       // OSR = 10 (80MHz/10 = 8MSPS). CS must set MCLK >= 8MHz.
        SDHSCTL2 = 255;                         // SMPSZ = 255+1 samples
        SDHSCTL6 = 0x19;                        // PGA Gain 0.1 dB
        SDHSCTL7 = 0xC;                         // MODOPTI = 0xC (80MHz PLL output frequency)
        SDHSDTCDA = 0x800;                          // DTC transfer data to start of LEA RAM
        SDHSIMSC = ACQDONE;                     // Enable acquisition done interrupt (after 256 samples transferred)
        SDHSCTL3 = TRIGEN_1;                    // Enable trigger
        SDHSCTL4 = SDHSON;                      // Turn on SD and start conversion
        __delay_cycles(640);                    // Delay for PGA worst case 40us settling time
    
        HSPLL_init();                           // Initialize the HSPLL and wait for it to lock
    
        // Configure TA2.1 for 1/sec to trigger the pulse generation and toggle LED
        TA2CCR0 = 9400;
        TA2CCR1 = 4700;
        TA2CCTL1 = OUTMOD_7 | CCIE;             // Enable output signal to trigger PPG, enable Interrupt
        TA2CTL = TASSEL__ACLK | TACLR | MC__UP; // Timer sourced from ACLK (VLO), clear timer
    
        while(1)
        {
            __bis_SR_register(LPM0_bits | GIE); // Enter LPM0 w/interrupt
            __no_operation();                   // For debug
        }
    }
    
    // Timer A2 interrupt service routine
    #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
    #pragma vector = TIMER2_A1_VECTOR
    __interrupt void Timer2_A1_ISR(void)
    #elif defined(__GNUC__)
    void __attribute__ ((interrupt(TIMER2_A1_VECTOR))) Timer2_A1_ISR (void)
    #else
    #error Compiler not supported!
    #endif
    {
    
        switch(__even_in_range(TA2IV, TAIV__TAIFG))
        {
    
            case TAIV__NONE:   break;           // No interrupt
            case TAIV__TACCR1:
                SDHSCTL4&= ~SDHSON;
                SDHSCTL5 &= ~SSTART;
                SDHSCTL3 = 0;
                SDHSDTCDA = 0x800;
                SDHSCTL3 = TRIGEN_1;
                SDHSCTL4 = SDHSON;
                SDHSCTL5 |= SSTART;             // Start conversion
                break;
            case TAIV__TAIFG:                   // overflow
                __no_operation();               
    			break;               
            default: break;
        }
    }
    
    // SDHS interrupt service routine
    #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
    #pragma vector = SDHS_VECTOR
    __interrupt void SDHS_ISR(void)
    #elif defined(__GNUC__)
    void __attribute__ ((interrupt(SDHS_VECTOR))) SDHS_ISR (void)
    #else
    #error Compiler not supported!
    #endif
    {
    
        switch(__even_in_range(SDHSIIDX, IIDX_6))
        {
            case IIDX_0:   break;               // No interrupt
            case IIDX_1:
                __no_operation();
                break;                          // OVF interrupt
            case IIDX_2:                        // ACQDONE interrupt
                P1OUT ^= BIT0;                  // Toggle LED to show new cyclelll
                __delay_cycles(1000);
                __no_operation();               // Put breakpoint here to view results
                break;
            case IIDX_3:   break;               // SSTRG interrupt
            case IIDX_4:   break;               // DTRDY interrupt
            case IIDX_5:   break;               // WINHI interrupt
            case IIDX_6:   break;               // WINLO interrupt
            default: break;
        }
    }
    
    void HSPLL_init(void)
    {
        // Configure USSXT Oscillator
        HSPLLUSSXTLCTL = OSCTYPE__CRYSTAL |  USSXTEN;
    
        // Set up timer to wait in LPM for crystal stabilization time = 4096 clocks for crystal resonator.
        // For 8MHz XTAL, 4096 clocks = 512us. Using VLO = 9.4kHz, wait 5 timer clock cycles = 532us.
        TA4CCR0 = 5;
        TA4CCTL0 = CCIE;                        // Enable Interrupt
        TA4CTL = TASSEL__ACLK | TACLR | MC__UP; // Timer sourced from ACLK (VLO), clear timer
        __bis_SR_register(LPM3_bits | GIE);     // Enter LPM3 w/interrupt
        __no_operation();                       // For debug
    
        // Check if oscillator is stable
        while((HSPLLUSSXTLCTL & OSCSTATE) == 0);
    
        // Output oscillator on pin
        HSPLLUSSXTLCTL &= ~XTOUTOFF;
    
        // Init PLL
        // Use the PLLM setting to get 80MHz output from our 8MHz input
        // Equation: PLL output clock frequency x 2 = input clock frequency x (PLLM+1)
        // Input clock frequency = 8MHz
        // Desired PLL output clock frequency = 80MHz
        // PLLM = 19
        HSPLLCTL = PLLM4 | PLLM1 | PLLM0 | PLLINFREQ; //PLLM = 19, PLL input frequency > 6MHz
    
        // Power up the UUPS to start the PLL
        UUPSCTL |= USSPWRUP;
    
        // Wait for UUPS to power up
        while((UUPSCTL & UPSTATE_3) != UPSTATE_3);
    
        // Wait for PLL to lock
        while(!(HSPLLCTL & PLL_LOCK));
    }
    
    // Timer A4 interrupt service routine
    #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
    #pragma vector = TIMER4_A0_VECTOR
    __interrupt void Timer4_A0_ISR(void)
    #elif defined(__GNUC__)
    void __attribute__ ((interrupt(TIMER4_A0_VECTOR))) Timer4_A0_ISR (void)
    #else
    #error Compiler not supported!
    #endif
    {
        // Stop the timer and wake from LPM
        TA4CTL = MC__STOP;
        __bic_SR_register_on_exit(LPM3_bits | GIE);
        __no_operation();
    }
    

  • Hi

    What if you don't add the printf in the code and to check the results to put a breakpoint in the SDHS_ISR? 

    I think there should have no error there, the only problem you want to know is how to show the results graphically, right? 

  • Hi
    I don`t want to have a graphic of results or something like this. I want to check data received by LEA visually and convert array back to input voltage using example`s formula (V = (adc_code * (f_s/2))/(gain*7FF) + Bias). I`m fail at this stage and can`t understand why.

  • Hi 

    Have you try the demo code without changing anything of it, just to check the results to put a breakpoint in the SDHS_ISR and 

    convert array back to input voltage using:  V = (adc_code * (f_s/2))/(gain*7FF) + Bias ?

  • Hi
    I use demo code without any changing. I put a breakpoint in the SDHS_ISR, add array "result" in Expressions in CSS Debug mode to see value of that one. But when I check result`s value they always zero regardless of input voltage.

  • TI_demo code_SDHS.txt
    /* --COPYRIGHT--,BSD_EX
     * 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.
     *
     *******************************************************************************
     *
     *                       MSP430 CODE EXAMPLE DISCLAIMER
     *
     * MSP430 code examples are self-contained low-level programs that typically
     * demonstrate a single peripheral function or device feature in a highly
     * concise manner. For this the code may rely on the device's power-on default
     * register values and settings such as the clock configuration and care must
     * be taken when combining code from several examples to avoid potential side
     * effects. Also see www.ti.com/grace for a GUI- and www.ti.com/msp430ware
     * for an API functional library-approach to peripheral configuration.
     *
     * --/COPYRIGHT--*/
    //******************************************************************************
    //   MSP430FR60xx Demo - SDHS sampling at 8MSPS and DTC transfer results to RAM
    //
    //   Description: Configure the SDHS for stand-alone use (register mode) at 8MSPS.
    //   Use the DTC to transfer the results to an array in RAM named "results" (located
    //	 in LEA RAM at 0x5000). Convert array back to input voltage using: 
    //   V = (adc_code * (f_s/2))/(gain*7FF) + Bias
    //   where,adc_code is the ADC result(16-Bit Signed Int),f_s = .755V(Full-scale voltage),
    //   gain = 10^(0.1/20)) = approximately 1, Bias = .9V, 7FF = 2047 
    //
    //   ***NOTE: On TS-Board, remove JP14, put SIG on inner pin and GND to outer pin.
    //            Valid input range is 600mV - 1200mV, as configured.***
    //           MSP430FR6043
    //         ---------------
    //     /|\|               |
    //      | |               |
    //      --|RST            |
    //        |           P1.0|---> LED
    //        |               |-USSXTIN
    //        |               |-USSXTOUT
    //        |         CH0_IN|<--- input signal
    //
    //   Gary Gao & Matt Calvo
    //   Texas Instruments Inc.
    //   February 2018
    //   Built with IAR Embedded Workbench V7.10 & Code Composer Studio V7.3
    //******************************************************************************
    #include <msp430.h>
    
    #define OSCTYPE__CRYSTAL OSCTYPE_0
    
    void HSPLL_init(void);
    
    #if defined(__TI_COMPILER_VERSION__)
    #pragma DATA_SECTION(results, ".leaRAM")
    #pragma RETAIN(results)
     int results[1024] = {0};
    #elif defined(__IAR_SYSTEMS_ICC__)
    #pragma location=0x5000
    __no_init  int results[1024];
    #pragma required = results
    #elif defined(__GNUC__)
     int results[1024] __attribute__ ((section (".leaRAM"), used));
    #else
    #error Compiler not supported!
    #endif
    
    int main(void)
    {
    
    
        WDTCTL = WDTPW | WDTHOLD;               // Stop WDT
    
        // Configure P1.0 as output for LED
        P1OUT &= ~BIT0;
        P1DIR |= BIT0;
    
        // Disable the GPIO power-on default high-impedance mode to activate
        // previously configured port settings
        PM5CTL0 &= ~LOCKLPM5;
    
        // Configure one FRAM waitstate as required by the device datasheet for MCLK
        // operation beyond 8MHz _before_ configuring the clock system.
        FRCTL0 = FRCTLPW | NWAITS_1;
    
    
        // Clock System Setup
        CSCTL0_H = CSKEY_H;                     // Unlock CS registers
        // Per Device Errata(CS12) set divider to 4 before changing frequency to
        // prevent out of spec operation from overshoot transient
        CSCTL3 = DIVA__4 | DIVS__4 | DIVM__4;   // Set all corresponding clk sources to divide by 4 for errata(CS12)
        CSCTL1 = DCOFSEL_4 | DCORSEL;           // Set DCO to 16MHz
        // Delay by ~10us to let DCO settle. 60 cycles = 20 cycles buffer + (10us / (1/4MHz))
        __delay_cycles(60);
        CSCTL3 = DIVA__1 | DIVS__1 | DIVM__1;   // Set all dividers to 1 for 16MHz operation
        CSCTL3 = DIVA__1 | DIVS__1 | DIVM__1;   // MCLK = SMCLK = 16MHz
        CSCTL0_H = 0;                           // Lock CS registers
    
        //Setup SAPH Bias Register Controlled
        SAPHKEY = KEY;
        SAPHBCTL &= ~ASQBSC;
        SAPHBCTL |= CPDA;
        SAPHICTL0 = 0;
        SAPHKEY = KEY+1;
    
        //Setup the SDHS with register mode
        SDHSCTL0 = TRGSRC_0 | AUTOSSDIS_1 | DFMSEL_0;// Software trigger,Left, 2s complement format
        SDHSCTL1 = OSR_0;                       // OSR = 10 (80MHz/10 = 8MSPS). CS must set MCLK >= 8MHz.
        SDHSCTL2 = 255;                         // SMPSZ = 255+1 samples
        SDHSCTL6 = 0x19;                        // PGA Gain 0.1 dB
        SDHSCTL7 = 0xC;                         // MODOPTI = 0xC (80MHz PLL output frequency)
        SDHSDTCDA = 0x800;                          // DTC transfer data to start of LEA RAM
        SDHSIMSC = ACQDONE;                     // Enable acquisition done interrupt (after 256 samples transferred)
        SDHSCTL3 = TRIGEN_1;                    // Enable trigger
        SDHSCTL4 = SDHSON;                      // Turn on SD and start conversion
        __delay_cycles(640);                    // Delay for PGA worst case 40us settling time
    
        HSPLL_init();                           // Initialize the HSPLL and wait for it to lock
    
        // Configure TA2.1 for 1/sec to trigger the pulse generation and toggle LED
        TA2CCR0 = 9400;
        TA2CCR1 = 4700;
        TA2CCTL1 = OUTMOD_7 | CCIE;             // Enable output signal to trigger PPG, enable Interrupt
        TA2CTL = TASSEL__ACLK | TACLR | MC__UP; // Timer sourced from ACLK (VLO), clear timer
    
        while(1)
        {
            __bis_SR_register(LPM0_bits | GIE); // Enter LPM0 w/interrupt
            __no_operation();                   // For debug
        }
    }
    
    // Timer A2 interrupt service routine
    #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
    #pragma vector = TIMER2_A1_VECTOR
    __interrupt void Timer2_A1_ISR(void)
    #elif defined(__GNUC__)
    void __attribute__ ((interrupt(TIMER2_A1_VECTOR))) Timer2_A1_ISR (void)
    #else
    #error Compiler not supported!
    #endif
    {
    
        switch(__even_in_range(TA2IV, TAIV__TAIFG))
        {
    
            case TAIV__NONE:   break;           // No interrupt
            case TAIV__TACCR1:
                SDHSCTL4&= ~SDHSON;
                SDHSCTL5 &= ~SSTART;
                SDHSCTL3 = 0;
                SDHSDTCDA = 0x800;
                SDHSCTL3 = TRIGEN_1;
                SDHSCTL4 = SDHSON;
                SDHSCTL5 |= SSTART;             // Start conversion
                break;
            case TAIV__TAIFG:                   // overflow
                __no_operation();               
    			break;               
            default: break;
        }
    }
    
    // SDHS interrupt service routine
    #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
    #pragma vector = SDHS_VECTOR
    __interrupt void SDHS_ISR(void)
    #elif defined(__GNUC__)
    void __attribute__ ((interrupt(SDHS_VECTOR))) SDHS_ISR (void)
    #else
    #error Compiler not supported!
    #endif
    {
    
        switch(__even_in_range(SDHSIIDX, IIDX_6))
        {
            case IIDX_0:   break;               // No interrupt
            case IIDX_1:
                __no_operation();
                break;                          // OVF interrupt
            case IIDX_2:                        // ACQDONE interrupt
                P1OUT ^= BIT0;                  // Toggle LED to show new cyclelll
                __delay_cycles(1000);
                __no_operation();               // Put breakpoint here to view results
                break;
            case IIDX_3:   break;               // SSTRG interrupt
            case IIDX_4:   break;               // DTRDY interrupt
            case IIDX_5:   break;               // WINHI interrupt
            case IIDX_6:   break;               // WINLO interrupt
            default: break;
        }
    }
    
    void HSPLL_init(void)
    {
        // Configure USSXT Oscillator
        HSPLLUSSXTLCTL = OSCTYPE__CRYSTAL |  USSXTEN;
    
        // Set up timer to wait in LPM for crystal stabilization time = 4096 clocks for crystal resonator.
        // For 8MHz XTAL, 4096 clocks = 512us. Using VLO = 9.4kHz, wait 5 timer clock cycles = 532us.
        TA4CCR0 = 5;
        TA4CCTL0 = CCIE;                        // Enable Interrupt
        TA4CTL = TASSEL__ACLK | TACLR | MC__UP; // Timer sourced from ACLK (VLO), clear timer
        __bis_SR_register(LPM3_bits | GIE);     // Enter LPM3 w/interrupt
        __no_operation();                       // For debug
    
        // Check if oscillator is stable
        while((HSPLLUSSXTLCTL & OSCSTATE) == 0);
    
        // Output oscillator on pin
        HSPLLUSSXTLCTL &= ~XTOUTOFF;
    
        // Init PLL
        // Use the PLLM setting to get 80MHz output from our 8MHz input
        // Equation: PLL output clock frequency x 2 = input clock frequency x (PLLM+1)
        // Input clock frequency = 8MHz
        // Desired PLL output clock frequency = 80MHz
        // PLLM = 19
        HSPLLCTL = PLLM4 | PLLM1 | PLLM0 | PLLINFREQ; //PLLM = 19, PLL input frequency > 6MHz
    
        // Power up the UUPS to start the PLL
        UUPSCTL |= USSPWRUP;
    
        // Wait for UUPS to power up
        while((UUPSCTL & UPSTATE_3) != UPSTATE_3);
    
        // Wait for PLL to lock
        while(!(HSPLLCTL & PLL_LOCK));
    }
    
    // Timer A4 interrupt service routine
    #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
    #pragma vector = TIMER4_A0_VECTOR
    __interrupt void Timer4_A0_ISR(void)
    #elif defined(__GNUC__)
    void __attribute__ ((interrupt(TIMER4_A0_VECTOR))) Timer4_A0_ISR (void)
    #else
    #error Compiler not supported!
    #endif
    {
        // Stop the timer and wake from LPM
        TA4CTL = MC__STOP;
        __bic_SR_register_on_exit(LPM3_bits | GIE);
        __no_operation();
    }
    

  • And please explain the formula from demo code  V = (adc_code * (f_s/2))/(gain*7FF) + Bias.What is f_s and Bias in code? Where does it come from or how is it considered for the formula?

  • Hi

    We have the description about f_s ,gain and Bias in the demo code

    f_s = 755mV(Full-scale voltage), gain = 10^(0.1/20))≈1, Bias = 900mV.

    Have you get  the value in the LEA RAM at start address of 0x4000?

  • Hello
    Start address is 0x5000 in demo program.
    When I send nothing to trandecer header result`s values in Experesion are zero. But when I send some voltage result`s values in Experesion are zero too.

  • When I use another program (Katie Piar`s one) I have same problem. Code compile, start without error or mistakes and then situation repeats.

    In her program address start on 0x2C00.

  • Hi

    Oh, you are right it is start from 0x5000. But it is not mater, you just need to see the value in the array named "results". The location = 0x2C00 is the demo for MSP430FR6047. You can just use the demo for MSP430FR6043. We can make sure the demo is no problem because we have verify it many times. Please check with you hardware. I think if you handle the software correctly, there should be some problem with your hardware.

    Best regards

    Gary

  • Maybe I have mistake in simple part of flashing MCU?
    1) I copy the example program from Resourse Explore
    2) I post code in new project
    3) Biuld and Debug that one
    4) Before start I connect sourse`s wire on trandecer header
    5) Start program (before it put breakpoint in SDHS interrupt), apply voltage (I use 0.0 - 1.5 V to send on trandecer header)
    6) Check "relults" array in Experesion.

    Program compile without any error or problems, but I don`t understand why incorrect thing happens.

  • Hi

    I notice the title is MSP430FR6047. So you are using the MSP430FR6047 right?

    If so you should use the code example for MSP430FR6047 at here https://dev.ti.com/tirex/explore/node?node=AFnWKjMB1ufMrYJYw64CVg__IOGqZri__LATEST

  • Yes. I use MSP430FR6047 . I tried to use example for MSP430FR6043 because they are equal in demo and I thought that it could be resolve of problem.

    I got example code by Resource Explore in CCS (It`s the same as your reference)

  • Why not use the code example for FR6047 that I send to you just now? 

  • Okey
    I download file from your reference and add to the CSS project

  • I should to build it, debug it and write to you?


  • It`s value when I tap button "resume" program at first time. In the second and third times of use button "resume" values aren`t changes.

  • Can open the value of results like 0~99?


  • After procedure from upper reply, I connect source to transducer header and start to apply voltage.
    I think by this I can simulate transducer `s work, because if I use real transducer with test stand will get same results. This method simply)
    Eventually values aren`t change. I suppose that when trandecer header received some voltage results of LEA values should changing.

  • Hi 

    I don't think the hardware you connect is correct. You can see the schematic of EVM below

    The DC voltage on PIN 1 should be cut off by the capacitor.

  • Hello
    How can it checked to be sure problem in that you notice? My board hasn`t the label C11. And I don`t understand what to do in this situation. I guess fixing of hardware is impossible. Is it like a spoilage?

  • Hi 

    You can down load the design files for EVM430-FR6047 https://www.ti.com/tool/EVM430-FR6047

  • Hello
    My board checked by multimeter (continuity mode). Header CH0 has capacitor. When I tested "Water Quick Start Guide" on the board it worked correct. I think it is indirect proof of having capacitor, cause otherwise program shows wrong graphic.

**Attention** This is a public forum