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.

MSP 432 I2C baudrate

Hi.

I'm using the MSP432 launchpad with the external HF 48MHz crystal,

The SMCLK is initialize to 1/2 the system clock , which is 48MHz. i check the on the external pin and measured SMCLK-24MHz.

but when i'm using the I2C devider by 60:

UCB3BRW = 0x3C;

the SCLK is measured to be 328Khz instead of 400KHz...

what could be wrong? 

  • Hi Shai!

    Is UCSWRST set in UCB3CTLW0 while setting the bit rate control register?

    Dennis
  • Yes, I'm setting the bit before all initiations to the I2C registers and then clearing it. all other initiations are preformed correctly.

    NVIC->ISER[0] = 1 << ((EUSCIB3_IRQn) & 31); // Enable eUSCIB3 interrupt in NVIC module
    // Configure USCI_B3 for I2C3 mode
    UCB3CTLW0 |= UCSWRST; // Software reset enabled
    MAP_I2C_enableInterrupt(EUSCI_B3_BASE, EUSCI_B_I2C_BYTE_COUNTER_INTERRUPT);
    UCB3CTLW0 |= UCMODE_3 | UCMST | UCSYNC | EUSCI_B_CTLW0_SSEL__SMCLK; // I2C mode, Master mode, SMCLK, sync
    UCB3CTLW1 |= UCASTP_2; // Automatic stop generated
    UCB3BRW = (US)(SMClock / I2C1BaudRate); // baudrate divider = SMCLK / I2C1BaudRate

    UCB3TBCNT = 0x0002; // number of bytes to be received

    MAP_Interrupt_setPriority(INT_EUSCIB3, I2C3_PR);

    UCB3I2CSA = 0x64;
    UCB3CTLW0 &= ~UCSWRST;
    UCB3IE |= UCRXIE | UCNACKIE | UCTXIE0| UCBCNTIE; // enable RX, TX interrupts
  • Anybody knows why the I2C baudrate isn't working correctly?

**Attention** This is a public forum