Skip to main content
RKage.2
Associate
March 27, 2021
Question

Timer in Encoder Mode Interrupt via Output Compare

  • March 27, 2021
  • 3 replies
  • 1089 views

I know, I'm repeating an age old question, but has there been any updates on generating an Interrupt when using a Timer in Encoder mode? I know, that the Interrupt doesn't fire in Encoder mode, but I read in this one thread, that it's somehow possible to set Channel 3 and 4 to Output Compare no Output and somehow create an interrupt that way, but that was a bit confusing. Can any one help?

This topic has been closed for replies.

3 replies

waclawek.jan
Super User
March 27, 2021

> generating an Interrupt when using a Timer in Encoder mode

Interrupt upon what? What do you want to achieve? What exactly is confusing in the linked thread?

JW

RKage.2
RKage.2Author
Associate
March 27, 2021

Interrupt on the encoder value changing.

The linked thread is confusion because I tried it, but simply nothing happens.

This a classic case of something beeing pretty simple, if you know how it works, but seems impossible, when you don't.

SMT32 Timers can be pretty confusing, even though I have read the Application Notes and the reference manual.

waclawek.jan
Super User
March 27, 2021

> The linked thread is confusion because I tried it, but simply nothing happens.

What exactly did you try, and what "nothing happens" exactly means?

> Interrupt on the encoder value changing.

I'm not sure why this would be useful.

The linked thread discusses something different: interrupt upon reaching a predetermined value.

Value is changing when an edge arrives on one or both channels CH1/CH2 (depending on the particular encoder mode selected), so you simply set up an input capture interrupt on the given channel.

JW