Extending TCPWM in Quadrature Decoder Mode

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi all,

I am working on CY8CKIT-043. I needed at least 32-bit for a quadrature decoder in my project, however, TCPWM only offers16-bit of counter width.

I wanted to extend the 16-bit to 32-bit, but, the only interrupt source available are "terminal_count" and "compare".

I believe I will need at least an overflow and underflow flag for me to get this to work.

I know I can't use non-TCPWM QuadDec because it consumes all of the UDBs.

Any tips?

Thank you.

0 Likes
1 Solution
5 Replies
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

Check if this QuadDecoder implementation works for you:

Quad Decoder with Button Switch component for rotary shaft encoders

Anonymous
Not applicable

Whoa, thank you!

I was actually trying to get around it by using this schematic to set a direction-flag in my TC interrupt:

Found here (by RÖB): Encoders Spin Us Right Round | Hackaday

I will try the software version later.

Thanks again.

0 Likes

Check also this hardware implementation for rotation direction

Quadrature decoding with Llogic Gates (No UDBs or TCPWMs use - Hackster.io

Sin título.jpeg

Anonymous
Not applicable

Thank you for both of the links, they are super helpful!

You give me a hard time for selecting the best answer.

0 Likes