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.

TM4C123gh6pm PWM PC4 xds100v2 problem

Hi,

I'm trying to implement PWM module to my PCBA.

But there's a strange problem.

The pwm module work fine on TM4C123g lauchpad. (Stellaris In-Circuit)

But the same code on my PCBA would jump into Fault_ISR (via XDS100v2)

This function would lead to fault_ISR on my PCBA.

PWMGenConfigure(PWM0_BASE, PWM_GEN_3, (PWM_GEN_MODE_DOWN));

->HWREG(ui32Gen + PWM_O_X_CTL) = ((HWREG(ui32Gen + PWM_O_X_CTL) &
                                     ~(PWM_X_CTL_MODE | PWM_X_CTL_DEBUG |
                                       PWM_X_CTL_LATCH | PWM_X_CTL_MINFLTPER |
                                       PWM_X_CTL_FLTSRC |
                                       PWM_X_CTL_DBFALLUPD_M |
                                       PWM_X_CTL_DBRISEUPD_M |
                                       PWM_X_CTL_DBCTLUPD_M |
                                       PWM_X_CTL_GENBUPD_M |
                                       PWM_X_CTL_GENAUPD_M |
                                       PWM_X_CTL_LOADUPD | PWM_X_CTL_CMPAUPD |
                                       PWM_X_CTL_CMPBUPD)) | ui32Config);

 and the NVIC_Register shows like

 

Other peripheral modules works fine (i2c, smbus, can, timer)

 

The PWM initializtion code is

	SysCtlPWMClockSet(SYSCTL_PWMDIV_64);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_PWM0);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
//    HWREG(GPIO_PORTC_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY_DD;
//    HWREG(GPIO_PORTC_BASE + GPIO_O_CR) |= 0xff;
	SysCtlDelay(10);
	GPIOPinConfigure(GPIO_PC4_M0PWM6);
	GPIOPinTypePWM(GPIO_PORTC_BASE, GPIO_PIN_4);

	uint32_t ui32PWMClock, PWM_FREQUENCY=64,ui32Load;
	ui32PWMClock = SysCtlClockGet() / 64;
	ui32Load = (ui32PWMClock / PWM_FREQUENCY) - 1;
	SysCtlDelay(10);

	PWMGenConfigure(PWM0_BASE, PWM_GEN_3, (PWM_GEN_MODE_DOWN));
	PWMGenPeriodSet(PWM0_BASE, PWM_GEN_3, ui32Load);
	PWMPulseWidthSet(PWM0_BASE, PWM_OUT_6, ui32Load / 2);
	PWMOutputState(PWM0_BASE, PWM_OUT_6_BIT, true);
	PWMGenEnable(PWM0_BASE, PWM_GEN_3);

 

I couldn't figure out how this happened.

Does anyone has the same or similar problem?

It would be great for any suggestion.

 

Regards