Hi,
I've a problem with SSI and stellarisware on the TI Stellaris Launchpad.
While the configuration of the SSI1 peripherial (same way as in stellarisware example), the programm seems to stop at "GPIOPinConfigure(GPIO_PCTL_PD2_SSI1RX);".
I don't know why and any other things are working well...
Code:
void SerialInit(unsigned int baud) {
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
GPIOPinConfigure(GPIO_PA0_U0RX);
GPIOPinConfigure(GPIO_PA1_U0TX);
GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), baud,
(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));
}
void SerialSyncPrintChar(char c) {
UARTCharPut(UART0_BASE, c);
}
void SerialSyncPrintE(char* msg) {
unsigned int cCount = strlen(msg);
int i = 0;
for (i = 0; i < cCount; i++) {
SerialSyncPrintChar(msg[i]);
}
}
void init_SpiADC() {
SerialSyncPrintE("SSI1");
SerialSyncPrintE("i0");
SysCtlDelay(2666666);
SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI1);
SerialSyncPrintE("i1");
SysCtlDelay(2666666);
GPIOPinConfigure(GPIO_PCTL_PD0_SSI1CLK);
GPIOPinConfigure(GPIO_PCTL_PD1_SSI1FSS);
SerialSyncPrintE("i2");
SysCtlDelay(2666666);
GPIOPinConfigure(GPIO_PCTL_PD2_SSI1RX);
SerialSyncPrintE("i3");
SysCtlDelay(2666666);
GPIOPinConfigure(GPIO_PCTL_PD3_SSI1TX);
SerialSyncPrintE("i4");
SysCtlDelay(2666666);
GPIOPinTypeSSI(GPIO_PORTD_BASE, (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3));
SerialSyncPrintE("i5");
SysCtlDelay(2666666);
SSIConfigSetExpClk(SSI1_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_0,
SSI_MODE_MASTER, SysCtlClockGet() / 64, 8);
// -> 80Mhz/64 -> 0.625Mhz SPI Clock
SerialSyncPrintE("i6");
SysCtlDelay(2666666);
// Enable the SSI0 module.
SSIEnable(SSI1_BASE);
// ...
}
int main(void) {
SysCtlClockSet(
SYSCTL_SYSDIV_2_5 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);
SysCtlPeripheralEnable(
SYSCTL_PERIPH_GPIOA | SYSCTL_PERIPH_GPIOB | SYSCTL_PERIPH_GPIOD
| SYSCTL_PERIPH_GPIOE | SYSCTL_PERIPH_GPIOF);
SerialInit(115200); // 115200 Baud
SysCtlDelay(2666666);
// ADC over SPI:
init_SpiADC();
// ...
}
I see receive "i2", but never "i3" :(
If anyone could provide any information on this I'd be very greatful!
regards
Raphael.