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.

MSP430FR2355: Reference Output to VREF+

Part Number: MSP430FR2355


I have an application where I need the Reference Output from the MSP430. According to the datasheet and user's guide, this should be possible on P1.7 (A7). So I started by configuring the corresponding PMM Registers:

PMMCTL2 |= REFGEN;

P1SEL0 |= BIT7;
P1SEL1 |= BIT7;

PMMCTL2 |= EXTREFEN;

This produces no output on my device. When looking at the Registers in the debugger, I see that EXTREFEN was not set in PMMCL2. The reference is running, though (REFGENACT, REFBGACT, REFBGRDY, REFGENRDY are all set).

I found in the datasheet that the refence can be output when the corresponding ADC channel (A7) is in use, so I tried:

  PMMCTL2 |= REFGEN;
  ADCMCTL0 |= ADCINCH_7;
  ADCCTL0 |= ADCON;
  ADCCTL0 |= ADCENC;

  P1SEL0 |= BIT7;
  P1SEL1 |= BIT7;

  PMMCTL2 |= EXTREFEN;

But this still does not work. The EXTREFEN bit remains unset and no refence voltage is output. I did not find any hint to this neither on the Internet nor in the MSP430FR2355 Code Examples. How can I get my refence available externally?

  • Hi Torben,

    You are correct in most of your implementation, however you are missing 2 lines of code which unlock the PMM registers and actually activates the port settings.

    Please refer to the following modification of your code snippet for an example of how to enable the external reference output on the MSP430FR2355:

    int main(void)
    {
    	WDTCTL = WDTPW | WDTHOLD;	// stop watchdog timer
    
    	//Disable I/O Functionality
    	P1SEL0 |= BIT7;
    	P1SEL1 |= BIT7;
    
    	PM5CTL0 &= ~LOCKLPM5;   //Activate previously configured port settings
    
    	PMMCTL0_H = PMMPW_H;    //Unlock PMM Registers
    	PMMCTL2 |= REFGEN;      // Enable variable reference generator
    	PMMCTL2 |= EXTREFEN;    // Enable 1.2V external reference output
    
    	while(1);               //Monitor VREF+ on P1.7
    
    	return 0;
    }

    Keep in mind, the variable reference generator does not necessarily need to be activated in order to output the 1.2V reference output. You will want to place the appropriate capacitors on the VREF+ pin to stabilize the voltage as recommended in Section 7.2.1.1 in the User's Guide.

    Best regards,

    Matt Calvo

**Attention** This is a public forum