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.

EK-TM4C123GXL: SPI Configuration Help

Part Number: EK-TM4C123GXL

Hey guys, hopefully someone can help me out with this because i'm pretty stuck. 

I've scoured the E2E forum and can't find a direct answer to my questions, so I figured that I would just make my own post. 

I need to use the Tiva C microcontroller to send SPI commands to a PLL. There are two major issues with this: the first is that the Tiva C SPI is 16-bit and I need to send 32-bit words over SPI. My initial plan is to try and use DMA with the Tx FIFO half empty interrupt. I'd ideally split the 32 bit word into a 16-bit and two 8-bit pieces to send over SPI. Do you think this could work?

Another major issue though, is that the chip select pin on the SPI interface is active low, and I need it to be active high to match the PLL timing diagram. I've seen people say you can use a different GPIO pin, but I never see any example code on how to actually do this. Is there a way to map the chip select to an separate GPIO pin? 

Any help would be extremely appreciated, thank you!

  • Mason08 said:
    My initial plan is to try and use DMA with the Tx FIFO half empty interrupt. I'd ideally split the 32 bit word into a 16-bit and two 8-bit pieces to send over SPI. Do you think this could work?

    I think that's using a sledge hammer to swat a fly. Sure it might work but you're more likely to bruise or break something.

    Better to ignore the FSS built in to the SPI. Just set a GPIO appropriately before sending the SPI and unset it after all has been sent. That built-in SPI chip select should generally be ignored.

    Mason08 said:
    Another major issue though, is that the chip select pin on the SPI interface is active low, and I need it to be active high to match the PLL timing diagram.

    That's highly odd. Are you really sure?

    Robert

  • Thanks for the quick reply Robert!

    Robert Adsett said:
    I think that's using a sledge hammer to swat a fly. Sure it might work but you're more likely to bruise or break something.

    It does seem like a bit of overkill. Is there a simpler solution? I need to make sure the bits are sent seamlessly. 

    Robert Adsett said:
    Better to ignore the FSS built in to the SPI. Just set a GPIO appropriately before sending the SPI and unset it after all has been sent. That built-in SPI chip select should generally be ignored.

    So I could literally just set a separate GPIO pin and wire the PLL chip select line to it, and that would be functionally the same? (Sorry I'm new to SPI programming)

    Robert Adsett said:
    That's highly odd. Are you really sure?

    The PLL in question is the HMC704LP4E. Another PLL that I might need to use is the same way, chip select going high for the duration of the SPI transfer. 

  • I've "escaped" a meeting - venture briefly here - and encounter:

    Robert Adsett said:
    I think that's using a sledge hammer to swat a fly.

    Love your "way" w/ "understatement!"

    Might this explain the (many) sledge hammers - multiple "bruised" walls - and complete (absence) of flies - noted w/in, "La Casa Adsett?"

  • Mason08 said:
    Robert Adsett
    I think that's using a sledge hammer to swat a fly. Sure it might work but you're more likely to bruise or break something.

    It does seem like a bit of overkill. Is there a simpler solution? I need to make sure the bits are sent seamlessly. 

    As I said below just use a separate GPIO to act as chip select. It's a rare chip using SPI that will have a problem with a pause in the clock (they do exist but it's not common). My quick scan of the datasheet didn't see any restrictions on the SPI clock.

    Mason08 said:
    Robert Adsett
    Better to ignore the FSS built in to the SPI. Just set a GPIO appropriately before sending the SPI and unset it after all has been sent. That built-in SPI chip select should generally be ignored.

    So I could literally just set a separate GPIO pin and wire the PLL chip select line to it, and that would be functionally the same?

    Yep

    Robert

  • Okay sweet, i'll try using a GPIO pin as a chip select and just hold that open while I send two 16-bit words.

    One really quick question: since I plan to use a separate GPIO pin, would I even need to configure the FSS in my SSI module?

    Thank you so much for your help!