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.

Configuring SSI clock

I am at my wits end. I have tried 5 different examples for configuring my TIVA EK-TM4C123GXL TM4C123GH6PM processor to do SSI and it keeps hard faulting on when I call the function:

SSIConfigSetExpClk(SSI0_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_1, SSI_MODE_MASTER, 250000, 16);

Below is my code. Please tell me why this thing blows up every time I try to confgure my SSI peripheral!

void Config(void){
uint32_t sysClock;
/*
* Note: ROM_* is a way to call a function for the TIVA's onboard ROM instead
* of relying on cluttering its flash drive memory with too many functions
*/

// Sets clock at 50MHz... 400MHz PLL /2 = 200 then div SYSDIV_4 = 50MHz
ROM_SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);
sysClock = ROM_SysCtlClockGet();

// Enable peripherals...
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); // Communication with PC
SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C0); // Serial comm with 4-channel ADC
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); // where UART and SPI is
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB); // where I2C is
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); // where LED's are

// Setup I2C peripheral for DS3503 ("infinitely" reprogrammable non-volatile memory)
// 0-5k pot 128 steps
//! - I2C0SCL - PB2
//! - I2C0SDA - PB3
GPIOPinConfigure(GPIO_PB2_I2C0SCL);
GPIOPinConfigure(GPIO_PB3_I2C0SDA);
ROM_GPIOPinTypeI2CSCL(GPIO_PORTB_BASE, GPIO_PIN_2);
ROM_GPIOPinTypeI2C(GPIO_PORTB_BASE, GPIO_PIN_3);
ROM_I2CMasterEnable(I2C0_BASE);
ROM_I2CMasterInitExpClk(I2C0_BASE, sysClock,false);

// Setup SPI peripheral for AD5292 (20-tp non-volatile memory)
// 0-20k pot 1024 steps
//! - SSI0Clk - PA2
//! - SSI0Fss - PA3
//! - SSI0Rx - PA4
//! - SSI0Tx - PA5
GPIOPinConfigure(GPIO_PA2_SSI0CLK);
GPIOPinConfigure(GPIO_PA3_SSI0FSS);
GPIOPinConfigure(GPIO_PA4_SSI0RX);
GPIOPinConfigure(GPIO_PA5_SSI0TX);
ROM_GPIOPinTypeSSI(GPIO_PORTA_BASE, GPIO_PIN_5 | GPIO_PIN_4 | GPIO_PIN_3 | GPIO_PIN_2);
//ROM_SSIClockSourceSet(SSI0_BASE, SSI_CLOCK_SYSTEM);
ROM_SSIConfigSetExpClk(SSI0_BASE, sysClock, SSI_FRF_MOTO_MODE_1, SSI_MODE_MASTER, 250000, 16);
ROM_SSIEnable(SSI0_BASE);

// Configure Port F pins to blink blue, green, and red light
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3);

// Setup UART peripheral
GPIOPinConfigure(GPIO_PA0_U0RX);
GPIOPinConfigure(GPIO_PA1_U0TX);
ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
ROM_UARTConfigSetExpClk(UART0_BASE, sysClock, 115200,
(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));

}

int main(void) {

Config();

// Loop forever and do stuff
while (1){

}
return 0;
}