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/MSP430F67791A: I2c interface with EEPROM issue

Part Number: MSP430F67791A

Tool/software: Code Composer Studio

I am presently working on I2C of msp430f67791A microcontroller & facing some issues with eeprom ( 24LC1025) interfacing. It is not getting initialized properly & hence not working. We are interfacing eeprom on the port pins P2.5 (clk) & P2.6 (data). while debugging we found that, it is not getting it's UCBBUSY flag cleared. & hence it is not initializing eeprom. my transmit init routine is as below. We are passing 0xC0 as prescale in below code. slave addres is 0x54.

void TI_USCI_I2C_transmitinit(unsigned char slave_address,unsigned char prescale){


P2SEL0 |= SDA_PIN | SCL_PIN;
UCB0CTLW0 |= UCSWRST; // Enable SW reset

UCB0CTLW0 |= UCMST | UCMODE_3 | UCSSEL_2 ;// I2C Master, use SMCLK
UCB0BR0 = prescale; // fSCL = SMCLK/160 = ~100kHz
UCB0BR1 = 0;
UCB0I2CSA = slave_address; // Set slave address
UCB0CTLW0 &= ~UCSWRST; // Clear SW reset, resume operation
UCB0IE |= UCNACKIE;

UCB0IE &= ~UCRXIE0;
UCB0IE |= UCTXIE0; // Enable TX interrupt

}

unsigned char TI_USCI_I2C_notready(){

return (UCB0STATW & UCBBUSY);

}

 We are calling above function & then checking for busy bit. like mentioned below.

TI_USCI_I2C_transmitinit(0x54,0xc0); // 0x96 init transmitting with USCI
while (TI_USCI_I2C_notready()); // wait for bus to be free

 can I get any support ?

Regards,

Kalpana Nachnekar

  • Hi Kalpana,
    there are a few thinks to check first:
    - have you put the pull up resistor on the SDA and SCL line which are required for the I2C bus?
    - can you do some probing of the signals to see that there is any communication ongoing.
    - which pins of Port 2 do you use (the default one: P2.5 and P2.6)?
    - do you use the LCD module - have you configured this?

    This would help to narrow down the problem.

    Best regards,
    Stefan
  • Hi Stefan,
     
    We are using pull up resistors  (4k7)on  the SDA and SCL lines on  port2  P2.5 and P2.6. For this microcontroller , in default case, 2 options are there for p2.5 & p2.6 , I2C & SPI . we have selected I2C. Also we are using LCd module & it is configured properly. working fine. 
    Regards,
    Kalpana Nachnekar
  • Hi Kalpana,

    forgot one important question before - which package variant you are using because for the 100 pin package as you can see from the datasheet the pins P2.5 and P2.6 are shared with the LCD. So it might be possible that do to the configuration settings in the LCD the pins have been assigned to the LCD.

    Can you also do some probing on the SCL and SDA lines. Are the lines on a high state in idle mode. What is send out on the signal lines when starting the communication.

    Best regards,
    Stefan
  • Hi Stefan,

    We are using 128 pins PEU package.

    Regards,
    Kalpana Nachnekar
  • Hi Kalpana,

    good then we should look on the SDA and SCL pins - can you do some probing with a scope or logic analyzer.

    Regards,
    Stefan
  • Hi Kalpana,

    could you solve the issue or do you have further questions or inputs regarding this topic?
    If solved, please select "Resolved" for the post that solved your issue so this thread can be closed out. If you have a different question, please select "Ask a related question" or " Ask a new question".
    Thanks a lot!

    Best regards,
    Stefan
  • Hi,

    I suppose that you were able to move on with your application as you didn't reply anymore, so I'll close this post.
    Please feel free to comment again if you look for further assistance regarding this topic, it will re-open the thread. If you have a different question, please select "Ask a related question" or " Ask a new question".

    Best regards,
    Stefan

**Attention** This is a public forum