oPulseTimeH Object

Main Index
Object List
Back to top of page Description:
 Measures the pulse time of a high-frequency input on a hardware specific I/O line.
 The following table lists the size and availability of the oPulseTimeH Object.
 ObjectSizeDescriptionA1A2B1B2C1
oPulseTimeH5 BytesMeasures the pulse time of a high-frequency input using a hardware specific I/O line.x
Back to top of page Operation:
 

When the Operate property is 1, the oPulseTimeH Object monitors I/O line 17 for a specified pulse.  When the pulse is started, a counter value reset and when the pulse ends, the counter value is copied to the Duration property.

The State property selects whether the pulse being measured is a high-going or low-going pulse.

The Timer property is an instance of the oCCP object which is used to do the actual pulse time calculation.  When the operate property transitions from 0 to 1, the oCCP object is configured so that it will use an oTimer object with an internal clock and a 1:1 prescale.   Note that all instances of the oTimer object will use the PIC's Timer1 Hardware Module.  Therefore, all instances of the oTimer object and objects that use the oTimer object will have the same 16-Bit count.  

Back to top of page Properties:

The following table lists the properties of the oPulseTimeH Object:

Property

Description

Duration
A value that indicates the current duration of one cycle.
Object Class: oWord Value Range: 0 - 65535
Data Type: Numeric Default Value: 0
State
A value that selects whether the pulse being measured is a high-going or low-going pulse.
Object Class: oSelect0to1 Value Range: 0 - 0
Data Type: Numeric Default Value: 0
Any changes to this property will be ignored until the operate property transitions from 0 to 1.
PreScaleDescription
0Measure Low-going pulses
1Measure high-going pulses
Operate
A value that selects whether or not the cycle duration is measured.
Object Class: oOperate Value Range: 0 - 1
Data Type: Numeric Default Value: 0
OperateConstantDescription
0cvOffThe cycle duration is not measured.
1cvOnThe cycle duration is measured.
Timer
The PIC Hardware object used to measure the pulse.
Object Class: oCCP Value Range: 0 - 65535
Data Type: Numeric Default Value: 0
Note: oCCP object uses an instance of the oTimer object.  All instances of the oTimer object use the same PIC hardware, Therefore all instances of the oPulseTimeH objects will read the same 16-Bit value.  Also note that setting its properties can affect the way the oPulseTimeH operates.
Address
Returns a pointer to the address of the oCounter Object instance.
Object Class: oAddress Value Range: 0 - 127
Data Type:Pointer (Read Only) Default Value: Address of Object

Back to top of page Examples:
 In the following example, the oPulseTimeH Object is used.
Visual Basic SyntaxC and Java Syntax
' This program measures the cycle
' time on I/O Line 17 and displays
' the result on I/O Group 1 and 3.

Dim C As New oPulseTimeH
Dim D As New oDIO16

Sub main()
  C.State = 1
  C.Operate = 1
  D.Direction = cvOutput
  Do
    D.State = C.Duration 
  Loop
End Sub
// This program measures the cycle
// time on I/O Line 17 and displays
// the result on I/O Group 1 and 3. 

oPulseTimeH C = New oPulseTimeH;
oDIO16 D = New oDIO16;

Void main(Void){
  C.State = 1;
  C.Operate = 1;
  D.Direction = cvOutput;
  Do{
    D.State = C.Duration;
  } While (1);
}
Basic Syntax 
' This program measures the cycle
' time on I/O Line 17 and displays
' the result on I/O Group 1 and 3.

C Var oPulseTimeH(1,cvOn)
D Var oDIO16(cvOutput)

Do
  D.State = C.Duration 
Loop
 

Back to top of page Related Items:

 The following table lists objects that use the oPulseTimeH Object.
 ObjectDescriptionA1A2B1B2C1
oRCIN(1-6)An Object that reads a Radio Receiver with up to 6 channels.x
oRCIN(1-6)XAn Object that reads a Radio Receiver with up to 6 channels using URCP values.x
 The following table lists objects with related functions
 ObjectDescriptionA1A2B1B2C1
oPWMHOutputs a high-speed Pulse-Width-Modulated output using hardware specific I/O lines.xxxxx
oPWMLOutputs a low-speed Pulse-Width-Modulated output on any I/O line.xxx
oPWMSOutputs a RC-Servo timed Pulse-Width-Modulated output on any I/O line.xxxxx
Back to top of page Version History and Bug List:
 Firmware Ver C1: Introduced.

Bugs: No known bugs.


ooPIC Compiler Ver 6.0 (c) Copyright 1997 - 2007 Savage Innovations, LLC.