ADC
 
 
 Bean ADC
 
A/D converter
High Level Bean

This bean implements encapsulation of CPU internal A/D converter peripheral functionality. Properties of the bean are defined in order to provide initialization code and selectable methods for the bean runtime API. The properties define all settings for the ADC operation mode, i.e., a type of the A/D device services (polling, interrupt, DMA), API provides a runtime measurement mode control.

More optional functionality is provided, such as:

Average value measurement - The bean allows to select multiple A/D conversions in one measurement and provides an average value from that. This may cause the measurement to be longer while providing more accurate result with a higher resolution (property Number of conversions).

Channel indepedency of measurement - The selected channels in the bean inspector can measure all channels separately, simultaneously, or continuously. Thus, each channel can measure independently of other channels.

The measured values can be returned in original format, or justified to an 8-bit or 16-bit unsigned integer.

The bean also has two of the following modes selectable by its Sharing property:

Not shared mode - the most efficient mode, tightly coupled with HW capabilities of AD converter device. The order of measurements on channels is and one bean supports needed accesses to all channels.
This bean mode allows to use the full capability of a multi-channel A/D converter with one bean, i.e., the whole A/D converter device is encapsulated in one bean but other beans cannot share this device. This configuration results in a short and fast to execute generated code. If the autoscan mode of the A/D converter is enabled, the selected channels have to be ordered consecutively( 2,3,4 is OK; but 2,3,5/4,3,2 is incorrect). One channel measurement option is not available. The autoscan mode allows to use the fastest mode of A/D conversion for all selected channels if the A/D converter device supports this mode. The trigger function of the channel, which is useful for synchronization with an internal or external signal, can also be used in Not Shared mode if the A/D converter device supports this function.

Shared mode - provided for independent control of measurements on different channels. Adds more intelligence than usual HW provides, but it costs more resources (code, speed).
This mode allows for one individual channel of an AD converter to be allocated by more AD beans. The channel(s) measurement conditions are under control of a dedicated AD bean. The sharing of the A/D converter device is accomplished by adding a new service routine. Hence generated code may not be as short and fast as the code for the Not shared mode. In the Shared mode the autoscan mode, the polling mode (interrupt service disabled mode), and the trigger function of A/D channels are not allowed.


Version specific information for HCS12 derivatives:
The type of the Value(s) parameter of GetValue and GetChanValue methods depends on the Result mode and the A/D resolution properties. GetValue and GetChanValue methods return a byte value for the Right justified mode and the 8-bit resolution (Resolution), a word values for the Right justified mode and the 10-bit resolution, a word value (0 - 65536) for the Left justified/unsigned mode and an integer value (-32768 - 32767) for the Left justified/signed mode.


This bean belongs to the category: CPU Internal Peripherals-Converter-ADC



Processor ExpertTM and Embedded BeansTM are registered trademarks of UNIS, Ltd.
©1997-2005, UNIS, Ltd.