AnsweredAssumed Answered

21489 EZ Talkthrough Example Change Channels

Question asked by Mildocate on Jan 18, 2017
Latest reply on Jan 24, 2017 by Hfuhrhurr

Hej all,

 

I am working on the 21489 AD1939 C Block-Based Talkthru 192kHz Example.

I plugged in a microphone and headphones. Works nicely. Bottom row of J5 is connected and of course the headphones to J8.

So, I only need 1 ADC value, but I get 4 (thats what I think???).

My input arrays RxBlock_A0 and A1 consist of 16384 values, which is ok because I want 16k samples. But only 1 of 4 values are useful for me.

I think my input is filled by each of the ADCs. How can I change this?

 

I changed

NUM_RX_SLOTS and NUM_TX_SLOTS to 1,

NUM_SAMPLES to 16384

 

If I call the floatData function like that

 

floatData(testData, rxA_block_pointer[blockIndex]+2, 4, NUM_SAMPLES / 4);

 

the array testData (size 4096) looks perfect. But thats not a nice solution....

 

 

#include "ADDS_21489_EzKit.h"

 

unsigned int PCI = 0x00080000 ;
unsigned int OFFSET = 0x00080000 ;


section("seg_dmda") int RxBlock_A0[NUM_SAMPLES*NUM_RX_SLOTS];
section("seg_dmda") int RxBlock_A1[sizeof(RxBlock_A0)];


section("seg_dmda") int TxBlock_B0[NUM_SAMPLES*NUM_TX_SLOTS];
section("seg_dmda") int TxBlock_B1[sizeof(TxBlock_B0)];

 

 

int TCB_RxBlock_A0[4] = { 0, sizeof(RxBlock_A0), 1, 0};
int TCB_RxBlock_A1[4] = { 0, sizeof(RxBlock_A0), 1, 0};

int TCB_TxBlock_B0[4] = { 0, sizeof(TxBlock_B0), 1, 0};
int TCB_TxBlock_B1[4] = { 0, sizeof(TxBlock_B0), 1, 0};


void InitSPORT()
{


TCB_RxBlock_A0[0] = (unsigned int) TCB_RxBlock_A1 + 3 - OFFSET + PCI ;
TCB_RxBlock_A0[3] = (int) RxBlock_A0 - OFFSET ;

 

TCB_TxBlock_B0[0] = (unsigned int) TCB_TxBlock_B1 + 3 - OFFSET ;
TCB_TxBlock_B0[3] = (int) TxBlock_B0 - OFFSET ;


TCB_RxBlock_A1[0] = (unsigned int) TCB_RxBlock_A0 + 3 - OFFSET + PCI ;
TCB_RxBlock_A1[3] = (int) RxBlock_A1 - OFFSET ;

 

TCB_TxBlock_B1[0] = (unsigned int) TCB_TxBlock_B0 + 3 - OFFSET ;
TCB_TxBlock_B1[3] = (int) TxBlock_B1 - OFFSET ;


*pSPMCTL0 = 0;
*pSPMCTL1 = 0;
*pSPCTL0 = 0;
*pSPCTL1 = 0;

 

*pDIV0 = 0x00000000; // Transmitter (SPORT0)
*pDIV1 = 0x00000000; // Receiver (SPORT1) at 12.288 MHz SCLK and 48 kHz sample rate

 

*pCPSP0B = (unsigned int)TCB_TxBlock_B0 - OFFSET + 3;
*pCPSP1A = (unsigned int)TCB_RxBlock_A0 - OFFSET + 3;

 

*pSPCTL1 = SCHEN_A | SDEN_A | SLEN32;

 

*pSPCTL0 = SCHEN_B | SDEN_B | SCHEN_A | SDEN_A | SPTRAN | SLEN32;


*pSP1CS0 = 0x0000000f; // Set to receive on channel 0-3 on SPORT1 A
*pSP0CS0 = 0x0000000f; // Set to transmit on channel 0-3 on SPORT0 A/B


*pMR1CCS0 = *pMT0CCS0 = 0;


*pSPMCTL0 = NCH3 | MFD1;
*pSPMCTL1 = NCH3 | MFD1;

 

*pSPMCTL0 |= MCEB | MCEA;
*pSPMCTL1 |= MCEA;
}

Outcomes