Code: Select all
#define ADCSPI 1
#define dspiBaudRateADC 70000000
#define transferSizeBitsADC 24
#define CSPolarityIdleADC 0x0E //Chip select polarity at idle
//DAC Idle High 0x0F
//ADC Idle Low 0x0E
#define DACSPI 2
#define dspiBaudRateDAC 25000000
#define transferSizeBitsDAC 8
#define CSPolarityIdleDAC 0x0F//Chip select polarity at idle
//DAC Idle High 0x0F
//ADC Idle Low 0x0E
Code: Select all
J2[25].function(1);//SPI1 clock ADC
J2[27].function(1);//SPI1 Input ADC
J2[28].function(1);//SPI1 Out ADC
J2[30].function(1);//SPI1 chip select 0 ADC
J2[29].function(1);//SPI2 clock DAC
J2[3].function(1);//SPI2 Input DAC
J2[4].function(1);//SPI2 Out DAC
J2[38].function(1);//SPI2 chip select 0 DAC
DSPIInit(ADCSPI,dspiBaudRateADC,transferSizeBitsADC,0x0E,
CSPolarityIdleADC,0,1,1,100,1);
DSPIInit(DACSPI,dspiBaudRateDAC,transferSizeBitsDAC,0,
CSPolarityIdleDAC,0,1,1,0,0);
Code: Select all
namespace ADCTable
{
static const int size = 3000000;
static volatile uint8_t __attribute__ ((aligned(2))) table[size*3] = { 0 }; //samples * 3 bytes each
static double timeTable[size] = { 0 };
}
http://www.ti.com.cn/cn/lit/ds/sbas547c/sbas547c.pdf
Now on with my question/issue.
My issue is using the DMA engine to control a very long, continuous transfer- about 3 million bytes. Using the following DSPIStart call,
Code: Select all
DSPIStart(ADCSPI,NULL,ADCTable::table,ADCTable::size*3,&spiSemADC,true,DEASSERT_EVERY_TRANSFER)
The current solution is using strictly interrupts to drive the SPI peripheral
Code: Select all
for(i = 0; i < ADCTable::size; i++)
{
DSPIStart(ADCSPI,NULL,&ADCTable::table[i*3],3,&spiSemADC, false ,1);
OSSemPend(&spiSemADC, 0);
}
My question is, is there something I am doing obviously wrong, or is the DMA driver not capable of what I described?
If I need to, I can post scope pictures at a later point.
Thank you,
-Matt