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.

TM4C1294 SSI3 Issue

Other Parts Discussed in Thread: TM4C1294NCPDT

I am using the TM4C1294NCPDT and trying to use the SSI3 to control the external FLASH. But the initialize of SSI3 is always not exercise at all.  May someone help me to check this issue.

I set the CPU with 120MHz, enables UART and SSI2.

Codes are below.

static void ssi3Init_FLASH(void)
{
    uint32_t pui32RxData;

    //
    // Enable the SSI3 Peripheral used by the SPI_FLASH.
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI3);

    //
    // Configure GPIO Pins for UART SSI.
    //
    GPIOPinConfigure(GPIO_PQ2_SSI3XDAT0);
    GPIOPinConfigure(GPIO_PQ3_SSI3XDAT1);
    GPIOPinConfigure(GPIO_PF2_SSI3FSS);
    GPIOPinConfigure(GPIO_PF3_SSI3CLK);
    GPIOPinTypeSSI(GPIO_PORTQ_BASE,     GPIO_PIN_2 | GPIO_PIN_3);
    GPIOPinTypeSSI(GPIO_PORTF_AHB_BASE, GPIO_PIN_2 | GPIO_PIN_3);

    // Configure and enable the SSI port for SPI master mode. Use SSI3,
    // system clock supply, idle clock level low and active low clock in
    // freescale SPI mode, master mode, 1MHz SSI frequency, and 8-bit data.
    // For SPI mode, you can set the polarity of the SSI clock when the SSI
    // unit is idle. You can also configure what clock edge you want to
    // capture data on. Please reference the datasheet for more information on
    // the different SPI modes.
    SSIConfigSetExpClk(SSI3_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_0,
    SSI_MODE_MASTER, 70000000, 8);

    //Enable
    SSIEnable(SSI3_BASE);

    // Read any residual data from the SSI port.  This makes sure the receive
    // FIFOs are empty, so we don't read any unwanted junk.  This is done here
    // because the SPI SSI mode is full-duplex, which allows you to send and
    // receive at the same time.  The SSIDataGetNonBlocking function returns
    // "true" when data was returned, and "false" when no data was returned.
    // The "non-blocking" function checks if there is any data in the receive
    // FIFO and does not "hang" if there isn't.
    //
    while(SSIDataGetNonBlocking(SSI3_BASE, &pui32RxData))
    {
    }
}

  • Hi Colin,

    Seems you did not enable peripheral GPIOQ and GPIOF. Also post the code where you set your system clock to 120 MHz.

    - Markel
  • Hello Collin

    And more problems on the way...

    SSIConfigSetExpClk(SSI3_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_0,
    SSI_MODE_MASTER, 70000000, 8);

    First of all SysCtlClockGet is not valid for TM4C129 devices. The system clock frequency is the return value SysCtlClockFreqSet function.

    Secondly, SSI at 70000000 cannot be derived from any know frequency of the device. The max clock frequency that can be done is 60MHz

    Regards
    Amit
  • Amit Ashara said:
    And more problems on the way...

    I can only hit, "Like" one-time - Ratz!      (along w/terrific tech support - display of "personality" makes the read/learning, "less cut/dry")    (i.e. boring...)

    Curious is "where/how" poster arrived @ 70MHz.     Starting from the highest rate - (even a legal one) normally does "not" prove - especially prudent.

    Baby steps - easing toward the (reduced) end goal (i.e. KISS) works far better for most here.    (especially for this oft challenged reporter)

  • Hi Markel,

    Thanks for your reply. I enable the peripheral GPIOQ and GPIOF with using the PinoutSet application which used for enable/disable the Ethernet and USB. I configure the system clock as below.

    static void cpuInit(void)
    {
        //
        // Make sure the main oscillator is enabled because this is required by
        // the PHY.  The system must have a 25MHz crystal attached to the OSC
        // pins.  The SYSCTL_MOSC_HIGHFREQ parameter is used when the crystal
        // frequency is 10MHz or higher.
        //
        #if _ETH_SUPPORT_ == 1
            SysCtlMOSCConfigSet(SYSCTL_MOSC_HIGHFREQ);
        #endif    //_ETH_SUPPORT_ == 1

        //
        // Set the clocking to run directly from the crystal at 120MHz.
        //
        g_ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
                                                 SYSCTL_OSC_MAIN |
                                                 SYSCTL_USE_PLL |
                                                 SYSCTL_CFG_VCO_480), 120000000);

        //
        // Configure SysTick for a periodic interrupt.
        //
            //Enable system tick
            MAP_SysTickPeriodSet(g_ui32SysClock);
            MAP_SysTickEnable();
    }//cpuInit

  • Hi Amit,

    Thanks for your help. After I correct the system clock frequency. I set the SSI clock frequency at 30MHz and change SSI to advanced mode for keep low between transfer. The ID of the SPI FLASH(M25PX16) can be read.
  • Hello Collin,

    There is an example for Advanced mode using Macronix Flash that does perform Advanced, Bi and Quad Mode. Maybe this link would be useful to accelerate your development process.

    www.ti.com/.../TIDM-TM4C129SDRAMNVM;tisearch=tidesigns

    Regards
    Amit
  • Thanks Amit for your great help.

    Regards,
    Collin
  • Hello Collin,

    A lot of reference design and software for TM4C are planned this year. Some of them may be simple boards and code, and some more complex application like protocol aggregators

    Regards
    Amit