View Single Post
Old 03-17-2016, 12:58 PM   #2667 (permalink)
EcoModding Lurker
Join Date: Mar 2016
Location: italy
Posts: 40
Thanks: 5
Thanked 2 Times in 2 Posts
Originally Posted by MPaulHolmes View Post
They may have different settings for initializing the quadrature encoder interface. Or maybe that's not the problem at all. I don't know why it's not working with my code. Maybe there's an issue with the swap ab inputs, or something. YOu coudl try to change:

QEICONbits.SWPAB = 0; // don't swap QEA and QEB inputs.

Change that to SWPAB = 1 instead?
i just removed the pull down resistors and now i have 4.16V max

i also tried to swap the inputs but the postcount is remaing the same

this is configuration code of an1162:
// ============= Encoder ===============

    MAXCNT = MotorParm.iCntsPerRev;    
    POSCNT = 0;
    QEICON = 0;
    QEICONbits.QEIM = 7;    // x4 reset by MAXCNT pulse
    QEICONbits.POSRES = 0;  // Don't allow Index pulse to reset counter
    QEICONbits.SWPAB = 1;   // direction 
    DFLTCON = 0;            // Digital filter set to off
i also tried to disable the filter but nothing changes..
  Reply With Quote