oSPIL Object

Back to top of page Description:
 An Object that provides SPI serial input and output.
 The following table lists the size and availability of the oSPIL Object.
 ObjectSizeDescriptionA1A2B1B2C1
oSPIL6 BytesProvides access to a low-speed SPI device on any I/O lines.xx
Back to top of page Operation:
 The oSPI Object uses the I/O line specified by the IOLineO property to send and the IOLineI property to receive an 8-Bit serial data transmission at the rate specified by the Rate property.

When a value is written to the oSPI Object's Value property, the oSPI Object will clock out SPI data.

When the Value property is read, the oSPI will clock in SPI data.

An optional Enable line is provided that is activated when the SPI data is clocked in or out.  This line is deactivated when the data transfer is complete. There are four methods described at the end of the properties list. These methods are used to set the initial state of the clock and data lines in the SPI device. This is especially useful for the Al Williams PAK-XXXX modules and many other SPI devices that expect the signals to start in a certain state.

Back to top of page Properties:

The following table lists the properties of the oSPIL Object:

Property

Description

Value
A value that is transmitted / received.
Object Class: oValue Value Range: 0 - 65535
Data Type: Numeric Default Value: 0
IOLineC
A value that specifies which I/O Line is connected to the Clock signal.
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.
IOLineI
A value that specifies which I/O Line is connected to the in-coming data 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.
IOLineO
A value that specifies which I/O Line is connected to the out-going data 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.
IOLineE
A value that specifies which I/O Line is connected to the Enable output.
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.
InvertE
A value that selects if the Enable output is inverted.
Object Class: oSelect0to1L Value Range: 0 - 1
Data Type: Numeric Default Value: 0
Rate
A value that selects how fast the data is to be transmitted / received.
Object Class: oSelect0to7 Value Range: 0 - 7
Data Type: Numeric Default Value: 0
preliminary information
Width
A value that selects how many data bits are to be transmitted / received.
Object Class: oSelect0to3 Value Range: 0 - 3
Data Type: Numeric Default Value: 0
WidthDescription
08-Bits of data are clocked in or out.
116-Bits of data are clocked in or out.
2Reserved for future use.
3Reserved for future use.
Mode
A value that selects when the data is to be outputted / inputted in relation to the clock signal.
Object Class: oSelect0to1 Value Range: 0 - 1
Data Type: Numeric Default Value: 0
DirectionDescription
0Data is samples before clock pulse.
1Data is samples after clock pulse.
BUG:
Setting Mode = 1 will cause the ooPIC to lock up.
Direction
A value that selects if the Most-Significant-Bit of the data is the first or last bit transmitted / received.
Object Class: oSelect0to1 Value Range: 0 - 1
Data Type: Numeric Default Value: 0
DirectionDescription
0Data shifted out lsb first.
1Data shifted out msb first.
Operate
A value that selects whether or not the port is operating.
Object Class: oOperate Value Range: 0 - 1
Data Type: Numeric Default Value: 0
OperateConstantDescription
0cvOffThe port is not operating.
1cvOnThe port is operating.
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 pageMethods

The following table lists the properties of the Pointer Object:
MethodsDescription
IOLineC.Low

Sets the SPI clock line low explicitly. Useful for some modes in some SPI devices.

IOLineC.HighSets the SPI clock line high explicitly.
IOLineO.LowSets the SPI data line low explicitly.
IOLineO.High

Sets the SPI data line high explicitly.

Back to top of page Example:

The following examples use the oSPIL Object.
Visual Basic SyntaxC and Java Syntax
' preliminary information 
// preliminary information 
Basic Syntax 
' preliminary information 
 

Back to top of page Related Items:

 The following table lists objects that use the oSPIL Object.
 ObjectDescriptionA1A2B1B2C1
oSPILProvides access to a low-speed SPI device on any I/O lines.xx
 The following table lists objects with related functions
 ObjectDescriptionA1A2B1B2C1
oSerialHProvides a high-speed asynchronous serial I/O port using hardware specific I/O lines.xxxxx
oSerialLProvides a low-speed asynchronous serial Input or Output on any I/O line.xxx
oSerialPortProvides a high-speed asynchronous serial I/O port with a buffer.xxxx
Back to top of page Version History and Bug List:
 Firmware Ver B2: Introduced.

Bugs: Setting Mode = 1 will cause the ooPIC to lock up.



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