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.

MIBSPI Support

Other Parts Discussed in Thread: HALCOGEN

Hi ,

I need to develop the SPI drivers for the TMS570 USB stick. My processor will interact with the HI3593 and HI6120 chips as master in SPI mode. I have gone through the SPI module in the TMS570 TRM. I have few doubts about choosing mode of SPI.

My main application will read and write the A429 lables for every 50ms time. So it would be better if the MIBSPI provides a buffer where i need to write the data to be sent and one more buffer where read to be read should be availbale. As per my understanding Multibuffer SPI can be used for this purpose.

I read that Multi buffer SPI is having better advantages that the compatible SPI mode. I have the intial driver code required as i am using the HALcogen generated code. But i am not sure how to configure the registers.

When i go through the corresponding registers, looks like i need to configure the TGx Control Registers. But what is the Trigger source and what is the Trigger event for my application ?

In compatibility mode, can i use the DMA for my purpose of writing into buffers with out CPU intervention ? Or  DMA can be used anly in Multi buffer mode ?

Please let me know how to proceed on this.

 

 

  • Hi Bindu Tanguturi,

    the MibSPI in compatibility mode acts exactly like a normal SPI peripheral, so DMA transfers from SPI to memory should be possible. The trigger source and event functionality adds additional timing features to the normal SPI mode. You can use external (GIOs) or internal signals (NHET, tick) to start a MibSPI group transfer. But if you want to have a standard SPI communication between uC and HI3593, HI6120 you can set the Trigger Event to "TRG_NEVER" and Trigger Source to "TRG_DISABLED" and use the standard API functions provided by the HALCoGen drivers, after configuring the MibSPI module for the communication with the mentioned devices.

    Best Regards,

    Gregor

  • Hi Gregor,

    As per your reply, without the need of any trigger event and source also, we can use the Mibspi. Is that my understanding correct ?

    I might have confused by asking about DMA also. I think i may not need DMA for my requirement.

    After i post this question, i have gone through the SPI module in the manual again. I have configure the HALCogen tool in the MibSPI. As we have 3 devices to communicate on the one SPI channel, we are using the NHET pins for the Chip selects. And we are also not using the SPIENA signal. Only 3 pins will be in the SPI mode.

    Would please explain me in detail about the operation of this module in Mibspi. How to configure the MibSPIRAM and what are the transfer groups ? And how the communciation happens between slave and this module ?

    I mean, the slave devices in my case requires Opcode before read or write. In the Normal SPI mode, i am sending command word (opcode) and then capturing the data or sending data in next clcokc cycle. I would like to know how this happens in the Multi buffer mode. From which location i should read (RxRAM) or which location i should write(Txram) ?

    I would like to know the operation of SPI using the MibSPIRAM and TG control registers.

    May thanks in advance.

  • Hello Bindu,

    the triggers are used to automatically (when an internal/external trigger event occurs) transmit data (transfer groups). You can transmit data without these triggers by using the APIs provided by HALCoGen => spiTransmit e.g..

    In HALCoGen => Help => Help Topics => Index => spi

     

    MibSPI has a programmable buffer memory with up to 128 receive and transmit buffers => MibSPI buffer RAM. These buffers are combined in transfer groups (up to 8 TGs, configurable in HALCoGen), which can, but do not necessarily need to be internally/externally triggered.

    The MibSPI Pin Timing Parameters can be found in the manual section 24.12. The difference in compare to a normal SPI communication is that you are using the MibSPI buffer RAM to store the data to transmit (Tx shift register) and the data you received (Rx shift register). By using the APIs you can set or get this data in/from buffer RAM.

    But I think in your case it would be easier to use the standard SPI interface or the MibSPI in compatibility mode. If you need to send an opcode and then waiting for the device to answer there is also the Transmission Lock functionality described in section 24.1.3 (but only for MibSPI mode).

    I hope this helps you to understand the MibSPI functionality.

    Best Regards,

    Gregor

  • Hi Gregor,

    In the standard SPI interface, CPU need to wait for each byte of Transmission or reception, which we want to avoid. So we would like to use the Multibuffer RAM feature.As per the TMS570 TRM manual MibSPI can be configured to function as Normal SPI (Compatibility(SPI) Mode Configuration) or Multibuffered SPI.

    But what do you mean by MibSPI in compatibility mode ?

    What is the significance of figure2 (can be replaced by spiTransmit) in the above reply ?

    If i can use the Multibuffer RAM for my requirement, my plan is to create 3 data formats and 3 Transfer Gropus as SPI is communicating with 3 devices. When the data will be Transmitted (rate of tx) from the Tx RAM ot received to the RxRAM ?

    Thanks.

  • Hi Bindu,

    what I meant with compatibility mode is what you mentioned in your third sentence "configure the MibSPI to function as normal SPI (Compatibility(SPI) Mode)".

    In figure 2 you can see an internally/externally triggered group transfer with the four buffers (B0-B3). I just wanted to make clear that if you do not want to use the automatic trigger function of MibSPI you can use the HALCoGen API function "spiTransfer" which you can call from your C code to start a transmit of a transfer group. This function e.g. is explained in the HALCoGen help menu, like you can see in the below picture.

     

    There is an equivalent function to retrieve the received data from the receive buffer RAM of MibSPI called "spiGetData". If you are not using the automatic trigger functionality of the MibSPI you can use these functions in your C code to realize the SPI communciation with your devices. The communication flow (when you send/receive data) depends on your program code and the behaviour/set up of the devices you are communicating with.

    Best Regards,

    Gregor

  • Hello Bindu,

    was the above answer helpful to understand the functionality of the MibSPI module and answered your orignially posted question?

    Best Regards,

    Gregor

  • Hi Gregor, Sorry for the late reply. I am on leave for the last week. I am not clear about the reason why i can not use the Tx/Rx RAM for my requirement. Please elaborate on the same. Thanks in advance. Bindu

  • Hello Bindu,

    I am not sure what you mean with "why I can not use the Tx/Rx RAM for my requirement". You can use the SPI in Multi-Buffer Mode with the Multi-Buffer RAM (TXRAM / RXRAM banks) if you would like to and if this fits your requirements. Please let me know whether this helped you to clearify your original posted questions.

    Best Regards,

    Gregor 

  • Hello Bindu,

    I saw that you opened another thread with similar content and it seems that this one was answered. So here is the link to the new post, just to have the connection between the two posts...

    Link:

    http://e2e.ti.com/support/microcontrollers/hercules/f/312/p/148402/536457.aspx#536457

    Best Regards,

    Gregor