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.

CCS: Some issues about TMS320F28027F SPI with multiple slaves

Other Parts Discussed in Thread: TMS320F28027F, C2000WARE, TMS320F28027

Tool/software: Code Composer Studio

Hello, TI employees or users!

I have some issues for dealing with "TMS320F28027F". I want to design SPI with 2 different slaves using the controller. 

One is for measuring voltage of the switch which is designed already(slave 1). V_switch will be converted to digital value inside of slave 1. In other words, the data which will communicate with controller is digital value.  The other slave is controlling input voltage of water pump.(slave 2) 

Basically, I want to design active cooling power converter. So, I will control the flow rate of the pump according to the measured V_switch.

Once V_switch exceeds our requirement, we want to increase input voltage for water pump so that flow rate will increase. As a result, switch voltage will be decreased again. Ultimately, v_switch will stay in the required range.  This is my goal of the project.

So, here are my issues. 

1. Chip Select

As far as I know, chip select signal enables each slave to communicate separately. That is,  slave 2 doesn't work while slave 1 is communicating with master, right?

However, my slave 2 should work according to the measured v_switch, which means I have to enable both slave 1 and 2 to communicate with master at the same time.

So, could you give me an insight for fixing my issue if you have?

2. MOSI, MISO

I am still confusing these two signals. I can understand the definition but not perfectly clear so far. With respect to communication between master and slave 1 in my case, MOSI should be signal which enables ADC to work and MISO should be the read data.  Is this done by automatically if I put correct signals for ADC of slave 1? 

Besides, MOSI should be the pulse to order ADC work.. How can I generate this signal? I thought that I could use one of PWM signal but this pulse has different high and low time period whereas PWM has equal value. 

3. SPISTE 

SPISTE stands for 'Slave-Transmission-Enable' so I understood this signal as CS1. Is this correct idea? 

If do, how can I make CS2 for Slave2?  

 

Thanks for reading my issues. This is my first time to design the interface and it is new world for me to be honest. 

I will really appreciate for your any comments and forgive me if my questions are stupid.  Thanks again,Sirs!

  • Changbum,

    1./3. The SPI chip select (i.e. SPISTE, CS, CS0, CS1, etc) is a signal that will enable the Slave device to be able to communicate. As the master, the SPI will drive this signal when data is being transmitted. On the slave side, the CS signal will enable the Slave to transmit its data on the clock edges it receives from the master.

    In a Multi-slave configuration, the SPI can ONLY communicate with a single slave at a time. This can be managed by using a GPIO on the master to individually select and control the CS line. for Two slaves, the signals required will be SPICLK, SPISOMI, SPISIMO, CS0, and CS1.

    2. The naming of these signals describes the direction of the data. They are reused on the module for both master and slave mode. The MOSI (SIMO as we say) is named as an acronym for what it stands for, Master Out, Slave In. So it is an output driven by the Master, to the slave, who takes it as an input. The same conditions are true in slave mode, it will be the data input from the master. The reverse is true for the the SOMI- -Slave Out, Master In.

    Please reference the Device User Guide (www.ti.com/.../sprug71) for this information. Also, we provide example code in C2000Ware. I hope that you have run through these. They should give you a basic understanding of how the SPI works on C2000 as far as setting up the interrupts, sending and receiving data, and managing the FIFOs.

    In an application sense, you can do what you are looking to do, but your data will not be "parallel". You will need to access your sensor and your control individually, but it can be done with one SPI.

    Thanks,
    Mark
  • Hello, Mark! 

    First of all, I sincerely appreciate for your kind comment! Your clear description made me understand well :)) Thanks again!

    Here are still some further questions.

    As far as I know, there is no pin which indicates for CS in case of TMS320F28027. Thus, only SPISTE pin can be used for CS which is limited to use only 2 slaves.

    Low signal for slave 1 and high signal for slave 2.

    I can operate two slaves by using SPISTE signal of course but I want to add one more function between slave 2 and master based on the information of slave 1.

    As mentioned, my project is varying flow rate of water pump only if measured voltage by adc(slave 1) exceeds our reference value. 

    For example, if adc is activated when SPISTE signal is low, power supply(slave 2) will be activated at high signal of SPISTE!

    When SPISTE is high, I can give signal to slave 2(Power supply). Unfortunately, power supply will be reacted when input signal is analog. Thus, dc voltage to power supply will be implemented by converting digital signal to analog using PWM technique. In overall, when SPISTE is high, analog input voltage 3.3V will be given to power supply and it will convert 3.3V to 15V. This will feed water pump.

    However, input voltage should be increased if measured voltage exceeds reference value e.g from 3.3V to 5V and this is essentially my issue.

    My idea is designing extra amplifier circuit to amplify input voltage up to 5V. Hence, GPIO 0 pin will have 3.3V analog signal and another GPIO 2 pin will have 5V signal.

    "When measured voltage is below reference value, GPIO 0 will be reflected to slave 2 whereas GPIO 2 when it exceeds reference. ". 

    However..... how can I make slave2 will reflect this concept? Slave 2 will only react when SPISTE is high and this is already used for GPIO 0....

    But it should change its pin automatically.... 

    Could you give me any advice to validate this? 

    P.S)  My project goal is to operate Water pump with SPI through "only Simulink models". But if it is impossible, I can also use SCI coding as well. 

    So any suggestion will be really helpful for me.

    Thanks for reading my problems, Sir! 

    Sincerely from

    Changbum,Son