I'm trying to interface with both the CC1121 and an L6470 motor controller via TI's SSI protocols. I've been working on this for a couple months now and at this point I can't figure out if I'm not getting anything back from the chips because my code is wrong or because I botched the hardware design somehow. The following code is to configure the CC11121 on SSI3 and the motor controllers on SSI1 & SSI2. I think I'm making all of the right API calls to configure the alternate functions correctly. The next part of the code just tries to send a command strobe to the CC1121 to see if it's alive and talking (because the idle status is denoted by 000....). I've taken out a lot of the #define s and some other GPIO code to try and make this shorter. Sorry for the poor formatting, I'm not sure what this textbox is doing. If anybody can see that I'm obviously not calling a critical function or that I'm trying to send data incorrectly so that the ARM or the CC1121 isn't recognizing the commands, please let me know. I'm pulling my hair out because I just can't see where I'm going wrong. In your reply, if you could include an example code of what you think I could change, that would be super helpful. Thanks everybody.
#include "inc/hw_gpio.h"
#include "inc/hw_memmap.h"
#include "inc/hw_sysctl.h"
#include "inc/hw_types.h"
#include "inc/hw_ints.h"
#include "driverlib/gpio.h"
#include "driverlib/sysctl.h"
#include "driverlib/ssi.h"
#include "driverlib/pin_map.h"
void main(void) {
SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN);
//START CONFIG CODE
// Enable GPIO and SSI
//Pin 1 -> M_B_MISO -> PB6 //Pin 4 -> M_B_MOSI -> PB7 //Pin 57 -> M_B_CS (SSI2 Fss) -> PB5 //Pin 58 -> M_B_SCLK (SSI2) -> PB4
SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI2); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);//SSI2, Motor Control B
//Pin 61 -> CC_SCLK (SSI3) -> PD0 //Pin 62 -> CC_CS (SSI3 Fss) -> PD1 //Pin 63 -> CC_MISO -> PD2 //Pin 64 -> CC_MOSI -> PD3
SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI3); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);//SSI3, CC1121
//Pin 28 -> M_A_MISO -> PF0 //Pin 29 -> M_A_MOSI -> PF1 //Pin 30 -> M_A_SCLK (SSI1) -> PF2 //Pin 31 -> M_A_CS (SSI1 Fss) -> PF3
SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI1); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);//SSI1, Motor Control A
GPIOPinConfigure(GPIO_PB4_SSI2CLK); GPIOPinConfigure(GPIO_PB5_SSI2FSS); GPIOPinConfigure(GPIO_PB6_SSI2RX); GPIOPinConfigure(GPIO_PB7_SSI2TX);
GPIOPinConfigure(GPIO_PD0_SSI3CLK); GPIOPinConfigure(GPIO_PD1_SSI3FSS); GPIOPinConfigure(GPIO_PD2_SSI3RX); GPIOPinConfigure(GPIO_PD3_SSI3TX);
GPIOPinConfigure(GPIO_PF0_SSI1RX); GPIOPinConfigure(GPIO_PF1_SSI1TX); GPIOPinConfigure(GPIO_PF2_SSI1CLK); GPIOPinConfigure(GPIO_PF3_SSI1FSS);
GPIOPinTypeSSI(GPIO_PORTB_BASE, 0x78); GPIOPinTypeSSI(GPIO_PORTD_BASE, 0x0F); GPIOPinTypeSSI(GPIO_PORTF_BASE, 0x0F);
SSIConfigSetExpClk(SSI1_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_3, SSI_MODE_MASTER, 1000000, 8);
SSIConfigSetExpClk(SSI2_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_3, SSI_MODE_MASTER, 1000000, 8);
SSIConfigSetExpClk(SSI3_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_0, SSI_MODE_MASTER, 1000000, 8);
SSIEnable(SSI1_BASE); SSIEnable(SSI2_BASE); SSIEnable(SSI3_BASE);
//END CONFIG CODE //START COMMS CODE
//CC1121 Command Strobes can be found in Table 6, page 15 of CC1121 User Guide
unsigned long CC_RX_MODE_STROBE = 0x34; //status byte should return 001
unsigned long ccStatus1 = 0xFFFF, ccStatus2 = 0xFFFF, ccStatus3 = 0xFFFF;
// Puts data in FIFO buffer to be sent/Reads data from receive FIFO buffer for the CC1121
SSIDataGetNonBlocking(SSI3_BASE, &ccStatus1); //checks status
SSIDataPut(SSI3_BASE, CC_RX_MODE_STROBE); //suppose to change cc1121 into receive mode
SSIDataGetNonBlocking(SSI3_BASE, &ccStatus2); //checks status
SSIDataGetNonBlocking(SSI3_BASE, &ccStatus3); //checks status
//END COMMS CODE
}//end main