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-TM4C1294XL and PWM module

Other Parts Discussed in Thread: EK-TM4C1294XL

Hi all,

I've purchased a connected launchpad with EK-TM4C1294XL.

I'm playing with the hello example, I've completed the Project 0 example and everithing in my toolchain seems to be working.

Next step  I would use the PWM but when I try to give clock to the PWM0 using

PWMClockSet(PWM0_BASE, PWM_SYSCLK_DIV_1); the program stops working, ideas?

main source:

Hi all,

I've purchased a connected launchpad with EK-TM4C1294XL.

I'm playing with the hello example, I've completed the Project 0 example and everithing in my toolchain seems to be working.

Next step  I would use the PWM but when I try to give clock to the PWM0 using 

PWMClockSet(PWM0_BASE, PWM_SYSCLK_DIV_1); the program stops working, ideas?

main source:
....
int main(void)
{
	// Run from the PLL at 120 MHz.
	g_ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
			SYSCTL_OSC_MAIN | SYSCTL_USE_PLL |
			SYSCTL_CFG_VCO_480), 120000000);

	// Configure the device pins.
	PinoutSet(false, false);

	// Enable the GPIO pins for the LED D1 (PN1).
	ROM_GPIOPinTypeGPIOOutput(GPIO_PORTN_BASE, GPIO_PIN_1);

	// Initialize the UART.
	ConfigureUART();

    	// Set the PWM clock to the system clock.
    	//SysCtlPWMClockSet(SYSCTL_PWMDIV_16);   << I cannot use this as stated in tivaware manual
	PWMClockSet(PWM0_BASE, PWM_SYSCLK_DIV_1);	// << Without this I can read in the UART hello test
	//
	// Hello!
	//
	UARTprintf("Hello, Test %d!\n",g_ui32SysClock);

	while(1)
	{


	}
}

  • Code snipet included does not reveal your, SysCtlPeripheralEnable() of, "PWM0_BASE."  Minus that - your program will fault upon your call to any such, "disabled" peripheral...

    And - no such (most necessary) SysCtlPeripheralEnable() references appear for any other peripherals, either...

  • You were right i shaved it to simplify for the post.

    The fact was that the example in Tivaware used that after SysCtlPWMClockSet...


    Now it works. Thank you very much!

    G.

  • Giuseppe Iellamo said:
     I shaved it off... to simplify the post.

    Glad you resolved - all credit to you - and thanks your Verify. 

    The fact that you tried to simplify/consolidate your post deserves applause!  Good for you.  Personally - when the posted code shows NO respect/care/concern for poor reviewers - I depart - leave such for the "hired help." 

    And - I made time/effort to suggest methods to increase poster efficiency - that recommendation list sits "duly noted" while the glacier gradually builds mass/power - and drifts along unchanged...

    Bon chance, mon ami...