This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28379D: ADS8694 spi code on LAUNCHXL-F28379D

Part Number: TMS320F28379D
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       

  • Hi Gustavo,

    I think the GPIO Mux setting look correct.

    Do you see any activity on any of the SPI pins if you view them with an oscilloscope? What if you switch the mux settings to '0' and set the direction to '1' and then toggle the GPIO by manipulating the GPDAT registers in the expressions window? If you can see the pin toggle this will at least verify you have the right launchpad pins.

    You might also want to examine the contents of the SpiaRegs in the expressions window after your code runs; this will validate that everything is configured as expected.

    I can't help you much further with the SPI specifically; expect a SPI expert to get back to you sometime Monday.
  • Hi Devin, thanks for your answer.
    I just discovered that no pin was working as it should. Everything dead!

    The reason is, I am using the pins reserved for High Speed mode.
    Although in the 7.7 GPIO and Peripheral Muxing pag 842 of TMS320F2837xD_TechnicalReference_spruhm8f is said,
    those pins sare also available for normal speed.

    What is not said, is that you need to configure SpiaRegs.SPICCR.bit.HS_MODE = 0; , also if you do not use high speed mode, in order to let them work.

    The examples are using other pins, so this setting is not needed. Maybe it would be good to update this information in the manual...

    Anyway, I now have some of the pins working. Others not. Maybe one day I will discover the reason. ;)

    I go further, while I wait for the spi expert. If I manage to get it working, I will post it here.
    Thanks again!

  • Gustavo,

    SPI initialization code settings does look right. No issues there.

    As Devin suggested, were you able to get GPIO58-61 working as GPIO output pins? Your message sounded as if you found some success. But, it is not clear.

    Regards,
    Manoj
  • Hi Manoj, thanks for your quick response.

    I continue to struggle with it, saddly.

    As I don't know, if the ADC is working (no reaction whatsoever), I decided to make a kind of brute force program to try communication avoiding most of the spi features and fifo and dma alltoghether.

    It works, so far, and I get the right bits back, when I use the loopback mode.

    But the ADC does not reacts. I have tested this with 2 diffent chips.

    Please, could you find somebody in Ti, who can help me with this particular ADC ( ADS8694 4 channels 18bit )? My prototype board is already made and if I cannot communicate with the chip, everything is to be designed again :(

    I cannot find errors in the board. I used two different boards to test the chips. They are connected as recommended in the datasheet, all the signals are there...

    I attach the two relevant files I am using. They fit in the example spi loopback from C2000Ware_1_00_05_00

    Thakks a lot!

    Gustavo

    0410.TEST_BruteForceSpi.c
    #include "F28x_Project.h"     
    
    // Function Prototypes
    void delay_loop(void);
    void initManualSpi(void);
    void ADS8694_CMD(Uint16 a);
    void WriteReadConfigADC18(Uint16 a);
    void error();
    void my_checkpoint(Uint32 z);
    
    Uint16 Cmd0,Cmd1,Cmd2,Cmd3,Cmd4,Cmd5;
    Uint16 r,a,i,z,checkpointValue;
    Uint32 rdataADC;
    
    void main(void)
    {
        // Initialize GPIO
        InitGpio(); 
    
        // Clear all interrupts and initialize PIE vector table
        DINT;
        InitPieCtrl();
    
        IER = 0x0000;
        IFR = 0x0000;
    
        InitPieVectTable();
    
        initManualSpi();												// This function uses the spi pins to imitate it
    
        Cmd0 = 0b1000010100000000; 										// Reset program registers (RST) (10000101 00000000)
        Cmd1 = 0b1100000000000000; 										// Manual Channel n Select (MAN_Ch_0) (11000000 00000000)
        Cmd2 = 0b0000000000000000; 										// continue with last config (00000000 00000000)
        Cmd3 = 0b0000101000000000;										// READ range channel 0	(0000101 0 00000000)
        Cmd4 = 0b0000101100000000;										// WRITE Channel 0 Input Range. I need 0x0110 (0000101 0 00000000)
    
        Cmd5 = 0b1000001011010011;										// 0b1000001011010011 This was for testing in loopback mode if everything comes back as wished
    
    
        //Uncomment only what is to be sent to the ADC
    
        //	ADS8694_CMD(Cmd0);											//	Reset program registers
        WriteReadConfigADC18(Cmd4);										// WRITE Range Ch0 (MAN_Ch_0)
        WriteReadConfigADC18(Cmd3);										// READ Range Ch0 (MAN_Ch_0)
        //	ADS8694_CMD(Cmd1);											// Manual Channel n Select (MAN_Ch_0)
        //	ADS8694_CMD(Cmd2);											// continue with last config
    
        /*	continue to convert forever
       for (;;) 
        {
        	ADS8694_CMD(Cmd2);		// now measure channel 0 in loop.
         	measuringNr ++;
    	   	delay_loop();
        }
         */
    
    
        my_checkpoint(rdataADC);
    }
    // END of main()
    
    
    void ADS8694_CMD(Uint16 a)
    {
        rdataADC = 0;
        GpioDataRegs.GPBCLEAR.bit.GPIO60 = 1;							// set clk low to begin swapping with a known position
        GpioDataRegs.GPBCLEAR.bit.GPIO61 = 1;							// set CS Low to start transmission
        delay_loop();
    
        for(i=0;i<16;i++)    											//Send CMD 16bit - SEND MSB FIRST !!!!
        {
            if(a &  0b1000000000000000)        							// if first character of a is a 1
                GpioDataRegs.GPBSET.bit.GPIO58 = 1;        				// send 1
            else
                GpioDataRegs.GPBCLEAR.bit.GPIO58 = 1;					// send 0
    
            GpioDataRegs.GPBTOGGLE.bit.GPIO60 = 1;    					// SCLK HI
            delay_loop();
            GpioDataRegs.GPBTOGGLE.bit.GPIO60 = 1;     					// SCLK LOW - ADC reads bit
            delay_loop();
    
            a = a << 1;
        }
        // At the 16th falling edge of the SCLK signal, (already happened)
        // the MSB of the conversion data is output on the SDO line and can be read by the host processor on the subsequent (17) falling edge of the SCLK signal.
        r=0;
        GpioDataRegs.GPBCLEAR.bit.GPIO58 = 1 ;         					// Put SPISIMO low for the next 18 bits to send
    
        GpioDataRegs.GPBTOGGLE.bit.GPIO60 = 1;    						// SCLK HI
        delay_loop();
    
        GpioDataRegs.GPBTOGGLE.bit.GPIO60 = 1;    						// SCLK LOW 17th falling edge (now we can read the MSB of the ADC18
    
        if(GpioDataRegs.GPBDAT.bit.GPIO59 == 1)							//Check SDO 1 or 0 (read MSB of 18 bits ADC result)
            rdataADC = 1;
        else
            rdataADC = 0;
    
        delay_loop();
    
        // continue with bits 16 - 0
        for(i=16;i<34;i++)												// SPISIMO remains 0 for 18 clks to read ADC18 result
        {
            GpioDataRegs.GPBTOGGLE.bit.GPIO60 = 1;    					// SCLK HI
            delay_loop();
            GpioDataRegs.GPBTOGGLE.bit.GPIO60 = 1;    					// SCLK LOW
            delay_loop();
    
            if(GpioDataRegs.GPBDAT.bit.GPIO59 == 1)						//Check SDO 1 or 0
                r = 1;
            else
                r = 0;
    
            rdataADC = rdataADC << 1; 									// make 18bits from received data	    MSB received first
            rdataADC = rdataADC | r; 									// make 18bits from received data	    MSB received first
        }
        GpioDataRegs.GPBCLEAR.bit.GPIO60 = 1;							// set clk low to make sure, transmission stops
        GpioDataRegs.GPBSET.bit.GPIO61 = 1;								// set CS high to end transmission
    }
    
    
    void WriteReadConfigADC18(Uint16 a)									// this should las only 24 clk cycles. Otherwise, the ADC sends wrong data.
    {
        rdataADC = 0;
        GpioDataRegs.GPBCLEAR.bit.GPIO60 = 1;							// set clk low to begin swapping with a known position
        GpioDataRegs.GPBCLEAR.bit.GPIO61 = 1;							// set CS Low to start transmission
        delay_loop();
        for(i=0;i<8;i++)    											//Send CMD 8bit
        {
            if(a &  0b1000000000000000)
                GpioDataRegs.GPBSET.bit.GPIO58 = 1;
            else
                GpioDataRegs.GPBCLEAR.bit.GPIO58 = 1;
    
            GpioDataRegs.GPBTOGGLE.bit.GPIO60 = 1;    					// SCLK HI
            delay_loop();
            GpioDataRegs.GPBTOGGLE.bit.GPIO60 = 1;     					// SCLK LOW - ADC reads bit
            delay_loop();
            a = a << 1;													// leftshift. Ej: cmd[0]: 10000101 << 1 = 100001010 (se agregan ceros a la derecha!!!)
        }
        r=0;
        GpioDataRegs.GPBCLEAR.bit.GPIO58 = 1 ;         					// Put SPISIMO low for the rest of the time
        for(i=8;i<16;i++)    											//Send the next eight bits = 0
        {
            GpioDataRegs.GPBTOGGLE.bit.GPIO60 = 1;    					// SCLK HI
            delay_loop();
            GpioDataRegs.GPBTOGGLE.bit.GPIO60 = 1;     					// SCLK LOW - ADC reads bit
            delay_loop();
        }
        //	From the 17th SCLK falling edge and onwards, SDO outputs the 8-bit data from the addressed register
        // during the next eight clocks, in MSB-first fashion.
        GpioDataRegs.GPBTOGGLE.bit.GPIO60 = 1;    						// SCLK HI
        delay_loop();
        GpioDataRegs.GPBTOGGLE.bit.GPIO60 = 1;    						// SCLK LOW 17th falling edge (now we can read the MSB of the ADC18
        if(GpioDataRegs.GPBDAT.bit.GPIO59 == 1)							//Check SDO 1 or 0 (read MSB of 8 bits ADC config)
            rdataADC = 1;
        else
            rdataADC = 0;
        delay_loop();
        // continue with bits 18 - 24
        for(i=16;i<25;i++)
        {
            GpioDataRegs.GPBTOGGLE.bit.GPIO60 = 1;    					// SCLK HI
            delay_loop();
            GpioDataRegs.GPBTOGGLE.bit.GPIO60 = 1;    					// SCLK LOW
            if(GpioDataRegs.GPBDAT.bit.GPIO59 == 1)						//Check SDO 1 or 0
                r = 1;
            else
                r = 0;
            rdataADC = rdataADC << 1; 									// make 8bits from received data	    MSB received first
            rdataADC = rdataADC | r; 									// make 8bits from received data	    MSB received first
            delay_loop();
        }
        GpioDataRegs.GPBCLEAR.bit.GPIO60 = 1;							// set clk low make sure, transmission stops
        if(GpioDataRegs.GPBDAT.bit.GPIO59 == 1)							//Check SDO for the last time (never know)
            r = 1;
        else
            r = 0;
        GpioDataRegs.GPBSET.bit.GPIO61 = 1;								// set CS high to end transmission
    }
    
    
    
    // delay_loop - Function to add delay
    //
    void delay_loop()
    {
        long k;
        for (k = 0; k < 200000; k++) {}
    }
    
    void my_checkpoint(Uint32 z)
    {
        checkpointValue = z;
        // the program will halt here.
        ESTOP0;
    }
    
    /*
    void initManualSpi()
    {
        EALLOW;
        GpioCtrlRegs.GPBGMUX2.bit.GPIO58 = 0;  						// GPIO58 = GPIO58 (SPISIMOA)
        GpioCtrlRegs.GPBGMUX2.bit.GPIO59 = 0;  						// GPIO59 = GPIO59 (SPISOMIA)
        GpioCtrlRegs.GPBGMUX2.bit.GPIO60 = 0;  						// GPIO60 = GPIO60 (SPICLKA)
        GpioCtrlRegs.GPBGMUX2.bit.GPIO61 = 0;  						// GPIO61 = GPIO61 (SPISTEA)
    
        GpioCtrlRegs.GPBMUX2.bit.GPIO58 = 0;  						// GPIO58 = GPIO58 (SPISIMOA)
        GpioCtrlRegs.GPBMUX2.bit.GPIO59 = 0;  						// GPIO59 = GPIO59 (SPISOMIA)
        GpioCtrlRegs.GPBMUX2.bit.GPIO60 = 0;  						// GPIO60 = GPIO60 (SPICLKA)
        GpioCtrlRegs.GPBMUX2.bit.GPIO61 = 0;  						// GPIO61 = GPIO61 (SPISTEA)
    
        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.GPBDIR.bit.GPIO58 = 1;							// configure GPIO58 as OUTPUT (SPISIMOA)
        GpioCtrlRegs.GPBDIR.bit.GPIO59 = 0;							// configure GPIO59 as INPUT  (SPISOMIA)
        GpioCtrlRegs.GPBDIR.bit.GPIO60 = 1;							// configure GPIO60 as OUTPUT (SPICLKA)
        GpioCtrlRegs.GPBDIR.bit.GPIO61 = 1;							// configure GPIO61 as OUTPUT (SPISTEA)
    
        // GPIO111 is used for the Hardware reset of the ADS8694.
        //Must be LOW to activate it
        GpioCtrlRegs.GPDGMUX1.bit.GPIO111 = 0;  					// GPIO111 = GPIO111
        GpioCtrlRegs.GPDMUX1.bit.GPIO111 = 0;  						// GPIO111 = GPIO111
        GpioCtrlRegs.GPDDIR.bit.GPIO111 = 1;						// configure GPIO111 as OUTPUT
        GpioCtrlRegs.GPDPUD.bit.GPIO111 = 0;  						// Enable pull-up on GPIO111 (RST)
        GpioDataRegs.GPDSET.bit.GPIO111 = 1; 						// Set GPIO111 HIGH !!!! to activate ADS8694 
        EDIS;
    }
    */
    //
    // error - Halt debugger when error received
    //
    void error(void)
    {
        asm("     ESTOP0");  //Test failed!! Stop!
        for (;;);
    }
    
    
    
    

    7217.Spi_of_BruteForceSpi.c
    //###########################################################################
    //
    // FILE:   F2837xD_Spi.c
    // for BRUTE FORCE
    
    //
    // Included Files
    //
    #include "F2837xD_device.h"
    #include "F2837xD_Examples.h"
    
    //
    // Calculate BRR: 7-bit baud rate register value
    // SPI CLK freq = 500 kHz
    // LSPCLK freq  = CPU freq / 4  (by default)
    // BRR          = (LSPCLK freq / SPI CLK freq) - 1
    //
    #if CPU_FRQ_200MHZ
    #define SPI_BRR        ((200E6 / 4) / 5E3) - 1 //very slow, to have time!!!
    #endif
    
    #if CPU_FRQ_150MHZ
    #define SPI_BRR        ((150E6 / 4) / 5E3) - 1
    #endif
    
    #if CPU_FRQ_120MHZ
    #define SPI_BRR        ((120E6 / 4) / 5E3) - 1
    #endif
    
    
    void InitSpi(void)
    {
        SpiaRegs.SPICCR.bit.SPISWRESET = 0;
        SpiaRegs.SPICCR.bit.CLKPOLARITY = 0;
        SpiaRegs.SPICCR.bit.SPICHAR = 0;
        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 = SPI_BRR;
    
        SpiaRegs.SPIPRI.bit.FREE = 1;
    
        SpiaRegs.SPICCR.bit.SPISWRESET = 1;
    }
    
    void initManualSpi()
    {
        EALLOW;
        GpioCtrlRegs.GPBGMUX2.bit.GPIO58 = 0;  						// GPIO58 = GPIO58 (SPISIMOA)
        GpioCtrlRegs.GPBGMUX2.bit.GPIO59 = 0;  						// GPIO59 = GPIO59 (SPISOMIA)
        GpioCtrlRegs.GPBGMUX2.bit.GPIO60 = 0;  						// GPIO60 = GPIO60 (SPICLKA)
        GpioCtrlRegs.GPBGMUX2.bit.GPIO61 = 0;  						// GPIO61 = GPIO61 (SPISTEA)
    
        GpioCtrlRegs.GPBMUX2.bit.GPIO58 = 0;  						// GPIO58 = GPIO58 (SPISIMOA)
        GpioCtrlRegs.GPBMUX2.bit.GPIO59 = 0;  						// GPIO59 = GPIO59 (SPISOMIA)
        GpioCtrlRegs.GPBMUX2.bit.GPIO60 = 0;  						// GPIO60 = GPIO60 (SPICLKA)
        GpioCtrlRegs.GPBMUX2.bit.GPIO61 = 0;  						// GPIO61 = GPIO61 (SPISTEA)
    
        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.GPBDIR.bit.GPIO58 = 1;							// configure GPIO58 as OUTPUT (SPISIMOA)
        GpioCtrlRegs.GPBDIR.bit.GPIO59 = 0;							// configure GPIO59 as INPUT  (SPISOMIA)
        GpioCtrlRegs.GPBDIR.bit.GPIO60 = 1;							// configure GPIO60 as OUTPUT (SPICLKA)
        GpioCtrlRegs.GPBDIR.bit.GPIO61 = 1;							// configure GPIO61 as OUTPUT (SPISTEA)
    
        // GPIO111 is used for the Hardware reset of the ADS8694.
        //Must be LOW to activate it
        GpioCtrlRegs.GPDGMUX1.bit.GPIO111 = 0;  					// GPIO111 = GPIO111
        GpioCtrlRegs.GPDMUX1.bit.GPIO111 = 0;  						// GPIO111 = GPIO111
        GpioCtrlRegs.GPDDIR.bit.GPIO111 = 1;						// configure GPIO111 as OUTPUT
        GpioCtrlRegs.GPDPUD.bit.GPIO111 = 0;  						// Enable pull-up on GPIO111 (RST)
        GpioDataRegs.GPDSET.bit.GPIO111 = 1; 						// Set GPIO111 HIGH !!!! to activate ADS8694 
        EDIS;
    }
    
    
    //
    // End of file
    //
    

  • Gustavo,

    Sorry, you haven't answered my question. Can you first answer the question asked in my previous post?

    Regards,
    Manoj
  • Sorry Manoj, I thought I had done this.
    Yes, I get the pins working. They do what they are suppose to do.
    I had started to write you and then I forgot I had not finished it and started a new message...

    Here is it:

    Yes, after configuring SpiaRegs.SPICCR.bit.HS_MODE = 0; things began to work.
    It remains an unclear task for me, however.

    Somehow I do not get it with the combination of SPICHAR, NUM_WORDS, TXFFIL, DMA_TRANSFER_SIZE and DMA_BURST_SIZE

    DMA_BURST_SIZE 8
    DMA_TRANSFER_SIZE 0 // (MEM_BUFFER_SIZE/FIFO_LVL)-1] (MEM_BUFFER is: sdata[9]
    TXFFIL 9

    word size is 4 bits
    so
    SpiaRegs.SPICCR.bit.SPICHAR = 4;

    This should work, if I follow the information on the TMS320F2837xD_TechnicalReference (spruhm8f)
    I send my data left justified. But I do not get back what I send. Data comming in is twice as big as data comming out. Let me simplify:

    sent 1, received 2
    send 3, received 6
    sent 4, received 8
    and so on
    Strange.

    I have tested several combinations, but nothing helps.

    This is my first time with spi. I am developping a rather complex project on my own and have to learn many things from scratch. So, I think I need to simplify the problem and that is why I decided to come down and test rudimentary communication with the ADC first.

    If I am not doing it bad, the ADC should have the bits it needs to give me some feedback.
    It does't.

    This shows, that my first problem is not with spi and dma, but with the ADC itself.

    Best regards!
    Gustavo
  • Gustavo,

    I'm a little bit lost in what I have to do. Should I close this thread?

    Are you working with ADS8694 to get this resolved?

    Regards,
    Manoj
  • Hi Manoj,
    I just manage to get the ADC working!
    As usual, it was my fault, sending wrong config commands.
    Now I can start testing spi for it.

    I would say, we close this tread.
    Many thanks for your care. It is always a pleasure to ask something here, the answer comes very quick and competent.
    And you all are very patient...

    Best regards,
    Gustavo