oSerialL Object

Main Index
Object List
Back to top of pageDescription:
 

A Hardware Object that sends and receives a low speed serial (up to 9600 baud) transmissions on any pin.

 The following table lists the size and availability of the oSerialL Object.
 ObjectSizeDescriptionA1A2B1B2C1
oSerialL5 BytesProvides a low-speed asynchronous serial Input or Output on any I/O line.xxx
Back to top of pageOperation:
 

The oSerialL Object uses the I/O line specified by the IOLineS property to send or receive an 8-Bit serial data transmission at the baud rate specified by the Baud property.

The IOLineS property specifies which I/O Line to use to transmit and receive the serial transmission.

The IOLineF property specifies which I/O Line to use to control the flow of the serial transmission.

In normal operation, both the IOLineS and and the IOLineF Lines use RS232 Logic states.  These logic states can be inverted so that both or either the IOLineS and the IOLineF lines use TTL Logic states.  (more on this later)  Note that the following description of operation is expressed in RS232 Logic states. 

Serial Output: When a value is written to the oSerialL Object's Value property, the oSerialL Object will wait until the flow control line (F) is brought to 5-Volts by the receiving device indicating that the receiving device is ready to receive a serial transmission.  Once at 5-Volts, the value is sent serially out the I/O line specified (S).

Serial Input: When the value property is read, the flow control line (F) is set to 5-Volts indicating that the oSerialL Object is ready to receive a serial transmission.  The oSerialL Object then waits for the sending device to initiate an 8-Bit serial transmission on the I/O line specified (S).  Once initiated, it receives the serial transmission and then returns the 8-Bit value.  While the 8-Bit serial transmission is being received, the flow control line is set back to 0-Volts indicating that the oSerial Object is once again busy.  The sending device must be configured to follow proper flow control protocol or it could send a second 8-Bit serial signal before the oSerialL Object is ready to receive it.

When the value of the IOLineF property is 0 then the flow control functions described above are disabled and the serial transmissions are performed without first checking the flow control status.

As mentioned above, the RS232 Logic can be inverted to TTL Logic.  The InvertS and InvertF properties are provided to invert the expected logic state of the Serial Line and the Flow Control Line respectively.  When these properties are set the corresponding I/O Line will work in reverse logic.  When they are reversed, the I/O Lines will use TTL Logic. 

In the diagram above, C-Time is the amount of time between the oSerialL Object processing one byte of data and the next.  This amount of time is directly related to how the oSerialL Object is used.  Note that there will ALWAYS be some amount of time between bytes.

Caution: The serial input and output signals are ALWAYS TTL level signals providing 0 and 5 volts (even if the using RS232 logic states). Conversion to RS232 signals can be done with a TTL to RS232 signal converter chip such as the SN75188 or the MAX203 which will provide the voltage conversion to the RS232 levels of +12 Volts and - 12 Volts as well as providing the required signal inversion.  It is important to note that the terms "RS232 Logic" and "TTL Logic" refer to the logical states while "RS232 Level" and "TTL Level" refer to the voltage level.

Back to top of pageProperties:

The following table lists the properties of the oSerialL Object:

Property

Description

Value
The value of the received and transmitted data.
Object Class: oValue Value Range: 0 - 255
Data Type: Numeric Default Value: 0
IOLineS
A value that specifies which I/O Line which is used to transmit and receive the serial transmission.
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.
InvertS
A value that selects whether or not the Serial Data is inverted.
Object Class: oSelect0to1L Value Range: 0 - 1
Data Type: Numeric Default Value: 0
IOLineF
A value that selects which I/O Line to use for Flow Control.
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.
InvertF
A value that selects whether or not the Flow Control is inverted.
Object Class: oSelect0to1L Value Range: 0 - 1
Data Type: Numeric Default Value: 0
Busy
A value that indicates the flow control line is indicating that the device is busy.
Object Class: oLogic Value Range: 0 - 1
Data Type: Numeric Default Value: 0
Baud
A value that selects the baud rate which controls the speed of the serial data stream.
Object Class: oSelect0to7 Value Range: 0 - 7
Data Type: Numeric Default Value: 0
BaudConstantDescription
0 Reserved
1cv1200The UART communicates at 1200 Baud.
2cv2400The UART communicates at 2400 Baud.
3cv9600The UART communicates at 9600 Baud.
5cv4800The UART communicates at 4800 Baud.
3, 4, 6, 7 Reserved
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 example, the oSerialL Object is used
'This program creates two oSerialL 
'Objects. One is used to receive a
'serial signal and the other is used
'to send a serial signal. 
'A oDio1 is used to show that while
'the oSerialL Object is waiting
'for incoming serial data, the 
'program flow is stopped.

Dim A As New oSerialL
Dim B As New oSerialL
Dim C As New oDIO1

Sub Main()
  C.IOLine = 24
  C.Direction = cvOutput
  B.IOLineS = 23
  B.IOLineF = 18
  B.Baud = cv2400
  A.IOLineS = 22
  A.IOLineF = 16
  A.Baud = cv2400
  Do
    A=B
    C.Invert
  Loop
End Sub

Back to top of page Related Items:

 The following table lists objects that use the oSerialL Object.
 ObjectDescriptionA1A2B1B2C1
oLCDSEControls a Scott Edwards Serial LCD Display.xxx
oMotorMindControls a DC motor that is driven by a Motor Mind module.xxx
oServoSEControls a Scott Edwards Serial Servo controller.xxx
oSoundginControls a Soundgin Sound Effects Engine / Voice Synthesizer chip.xxx
oVideoICControls an Intuitive Circuits On-Screen Display Character Overlay board.xxx
 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
oSerialPortProvides a high-speed asynchronous serial I/O port with a buffer.xxxx
oSPILProvides a low-speed Serial Peripheral Interface on any I/O line.xx
Back to top of page Version History and Bug List:
 Firmware Ver B1: Introduced.

Bugs: No known bugs.


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