Why is my latch takink so long to turn on in somecases?

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
The top trace represents my sensor input into a CCP. It is Hall Effect sensor That is detecting the rotation of a hard drive platter running at a fairly constant RPM. Somewhere around 800 RPM.

The bottom trace is a latch port that I am quickly turning off and back on on every CCP interrupt. It looks like every 1.98 seconds the latch stays off for 84ms (that is one rotation of the disk). Why would my latch not be turning back on so regularly?

My chip is a PIC18F27J13 running at 8MHZ,

Here is my interrupt code.

Code:
if (PIR4bits.CCP5IF == 1)
  {
  
  PIR4bits.CCP5IF = 0;  
  
  LATBbits.LATB4 = 0;  
  LATBbits.LATB4 = 1;
  }

upload_2018-11-14_16-25-41.png
 
Last edited:
Top