LPC1768 QEI Max Capture speed

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPC1768 QEI Max Capture speed

2,820件の閲覧回数
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 返答(返信)

2,798件の閲覧回数
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 件の賞賛
返信

2,796件の閲覧回数
hdhedhu10
Contributor II

Maximum frequency is 350Khz.

0 件の賞賛
返信

2,742件の閲覧回数
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 件の賞賛
返信