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/MSP432P411V: Internal VREF and VeREF is different

Part Number: MSP432P411V
Other Parts Discussed in Thread: TLV9004

Tool/software: Code Composer Studio

In case of VeREF, it does not respond unless the input is more than 60mV.

MSP-EXP432P4111: VREF2.5V OK, VeREF3.3V OK

MSP-EXP432P401R: VREF2.5V OK, VeREF3.3V OK

Our board (MSP432P411V): VREF2.5V OK, VeREF3.0V NG (A16..A21)

It seems that ADC14xMEM comes out from 4digits (1023?) and less than 3digits.

  • Hello,

    iwao IWAKIRI said:
    In case of VeREF, it does not respond unless the input is more than 60mV.

    I'm sorry, but I'm not sure I understand the issue. It'd be helpful if you can add some clarification. It sounds like your board isn't working when you select VeREF as the voltage reference input. Is that correct?

    VeREF is intended to be an input from an external voltage reference. The VREF pins allow you to use the internal reference voltages outside of the MSP432P411V device. Your code will need to be configured properly (see the device-specific code examples here) depending on whether you're using an internal or external reference. Also, voltage references typically need time to settle before use.

    Regarding your board, I would highly recommend comparing your design to the design of the MSP-EXP432P111 or MSP-EXP432P401R LaunchPads. You can find the schematic in each LaunchPad's user's guide. Pay special attention to the recommended capacitors (especially around the VeREF and VREF pins) and other connections that are specified in the datasheet too.

    Regards,

    James

  • This code will probably work correctly.

    void ADC_Start(void)
    {
    if (!ADC_ON)
    {
    TIMERA_Init(&tmrConfig_adc);
    
    #if 1
    #define REF_SELECT ADC_VREFPOS_AVCC_VREFNEG_VSS
    MAP_REF_A_setReferenceVoltage(REF_A_VREF2_5V);
    MAP_REF_A_enableReferenceVoltage();
    #else
    #define REF_SELECT ADC_VREFPOS_EXTPOS_VREFNEG_EXTNEG
    MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P5
    , GPIO_PIN6 // 3.0V
    | GPIO_PIN7
    , GPIO_TERTIARY_MODULE_FUNCTION);
    #endif
    MAP_REF_A_disableTempSensor();
    MAP_REF_A_disableReferenceVoltageOutput();
    
    MAP_ADC14_enableModule();
    uint32_t smclk = MAP_CS_getSMCLK();
    if (CS_3MHZ == smclk)
    {
    MAP_ADC14_initModule(
    ADC_CLOCKSOURCE_SMCLK,
    ADC_PREDIVIDER_1,
    ADC_DIVIDER_2,
    0
    );
    }
    else
    {
    MAP_ADC14_initModule(
    ADC_CLOCKSOURCE_SMCLK,
    ADC_PREDIVIDER_4,
    ADC_DIVIDER_5,
    0
    );
    }
    
    MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P5
    , GPIO_PIN5
    | GPIO_PIN4
    | GPIO_PIN3
    | GPIO_PIN2
    | GPIO_PIN1
    | GPIO_PIN0
    , GPIO_TERTIARY_MODULE_FUNCTION);
    MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P4
    , GPIO_PIN7
    | GPIO_PIN6
    | GPIO_PIN5
    | GPIO_PIN1
    | GPIO_PIN0
    , GPIO_TERTIARY_MODULE_FUNCTION);
    MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P6
    , GPIO_PIN1
    | GPIO_PIN0
    , GPIO_TERTIARY_MODULE_FUNCTION);
    MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P9
    , GPIO_PIN1
    | GPIO_PIN0
    , GPIO_TERTIARY_MODULE_FUNCTION);
    MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P8
    , GPIO_PIN6
    | GPIO_PIN5
    | GPIO_PIN4
    | GPIO_PIN7
    , GPIO_TERTIARY_MODULE_FUNCTION);
    
    MAP_ADC14_configureMultiSequenceMode(ADC_MEM0, ADC_MEM18, true);
    MAP_ADC14_configureConversionMemory(ADC_MEM0 , REF_SELECT, ADC_INPUT_A0 , false);
    MAP_ADC14_configureConversionMemory(ADC_MEM1 , REF_SELECT, ADC_INPUT_A1 , false);
    MAP_ADC14_configureConversionMemory(ADC_MEM2 , REF_SELECT, ADC_INPUT_A2 , false);
    MAP_ADC14_configureConversionMemory(ADC_MEM3 , REF_SELECT, ADC_INPUT_A3 , false);
    MAP_ADC14_configureConversionMemory(ADC_MEM4 , REF_SELECT, ADC_INPUT_A4 , false);
    MAP_ADC14_configureConversionMemory(ADC_MEM5 , REF_SELECT, ADC_INPUT_A5 , false);
    MAP_ADC14_configureConversionMemory(ADC_MEM6 , REF_SELECT, ADC_INPUT_A6 , false);
    MAP_ADC14_configureConversionMemory(ADC_MEM7 , REF_SELECT, ADC_INPUT_A7 , false);
    MAP_ADC14_configureConversionMemory(ADC_MEM8 , REF_SELECT, ADC_INPUT_A8 , false);
    MAP_ADC14_configureConversionMemory(ADC_MEM9 , REF_SELECT, ADC_INPUT_A12, false);
    MAP_ADC14_configureConversionMemory(ADC_MEM10, REF_SELECT, ADC_INPUT_A13, false);
    MAP_ADC14_configureConversionMemory(ADC_MEM11, REF_SELECT, ADC_INPUT_A14, false);
    MAP_ADC14_configureConversionMemory(ADC_MEM12, REF_SELECT, ADC_INPUT_A15, false);
    MAP_ADC14_configureConversionMemory(ADC_MEM13, REF_SELECT, ADC_INPUT_A16, false);
    MAP_ADC14_configureConversionMemory(ADC_MEM14, REF_SELECT, ADC_INPUT_A17, false);
    MAP_ADC14_configureConversionMemory(ADC_MEM15, REF_SELECT, ADC_INPUT_A18, false);
    MAP_ADC14_configureConversionMemory(ADC_MEM16, REF_SELECT, ADC_INPUT_A19, false);
    MAP_ADC14_configureConversionMemory(ADC_MEM17, REF_SELECT, ADC_INPUT_A20, false);
    MAP_ADC14_configureConversionMemory(ADC_MEM18, REF_SELECT, ADC_INPUT_A21, false);
    
    MAP_ADC14_setSampleHoldTime(ADC_PULSE_WIDTH_32, ADC_PULSE_WIDTH_32);
    MAP_ADC14_enableSampleTimer(ADC_AUTOMATIC_ITERATION);
    MAP_ADC14_setResolution(ADC_14BIT) ;
    ADC14_setResultFormat(ADC_UNSIGNED_BINARY);
    
    MAP_Timer_A_initCompare(tmrConfig_adc.base, &(Timer_A_CompareModeConfig)
    {
    .compareRegister = TIMER_A_CAPTURECOMPARE_REGISTER_1,
    .compareInterruptEnable = TIMER_A_CAPTURECOMPARE_INTERRUPT_DISABLE,
    .compareOutputMode = TIMER_A_OUTPUTMODE_SET_RESET,
    .compareValue = MAP_Timer_A_getCaptureCompareCount(tmrConfig_adc.base, TIMER_A_CAPTURECOMPARE_REGISTER_0)
    });
    MAP_Timer_A_startCounter(tmrConfig_adc.base, TIMER_A_UP_MODE);
    
    MAP_ADC14_setSampleHoldTrigger(ADC_TRIGGER_SOURCE1, false);
    
    MAP_ADC14_enableInterrupt(ADC_INT18);
    MAP_ADC14_enableConversion();
    
    MAP_Interrupt_enableInterrupt(INT_ADC14);
    MAP_Interrupt_enableMaster();
    
    }
    
    }

    With VeREF, A0..A15 detects from a few mV,

    A16 and A19 require 60 mV. I haven't seen all from A17.

    A16 is amplified by TLV9004, but A19 is only divided by the resistor.

    I have confirmed P401R,P4111. There is no problem unexpectedly.

  • Hello,

    If this software works on the LaunchPads but not your board, then I suspect there's a hardware issue on your board that's causing the issue. Please see my earlier comments about that. I would also check that your timer configuration allows enough time for all the ADC channels to finish sampling before it triggers the conversion start again. Perhaps it would be worth using the automatic mode or single sample mode.

    Regards,

    James

  • I'm running the same code in LaunchPad to see it.
    I think the only difference is the MCU.
    I received the P411V/P4111/P401R samples, so I will try reworking my board.

  • It was because a capacitor was attached to VeREF-.
    By removing this, the problem disappeared.

  • Hello,

    iwao IWAKIRI said:
    It was because a capacitor was attached to VeREF-.
    By removing this, the problem disappeared.

    Great! A difference between the hardware makes sense since you were using the same software and device. Nice work. I'll mark the thread as resolved.

    Regards,

    James

**Attention** This is a public forum