LPC1768 QEI Max Capture speed

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

LPC1768 QEI Max Capture speed

908 次查看
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.
标签 (3)
标记 (2)
0 项奖励
回复
3 回复数

886 次查看
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 项奖励
回复

884 次查看
hdhedhu10
Contributor II

Maximum frequency is 350Khz.

0 项奖励
回复

830 次查看
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 项奖励
回复