Excellent series. Just to make the quick (and well explained already!) comment, that to use and test this I2C code one needs the I2C device attached to the launchpad. Otherwise, there will be no pull-up resistors implemented, and the lines will be indeterminate. Brock did explain this earlier really well. Thanks again Brock.
Ok, so today I learned that the slave register is tricky. The sensor I am writing to is a MAX30102 and is addressed with 0xAE for write and 0xAF for read. If I write UCBI2CSA = 0xAE the write will fail resulting in a frame showing start+2F+NACK. To make it work correctly you must either provide a binary value UCBI2CSA = 0b1010111 leaving out he LSB. Or perform binary shift right i.e. UCBI2CSA = 0xAE >> 1. Why it works this way I am not sure but even if I mask the UCBI2CSA register i.e. UCBI2CSA |= it still will not work. Only with the binary value or the shift right will it work and deliver to the right slave address. On my logic analyzer I there for see 0x57 as the slave address which really means 0xAE. I guess this is a compiler interpretation issue.
Thank you soo much Mr.LaMeres. Really.
Made it work with MSP430FR2476 and generic DS3231 RTC board.
I have been looking for these videos for like 5 years. Thank you!!!
Excellent series. Just to make the quick (and well explained already!) comment, that to use and test this I2C code one needs the I2C device attached to the launchpad. Otherwise, there will be no pull-up resistors implemented, and the lines will be indeterminate. Brock did explain this earlier really well. Thanks again Brock.
I recreated the example for another MSP and it worked fine! Thank you very much! Very well explained.
hey Rafela i'm trying to implement I2C communication between two msp432's i can't make it work. Can you please guide me on how to do it
hello Sir, Please make video on I2C communication with AT24C512
and MSP430FR2355
Tried the example. Worked great then attempted to build functions but struggle to get it to work.
Your example is not practical.
TI is zero help.
working on TI's microcontroller felt like a waste of time
Ok, so today I learned that the slave register is tricky. The sensor I am writing to is a MAX30102 and is addressed with 0xAE for write and 0xAF for read. If I write UCBI2CSA = 0xAE the write will fail resulting in a frame showing start+2F+NACK.
To make it work correctly you must either provide a binary value UCBI2CSA = 0b1010111 leaving out he LSB.
Or perform binary shift right i.e. UCBI2CSA = 0xAE >> 1.
Why it works this way I am not sure but even if I mask the UCBI2CSA register i.e. UCBI2CSA |= it still will not work.
Only with the binary value or the shift right will it work and deliver to the right slave address.
On my logic analyzer I there for see 0x57 as the slave address which really means 0xAE.
I guess this is a compiler interpretation issue.
still no ground. I guess it's grounded back through the computer