oDIO8F Object

Back to top of page Description:
 The oDIO8F Object is an I/O Function Object that manages 8 of the I/O Lines in such a way that when new data is presented on them, a Data Strobe is generated and output.  The purpose of a Data Strobe is to tell the receiving device that new data is ready on the I/O Lines.

The oDIO8F Object is capable of splitting the 8-bit data into two 4-bit packets, send each packet with its own data strobe.  This is useful for devices such as some LCDs and reduces the number of I/O lines used to transfer data.

A control I/O Line is also provided and can be used as either an input or an output.  When used as an input it can monitor a device's busy line and when used as an output it can drive a device control line.

 The following table lists the size and availability of the oDIO8F Object.
 ObjectSizeDescriptionA1A2B1B2C1
oDIO8F6 BytesProvides an 8-bit digital I/O with flow control.

x

xx
Back to top of page Operation:
 When new data is presented, the State property is copied to the I/O Line specified by the IOLineC property.

When the State property is set, the value that it was set to is sent out the I/O Lines specified by the IOGroup and a data strobe is generated on the I/O Line specified by the IOLineD property.  The data strobe is used to tell a connected device that the data is ready to be transferred.

The Mode property specifies if the data is broken up into two 4 bit transfers.  When Mode set to 0, a single 8-bit data transfer is made.  When Mode is set to 1, the data is transferred in two 4 bit packets each with its own data strobe.   Additionally when Mode is 1, the Nibble property specifies which side of the 8-bit I/O Group to use.  The Nibble property has no affect when Mode is 0.

The IOLineD property specifies which I/O Line to use to output the data strobe.  An InvertD property is also provided to invert the data strobe signal.

The IOLineC property specifies which I/O line to use as a control line. An InvertC property is also provided to invert the the logic of the control line.

The Option property specifies how to use the control line.  If Option is 0, then the control line is used as a output for things such as the register select line on LCDs.  If Option is 1, then the control line is used as a input for things such as the busy line on a printer.

The DataStrobe property is an instance of the oDataStrobe object which is created when the oDIO8F object is.  The oDIO8F object configures the DataStrobe object in such a way that it will provide the necessary I/O control. Changing attributes of the oDataStrobe may change the way the oDIO8F behaves to something different than the way described in this document.  (see oDataStrobe object for more detail on how it generates data strobes)

Back to top of page Properties:

The following table lists the properties of the oDIO8F Object:

Property

Description

State
A Value who's binary data is sent to the I/O Group.
Object Class: oByte Value Range: 0 - 255
Data Type: Numeric Default Value: 0
Each time a value is assigned to the State property, the value is copied to I/O Group and a Data-Strobe is generated.  If mode is set to 1, then the 8-bit value is broken into two 4-bit values and then each 4-bit value is sequentially copied to half of the I/O Group with a Data-Strobe generated for each.
Bit Value in StateDescription
0The specified I/O line is at 0 Volts.
1The specified I/O line is at +5 Volts.
VString
A string version of the Value property.
Object Class: oProperty
Data Type: Numeric (Write-Only)
Note: When assigning value to the VString property, the busy line IS checked for a non busy status before the a Data-Strobe is generated.
IOGroup
A value that specifies which group of 8 I/O lines is used to output the data.
Object Class: oIOGroup Value Range: 0 - 3
Data Type: Numeric Default Value: 0
Some I/O Lines have special purposes.  Be sure to see oIOGroup for details.
Nibble
A value that selects which side of the IOGroup to use when in 4-Bit mode.
Object Class: oSelect0to1 Value Range: 0 - 1
Data Type: Numeric Default Value: 0
NibbleConstantDescription
0cvLow

The oDIO8F Object uses the lower 4 bits of the specified IOGroup

1cvHigh

The oDIO8F Object uses the upper 4 bits of the specified IOGroup

Mode
A value that selects if the transferred 8-bit value will be broken up into two 4-bit transfers.
Object Class: oSelect0to1 Value Range: 0 - 1
Data Type: Numeric Default Value: 0
ModeConstantDescription
0cv8Bit

The Value property will be transferred as a single 8-bit value and a single data-strobe will be generated when the Value property is written to.

1cv4Bit

The Value property will be transferred as two 4-bit values and a data-strobe will be generated for each when the Value property is written to.

IOLineD
A value that specifies which I/O line is used to output the Data Strobe logic state.
Object Class: oIOLine Value Range: 0 - 31
Data Type: Numeric Default Value: 0
Some I/O Lines have special purposes.  Be sure to see oIOLine help file for details.
InvertD
A value that selects that the outputted logic state of the Data Strobe is to be inverted.
Object Class: oSelect0to1L Value Range: 0 - 1
Data Type: Numeric Default Value: 0
InvertDDescription
0

