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.

RM48L952: SPI ENA functionality/documentation problem

Part Number: RM48L952
Other Parts Discussed in Thread: HALCOGEN

First post on this this forum, thanks for your help.

I have a problem trying to setup the ENA pin functionality.

My HW setup is:

  • RM48 Evaluation board
  • wire connection on read pad 
    • SPI1 CLK <> SPI3 CLK
    • SPI1 SOMI <> SPI3 SOMI
    • SPI1 SIMO <> SPI3 SIMO
    • SPI1 ENA <> SPI3 ENA
    • SPI1  CS0 <> SPI3 CS0

I have a simple project build with halcogen and I'm able to communicate in "Three-Pin Mode" (No care on ENA and CS) using SPI in compatibility mode to transfer one 16-bit word from SPI1 (master) to SPI3 (slave) in polling mode. 

Now I want to do a step forward and use the ENA pin (no care on CS).

I set it as functional in halcogen to both SPI1 and SPI3 and enabled in the data format 0 of SPI1 "wait for enable". Now SPI1 waits for ENA, but SPI3 never pulls down ENA (I see it on oscilloscope) and the communication never takes place, SPI1 never drives the CLK. The master side (SPI1) seems ok because if i turn SPI3 ENA as GPIO and I pull it down manually, the communication takes place.

I even tried to write something in SPI3->DAT0, because I thought that It was waiting to have something ready in TX, but nothing changed.

Do you see anything wrong in my setup? Do you see any pitfall in this layout?

In this foggy situation I have two more doubts on documentation studying the TRM SPNU503B:

  • in Table 24-1, in slave mode column it says if SPI ENA enabled "Receives ENA from the external master". My understanding is that in this case ENA is an output in slave mode as said in "24.2.4 Operation with SPIENA". 
  • in Table 24-9, in CLKMOD row, it says that for value 1 (and I set 1 for SPI1 to make it master), the SPI ENA is an output. My understanding is that it is an input in this case

Thanks

  • Hello Valerio,

    You said you don't use CS signal in you 3-pin mode and 5-pin mode. To use five pin mode (CLK, SIMO, SOMI, CS, and ENA), both the SPIENA and SPICS must be configured as functional pins.

    Regards,
    QJ
  • Hello QJ,
    thanks for the answer.
    My hardware connections are 5pin but for the moment I'm trying 4pins (CLK,SIMO,SOMI and ENA).
    Anyway I have solved. The problem was that SOMI was not set as functional. I did that because I'm implementing an unidirectional communication (don't care about data from slave) between two RM48. I doesn't seem obvious to me that there is a relation between ENA and SOMI.
    Could you please answer to my questions on documentation?

    Let me try a step forward. I'm implementing something similar to application note SPNA231 (High Speed Serial Bus Using the MibSPIP Module). For what I understand ENA means more "I'm ready to transmit another word" instead of "OK, I have read the last word". This means that even if I don't care about slave transmission, I have to feed the slave SPI with dummy data. I plan to feed this data from MIB buffers or by hooking RX and TX to two DMA channels.
    My question is: what guarantees that RX is serviced before the TX? My fear is that TX is fed before BUF is read, and when TX is fed ENA goes low and data in reception are lost.
    Can someone clarify what mechanism guarantees the priority between the two steps (reception and then dummy transmission), how can I be sure to preserve data reception when using ENA?

    Thanks!
  • Any answer? Primarily on the priority doubt...

    Does the SPI machine somehow guarantees a priority between reception and transmission when I'm working without CPU intervention? (For example a DMA channel for reception and a DMA channel for transmission with potentially different wait timings)

  • What should I consider?

    1. Question is stupid
    2. Question has no answer

    anyway let me now please!

    Thanks

  • Valerio,

    Sorry for the delay in response. Its a good question actually.

    The MibSPI has a buffer mode option that allows you to specify whether you want to wait for the TX buffer to be serviced, the RX buffer, or both.
    This is useful in case you only want to transmit and throw away receive data, or vice versa.

    The SPI though relies on DMA channel priority RX being higher than TX in order to make sure they occur in the correct order. This starts to get a little dangerous on devices like the LC4357 where the DMA has now two transfer units so I would prefer you use the Buffer Mode of MibSPI on a device like that to control the sequencing.
  • Hi Anthony!
    Thanks for clarifying this point to me. So I must handle priority on DMA side, it makes sense, I will try.