Quadrature Encoder Iinterface (QEI) od PIC

Discussion in 'Embedded Systems and Microcontrollers' started by dmta, Jun 5, 2013.

  1. dmta

    Thread Starter Member

    Mar 24, 2013
    32
    1
    Hi all,

    Does anyone have an application note or a sample code on how to configure and read speed/position from the QEI module in PIC 18FXX31????????

    Regards
     
  2. WBahn

    Moderator

    Mar 31, 2012
    17,762
    4,800
    Just sketch out the relationships of the two inputs and you'll see that you have a very simple state machine. You have four states and depending on which input changes you can transition from any state to one of two of the other three states. Depending on the transition, you either count up or count down. Your count gives you position and the rate at which you are counting gives you the speed.
     
  3. WBahn

    Moderator

    Mar 31, 2012
    17,762
    4,800
    Or, you could try Googling something like, say: PIC QEI module

    The first thing that comes up is a PDF file from Microchip titled, "Measuring Speed and Position with the QEI Module"

    Seems like that might be worth looking at.

    Wonderful thing, this Google. Perhaps it will catch on someday.
     
    TBayBoy and THE_RB like this.
Loading...