The Data Strobe is a low-going pulse.

1The Data Strobe is a high-going pulse.
IOLineC
A value that specifies which I/O line is used for the Control line.
Object Class: oIOLine Value Range: 0 - 31
Data Type: Numeric Default Value: 0
Some I/O Lines have special purposes.  Be sure to see oIOLine help file for details.
InvertC
A value that selects whether or not to invert the logic of the Control Line.
Object Class: oSelect0to1 Value Range: Fixed
Data Type: Numeric Default Value: 0
InvertCDescription
0

The logic of the Control Line is not inverted.

1

The logic of the Control Line is inverted.

Option
A value that selects whether to use the Control line as an input or an output line.
Object Class: oSelect0to1 Value Range: 0 - 1
Data Type: Numeric Default Value: 0
Availability: Added in Firmware B2.
OptionDescription
0

IOLineC is used as Output.

1

IOLineC is used as Input.

Operate
A value that selects if new data is sent to the connected device or not.
Object Class: oOperate Value Range: 0 - 1
Data Type: Numeric Default Value: 0
OperateConstantDescription
0cvOffNew data is not sent to the device.
1cvOnNew data is sent to the device.
DataStrobe
The Processing object used to output the data strobe.
Object Class: oDataStrobe Value Range: 0 - 1
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 Examples:
 In the following example, the oLCD Object is used to display the phrase "Hello World" on a LCD module that uses the 44780 chip set.  Note that much of this has been automated with the oLCD object which encapsulates the oDIO8F Object.
Visual Basic SyntaxC and Java Syntax
' Uses the oDIO8F Object to print
' "Hello There" on an LCD.

Dim B As New oDIO8F

Sub Main() 
  B.IOLineD = 27: ' Data Strobe on 27
  B.IOLineC = 26: ' Regsiter Control on 26
  B.IOGroup = 3:  ' Use group 3 for I/O
  B.Mode = 1:     ' Select 4-bit mode
  B.Nibble = 1    ' Select upper 4 bits.
  B.Operate = 1	  ' Turn on the DIO8F
  ' Sending this data to the LCD
  ' configures the LCD for 4-bit 
  ' and clears the screen
  B.InvertC = 0
  B = 0
  B = 51
  B = 50
  B = 40
  B = 8
  B = 12
  B = 6
  B = 1 
  B.InvertC = 1
  Delay = 500
  ' Sends the data for "Hello World"
  B.VString = "Hello World"
End Sub
// Uses the oDIO8F Object to print
// "Hello There" on an LCD.

oDIO8F B = New oDIO8F;

Void Main(Void){
  B.IOLineD = 27;
  B.IOLineC = 26;
  B.IOGroup = 3;
  B.Mode = 1;
  B.Nibble = 1;
  B.Operate = 1;
  // Sending this data to the LCD
  // configures the LCD for 4-bit
  // and clears the screen  
  B.InvertC = 0;
  B = 0;
  B = 51;
  B = 50;
  B = 40;
  B = 8;
  B = 12;
  B = 6;
  B = 1;
  B.InvertC = 1;
  Delay = 500;
  // Sends the data for "Hello World"
  B.VString = "Hello World";
}
Basic Syntax
' Uses the oDIO8F Object to print
' "Hello There" on an LCD.

Dim B As New oDIO8F(3,1,1,27,0,26,0,cvOn)

' Sending this data to the LCD
' configures the LCD for 4-bit 
' and clears the screen
B.InvertC = 0
B = 0
B = 51
B = 50
B = 40
B = 8
B = 12
B = 6
B = 1 
B.InvertC = 1
Delay = 500
' Sends the data for "Hello World"
B.VString = "Hello World"

Back to top of page Related Items:

The following table lists objects that use the oDIO8F Object.
 ObjectDescriptionA1A2B1B2C1
oLCDControls a LCD Display.xxx
oLPTControls a printer.xx
oSP0256Controls a SP0256-AL2 Voice Synthesizer Chip.xx
 The following table lists objects with related functions
 ObjectDescriptionA1A2B1B2C1
oDIO8Provides an 8-bit digital I/O.xxxxx
oDIO8BProvides an 8-bit digital Output with blanking.x
Back to top of page Version History and Bug List:
 Firmware Ver B1: Introduced.
Firmware Ver B2: Option property added.

Bugs: No known bugs.


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