oIOLineP Object

Main Index
Object List
Back to top of pageDescription:
 Controls one of the PIC's I/O lines accessible by the PIC's PWM Module.
 The following table lists the size and availability of the oIOLineP Object.
 ObjectSizeDescriptionA1A2B1B2C1
oIOLineP1 ByteControls one of the PIC's I/O lines accessible by the PIC's PWM Module.xxxxx
Back to top of pageOperation:
 An Object that controls one of the PIC's I/O lines accessible by the PIC's PWM Module.

The Line property specifies which PWM I/O line to use.  0 will access I/O Line 18 and 1 will access I/O Line 17.

Once the Line properties set, the Direction and the State properties reference the actual hardware that controls the Direction and State of the specified PIC I/O Pin. 

The State property references the electrical state of the I/O Pin specified.

The Direction property specifies if the I/O Pin is an input or an output. When the Direction property is set to 0 (cvOutput), then the specified Pin will output either 0 or 5 Volts depending on what the State property is set to.  When the Direction property is set to 1 (cvInput), then the specified Pin is set to be an input and the State property will report whether or not 5 Volts is being applied to the Pin by an external device.

Note that since the Direction and State properties reference the actual hardware of the specified PIC I/O Pin, then changing the Line property will also re-index the hardware that the Direction and State properties reference.   This means that you MUST set the Line property BEFORE you set the Direction property for the Direction property to affect the I/O line you want to use.  For example, if 1 is specified (Pin 17) and it is an input, then the Direction property would read 1 and the State property would report the current electrical state of Pin 17.  Then if the Line property was changed to 0 (Pin 18) and Pin 18 was an output, the Direction property will now read 0 and the State property would report the current electrical state of Pin 18.  See other examples below.

Note that the oIOLineP Object does not control the PWM module.  That job is reserved for the oPWM Object which uses the oIOLineP Object to designate which I/O Line it is going to use.

Also note that the Line property is the default property.  This means that if an instance of the oIOLineP Object exists, then not only can the Line property be set to 1 by assigning it with the statement "IOLine.Line = 1", it can also be set with the statement: "IOLine = 1" as demonstrated in the oPWM Object.

Back to top of pageProperties:
 

The following table lists the properties of the oIOLineP Object:

Property

Description

Line
A value that selects the I/O Line to use.
Object Class: oSelect0to1 Value Range: 0 - 1
Data Type: Numeric Default Value: 0
IOLineDescription
0

The Direction and State properties reference IOLine 18. 18 can be assigned to Line in place of 0 but it will read back as 0.

1

The Direction and State properties reference IOLine 17. 17 can be assigned to Line in place of 1 but it will read back as 1.

Direction
A value that specifies if the I/O line is a Input or an Output.
Object Class: oProperty Value Range: 0-1
Data Type: Numeric Default Value: 1 (cvInput)
DirectionConstantDescription
0cvOutputThe specified I/O Line is an output and the State property is written to it.
1cvInputThe specified I/O Line is High-Z and the State property is read from it.
State
A value that indicates the current electrical state on the I/O line.
Object Class: oProperty Value Range: 0 - 1
Data Type: Numeric Default Value: 0
ValueConstantDescription
0cvOffThe specified I/O line is at 0 Volts.
1cvOnThe specified I/O line is at +5 Volts.
IsLow
A value that indicates if the current state is Low.
Object Class: oProperty Value Range: 0 - 1
Data Type: Numeric (Read-Only) Default Value: (Not State)
The IsLow property reports the reverse value of the State property.  It is worded to be understood in an evaluation such as: if X.IsLow then...
IsHighDescription
0The Electrical State is at a Logical High (5 Volts).
1The Electrical State is at a Logical Low (0 Volts).
IsHigh
A value that indicates if the current state is High.
Object Class: oProperty Value Range: 0 - 1
Data Type: Numeric (Read-Only) Default Value: N/A
The IsHigh property reports the same value as the State property.  It is worded to be understood in an evaluation such as: if X.IsHigh then...
IsHighDescription
0The Electrical State is at a Logical Low (0 Volts).
1The Electrical State is at a Logical High (5 Volts).
Port
The PIC Hardware object used to control the I/O line.
Object Class: oPort Value Range: 2
Data Type: Numeric (Read-Only) Default Value: 0
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 pageExamples:
 In the following examples, the oIOLineP Object is used.
Visual Basic Syntax C and Java Syntax
'This program turns an 
'output on and then off at
'a rate of once a second.

Dim A As New oIOLineP

Sub Main()
  A.Line = 17
  A.Direction = cvOutput
  Do
    A.State = Not A.State
    ooPIC.Delay = 1000
  Loop
End Sub
//This program turns an 
//output on and then off at
//a rate of once a second.

oIOLineP A = New oIOLineP;

Void Main(Void){
  A.Line = 17;
  A.Direction = cvOutput;
  Do{
    A.State = Not A.State;
    ooPIC.Delay = 1000;
  }
}
Basic Syntax 
'This program turns an 
'output on and then off at
'a rate of once a second.

A As oIOLineP(17,cvOutput)

Do
  A.State = Not A.State
  ooPIC.Delay = 1000
Loop
 

Back to top of page Related Items:

 The following table lists some of the objects that use the oIOLineP Object.
 ObjectDescriptionA1A2B1B2C1
oDCMotorControls a DC motor that is driven by an LMD18200 H-Bridge driver.xxx
oHBridgeHManages the I/O for driving an H Bridge using hardware specific I/O lines for the PWM.xxx
oPWMHProvides a high-speed Pulse-Width-Modulated output using hardware specific I/O lines.xxxxx
oPWMControls one of the PIC's PWM Hardware Module.xxxxx
 The following table lists objects with related functions
 ObjectDescriptionA1A2B1B2C1
oIOLineProvides access to a single I/O Line.xxxxx
oIOLineAProvides access to a single I/O Line accessible by the PIC's A2D Module.xxxxx
oIOPackProvides access to four I/O lines.xxxxx
oIOGroupProvides access to eight I/O lines.xxxxx
Back to top of page Version History and Bug List:
 Firmware Ver A1: Introduced.

Bugs: No known bugs.


 

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