Because of the Thanksgiving holiday in the U.S., TI E2E™ design support forum responses may be delayed from November 25 through December 2. Thank you for your patience.

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.

MSP430G2553: SPI bus communication

Part Number: MSP430G2553
Other Parts Discussed in Thread: DAC161S997, ADS1220, , ADS1120, MSP430G2955, ENERGIA

Hello everyone,

I'm working on a project in which i'm using the MSP430G2553 MCU, ADS1220, and DAC161S997. I have developed a library for each device and made it work, the problem is when i put them on the same SPI bus they start to behave abnormally and some times they don't respond at all (i know that each device has a different SPI mode and the switching is taken care in the library). Does anyone know this problem or any idea about the solution.

Thank you in advance. 

  • Hello Manai,

    How are you controlling the CS pins? Only one SPI slave device should be active at any given time and this is controlled through separate chip select pins. I would recommend that you use the USCI in 3-pin mode and control the CS pins manually via a GPIO. It would be helpful if you could provide oscilloscope or logic analyzer screenshots of your communication lines.

    Regards,
    Ryan
  • Hi Manai!

    I use almost the same here in various projects - DAC161S997 and ADS1120 on one SPI bus of a MSP430G2955. It works perfectly. You figured out the most important thing: Switching the SPI modes. As Ryan said, the STE cannot be used with multiple slaves and you have to use a dedicated CS for each device controlled by your software.

    So at least I can tell you that it works in general. If you still have problems you could maybe post some code.

    Dennis

  • Thank you Dennis and Ryan for your replay.

    for the CS part i'm actually using the software solution through a dedicated GPIO pin for each device not the STE and yet still no good results. Here two functions from each library that write a value to given register. the other functions are developed on the same principle (mainly the write and the read functions).

    Thank you.

  • Do those functions ensure the byte has been transmitted completely? I don't know them, so I have no idea about their working principle. I'm asking because writing something to the TX buffer does not mean the byte has been transmitted yet. And if there is 1µs delay, it might still not be, depending on your SPI clock. Maybe you're raising CS too early?
  • these are functions that i developed and they work fine for each device separately but the problem is when i put them on the same bus. These functions are based on the SPI library of the Energia framework and as i said it works fine for each device.
  • Then did you check if there isn't something wrong with your CS lines? Maybe one isn't driven high and therefore one of the slave is active and controls the MISO line all the time? Some slaves do work with CS tied low permanently, so when testing with only one slave this issue might not be seen.
  • i checked the CS lines and they are OK. I wander if you can tell me how you make them work on the same bus or the part of code that handle the switching, of course if you don't mind.

**Attention** This is a public forum