lpcware

mcpwm

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by praveenb on Mon Mar 09 02:18:12 MST 2015
i written a code to generate 90 degree phase shift, i done it when i given to QEI module it showing direction error, Device lpc1769

my code is

LPC_SC->PCONP |= ( 0x01 << 17 );
LPC_SC->PCONP |= ( 0x01 << 1 );


LPC_LPC_SC->PCLKSEL1 |= ( 0x03 << 30 );     //Selecting Clock

LPC_MCPWM->MCPER0 = 10000 * 625;                //Pulse Period Channel0
LPC_MCPWM->MCPW0 = 10000 * 312.5;
LPC_MCPWM->MCDEADTIME = ( ( 0x0 << 10 ) | 0x9C );
LPC_MCPWM->MCPW1 = 10000 * 625;
LPC_MCPWM->MCCON_SET = 0x40000D1B;

it generate 1Hz and 90 degree phase shift, when i given this signal to QEI module, i am getting a error in error register direction and phase error, if some one knows about this please suggest

using feedback register we can solve this problem, but i do not know how to use feedback register

Outcomes