ADC
 
 
 Bean ADC
 

A/D converter  Analog/Digital konvertor
High Level Bean            Element vysokej úrovne        

Preklad: jarjan, december 2008

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. 
Tento element implementuje zapúzdrenie internej periférie mikrokontroléra (CPU) ktorý zabezpečuje funkcionalitu A/D prevodníka.  Vlastnosti objektu sú definované s takým určením, aby mohli poskytnúť inicializačný kód a volitelné metódy pre programové rozhranie (API) používaného počas behu programu.  Vlastnosti definujú všetky nastavenia pre operačný režim ADC, t.j. typ služby A/D zariadenia (polling, prerušenie, DMA), API poskytuje riadenie režimu merania počas behu programu. 

More optional functionality is provided, such as:
Poskytuje viac voliteľných funkcií, ako: 
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).
Meranie priemernej hodnoty - Element umožňuje vybrať viacnásobné A/D konverzie počas jedného merania a poskytne ich priemernú hodnotu. Toto môže spôsobiť predĺženie merania pokiaľ sa vykonáva presnejšie meranie s vyššou presnosťou (vlastnosť Počet prevodov). 

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. 
Nezávislosť kanálu od merania - Vybraté kanály v "bean inspector-e" (aplikácia nastavujúca vlastnosti elementu A/D) môžu merať všetky kanály samostatne, súčasne, alebo v kontinuálne. A tak, každý kanál môže merať nezávislo do ostatných kanálov.

The measured values can be returned in original format, or justified to an 8-bit or 16-bit unsigned integer.
Namerané hodnoty môžu byť vrátené v originálnom formáte, alebo zarovnané vo formáte 8-bitového alebo 16-bitového bez-znamienkového celého čísla typu Integer. 

The bean also has two of the following modes selectable by its Sharing property:
Element má tiež dve z nasledovných režimov navoliteľných pomocou  Vlastnosti zdielania:

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.

Nezdielaný režim - najefektívnejší režim, pevne zviazaný s HW schopnosťami zariadenia určeného na A/D konverziu.  The order of measurements on channels is and one bean supports needed accesses to all channels. Tento režim elementu (beanu - "fazuľky" - rozumej element s danou funkcionaltou - a ... nezamýšľaj sa nad "filozofickou hĺbkou tohto "výrazu") umožňuje maximálne  využiť schopnosti viackanálového A/D prevodníka s jedným "bean-om", t.j., celé zariadenie A/D prevodníka je zapúzdrené do jedného elementu (bean-u), ale ostatné "beany" nemôžu zdieľať toto zariadenie. Táto konfigurácia má za výsledok že sa bude generovať programový kód ktorý bude krátky a rýchly. Ak je povolený pre A/D prevodník  režim - auto scan - automatického "skenovania", navolené kanály by mali byť zoradené za sebou (2,3,4 je v PORIADKU; ale 2,3,5/4,3,2 je nesprávne). Voľba merania len v jednom kanáli nie je povolená. Režim AUTOSCAN umožňuje použiť najrýchlejšie režimy A/D konverzie pre všetky navolené kanály ak  zariadenie A/D konverzie podporuje tento režim. V nezdielanom režime (NON SHARED MODE), ak zariadenie A/D konverzie podporuje túto funkciu, možno použiť aj funkciu triggera kanála (spúšťača), ktorý je užitočný pre synchronizáciu s internými alebo externými signálmi.  

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.

Zdieľaný režim - poskytovaný pre nezávislé riadenie meraní na rôznych kanáloch. Pridáva oveľa viac "inteligencie" než zvyčajne HW poskytuje, ale daňou je väčšia spotreba zdrojov ( viac inštrukcií kódu, nižšia rýchlosť výsledku). Tento režim umožňuje aby jeden individuálny kanál s A/D prevodníkom bol pridelený viacerým AD "beanom". Podmienky merania daného kanálu sú riadené určeným "beanom". Zdieľanie zariadenia A/D prevodníka je zabezpečené pridaním nového (ďalšieho) obslužného podprogramu (podprogramu). Z tohto dôvodu generovaný (programový) kód namôže byť taký krátky a rýchly ako kód pre NEZDIEĽANÝ REŽIM. V zdieľanom režime nie je povolený pre A/D kanály režim AUTOSCAN, režim POOLING  (režim v ktorom je zakázaná obsluha prerušenia), a funkcie triggera (spúšťača pomocou signálu). 


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.

Špecifické informácie závislé od čísla verzie pre triedu mikrokontrolérov  HCS12:  Typ parametra Value(s) metódy  GetValue a GetChanValue závisí od Režimu výsledkov (Result mode) a od nastavenia vlastnosti A/D rozlíšenia. GetValue a GetChanValue metódy vracajú "bajtovú" hodnotu v režime zarovnania doprava a 8 bitovom rozlíšení, "word-ovskú" (word=slovo t.j. 16 bit. slovo) hodnotu v režime zarovnávania doprava a 10-bitovom rozlíšení, "word-ovskú" hodnotu (0 až 65535) v režime zarovnávania doľava a bez znamienka a hodnotu integer (-32768 - 32767) pre režim zarovnávania doľava so znamienkom (t.j. režim kladných a záporných hodnôt). 


This bean belongs to the category: CPU Internal Peripherals-Converter-ADC
Tento "bean" patrí do kategórie: Interné periférie-konvertor-ADC  CPU-čka



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