| The oCCP Object directly encapsulates the PIC's CCP1 Hardware Module. (CCP1) The CCP1 Hardware Module captures the 16-bit value of the Timer1 Hardware Module when an event occurs on I/O Line 17 (RC2/CCP1). When the Operate property is set to 1, the oCCP object first configures the Timer1 Hardware Module and then sets the CCPxM3 bit which turns the CCP Module on at which time to will begin to wait for the event to occur. The Mode property selects the event that causes the capture which can be one of the following:
Every falling edge
Every rising edge
Every 4th rising edge
Every 16th rising edge
When the event occurs, the 16-bit value of the Timer1 Hardware Module is captured and placed into the Value property. If another capture occurs before the Value property is read, the old captured value is overwritten by the new value. When to operate property transitions from 0 to 1, the Mode property is copies to the CCP Module's CCPxM1 and CCPxM0 bits. Note that all instances of the oCCP object will use the PIC's CCP1 Hardware Module. Therefore, all instances of the oCCP object will have the same 16-Bit count. This includes instances of objects that use the oCCP object. The Timer property is an instance of the oTimer object which the oCCP object uses. When the operate property transitions from 0 to 1, the oCCP object configures the Timer's properties so that it will use an internal clock with a 1:1 prescale. Attributes of the Timer object's operation can be adjusted by directly manipulating it, but note that doing so may change the way the the oCCP object works to something different than described in this document. (see oTimer Object for more detail). |