Other Parts Discussed in Thread: C2000WARE
Dear All,
There are a list of Quadrature Encoders compatible with the Quadrature Decoder of the LAUNCHXL?
And the registers initialization programing?
Is the following Encoder compatible? Is the one turn pulse compatible?
See attached file.
Initialization code:
EQep1Regs.QDECCTL.bit.QSRC=00; // QEP quadrature count mode
EQep1Regs.QEPCTL.bit.FREE_SOFT=2; //Position counter is unaffected by emulation suspend
//
// PCRM=00 mode - QPOSCNT reset on index event
//
EQep1Regs.QEPCTL.bit.PCRM=00; //Position counter reset on an index event
EQep1Regs.QEPCTL.bit.UTE=0; // Disable eQEP unit timer
EQep1Regs.QEPCTL.bit.QCLM=0; // Latch on position counter read by CPU.
EQep1Regs.QEPCTL.bit.IEL=0b10; //Latches position counter on falling edge of the index signal
EQep1Regs.QPOSMAX=ENCODER_DIM; // the counter will be between 0 and ENCODER_DIM
EQep1Regs.QPOSINIT=ENCODER_DIM/2; // Initialize Decoder Counter to 20000/2
EQep1Regs.QEPCTL.bit.SWI=1; //Initialize position counter (QPOSCNT=QPOSINIT). This bit is not cleared automatically
DELAY_US(5000L);
EQep1Regs.QEPCTL.bit.SWI=1;
DELAY_US(5000L);
EQep1Regs.QEPCTL.bit.SWI=0;
EQep1Regs.QEPCTL.bit.QPEN=1; // eQEP position counter is enabled
Can you provide equivalents (links) that are compatible with register initialization? Or provide corrections to the above initialization?
Thanks,
Luís Gonçalves