oRTC Object

Back to top of page Description:
A Processing Object that performs a Real Time Clock format counting operation by increasing or decreasing an oBuffer Object's array for each "Clock-Tick"
The following table lists the size and availability of the oRTC Object.
 ObjectSizeDescriptionA1A2B1B2C1
oRTC4 BytesCauses an oBuffer Object to maintain a Real Time Clock.xxxxx
Back to top of page Operation:
 

When using the oBuffer object, to which this object points, the digits are loaded from left to right as they are read. buf(1) = hours 10's digit, 2 = hours 1's digit, down to the seconds and if using 1/60th second tics, those two digits at location 7 and 8. Each digit takes up a whole byte within the oBuffer object. The oRTC object will update and overflow the buffer data to reflect the time. Use the oBuffer.RTCString property to get the time from the RTC.

Note that this is not a battery backed up clock and it is not perfectly accurate.  It is handy as a quick digital time keeping clock.

Back to top of page Properties:

The following table lists the properties of the oRTC Object:

Property

Description

Operate
A value that selects whether or not the count is updated.
Object Class: oOperate Value Range: 0 - 1
Data Type: Numeric Default Value: 0
OperateConstantDescription
0cvOff

The count is not updated.

1cvOn

The count is updated.

ClockIn1
A pointer to an oLogic Object whose value, when cycled, is used to increment and decrement the value of the oBuffer object pointed to by the Output property.
Object Class: oLogicPtrI Value Range: Any oLogic Object
Data Type: Pointer Default Value: Null
A "Clock Tick" is counted when it changes from High to Low in value.
Output
A pointer to an oBuffer Object whose byte-array will be incremented or decremented in an 24-Hour clock fashion.
Object Class: oBufferPtr Value Range: Any oBuffer Object.
Data Type: Pointer Default Value: Null
Direction
A value that selects the direction of the count.
Object Class: oSelect0to1L Value Range: 0 - 1
Data Type: Numeric Default Value: 0
DirectionConstantDescription
0cvPositive

Count positively (Increment)

1cvNegative

Count negatively (Decrement)

Tick
A value that selects how the oRTC object values each Clock-Tick.
Object Class: oSelect0to1 Value Range: 0 - 1
Data Type: Numeric Default Value: 0
If the Tick property is set to 1, the 100ths second byte of the Output object is incremented or decremented by 1 each clock-tick. If Tick property is cleared to 0, the seconds byte of the Output object is incremented or decremented by 1 each clock-tick.
TickDescription
0

Each "Tick" detected by the oRTC Object increments or decrements the ones column of the Seconds.

1

Each "Tick" detected by the oRTC Object increments or decrements the ones column of the 1/60 Seconds.

PM
A value that indicates that the time is afternoon.
Object Class: oLogic Value Range: 0 - 1
Data Type: Numeric Default Value: 0
PMDescription
0

The Real-Time-Clock is less than "12:00:00:00"

1

The Real-Time-Clock is more than or equal to "12:00:00:00"

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 Example:
The following examples use the oRTC Object.
Visual Basic Syntax C and Java Syntax
'This program creates a Virtual
'Circuit that displays the time
'on a LCD Module.

Dim L As New oLCD
Dim T As New oRTC
Dim B As New oBuffer8

Sub main() 
  T.ClockIn1.Link(ooPIC.Hz1)
  T.Output.Link(B)
  T.Operate = 1
  L.IOGroup = 3
  L.IOLineRS = 26
  L.IOLineE = 27
  L.Nibble = 1
  L.Operate = 1
  L.Init
  L.Clear
  Do
    L.Clear
    L.VString = B.RTCString 
    ooPIC.Delay = 99
  Loop
End Sub 
// This program creates a Virtual
// Circuit that displays the time
// on a LCD Module.

oLCD L = New oLCD;
oRTC T = New oRTC;
oBuffer8 B = New oBuffer8;

Void main(Void){
  T.ClockIn1.Link(ooPIC.Hz1);
  T.Output.Link(B);
  T.Operate = 1;
  L.IOGroup = 3;
  L.IOLineRS = 26;
  L.IOLineE = 27;
  L.Nibble = 1;
  L.Operate = 1;
  L.Init;
  L.Clear;
  Do{
    L.Clear;
    L.VString = B.RTCString;
    ooPIC.Delay = 99;
  } While (1);
}
Basic Syntax 
'This program creates a Virtual
'Circuit that displays the time
'on a LCD Module.

L As oLCD(3,1,27,26,cvOn)
T As oRTC(,,,,cvOn)
B As oBuffer8

T.ClockIn1.Link(ooPIC.Hz1)
T.Output.Link(B)
L.Init
L.Clear
Do
  L.Clear
  L.VString = B.RTCString 
  ooPIC.Delay = 99
Loop
 

Back to top of page Related Items:

The following table lists other objects with related functions.
 ObjectDescriptionA1A2B1B2C1
oBuffer(1-32)32 Objects that Manage various sized data-buffer/string variable.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.