Rotary encoder and MIMXRT1020

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Rotary encoder and MIMXRT1020

Jump to solution
1,990 Views
Irv95G
Contributor II

Hi, im new to embeded systmes, im trying to interface a mechanical rotary encoder with the MIMXRT 1020 EVK,  can anyone tell me if there are speciphic module/peripherals to do this ? i'm currently trying with interrups pins.

 

thanks 

0 Kudos
Reply
1 Solution
1,984 Views
ErichStyger
Specialist I

It depends on your usage and the frequency of your rotary encoder: Because mechanical, you will need to debounce the signals imho. And the signal frequency is probably so low that using interrupts does not make much sense. What I use for such things are normal GPIO pins (polled) with a debounce state machine. That has the advantage that you don't need precious interrupts and you don't run into a 'death-by-interrupt' situation.

 

I hope this helps,

Erich

View solution in original post

4 Replies
1,967 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @Irv95G ,

RT1020 has QTMR and ENC. QTMR can deal with quadrature mode and increase/decrease mode. ENC is enhanced quadrature encoder/decoder module.

 

Regards,

Jing 

0 Kudos
Reply
1,985 Views
ErichStyger
Specialist I

It depends on your usage and the frequency of your rotary encoder: Because mechanical, you will need to debounce the signals imho. And the signal frequency is probably so low that using interrupts does not make much sense. What I use for such things are normal GPIO pins (polled) with a debounce state machine. That has the advantage that you don't need precious interrupts and you don't run into a 'death-by-interrupt' situation.

 

I hope this helps,

Erich

1,962 Views
FormalMeerkat
Contributor I

Thank you for such a wonderful post and sharing. God bless you.! 

 

prepaidcardstatus

0 Kudos
Reply
1,968 Views
Irv95G
Contributor II

Thanks for the information ErichS

0 Kudos
Reply