Change polarity of Input components

Moderator: Benj

Post Reply
Ronnyvs
Posts: 10
Joined: Mon Mar 25, 2019 3:04 pm
Been thanked: 2 times
Contact:

Change polarity of Input components

Post by Ronnyvs »

Hello guys,

Can someone help me how i can change the polarity of some components?

Normally, when I design, I use pull-up.
When I use a switch, I can change the polarity to active low. With a little c-code I make some pull-ups for the ports I want to use the switches… no problem at all…

But,
When I want to use a rotary encoder, I don’t know how, or maybe it is not possible, to set the ports I want to use at active low.

Has someone done this before, or has someone a solution?

Already thanks for the answers….

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Change polarity of Input components

Post by Benj »

Hello,

A quadrature encoder works with the waveforms being both high and low. The MCU doesn't care if you are using active high or active low type switches. What will matter is the encoder itself. Are you using an off the shelf encoder or making it yourself from individual switches?

Ronnyvs
Posts: 10
Joined: Mon Mar 25, 2019 3:04 pm
Been thanked: 2 times
Contact:

Re: Change polarity of Input components

Post by Ronnyvs »

Thank you for your answer Ben,

I did the test with a PEC12R encoder and it didn't work.
I thought that the beginning state of the software must noticed a beginning of port-a and port-b logic 0.
I know that the next states of the encoder is 01 or 10 is (depending witch way to rotate)...

so it put me on the wrong leg....
your explanation is well known by me... so i changed de PEC12R by another PEC12R and it worked !

The encoder was broken!!!!!

But al credits to you Ben,
without your answer i was still thinking that the software needed a beginning state of 2 ports at logic 0....

Post Reply