From: dave@davehigton.me.uk   
      
   In message    
    The Natural Philosopher wrote:   
      
   > I am slightly curious as to how the PICO could miss what is a several   
   > hundred microsecond wide pulse.   
      
   AFAICS there are many pitfalls:   
      
   1) An interrupt can be being serviced, so the pulse is over before you   
   get to see it.   
      
   2) If you're looking for a pulse, you should be looking edge triggered   
   rather than level triggered, but even then you may not get to react to   
   the edge immediately because of an interrupt being serviced, so you'd   
   get an anomalous result.   
      
   3) You can look level triggered, but you need to turn off all interrupts   
   to ensure you really are loking at it in real time.   
      
   4) I had a play with an ultrasonic ranger a couple of years or so ago.   
   I couldn't understand why I wasn't getting any return pulses at all.   
   I eventually realised that I was sending another start pulse before   
   the current cycle had finished.   
      
   Regardless, you need an escape from any and every potential infinite   
   loop. Whatever you're doing.   
      
   If you can use a hardware timer in the chip, that's a much more reliable   
   solution.   
      
   David   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|