You are here

Simultaneous SPI DMA not working. | Cypress Semiconductor

Simultaneous SPI DMA not working.

Summary: 8 Replies, Latest post by Bob Marlowe on 27 Nov 2013 06:01 AM PST
Verified Answers: 0
Last post
Log in to post new comments.
Rocketmagnet's picture
User
159 posts

 I have a PSoC3666 project containing 4 identical SPI Master components. Each is fed by it's own TX and RX DMAs.

I can get one of these units working on its own by enabling its DMA channels. But when I try to enable the DMA channels of the other three SPI components, the first one breaks.

 

    CyDmaChSetInitialTd_FAST(SPI_TxChannel[0], SPI_TxTD[0]);

    CyDmaChSetInitialTd_FAST(SPI_RxChannel[0], SPI_RxTD[0]);

    CyDmaChEnable_FAST(SPI_RxChannel[0]);

    CyDmaChEnable_FAST(SPI_TxChannel[0]);               // This works on its own.

    

    CyDmaChSetInitialTd_FAST(SPI_TxChannel[1], SPI_TxTD[1]);

    CyDmaChSetInitialTd_FAST(SPI_RxChannel[1], SPI_RxTD[1]);

 

    CyDmaChEnable_FAST(SPI_RxChannel[1]);

    CyDmaChEnable_FAST(SPI_TxChannel[1]);               // But when I add this, it all stops working.

 
Is there some reason enabling a second DMA would affect the first one?
 
Hugo
 
Rocketmagnet's picture
User
159 posts

 Yup, found out why. Already.

 

The DMA doesn't like it if you enable it with the Transfer Count set to zero.

 

Hugo

 

hli
user_78878863's picture
User
2759 posts

Writing down a problem sometimes helps with understanding what one tries to achive- and to see the difference to what one did... So don't hesitate to ask and then answer your own question.

I know of places where one is forced to explain a problem to a teddy bear first, before being allowed to ask a co-worker. Solves about 50% of all questions :)

H L
user_460349's picture
User
1362 posts

In that case they should get 2 teddy bears, 100% of problems would be fixed...

hli
user_78878863's picture
User
2759 posts

Statistics101 says otherwise...

user_1377889's picture
User
10803 posts

@HL

Poor math!! With 2 teddybears you'll get 75% solved, not more.

 

Bob

H L
user_460349's picture
User
1362 posts

If you tell the the 2nd bear about the 50% unsolved problem, that would become 75% max.

But if you tell the 2nd bear 100% of the problem, than it is possible you get 100%.
Rocketmagnet's picture
User
159 posts

 Thanks Hli,

 

Yes, we often use that method at work. Just grab someone and ask them for help, then while explaining the problem, say "Oh, I worked it out now. Thanks you were a great help".

 

Hugo

 

user_1377889's picture
User
10803 posts

@HL

So you think that when you tell the 2nd bear all the problems including those you've already solved (by telling them to the first bear) you are going to get a better result than when talking about the unsolved problems only? Turns out to be an interesting statistical problem, but I still question your math.

 

Bob

Log in to post new comments.