Quantcast
Viewing all articles
Browse latest Browse all 17527

SPI EDMA ping-pong data receiving on the DSP side

 Hi All!

 I want to use SPI EDMA data receiving on the DSP side from external 8ch 16bit ADC. ADC indicates that data of one conversation is ready by the negative edge of BUSYpin. After the event from BUSY-pin EDMA should receive 16 bytes (8ch 16bit) of data and put it to the ping buffer. Ping/pong buffer has 128 samples of each channels (128*16*8/8 = 2048 samples).

When ping buffer is full EDMA should start to fill pong buffer, and data from the ping buffer should copy to third buffer(with increment). After pong buffer is full, EDMA should fill ping buffer and copy data from the pong buffer to third buffer(with increment). Third buffer is more large than ping and pong buffer and should be fill by the circle.

 My understanding how to realize it:

Initialize EDMA with shadow region 1 for interrupts. Ch7 as GPIO Bank1 Event and Ch18 as SPI1 Receive Event

For dummy SPI data transmission use Ch7 (GPIO1 Bank event) ParamSet with follow parameters:

         Use A-sync

         ACnt = 16; //2 bytes per channel

         BCnt = 128; // 1 time transmission

         CCnt = 1; // 1 time transmission

For real SPI data receiving I would use Ch18 ParamSet with follow parameters:

Use A-sync

         ACnt = 16; //2 bytes per channel

         BCnt = 128; // 1 time transmission

         CCnt = 1; // 1 time transmission

 When EDMA received all 2048 bytes EDMA interrupt is calling and reinitialize destination pointer(from ping to pong buffer and etc.) in the ISR.

 So, I planing to use two ParamSet (1 for receive dummy data and one for receive true data). 

 whether this is the best way for my objective? 


Viewing all articles
Browse latest Browse all 17527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>