Author Topic: QEI module of PIC18F4431  (Read 3986 times)

0 Members and 1 Guest are viewing this topic.

Offline onemilimeterTopic starter

  • Frequent Contributor
  • **
  • Posts: 314
QEI module of PIC18F4431
« on: January 26, 2011, 02:46:45 pm »
I've a motor with an incremental encoder. The resolution of the encoder is 2000ppr. The A-B-IDX of the encoder is connected to the QEI module input of PIC18F4431. Since the QEI module counts at every edge (rising and falling), can I say that the output of the QEI module will be from 0-7999?

http://ww1.microchip.com/downloads/en/devicedoc/39616b.pdf

Thanks.
 

Offline ANTALIFE

  • Frequent Contributor
  • **
  • Posts: 509
  • Country: au
  • ( ͡° ͜ʖ ͡°)
    • Muh Blog
Re: QEI module of PIC18F4431
« Reply #1 on: November 22, 2018, 04:26:39 am »
Give it a go and see what happens ;^)

Offline H.O

  • Frequent Contributor
  • **
  • Posts: 814
  • Country: se
Re: QEI module of PIC18F4431
« Reply #2 on: November 22, 2018, 05:57:25 am »
It depends on how you set up the QEI module.
It can either wrap around to zero when it sees the index pulse OR when it hits an arbitrary count.
If you set it up to wrap around at 7999 then it will do so no matter how many cycles per rev the encoder actually has.
If you set it up to wrap around on index then it will do so no matter how many cycles per rev the encoder has.

It can also be set to either 2x or 4x decoding so if your encoder has 2000 lines or cycles per rev the module will count either 4000 or 8000 counts per rev.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf