cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
197 Views
Registered: ‎07-18-2019

TimerCounter IP Core PWM without interrupts

Hi, I am trying to use the PWM function of the Timer Counter IP core in vivado. The provided PWM code example use interrupts, but I would like to use it without inerrupts. I have tried configuring the core and just starting it, but it seems to only do a single cycle. How can I configure the Timer Counter IP core in pwm mode without using interrupts?

int ACC_Trigger_Init() {

	Status = XTmrCtr_Initialize(&TimerCounterInst, XPAR_TMRCTR_0_DEVICE_ID);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	//XTmrCtr_SetOptions(&TimerCounterInst, TMRCTR_0, XTC_AUTO_RELOAD_OPTION);
	//XTmrCtr_SetOptions(&TimerCounterInst, TMRCTR_1, XTC_AUTO_RELOAD_OPTION);

	/* Disable PWM for reconfiguration */
	XTmrCtr_PwmDisable(&TimerCounterInst);

	Period = PWM_PERIOD;
	HighTime = PWM_PERIOD / DUTYCYCLE_DIVISOR;

	DutyCycle = XTmrCtr_PwmConfigure(&TimerCounterInst, Period, HighTime);
	if (Status != XST_SUCCESS) {
		return  XST_FAILURE;
	}

	/* Enable PWM */
	XTmrCtr_PwmEnable(&TimerCounterInst);

	//XTmrCtr_Start(&TimerCounterInst, TMRCTR_0);
	//XTmrCtr_Start(&TimerCounterInst, TMRCTR_1);
	//XTmrCtr_PwmStart();
	return XST_SUCCESS;
}
Tags (2)
0 Kudos
1 Reply
Highlighted
118 Views
Registered: ‎07-18-2019

I have also tried running the pwm exemple with interrupts provided without success. The output line remains high. 

0 Kudos