LPC1768 QEI Max Capture speed

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC1768 QEI Max Capture speed

556 Views
hdhedhu10
Contributor II
QEI configuration code is shown below :
 
CLKPWR_ConfigPPWR (CLKPWR_PCONP_PCQEI, ENABLE);
 
/* As default, peripheral clock for QEI module
* is set to FCCLK / 2 */
// printf("\n qei_start");
CLKPWR_SetPCLKDiv(CLKPWR_PCLKSEL_QEI, CLKPWR_PCLKSEL_CCLK_DIV_1);
 
 
// Reset all remaining value in QEI peripheral
QEIx->QEICON = QEI_CON_RESP | QEI_CON_RESV | QEI_CON_RESI;
QEIx->QEIMAXPOS = 0x00;
QEIx->CMPOS0 = 0x00;
QEIx->CMPOS1 = 0x00;
QEIx->CMPOS2 = 0x00;
QEIx->INXCMP = 0x00;
QEIx->QEILOAD = 0x00;
QEIx->VELCOMP = 0x00;
QEIx->FILTER = 0x00;
// Disable all Interrupt
QEIx->QEIIEC = QEI_IECLR_BITMASK;
// Clear all Interrupt pending
QEIx->QEICLR = QEI_INTCLR_BITMASK;
// Set QEI configuration value corresponding to its setting up value
QEIx->QEICONF = ((QEI_CFGOPT_Type *)QEI_ConfigStruct)->ulQEIConfig;
 
 
 
This configuration does not seem to work if we move encoder really fast...This code is setup to use 100MHZ as peripheral clock but it still fails to recognize the signals properly when we move it fast. In slow motion it captures all the count properly.
LPC datasheet does not mention till what frequency QEI is capable of counting pulse. I have attached the logic analyzer capture of the signals which is troubling me.
Labels (3)
Tags (2)
0 Kudos
Reply
3 Replies

534 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I have checked the data sheet of LPC176x, but it does not list the max speed of QEI.

For your case, what is PhaseA/PhaseB signal frequency which are from encoder?

BR

XiangJun Rong

0 Kudos
Reply

532 Views
hdhedhu10
Contributor II

Maximum frequency is 350Khz.

0 Kudos
Reply

478 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I suppose that it is okay for the QEI counter counts both falling/rising edge of both phaseA/PhaseB signal(x4) even if the phaseA signal frequency is 350K.

Hope it can help you

BR

XiangJun Rong

0 Kudos
Reply