Good evening!
While migrating my design from LM3S9B96 to TM4C1294KCPDT, I face the problem with SSI0 which is used to communicate with ADC.
I connected my oscilloscope/data analyser to 4 SPI pins and see the TX pin is always low during data transfers, while I am writing 0xFF to the port. When I try to toggpe the pin manually (by writing 0 to GPIO_AFSEL, GPIO_DIR appropriate bits and toggle with GPIO_DATA bit), I see the state is changed on my oscilloscope.
Here is how I am initializing the SSI0:
SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI0);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOP);
GPIOPinConfigure(GPIO_PA2_SSI0CLK);
GPIOPinConfigure(GPIO_PA3_SSI0FSS);
GPIOPinConfigure(GPIO_PA4_SSI0XDAT0);
GPIOPinConfigure(GPIO_PA5_SSI0XDAT1);
GPIOPinTypeSSI(GPIO_PORTA_BASE, GPIO_PIN_5 | GPIO_PIN_4 | GPIO_PIN_3 |
GPIO_PIN_2);
GPIOPinTypeGPIOOutput(GPIO_PORTP_BASE, GPIO_PIN_1); // Used as CS
SSIAdvModeSet(SSI0_BASE, SSI_ADV_MODE_LEGACY);
SSIEnable(SSI0_BASE);
Here is the code for output function:
Void SPISend(char Channel, unsigned char Len, const unsigned short *Send, unsigned short *Recv)
{
unsigned char i;
SSIConfigSetExpClk(SSI0_BASE, Clk, SPICfg[Channel].Mode,
SSI_MODE_MASTER, SPICfg[Channel].Baud, SPICfg[Channel].DataWidth);
SSIEnable(SSI0_BASE);
if(SPICfg[Channel].CSBase)
{
GPIOPinWrite(SPICfg[Channel].CSBase, SPICfg[Channel].CSPin, 0);
}
i = Len;
while(i)
{
//SSIDataPut(SSI0_BASE, *(Send++));
SSIDataPut(SSI0_BASE, 0xFF); // Here I am trying to send exactly the high level
i--;
}
while(SSIBusy(SSI0_BASE));
if(SPICfg[Channel].CSBase)
{
GPIOPinWrite(SPICfg[Channel].CSBase, SPICfg[Channel].CSPin, SPICfg[Channel].CSPin);
}
i = Len;
while(i)
{
unsigned long Buf;
SSIDataGet(SSI0_BASE, &Buf);
*(Recv++) = (unsigned short)Buf;
i--;
}
}
But then I call SPISend(2, 4, Snd, Rcv); with Snd[4] = {0xFF, 0xFF, 0xFF, 0xFF}; I got TX and RX pins low:
IO6 is TX pin, and IO7 is RX pin here.
Please help!
