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.

TM4C129 clock question

Other Parts Discussed in Thread: MIKROELEKTRONIKA

Hello,

I'm using TM4C129 microcontroller with Keil uVision.

First I was using Mikroelektronika dev board ( http://www.mikroe.com/mikromedia/5/tiva/ ) and with PIOSC and PLL, board works on 118MHz (it was crashing on 120MHz).

Then I made my own board, and i got 114 MHz, after few days my chip dies, and on same board I put another chip, and this one could't go over 106 MHz.

I'm using external oscillator 16MHz, this is my code:

	SYSCTL->MOSCCTL  = (1<<4);
	SYSCTL->MEMTIM0  = 0x00110091;
	SYSCTL->RSCLKCFG = 0x03300000;
	SYSCTL->PLLFREQ1 = 0x00000001;
	SYSCTL->PLLFREQ0 = 0x00000019;
	SYSCTL->MEMTIM0  = 0x01540154;
	SYSCTL->PLLFREQ0 = 0x00800035;
	SYSCTL->RSCLKCFG = 0xC3300000;
	for (i= 32768; i>0; i--)
	{
		if (SYSCTL->PLLSTAT)
		{
			break;
		}
	}
	SYSCTL->RSCLKCFG = 0x13300003;

Can this microcontroller operate on 120MHz? I need every single megahertz.

Thank you,

Tomica.

  • Hello Tomica,

    When you enable the MOSC, you need to give it sufficient time for the crystal to power up. This mentioned as Cyrstal Start Up time in the Electrical Specification, which is clearly not the case in the code.

    Secondly when you power up the PLL the value is 0x00800035. The MINT=0x35 and the N=0x1 would generate a PLL VCO of 424MHz. The RSCLKCFG does not have the PLL divider so it would end up using this VCO as the clock. So during the clock switchover when RSCLKCFG is configured as 0x13300003, the high frequency clock would be injected. The device works at 120MHz but not at 424MHz...

    So corrections

    1. After MOSCTL please honor the Crystal Start Up time

    2. Please program the PSYSDIV in RSCLKCFG before powering the PLL.

    Regards

    Amit

  • Hello Amit,

    thank you for your answer, but I still can't get more than 104MHz...

    I changed my code into:

    	SYSCTL->MOSCCTL  = (1<<4);
    	for (i=0; i<288000; i++);
    	SYSCTL->MEMTIM0  = 0x00110091;
    	SYSCTL->RSCLKCFG = 0x03300003;
    	SYSCTL->PLLFREQ1 = 0x00000001;
    	SYSCTL->MEMTIM0  = 0x01540154;
    	SYSCTL->PLLFREQ0 = 0x00800034;
    	SYSCTL->RSCLKCFG = 0xC3300003;
    	for (i= 32768; i>0; i--)
    	{
    		if (SYSCTL->PLLSTAT)
    		{
    			break;
    		}
    	}
    	SYSCTL->RSCLKCFG = 0x13300003;

    If I put value bigger than 0x34 in register PLLFREQ0, microcontroller stops immediately or after few seconds...

    Did I miss something?

    Thank you,

    Tomica

  • Hello Tomica

    Since I do not have your toolchain, I would suggest the following without being able to test it

    	SYSCTL->MOSCCTL  = (1<<4);
    	for (i=0; i<288000; i++);
    	SYSCTL->MEMTIM0  = 0x00110091;
    	SYSCTL->RSCLKCFG = 0x03300003;
    	SYSCTL->PLLFREQ1 = 0x00000001;
    	SYSCTL->MEMTIM0  = 0x01D701D7;
    	SYSCTL->PLLFREQ0 = 0x0080001E;
    	SYSCTL->RSCLKCFG = 0x43300003;
    	for (i= 32768; i>0; i--)
    	{
    		if (SYSCTL->PLLSTAT)
    		{
    			break;
    		}
    	}
    	SYSCTL->RSCLKCFG = 0x93300003;

    Regards

    Amit

  • That works, but that is 60MHz...Too low for my application.

    I tried with maximum MEMTIM0 value (0x03D703D7), and PLLFREQ0 = 0x3C, and don't work...(This must be 120MHz).

    It works with PLLFREQ = 0x38...

  • Hello Tomica,

    My mistake as I forgot the PLLFREQ1 has the divider.

    SYSCTL->MOSCCTL  = (1<<4);
    for (i=0; i<288000; i++);
    SYSCTL->MEMTIM0  = 0x00110091;
    SYSCTL->RSCLKCFG = 0x03300003;
    SYSCTL->PLLFREQ1 = 0x00000000;
    SYSCTL->MEMTIM0  = 0x01D701D7;
    SYSCTL->PLLFREQ0 = 0x0080001E;
    SYSCTL->RSCLKCFG = 0x43300003;
    for (i= 32768; i>0; i--)
    {
        if (SYSCTL->PLLSTAT)
        {
            break;
        }
    }
    SYSCTL->RSCLKCFG = 0x93300003;

    Regards

    Amit

  • Tomica Car1 said:

    Then I made my own board, and i got 114 MHz, after few days my chip dies, and on same board I put another chip, and this one could't go over 106 MHz.

     Hi, please can you post more information of the way it died? Got hot never responsive?

     I am interested to see everything can evaluate fault analysis.

  • I've tried this, and almost any other combination, then I put 0x03 in PLLFREQ1, with PSYDIV=3 that makes general divider=16, and with oscillator 16MHz, value writen in PLLFREQ0 i frequency in MHz...and also in MEMTIM0=0x01D701D7 (maximum value);

    When I wrote number 109(decimal) in PLLFREQ, my LED was blinking with 1 second period, which means that frequency was 120MHz...LED was blinking few minutes, and I was happy. Then I uncommented the rest of code (which worked with previous microcontroller (the one that operates with 114MHz)), and stopped working...

  • Hello Tomica,

    If the previous setting was giving a system clock of 60MHz, then the new setting with PLLFREQ1 changed to 0x0 would give 120MHz. This is already being done in the TIVAWare API's (which is not being used by the code). Please do note that the PLL has a operating VCO range. Using a value of M such that it goes out of range may cause the device to lock up.

    So an arbitrarily programmed value may be causing your device to go "dead"

    Regards

    Amit

  • I wasn't measuring, just doing math.

    There is no error in code...now I measured time, and with PLLFREQ0 = 0x37 (55 decimal) came 120MHz!

    But with value 55, frequency should be 110MHz (16*55/2/4 = 110)

    This code works for now (just LED blinking):

    	SYSCTL->MOSCCTL  = (1<<4);
    	for (i=0; i<288000; i++);
    	SYSCTL->MEMTIM0  = 0x00110091;
    	SYSCTL->RSCLKCFG = 0x03300000;
    	SYSCTL->PLLFREQ1 = 0x00000001;
    	SYSCTL->PLLFREQ0 = 0x00000019;
    	SYSCTL->MEMTIM0  = 0x01D701D7;
    	SYSCTL->PLLFREQ0 = 0x00800037;
    	SYSCTL->RSCLKCFG = 0xC3300000;
    	for (i= 32768; i>0; i--)
    	{
    		if (SYSCTL->PLLSTAT)
    		{
    			break;
    		}
    	}
    	SYSCTL->RSCLKCFG = 0x13300003;
    	

    Amit, thank you for your time and help,

    Tomica.

  • Hello Robert,

    I burned 3 chips.

    One just create a sound(like shortcircle) and stopped working(wasn't hot, but pulled power to 0.2V), one died and started heating (can't remember if my mistake), and the last is my mistake, I touchet it with some wire.

    If you want I can send them to you.

    Tomica.

  • Tomica Car1 said:

    One just create a sound(like shortcircle) and stopped working(wasn't hot, but pulled power to 0.2V), one died and started heating (can't remember if my mistake), and the last is my mistake, I touchet it with some wire.

     BGA or QFP?
     Are all solder point good ? Myne is just preplan for future production.

     Actually I burned one Stellaris LM4f120 due to damn zero ohm resistor on launchpad and nothing other, pcb on 123 part where luckily ok, clearly I cannot guarantee future on my hardware too ;)

    Tomica Car1 said:
    If you want I can send them to you.

     It is better send to TI for failure analysis instead, Amit what do you think?

     Thank a lot sharing this information.

  • Hello Roberto,

    It can be sent to TI for failure analysis but without being sure as to how the first two died it would be tough working it out. A schematic of the board would be useful. More details on failure condition (if a 4th can be failed) would be must.

    Regards

    Amit