MOD54415 DSPI CS Assertion
Posted: Wed Apr 08, 2015 7:18 am
//Setup Code Below
ADCTable, used to store raw ADC Data
The ADC I am communicating with is an ADS8881. Chip Select tied to CONVST.
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,
I can see on my scope that the clock and chip select are asserted in the correct directions, but the chip select is not De-asserted every 24 bits like I have requested. It will only assert at the beginning, and de-assert at the end of the transfer.
The current solution is using strictly interrupts to drive the SPI peripheral
This solution correctly asserts chip select every 24 bits and data that comes back is correct. However, this is not the solution I want because I need to be able to complete other tasks and communicate with other devices on other DSPI buses, specifically a DAC.
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
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