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.

AM335x: DMTimer won't toggle pin on overflow in one shot mode

Hi,

We are trying to use the DMTimer to set the ouput pin to 1, count to overflow then set the pin to 0 (toggle) and stop. This should be possible using the timer in one shot mode however for some reason it won't work. If we use the exact same code but set the auto reload it works but then it won't stop toggling the pin which cannot work in our application. Also the if we enable the overflow interrupt it will fire correctly so this proves that we have an overflow in the first place. 

Any idea?

Here a snippet how what we are doing. We are using Android Jellybean running kernel 3.2.

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

omap_dm_timer_set_pwm(gptimer, def_on, toggle, trigger);
omap_dm_timer_set_load(gptimer, autoreload, 0xffF00000);
omap_dm_timer_start(gptimer);

  • 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.