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.

Tiva TM4C1294NCPDT Microcontroller PLL setting



Hi,

We are using Tiva micro controller for high speed SPI interface up to 50MHz.

So to get the frequency of 50MHz, I need to set system clock at 100MHz.

This requires PLL VCO frequency to be set at 400MHz instead of 480MHz.

Can anybody provide me coding example to set VCO frequency other than 480MHz or 320MHz?

Regards,

Bipin

  • BIPIN BHATT said:
    We are using Tiva micro controller for high speed SPI interface up to 50MHz.

    My small tech firm has (not yet) used that model MCU.     Yet - does not your "opening sentence" provide a quick/easy answer?

    Should your MCU be the master - then that 50MHz must be the "maximum" acceptable data rate - declared by your remote.    (assumed slave)    Thus - 50MHz is a "speed limit" - not a stict requirement!     Cannot you choose the nearest SPI data rate - staying w/in that 50MHz limit - while employing either of those "standard" VCO frequencies of 320 or 480MHz?

    In that manner you've eliminated "unknowns" which may have, "Unintended and Unwanted" consequences - even upon (other) portions of the MCU.

    Suggest that you remain with "tried/true" - exercise your individuality where payoff proves higher - and less "inviting" to the unknown...

  • Hi BIPIN,

    Coding example? Nope I'm not gonna make one for that on the fly... why? Well... it's not exactly easy.
    You would need to either edit the library or hard code it. And setting the PLL is not the easiest of tasks (I would avoid it of possible), it's not impossible nor unreliable either.

    You need to set a Q and N both to 0 and then the MDIV to 8. This would create a 400Mhz VCO. If you check the datasheet the justification for these values would be more apparent, I won't get into more details for now (unless you really, really (x10000), need the clock at 100Mhz).

    I advise you to follow cb1 advise, you could easily get 40Mhz SPI with a system clock at 120Mhz, wouldn't that suffice?

    You can very well read the datasheet, see the method and then later set the VCO to 400Mhz, or read how the library does it (careful, it uses various methods with structs and "hidden" functions") but is that work really worth it? Remember that setting up the clock wrongly can lock your board (though you should be able to unlock it)
  • Perhaps, "Risk-Reward" enters here.   Doubtful that poster has made the case for "precise" 50MHz.

    Time spent on an (unworthy) pursuit necessarily subracts from time/effort directed toward more (meaningful) - does it not?

    Sometimes the best "answer" to (what appears to be) a misguided request is, "Don't do it!"