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.
Tool/software: TI C/C++ Compiler
Hello Ti
Hope that someone can help me to understand the I2C Protocol
I have been working on generating a clock on SCK pin but oscilloscope is always reading Low without any generated clock
I have been working on this code
// Configure GPIO of I2C
P1OUT &= ~BIT0; // Clear P1.0 output latch
P1DIR |= BIT0; // For LED
P1SEL0 |= BIT2 | BIT3; // I2C pins
// Disable the GPIO power-on default high-impedance mode to activate
// previously configured port settings
PM5CTL0 &= ~LOCKLPM5;
// Configure USCI_B0 for I2C mode
UCB0CTLW0 |= UCSWRST; // Software reset enabled
UCB0CTLW0 |= UCMODE_3 | UCMST | UCSYNC; // I2C mode, Master mode, sync
UCB1CTLW0 |= UCTR + UCTXSTT;
UCB0CTLW1 |= UCASTP_2; // Automatic stop generated
// after UCB0TBCNT is reached
UCB0BRW = 0x0008; // baudrate = SMCLK / 8
UCB0TBCNT = 0x0005; // number of bytes to be received
UCB0I2CSA = 0x2A; // Slave address
UCB0CTL1 &= ~UCSWRST;
so if there is someone who can help me to understand how i can generate the clock from this code that is initializing the I2C
Thanks in Advance
Best Regards,
Sherif Ismail
Hi Sherif,
What hardware are you using for your testing? If you are using Launchpads associated with the MSP430FR2355, you should be able to pretty easily get up and running with I2C communication using the I2C examples provided in the TI Resource Explorer.There are examples showing how to properly initialize and connect the master and slave boards to enable I2C communication between the two. If you are using custom HW you would need to go into the example code and make sure that the proper port pins are being initialized for your specific hardware setup.
Don't forget that for proper I2C communication, you need 2 separate pullup resistors for the SDA and SCL lines.
Best regards,
Matt
Hello Matt
Thank you for your kind response.
actually it is not working even to read the signal using an oscilloscope i am working on configuration of LDC1614_EVM as you can find it is working on I2c Serial communication protocol I am done with the LDC1614 Driver configuration but i am still facing a problem in working on the I2C I am not able even to generate any single clock I am not even able to transfer any data that why i feel bad in doing this.
So i wish if there is an opportunity to help me to overcome this problem. I would like also to ask anther question should i use an external pull of resistance besides the internal Pull up resistance or there is no need for this.
finally i would also like to thank you for your help.
Best regards
Sherif Ismail.
Sherif,
Your initial post references the MSP430FR2355 but your last comment mentions the LDC1614_EVM. Could you please clarify exactly what hardware you are using for your I2C testing.
Have you tried importing a basic I2C example from the TI Resource Explorer to see if you are at least able to measure the proper I2C signals coming out of the device pins? In order for your oscilloscope to measure I2C signals properly you will need to have the I2C lines pulled up to VCC with a resistor value that is given in the device's datasheet.
Best regards,
Matt
Hello Matt,
I am trying to communicate the MSP430FR2355 to the I2C pins in the LDC1614EVM .
Yes i have tried the I2C example and also it was the same i wasn't able to see any clock signals on the oscilloscope that's why i wonder if there is something wrong with my Launchpad how the GPIO pin is not working in I2C while working as normal I/O pin. I also wonder shall i connect external Pull up resistance to generate the I2C SCL ?
Thanks in advance
Sharif,
Could you please attach some pictures showing your hardware setup with the MSP430FR2355 LP connected to the LDC1614EVM with the required I2C pull-up resistors to VCC attached? In addition to the picture, a diagram of the setup with the oscilloscope connected to the boards would help me to visualize why you might not be seeing the clock on the SCL line.
Best regards,
Matt
Hello,
I have not heard back regarding this issue in over a week so I am going to assume the issue was resolved. If this was not the case please go ahead and comment back with more information regarding the current status.
Best regards,
Matt
**Attention** This is a public forum