oIOGroup Object

Main Index
Object List
Back to top of pageDescription:
 

The oIOGroup Object provides access to eight I/O lines and is essentially a pointer that allows the program to choose which I/O lines to control at run time.  The program can also, at run-time, re-specify which I/O lines to use at any time.

The selected eight I/O lines can be set to read the electrical state presented on them or set to output a specified electrical state.

The difference between this object and the oDIO8 Object is that the oDIO8 Object arranges the properties in such a way that it can be used in a virtual circuit.  Another difference between the two is that oIOGroup will use 1 byte of variable memory while the oDIO8 uses 1 byte of object memory.  This can be an important difference when creating large programs. 

 The following table lists the size and availability of the oIOGroup Object.
 ObjectSizeDescriptionA1A2B1B2C1
oIOGroup1 ByteControls a group of 8 I/O lines.xxxxx
Back to top of pageOperation:
 An oIOGroup Object provides access to 8 I/O Lines by indexing the available I/O Lines via the value of the Group property.

The Group property specifies which group of I/O lines to use.  The groups are defined by the physical PIC I/O Ports available in the PIC where 1 = Port B, 2 = Port C and 3 = Port D. Setting the Group property to 0 is a special case that effectively points to nothing.

Once the Group property is set, the Direction and the State properties reference the actual hardware that controls the Direction and State of the specified PIC I/O Pins. 

The State property references the electrical state of the I/O Pins specified. (Note that this property was added in Firmware C.1.  See history.)

The Direction property specifies if the I/O Pins are inputs or outputs. (Note that this property was added in Firmware C.1.  See history.)

When the Direction property is set to 0 (cvOutput), then the specified Pins 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 Pins are set to be an inputs and the State property will report whether or not 5 Volts is being applied to the Pins 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 Group property will also re-index the hardware that the Direction and State properties reference.   This means that you MUST set it BEFORE you set the Direction property for the Direction property to affect the I/O line you want to use.  For example, if Pins 8-15 are specified and they are inputs, then the Direction property would read 255 and the State property would report the current electrical state of Pins 8-15.  Then if the Pack property was changed to 3 and Pins 24-31 were outputs, the Direction property will now read 0 and the State property would report the current electrical state of Pins 24-31.  See other examples below.

Note that the Group property is the default property.  This means that if an instance of the oIOGroup Object exists, then not only can the Group property be set to 1 by assigning it with the statement "IOGroup.Group = 1", it can also be set with the statement: "IOGroup = 1" as demonstrated in the o7Seg Object's help page.

Caution: the I/O lines in Group 2 are used for special purposes such as PWM, serial input/output and DDELink.  Be sure that you are not attempting to reuse them if the special functions are in use.

Back to top of pageProperties:

The following table lists the properties of the oIOGroup Object:

Property

Description

Group
A value that selects the I/O Group to use.
Object Class: oSelect0to3 Value Range: 0 - 3
Data Type: Numeric Default Value: 0
GroupConstantDescription
0cvOff

The instance of the oDIO8B Object is inactive.

1 

The oDIO8B Object uses pins 8 - 15 for its I/O.

2* 

The oDIO8B Object uses pins 16 - 23 for its I/O.

3 

The oDIO8B Object uses pins 24 - 31 for its I/O

*Caution: the I/O lines in Group 2 are used for special purposes such as PWM, serial input/output and DDELink.  Be sure that you are not attempting to reuse them if the special functions are in use.
Direction
A value that specifies if the I/O lines are Inputs or an Outputs.
Object Class: oProperty Value Range: 0 - 255
Data Type: Numeric Default Value: N/A
Availability: This property was added if firmware version C.1.
Each Bit in DirectionConstantDescription
0cvOutput

The specified I/O Line are outputs.

1cvInput

The specified I/O Line are inputs.

State
A value that indicates the current electrical state on the I/O lines.
Object Class: oProperty Value Range: 0 - 255
Data Type: Numeric Default Value: 0
Availability: This property was added if firmware version C.1.
Each Bit in State ConstantDescription
0cvOffThe specified I/O line is at 0 Volts.
1cvOnThe specified I/O line is at +5 Volts.
Port
The PIC Hardware object used to control the I/O group.
Object Class: oPort Value Range: 0 - 3
Data Type: Numeric 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 page Related Items:
 The following table lists objects that use the oIOGroup Object.
 ObjectDescriptionA1A2B1B2C1
o7SegAn Object that displays a number on a 7-Segment LED display.x
o7Seg2An Object that displays a number on a Dual 7-Segment LED display.x
o8BarAn Object that displays a number on an 8-Segment LED bargraph.x
oBumper8Reads an 8-contact bumper.xx
oDIO8Provides an 8-bit digital I/O.xxxxx
oDIO8BProvides an 8-bit digital I/O with blanking.x
oDIO8FProvides an 8-bit digital I/O with flow control.xxx
oKeypad2Reads a Keypad matrix of up to 8 x 8.xx
oOrbitSwitch8Reads a circular array of 8 switches.xx
 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
oIOLinePProvides access to a single I/O Line accessible by the PIC's PWM Module.xxxxx
oIOPackProvides access to four I/O lines.xxxxx
Back to top of page Version History and Bug List:
 Firmware Ver A1: Introduced as just a pointer.
Firmware Ver C1: Expanded to include the State and Direction properties.

Bugs: No known bugs.


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