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.

DMTimer one shot trigger

Hi,

We are trying to start a timer in one shot mode and have it toggle the output pin a single time on overflow but it doesn't work. If we keep the same configuration but change the mode to auto-reload it works but then we have multiple pin toggle. Note that we always get the interrupt successfully even if we don't get the pin toggle. See how we configure the timer below.

Any advice would be appreciated.

int def_on = 1; // Set the PORTIMERPWM output pin and select negative pulse for pulse mode
int toggle = 1; // 1 = Toggle mode
int trigger = OMAP_TIMER_TRIGGER_OVERFLOW; // 1 = Trigger on overflow
int autoreload = 0; // 0 = One shot timer

gptimer = omap_dm_timer_request_specific(4);

/* Setup interrupt */
irq = omap_dm_timer_get_irq(gptimer);
irq_request_ret = request_irq(irq, (void *)&irq_handler, irqflags, devname, dev_id);
omap_dm_timer_set_int_enable(gptimer, OMAP_TIMER_INT_OVERFLOW); // 1<<1 = overflow

/* Set mode and start timer */
omap_dm_timer_set_pwm(gptimer, def_on, toggle, trigger);
omap_dm_timer_set_load_start(gptimer, autoreload, 0xff000000);

  • Well end the end it was just a misunderstanding on our part. We were expecting the output pin to start at it's default state, toggle on overflow and then stay there after the timer is stopped but it's not. As soon as the timer is stopped, the pin goes back to it's default state so when using the timer in one shot mode, the toggle and the pulse mode have the same end result.