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.

SSI and uDMA in Ping Pong Mode

Other Parts Discussed in Thread: TM4C1233H6PM

Hi,

I am new to the forums and this is my first question posted here. Anyway, I am doing some development with the LM4F120 Stellaris Launchpad and the on board chip is a TM4C1233H6PM. I am using Keil uVision4 as my IDE to develop my code. For the start up file I use startup_TM4C123.s and I use the driver library and header files that are found in  C:\ti\TivaWare_C_Series-1.0.
I am trying to write code to receive incoming data on one SSI module (SSI3 in my code) and then send it on another SSI module (SSI 1 in my code). I am trying to set up uDMA ping pong mode for the receive side on SSI3. My basic vision of how my code should work is to initialize everything and then sit in a while loop until all the data has been received and transmitted. While in that while loop I expect the SSI to make DMA request when the FIFO has 4 data pieces in it. When that request happens I expect it to go to my SSI3_Handler interrupt handler and to put the code onto the SSI0 sending FIFO and repeat.

My problem is, is that for some reason, I never get into the interrupt handler. It appears as the the DMA request is never being asserted.

In writing this code I followed the udma_demo.c code provided in the tivaware file and also tried to follow the API and TM4C1233H6PM manuals.

The udma_demo code/project works properly on my board so I am not sure why following the same general outline but with SSI instead of UART is not working.

My code is attached.

7522.startup_TM4C123.s

1680.DM_Comm_Initialize.c
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* DM_Comm_Initialize is the C file that contains all of the initialization
functions needed to run the DM_Comm.c file.
Written by Barrett Taylor on July 3, 2013.
*/
#include "DM_Headers.h"
uint8_t g_uDMAControlTable[1024] __attribute__ ((aligned(1024)));
uint16_t g_ROERxBufA[8];
uint16_t g_ROERxBufB[8];
/**********************************************************************************************
void InitializeClock(): This function is used to set the system clock of the board to the
desired values.
**********************************************************************************************/
void InitializeClock(void)
{
//Set the system clock to run from the PLL and set to run at 66.6MHz. Set the main oscillator to 16MHz.
SysCtlClockSet(SYSCTL_SYSDIV_3 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

5807.DM_Comm_Functions.c
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* DM_Comm_Functions is the C file that contains all of the functions neccessary to operate the
DM_Comm.c file. This includes initialization functions as well as implementation functions.
Written by Barrett Taylor on July 3, 2013.
*/
#include "DM_Headers.h"
uint32_t g_pixel_count;
/**********************************************************************************************
void RunComms(): Is basically like main() in that this calls all the other functions.
Needed to make a separate function to be able ot call it from timeout routines.
**********************************************************************************************/
void RunComms(void)
{
uint16_t OCE_retreived_data[2]; //Variable to hold 16 bit data piece from OCELOT.
uint16_t* OCE_retreived_data_ptr; //Pointer to the OCELOT retreived data.
uint16_t DM_retreived_data[2]; //Variable to hold 16 bit data from the DM.
uint16_t* DM_retreived_data_ptr; //Pointer to data received from the DM.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


Please help if you can!
Thanks,
Barrett Taylor 

  • For anyone interested, I was able to solve my problem. The posted code works properly. The reason it was not working for me was the order that my initialization functions were being called in. I was calling the Init_GPIO function last in my SystemInit call. Apparently, doing this reset other registers (like DMA initialization) unintentionally. TO solve this problem I called Init_GPIO right after InitializeClock and everything worked a lot better!

    Barrett Taylor