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.

MSP430F5359 using port mapping ports as normal ports

Other Parts Discussed in Thread: MSP430F5359

Hi All,

We are using the MSP430F5359, this MCU has port 2 and 3 that have mapping functionality. For our project we don't want to use them this functionality but just as a normal I/O port with some pins to use for interrupts. We have made a program but  the interrupts keep firing, we have simple button switch on one pin of port 2 and we don't press it.

In our configuration we do the following:

P2IE |= BIT2;

P2IES |= BIT2;

P2IFG & =~BIT2;

The flag is initially not set, but when we run the program the vector is continieusly called.

#pragma vector=PORT2_VECTOR __interrupt void Port_2(void) {

// Exit low power mode LPM3_EXIT;

P2IFG  &= ~BIT2;

}

We have looked in the product code example folder and to our understanding the when not using the mapping functionality the pins should be configured like any other normal port with interrupts? Are we missing a step here because these are "special" mapping ports? 

Any feedback is welcome!

  • How is the switch connected to the circuit?

    If it's a "normally open" pushbutton that grounds the port pin you'll need a pull-up resistor. This is so the pin isn't left floating while the button is not pressed. You can use an external pull-up, or activate the internal one by setting PxREN and PxOUT appropriately.
  • You're right. When PxSEL is clear, the pins are normal pins. Mapping only occurs for the secondary (module) function when PxSEL is set.
    Is your port pin always connected to a defined logic level? If not, you might be catching radio waves or other crosstalk (CMOS input pins are high impedance) and the input is oscillating, causing frequent interrupts. So in addition to the switch (assuming it connects to VSS) you'll need an additional external or internal pull-up (then to VCC) to keep the pin on a defined logic level when the button is not pressed.
    To enable the itnernal pull-up, do
    P2OUT|=BIT2; // output or pull-up high
    P2REN|=BIT2; // enable pull-up

**Attention** This is a public forum