mcpwm

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

mcpwm

412 Views
lpcware
NXP Employee
NXP Employee
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
Labels (1)
0 Kudos
1 Reply

311 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by praveenb on Mon Mar 09 02:18:40 MST 2015

Quote: praveenb
i written a code to generate 90 degree phase shift, i done it when i given to QEI module it showing direction error

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 to QEI module in error register direction and phase error bit is setting, if some one knows about this please suggest


0 Kudos