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.
good day,guys!!
im working on i2c interface l3g4200 an msp430f2618 and got some problems :(
1.how the msp430 can read SAK bit from L3G4200
2.how the msp430 can transfer SDA+W(8bit),while the register UCBxI2CSA has only 7bit and 10bit working mode
3.how the msp430 can generate SR-signal to start reading a byte from L3G4200
plesea tell me if u know the ansers.thanks u all
here is my code,the result of x,y,x is always 0xE4E4 :(
Question 1 is related to the l3g4300 internal protocol. Its device datasheet should tell you.
Q2: the I2C start byte is composed of a 7 bit address and a trailing R/W bit.
The F2618 USCI takes the 7 bit slave address (right-justified, so 0 to 0x7f) in its slave address register, while the R/W bit is automatically added based on the (inverted) UCTR bit that defines the transaction direction.
When you set the TXSTT bit, then the USCI will generate a start condition, assemble the start byte form UCTR and slave address, and send it too. Don't send the slave address yourself. (well, in your read function, writing to TXBUF is a NOP anyway, as UCTR is clear)
There are nice diagrams in the users guide, explaining what happens when, and where you have to act and what is done automatically.
Q3: SR? Slave Ready? Start Reading? Spill Rice?
If this is a separate signal line, then you can connect it to a GPIO port of the MSP and handle it using standard GPIO port operations.
In your code, instead of checking the TXIFG and RXIFG status bits of the USCI hardware, you check for an external signal on P3. For what purpose? What does this signal do?
It also makes no sense reading RXBUF and setting UCTXNACK before the start byte has been sent. Again, see the diagrams in the users guide.
thanks for your help.I'll try again follow your answers.if i got other problems,could i ask u for helping?
**Attention** This is a public forum