Other Parts Discussed in Thread: ADS8694, C2000WARE
Dear people,
please, it would be great if somebody could give me advise on this:
I am trying to communicate with a ADS8694 4 channels 18bit ADC via Spi, controlled by a TMS320F28379D Launchpad.
Tha software is an adaptation of the Example_2837xD_Spi_dma.c (C2000Ware_1_00_05_00)
Using the loopback setting, everything goes well. But on "real life", all what I get is ones on the SDO line, it doesn't matter, what I send to the ADC.
All the signals are working as expected, the only thing I changed was the pins for the different lines of the Spi.
I am using following configuration:
void InitSpi(void)
{
SpiaRegs.SPICCR.bit.SPISWRESET = 0;
SpiaRegs.SPICCR.bit.CLKPOLARITY = 0;
SpiaRegs.SPICCR.bit.SPICHAR = (16-1);
SpiaRegs.SPICCR.bit.SPILBK = 0;
SpiaRegs.SPICTL.bit.MASTER_SLAVE = 1;
SpiaRegs.SPICTL.bit.TALK = 1;
SpiaRegs.SPICTL.bit.CLK_PHASE = 0;
SpiaRegs.SPICTL.bit.SPIINTENA = 0;
SpiaRegs.SPIBRR.bit.SPI_BIT_RATE = SPIA_BRR;
SpiaRegs.SPIPRI.bit.FREE = 1;
SpiaRegs.SPICCR.bit.SPISWRESET = 1;
}
void InitSpiaGpio()
{
EALLOW;
GpioCtrlRegs.GPBPUD.bit.GPIO58 = 0; // Enable pull-up on GPIO58 (SPISIMOA)
GpioCtrlRegs.GPBPUD.bit.GPIO59 = 0; // Enable pull-up on GPIO59 (SPISOMIA)
GpioCtrlRegs.GPBPUD.bit.GPIO60 = 0; // Enable pull-up on GPIO60 (SPICLKA)
GpioCtrlRegs.GPBPUD.bit.GPIO61 = 0; // Enable pull-up on GPIO61 (SPISTEA)
GpioCtrlRegs.GPDPUD.bit.GPIO111 = 0; // Enable pull-up on GPIO111 (RST)
GpioCtrlRegs.GPBQSEL2.bit.GPIO58 = 3; // Asynch input GPIO58 (SPISIMOA)
GpioCtrlRegs.GPBQSEL2.bit.GPIO59 = 3; // Asynch input GPIO59 (SPISOMIA)
GpioCtrlRegs.GPBQSEL2.bit.GPIO60 = 3; // Asynch input GPIO60 (SPICLKA)
GpioCtrlRegs.GPBQSEL2.bit.GPIO61 = 3; // Asynch input GPIO61 (SPISTEA)
GpioCtrlRegs.GPBGMUX2.bit.GPIO58 = 3; // Configure GPIO58 as SPISIMOA
GpioCtrlRegs.GPBGMUX2.bit.GPIO59 = 3; // Configure GPIO59 as SPISOMIA
GpioCtrlRegs.GPBGMUX2.bit.GPIO60 = 3; // Configure GPIO60 as SPICLKA
GpioCtrlRegs.GPBGMUX2.bit.GPIO61 = 3; // Configure GPIO61 as SPISTEA
GpioCtrlRegs.GPBMUX2.bit.GPIO58 = 3; // Configure GPIO58 as SPISIMOA
GpioCtrlRegs.GPBMUX2.bit.GPIO59 = 3; // Configure GPIO59 as SPISOMIA
GpioCtrlRegs.GPBMUX2.bit.GPIO60 = 3; // Configure GPIO60 as SPICLKA
GpioCtrlRegs.GPBMUX2.bit.GPIO61 = 3; // Configure GPIO61 as SPISTEA
GpioCtrlRegs.GPDGMUX1.bit.GPIO111 = 0; // GPIO111 = GPIO111 - This is for the Hardware-Reset-pin of the ADS8694
GpioCtrlRegs.GPDMUX1.bit.GPIO111 = 0; // GPIO111 = GPIO111
GpioCtrlRegs.GPDDIR.bit.GPIO111 = 1; // configure GPIO111 as OUTPUT
GpioDataRegs.GPDSET.bit.GPIO111 = 1; // Set GPIO111 HIGH !!!! to activate ADS8694
EDIS;
}
My settings for Dma are:
#define BURST 7
#define TRANSFER 4
#define FIFO_LVL 8
And I am sending Data like this:
Uint16 sdata0[36] = { 1,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; // this is an example of command.
My rdata[] array looks exacly as the sdata[] array on the loopback modus, but if I set SpiaRegs.SPICCR.bit.SPILBK = 0 , the rdata looks like { 65535,65535,65535 etc....... }
What am I doing wrong, besides being already desperate?
with my best regards,
Gustavo