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.

Interfacing MSP430F169 with AD7150

Other Parts Discussed in Thread: MSP430F169

 

Hello

For my student project, I need to interface MSP430F169 with the Capacitance to Digital Converter AD7150 from Analog Devices, Inc.

I have been having problems understanding how to write the code in C for the I2C communication between the two.

Basically, I need to 

1. Configure the AD7150 chip by writing to its internal registers

2. Read from the AD7150 data register, the data value obtained after conversion

3. This happens periodically with the Timer and an interrupt routine

Could anyone give me any source of general or specific code examples (I2C read and write Operations on a Slave Device) on how to do this! 

It would be really great, if I could get some help.

Thank you so much

  • There have been LOTS of I2C-related threads recently.
    And the board has a search function.
    It should provide enough information for implementing an I2C connection. (I know it will - I wrote a large part of the I2C discussion traffic in the last weeks)

    And I'll doubt you'll find much AD7150 specific help here. The device datasheet should tell you what data to send and what answers to expect.

  •  

    Thank you so much for your time and reply! 

    I actually did that before posting my question. 

    I forgot to mention that all the threads I have seen are concerned with USCI and not UART which I need. Very few are.

    Nonetheless, I will try my best to find a way through it.

    Thank you once again.

  • shake4990 said:
    I forgot to mention that all the threads I have seen are concerned with USCI and not UART which I need.

    Sorry, I didn't notice the F169 requirement.

    Indeed, the USART is different form the USCI. I used the 169 and SPI myself (actually the 1611 in production, but started with 169 there), and I found the I2C part of the USART to be too complex and 'high-level' for most applicaitons. If you want to read large chunks of data (such as from an EEPROM or so), it might be useful, but for small, short transfers with changing direction, it is way too complex to be of any use. I implemented my own I2C with bit-banging code (direct manipulation of GPIO port pins) and found it much easier.

    This approach will be busy-waiting, but for short transfers, implementing an ISR mechanism is massive overkill even if you had an USCI module. Most people use I2C in busy-waiting mode on the USCI too, just that the actual start/stop condition logic and data bit banging is done in hardware there.

    The I2C hardware protocol logic is nicely described in the users guides (check the 2x or 5x family users guide too, USCI section. The low-level signals are the same for any I2C implementation)

**Attention** This is a public forum