| Description: |
| |
A Hardware Object that provides a 16-bit high speed counter with optional Crystal controlled frequency and input scaling. |
| Operation: |
| |
The oTimer Object counts each cycle of a clock source by incrementing the 16 bit Value property each time the clock source cycles. An MSB Flag property reflects the 16th bit of the Value property and can be used as the input to a oCounter Object to extend the count. (See remarks on the MSB below). The ExtClock property specifies if the programmable-clock counts the cycles of an internal 5Mhz clock or a external clock supplied on I/O line 16. An ExtXtal property specifies if I/O Line 16 is used in conjunction with I/O Line 17 for a crystal to be connected. A PreScale property specifies a value which divides the clock source frequency before it is counted. The Operate property specifies if the Value property will increase each time the clock source cycles. When the Value property reaches a count of 65535, the next clock source cycle will roll the Value back to 0. |
| Remarks: |
| |
Since only one physical 16-bit timer is implemented within the OOPic, the properties of all instances of the oTimer and oTimerX Objects will read the same. Limitations on the MSB property: Although The MSB property of the oTimer Object can be read in code, the Timer Module has a physical limitation that prevents its MSB from being linked to in a Virtual Circuit. This Limitation is present in the oTimer Object. The oTimerX Object accommodates for that limitation by providing a MSB Flag property that mirrors the Timer Module's MSB. This accommodation requires two additional bytes of memory. If the MSB is not needed, it is recommended that the smaller oTimer Object be used. The oFreq Object also uses the 16-bit timer. |
| Property Options: |
| |
The oTimer Object has 1 variant which is selected with the property option X.
- X specifies that the MSB property is linkable in a Virtual Circuit.
| MSB Not linkable | MSB Linkable |
 |
oTimer |  |
oTimerX |
|
| Storage size & Availability: |
| |
The following table lists the size and availability of the oNavCon Object and its variations:
| Object | Size | Version |
 |
oTimer |
1 Byte |
A.1.0 and greater |
 |
oTimerX |
3 Bytes |
B.1.0 |
|
| Properties: |
| |
The following table lists the Properties of the oTimer Object:
| Property |
Description |
| Address |
Returns a pointer to the address of the oTimer Object instance. Data-Type: Number-Pointer, Read-Only Data-Range: 0 - 127 |
| ExtClock |
Determines if the oTimer Object uses I/O Lines or an internal clock for its clock source. Data-Type: Bit Data-Range: 0 - 1 The following table list the values of the ExtClock Property.
| ExtClock |
Constant |
Description |
| 0 |
cvOff |
5Mhz internal clock is used as the input frequency to the oTimer Object. |
| 1 |
cvOn |
I/O Lines 16 & 17 are used for the source of the input frequency to the oTimer Object. |
|
| ExtXtal |
A value that specifies if the external crystal driver is enabled on the I/O lines. Data-Type: Bit Data-Range: 0 - 1 The following table lists the values of the ExtXtal Property:
| ExtXtal |
Constant |
Description |
| 0 |
cvOff |
The external crystal drive circuitry is disabled. The oTimer Object uses only I/O line 16. |
| 1 |
cvOn |
The external crystal drive circuitry is enabled. The oTimer Object uses both I/O Lines 16 & 17. |
|
| MSB |
The Most-Significant-Bit of the Value property. Cycles each time the oTimer Object counts to 65535. Data-Type: Bit, Flag Data-Range: 0 - 1 The following table list the values of the MSB Property.
| MSB |
Constant |
Description |
| 0 |
|
Value property is <= 32767 |
| 1 |
|
Value property is >= 32768 |
|
| Operate |
A value that specifies whether or not the oTimer Object counts the cycles of the clock source . Data-Type: Bit, Flag Data-Range: 0 - 1 The following table lists the values of the Operate Property:
| Operate |
Constant |
Description |
| 0 |
cvFalse |
The Value property is not updated. |
| 1 |
cvTrue |
The Value property is updated. |
|
| PreScale |
A value that specifies by what the input clock of the oTimer Object will be divided . Data-Type: Nibble Data-Range: 0 - 3 The following table list the values of the PreScale Property.
| PreScale |
Constant |
Description |
| 0 |
|
1:1 - The input clock is not changed. |
| 1 |
|
1:2 - The input clock is divided by 2. |
| 2 |
|
1:4 - The input clock is divided by 4. |
| 3 |
|
1:8 - The input clock is divided by 8. |
|
| String |
The Value property represented as a string. Note: The String property is available in OOPic Basic Version 2 Data-Type: String |
| Value |
The current cycle count value. Data-Type: Word, Default Data-Range: 0 - 65535 |
|
| Example: |
| |
In the following example, the oTimer Object's Value property is outputted on the oDio16's 16 I/O lines.
' Copy the oTimer's
' Value to an oDio16.
Dim T As New oTimer
Dim D As New oDio16
Sub Main()
D.IOGroup = 1
D.Direction = cvOutput
T.Operate = 1
T.PreScale = 3
T.Operate = cvTrue
Do
D.Value = T.Value
Loop
End Sub
|
|
| See Also: |
| |
OOPic.Hz1 - A property of the OOPic Object that provides a 1 Hertz clock. OOPic.Hz60 - A property of the OOPic Object that provides a 60 Hertz clock. oClock - An Object that provides a controllable clock rate. oCountDown - An Object that counts down to 0.
|