capture pwm missing
2005-04-22 by dasbento@aeiou.pt
Hello group,
I have one problem in capture of PWM, i.e, sometimes exist missing the
capture of PWM.
I'm using the LPC2129!!
My interrupt function is the following
void capture (void) {
if(T1IR & TIR_CR0I){ //interrupt no chanel0 (eixo dos xx)
T1IR = TIR_CR0I;
acel_cap_eixo_x();
}
if(T1IR & TIR_CR1I){ //interrupt no chanel1 (eixo dos yy)
T1IR = TIR_CR1I;
acel_cap_eixo_y();
}
if(T1IR & TIR_CR2I){ //interrupt no chanel2 (eixo dos zz)
T1IR = TIR_CR2I; //clear flag interrupt
acel_cap_eixo_z();
}
VICVectAddr = 0xFFFFFFFF;
}
void acel_cap_eixo_x(void){
u32 tpu;
if(IOPIN0 & ACEL_asc_x){ //verify if rising edge
tpu=T1CR0;
INS_ACEL_write(0, ((ACEL_T2_x-ACEL_T1_x)<<12)/(tpu-ACEL_T1_x));
ACEL_T1_x=tpu;
}else{ //falling edge
ACEL_T2_x = T1CR0;
}
return;
}
Someone has some suggestion for this problem!!!
Thanks
Domingos
_________________________________________________________
CEAC Cursos de forma\ufffd\ufffdo profissional - pe\ufffda informa\ufffd\ufffdes aqui.:
http://ceac.online.pt/