AnsweredAssumed Answered

21489 SPORT Receive from ADC doenst work

Question asked by Mildocate on May 4, 2017
Latest reply on Jun 1, 2017 by Jithul_Janardhanan

Hi all,

 

I am working with the ADSP 21489.

I have an ADC connected as follows

ADC Out -> DAI 5 -> SPORT 1A

 

I am using the DSP PCG and it generates a SCLK of ~6MHz and Frame Sync of 105kHz.

 

I want:

DSP sends out FrameSync, ADC gives data to the DSP. The DSP has 2 pingPong Buffers each of size 16384 = 2^14. When the first buffer is full, it changes to the second buffer and so on.

 

Problem:

Settings doesnt work. Please give me some advices.

 

Here my Init Code

------------------------------------------------------------

SRU(HIGH, PBEN07_I); // Serial Clock
SRU(HIGH, PBEN15_I); // Test Pin für SCLK
SRU(HIGH, PBEN08_I); // FS

*pPCG_CTLA1 = 4 | 0xC00000 | (1 << 20);
*pPCG_CTLA0 = 238 | ENFSA | ENCLKA;
*pPCG_PW1 = 2;

SRU(PCG_CLKA_O, DAI_PB07_I);
SRU(PCG_CLKA_O, DAI_PB15_I);

SRU(DAI_PB07_O, SPORT1_CLK_I); 

SRU(DAI_PB08_O, SPORT1_FS_I);

SRU(DAI_PB05_O, SPORT1_DA_I);
SRU(PCG_FSA_O, DAI_PB08_I);

-----------------------------------------------------------

 

#include "ADDS_21489_EzKit.h"

 

// SPORT RX DMA destination buffers
extern int pingPong_0[];
extern int pingPong_1[];

 

//Set up the TCBs to rotate automatically
int TCB_RxBlock_A0[4] = { 0, 0x0004000, 1, 0};
int TCB_RxBlock_A1[4] = { 0, 0x0004000, 1, 0};


void InitSPORT()
{

// Set up "ping-pong" chained DMAs
//Proceed from Block A0 to Block A1
TCB_RxBlock_A0[0] = 0x000e3fff; // Last Index in PingPong 1
TCB_RxBlock_A0[3] = (int) pingPong_0 ; 


//Proceed from Block A1 to Block A0
TCB_RxBlock_A1[0] = 0x000c7fff; // Last Index in PingPong 0
TCB_RxBlock_A1[3] = (int) pingPong_1 ;


//Clear out SPORT 0/1 registers
*pSPMCTL1 = 0;
*pSPCTL1 = 0;
*pCPSP1A = 0;

/////////////////////////////////////////////////////////////////////////////////////
// Analog Input and output setup
/////////////////////////////////////////////////////////////////////////////////////

// External clock and frame syncs generated
*pDIV1 = 0x0;

 

// Enabling DMA Chaining for SPORT1 RX
// Block 1 will be filled first


*pCPSP1A = (int)pingPong_1;

 

*pSPCTL1 = SPEN_A|SLEN32|SDEN_A|SCHEN_A;

// sport1 receive
*pSP1CS0 = 0x00000001; // Set to receive on channel 0-3 on SPORT1

*pMR1CCS0 = 0;


*pSPMCTL1 = 0;
}

Outcomes