cancel
Showing results for 
Search instead for 
Did you mean: 

Code Examples

Ashish2614
New Contributor II

In SPI_DMA example how queue works for multiple slaves in single node , unable to understand from documents of iLLD.@User16286 

0 Likes
6 Replies
AlenAn14
Moderator
Moderator

Hi @Ashish2614 ,

Can you please elaborate more on your query with regards to the IDE used (Modus Toolbox or PSoC Creator) and the code example referred from the same?

Can you also please clarify about what you meant by 'single node'?

And in case of the SPI slaves, are the same connected in a daisy chain or are you using separate SPI SCB blocks for each slave? 

It would also be helpful if you can mention the part number of the PSoC device you are  using.

Regards
Alen

0 Likes
Ashish2614
New Contributor II

Hi Alen , i am using Tc277 in which at QSPI0(single node) three slaves are connected and i need to implement Queue with DMA to recieve configuration and data and send response back , i didnt understand the example given finding the Queue Implementation.

i am using Aurix IDE example is SPI_DMA_1_KIT_TC275_LK , each slave has its own dedicated Chip select line 

0 Likes
cwunder
Employee

You will need to provide more explanation as to where your issue reside...
The QSPI has multiple modes of operation.

cwunder_2-1642272498638.png

cwunder_1-1642272232034.png

0 Likes
Ashish2614
New Contributor II

Hi Cwunder,

Infineon Library didnot  exaplianed how to implement Queue Part with help of DMA , with help of Ifx QSPI library i am able to understand how to used it for single Channel of a module but in run time switching of Channel is not clear and how Queue Part should be implement in code is not clear.

 

flow i want is 

Module Initialization 

Channel Initialization 

load configuration (how and what are the rules to load this Value )

load data (how and from where this data should be loaded  in point of queue Implementation)

Send data 

Get response in RX FIFO 

send this RX Fifo as per Queue.

 

and @cwunder  can you please provide any link to above image documenta as image is not clear 

Thanks 

0 Likes
cwunder
Employee

You have stated you want to run a SPI master with three slave device on three different chip selects. The next step  would be to determine what mode to operate the QSPI in based on the frame formats of the three slave devices you are communicating with. Based on this you would choose the mode to operate the QSPI in. Then you can setup your buffers for the DMA (with both the BACON and data).

The QSPI queue (FIFO) can hold four entries. You write the BACON and Data to the TX FIFO and you can have the DMA service the QSPI transmit and receive events. 

Ashish2614
New Contributor II

Thanks Cwunder again for your help and effort ,

By going through Ifx library i am clear till part you mentioned but i cant see how Queue will work in example code like how next part is loaded automatically with using of DMA. without CPU intervention.

 

So its something like that 

lets say i have QSPI 0 and QSPI 2 active 

In QSPI0  i have three slave device  Q01 ,Q02,Q03 and in QSPI 2 i have two Slave devices Q21, Q22 

now i have to create queue in such a away 

load configuration  for Q01 send data by filling TXFifo wait till you get response.

now move to next load  configuration 

load configuration  for Q02 send data by filling TXFifo wait till you get response.

now move to next load  configuration

load configuration  for Q03 send data by filling TXFifo wait till you get response.

now move to next load  configuration

load configuration  for Q21 send data by filling TXFifo wait till you get response.

now move to next load  configuration

load configuration  for Q22 send data by filling TXFifo wait till you get response.

now move to next load  configuration

Now again load the configuration for first QSPI slave device that is QSPI01.

0 Likes