I have implemented motor control code that uses the eQEP to interrupt every time a pulse is registered. This is important to my application, as no interrupt can be missed in order to successfully commutate the motor. I have added SCI in order to send commands to the microcontroller. The motor spins as expected, but when I send commands via SCI to the driver, I start to miss pulses which eventually causes the motor to stop spinning. I think this is because reading from the SCI buffer is causing me to miss eQEP interrupts, but I'm not exactly sure how to test this. Below are my register settings for the eQEP and SCI. Any help on this is much appreciated!
SciaRegs.SCIFFTX.all=0xE040;
SciaRegs.SCIFFRX.all=0x2044;
SciaRegs.SCIFFCT.all=0x0;
SciaRegs.SCICCR.all =0x0007;
SciaRegs.SCICTL1.all =0x0003;
SciaRegs.SCICTL2.bit.TXINTENA =1;
SciaRegs.SCICTL2.bit.RXBKINTENA =1;
SciaRegs.SCIHBAUD =0x0000;
SciaRegs.SCILBAUD =0x0002;
SciaRegs.SCICTL1.all =0x0023;
EQep1Regs.QUPRD=18000000;
EQep1Regs.QEINT.bit.PCO = 1;
EQep1Regs.QEINT.bit.PCM = 1;
EQep1Regs.QEPCTL.bit.FREE_SOFT=2;
EQep1Regs.QEPCTL.bit.PCRM=1;
EQep1Regs.QEPCTL.bit.UTE=0;
EQep1Regs.QEPCTL.bit.QCLM=0;
EQep1Regs.QPOSMAX=0x00000800;
EQep1Regs.QPOSCMP=0x00000000;
EQep1Regs.QEPCTL.bit.QPEN=1;
EQep1Regs.QCAPCTL.bit.UPPS=1;
EQep1Regs.QCAPCTL.bit.CCPS=2;
EQep1Regs.QCAPCTL.bit.CEN=1;
EQep1Regs.QPOSCTL.bit.PCE = 1;