Forums

capture pwm missing

Started by dasb...@... April 22, 2005
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 formao profissional - pe informaes aqui.:
http://ceac.online.pt/


An Engineer's Guide to the LPC2100 Series


Take a look at the PWM.1 Errata. I did not see LPC2129 Erratasheet
on the web, but bug should be the same as published in Erratasheets
for other members of this family. --- In lpc2000@lpc2..., dasbento@a... wrote:
> 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 formao profissional - pe informaes aqui.:
> http://ceac.online.pt/