Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] accurate pulse measurements

2005-01-23 by Robert Adsett

At 04:05 PM 1/23/05 +0000, you wrote:
>void acel_cap_eixo_x(void){
>         u32 tpu;
>
>         if(IOPIN0 & ACEL_asc_x){                //verify if rising edge
>                 tpu=T1CR0;
>
>duty_x=(float)(ACEL_T2_x-ACEL_T1_x)/(float)(tpu-ACEL_T1_x));


I haven't gone through this in any sort of detail, but doing floating point 
in an interrupt is at least questionable.  At the very least you need to 
check if your compiler supports it.  BTW despite the casts the above will 
be done in double precision.

Also, please trim those parts of the previous post you are not referring to.

Robert


" 'Freedom' has no meaning of itself.  There are always restrictions,
be they legal, genetic, or physical.  If you don't believe me, try to
chew a radio signal. "

                         Kelvin Throop, III

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.