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.

MSP430F6435:How to initialize GPIO for I2C

Part Number: MSP430F6435
Other Parts Discussed in Thread: MSP430F6638

Hi.

I am trying to implement I2C on MSP430F6435IPZ.
Since this is my first time using I2C, I got msp430f66xx_usci_i2c_standard_master.c from resource explorer for reference.
Within the GPIO initialization function
P2MAP0 = PM_UCB0SDA;
P2MAP1 = PM_UCB0SCL;
but the MSP430F6435 datasheet states that P2MAP1 is I2C data and P2MAP2 is clock.
(The MSP430F6638 had the same mapping.)
Why is it set like the reference?

The reference functions are as follows.

void initGPIO()
{
//LEDs
LED_OUT &= ~LED_PIN; // P1 setup for LED & reset output
LED_DIR |= LED_PIN;

// Disable Interrupts before altering Port Mapping registers
__disable_interrupt();
// Enable Write-access to modify port mapping registers
PMAPPWD = 0x02D52;

//I2C Pins
P2SEL |= BIT0 | BIT1;
P2MAP0 = PM_UCB0SDA;
P2MAP1 = PM_UCB0SCL;

// Disable Write-Access to modify port mapping registers
PMAPPWD = 0;
}

  • Hi Saitoh,

    This table is defult mapping, actually, you can remap any function based on this table:

    P2MAP0 = PM_UCB0SDA;  -> Mapping P2.0 to num-15: UCB0SDA
    P2MAP1 = PM_UCB0SCL;   -> Mapping P2.1 to num-14: UCB0SCL

    Thanks!

    Best Regards

    Johnson

**Attention** This is a public forum