|
||
| Description: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A Hardware Object that takes an analog voltage presented to one of the OOPic's I/O lines and converts it to a digital value. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Operation: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
An oA2D10 Object takes the voltage present on the I/O Line specified by the IOLine property and compares it to a reference voltage. It then generates a digital value which represents what percentage the voltage is of the reference voltage and updates its Value property with the generated value. The IOLine property specifies which one of four analog enabled Input Lines on the OOPic to use. If the IOLine property is set to 0 then the instance of the oA2D10 Object is dormant. An Operate property is provided to activate the oA2D10 Object. When set to 1 the oA2D10 Object continuously performs an analog-to-digital conversion of the voltage present on the I/O Line specified by the IOLine property and updates its Value property with the result. When the Operate property is cleared to 0 the oA2D10 Object enters a dormant state thus leaving the Value property at the value of the last conversion. The ExtVRef property of the OOPic Object determines the analog reference voltage which is selectable to either +5 volts or the voltage level supplied on the OOPic’s I/O line 4. If the ExtVRef property is set to 0 then +5 volts is used as the reference voltage. If the ExtVRef property is set to 1 then the voltage applied to the OOPic’s I/O Line 4 is used as the maximum voltage in the voltage conversion range. The maximum voltage allowed on I/O Line 4 is 14-Volts DC. Each dimensioned instance of an oA2D10 Object shares the analog-to-digital converter (A/D) module which converts the analog input signals to a corresponding digital number with all of the other Analog to Digital Objects. The A/D module has seven analog inputs available on the OOPic’s I/O lines 1 - 7 which are multiplexed into a single sample and hold register. The sample and hold register is the input into the A/D module which generates the result via successive approximation. The analog-to-digital conversion process takes approximately 14µs. Each dimensioned instance of an Analog to Digital Object with an Operate property set to 1 will in turn request an analog-to-digital conversion be done on the voltage present on the I/O line specified in the Analog to Digital Object’s IOLine property. When the conversion is completed the resulting value will be placed in the Objects Value property and the next Analog to Digital Object instance will follow the same until all active Analog to Digital Object instances have been addressed. After the last Analog to Digital Object instance has been addressed the process begins again with the first Analog to Digital Object instance. With all 7 possible Analog to Digital Object instances dimensioned and all 7 Operate properties set to 1 the entire conversion process takes 98µs. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Remarks: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
When any Analog to Digital Object is in use, I/O lines 1, 2, 3, and 4 are set to read an analog value, and any Digital-I/O Object using these I/O lines will read 0. If any Analog to Digital Object is set to use I/O Lines 5, 6, or 7, then all I/O lines 1 to 7 are set to read analog values. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Storage size & Availability: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The following table lists the size and availability of the oA2D10 Object.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Properties: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The following table lists the Properties of the oA2D10 Object
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Caution: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The maximum voltage allowed on I/O Line 4 is 14-Volts DC. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Example: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
In the following example uses the oA2D10 Object.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| See Also: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| oA2D - An Object that converts a voltage to an 8-Bit number. oA2DX - An Object that detects when an analog value has exceeded a threshold. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||