Part Number:TM4C1294NCPDT
Tool/software: Code Composer Studio
I have some problems on SSI of TM4C1294NCPDT on Tiva™ EK-TM4C1294XL Launchpad. The SSI is set as master, when transmitting data, the SSI do not work. The pin clock (PA2) do not change. I use the code provided by TI workshop as below. When running to the code 'SSIDataPut(SSI0_BASE, ui32Data)', all the SSI pins on chip do not change, and the register of SSIDR always stays zero. Could you please help me to figure out the problem. Thanks in advance...
#include<stdint.h>
#include<stdbool.h>
#include"inc/hw_memmap.h"
#include"inc/hw_ssi.h"
#include"inc/hw_types.h"
#include"driverlib/ssi.h"
#include"driverlib/gpio.h"
#include"driverlib/pin_map.h"
#include"driverlib/sysctl.h"
uint32_t ui32SysClkFreq;
#define NUM_SSI_DATA 8
constuint8_t pui8DataTx[NUM_SSI_DATA] =
{0x88, 0xF8, 0xF8, 0x88, 0x01, 0x1F, 0x1F, 0x01};
// Bit-wise reverses a number.
uint8_t
Reverse(uint8_t ui8Number)
{
uint8_t ui8Index;
uint8_t ui8ReversedNumber = 0;
for(ui8Index=0; ui8Index<8; ui8Index++)
{
ui8ReversedNumber = ui8ReversedNumber << 1;
ui8ReversedNumber |= ((1 << ui8Index) & ui8Number) >> ui8Index;
}
return ui8ReversedNumber;
}
intmain(void)
{
uint32_t ui32Index;
uint32_t ui32Data;
ui32SysClkFreq = SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), 120000000);
SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI0);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
GPIOPinConfigure(GPIO_PA2_SSI0CLK);
GPIOPinConfigure(GPIO_PA3_SSI0FSS);
GPIOPinConfigure(GPIO_PA4_SSI0XDAT0);
GPIOPinTypeSSI(GPIO_PORTA_BASE,GPIO_PIN_4|GPIO_PIN_3|GPIO_PIN_2);
SSIConfigSetExpClk(SSI0_BASE, ui32SysClkFreq, SSI_FRF_MOTO_MODE_0, SSI_MODE_MASTER, 10000, 16);
SSIEnable(SSI0_BASE);
while(1)
{
for(ui32Index = 0; ui32Index < NUM_SSI_DATA; ui32Index++)
{
ui32Data = (Reverse(pui8DataTx[ui32Index]) << 8) + (1 << ui32Index);
SSIDataPut(SSI0_BASE, ui32Data);
while(SSIBusy(SSI0_BASE))
{
}
}
}
}