You are on page 1of 4

ADC

General Info
Properties
Methods
Events
Types and constants
Application Notes
Typical Usage
Types & definitions
Embedded Components
Component ADC
A/D converter
Component Level: High
Category: CPU Internal Peripherals-Converter-ADC
This component implements encapsulation of CPU internal A/D converter peripheral
functionality. Properties of the component are defined in order to provide initialization code and
selectable methods for the component 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 component 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 component 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 component 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 component supports needed
accesses to all channels.
This component mode allows to use the full capability of a multi-channel A/D converter with one
component, i.e., the whole A/D converter device is encapsulated in one component but other
components 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
components. The channel(s) measurement conditions are under control of a dedicated AD
component. 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 HC08, HCS08, RS08 and ColdFireV1
derivatives:
Pgina 1 de 4 Component documentation - General info
21/03/2014 http://127.0.0.1:62853/help/ntopic/com.freescale.doc.processorexpert.components/Beans/...
The type of the Value(s) parameter of GetValue and GetChanValue methods is a
byte if the ADC is set to 8-bit resolution (see the Result Mode property), otherwise
the type of the Value(s) is a word.
Version specific information for HCS08, RS08 and ColdFireV1 derivatives
The Internal trigger of the ADC component is connected to the output of a selected module in
the Internal trigger source property. The ADC component does not configure the module. User
has to configure the module by other components (e.g. TimerInt, Init_RTI or Init_RTC
component).
Version specific information for 56F800x derivatives:
The type of the parameter Value(s) of GetValue and GetChanValue methods is word.
Version specific information for 56800/E derivatives except 56F800x:
Note: For these CPUs, besides a defined channel list, also a sample list is defined.
The channel list is used for selection and allocation of measuring pins and for
specification of a mode, either Single Ended or Differential. It's possible to assign a
channel number (indirectly pin) and other settings while considering HW limitations
(watched by PE) for each sample. Then all methods work with samples instead of
channels.
GetHighLimitStatus, GetLowLimitStatus a GetZeroCrossStatus methods return statuses
of samples 0-7 in appropriate bits of the returned value when Start, Measure or
EnableIntTrigger measuring methods were used. If MeasureChan or
EnableIntChanTrigger measuring method were used, these 'Get' methods return their
statuses in sample 0 (bit0) position. The rest of statuses of samples 1-7 are in
corresponding bites 1-7. Status of sample 0 is lost.
With any settings of the component the code is optimal; however, in case the code
would seem too large to meet the need of the application it is recommended to
follow the instructions bellow.
It's recommended not to combine measurement methods Start, Measure or
EnableIntTrigger together with MeasureChan or EnableIntChanTrigger, because this can
lead to a larger and slower code, particularly when every sample has different
setting of High limit, Low limit, Offset or ZeroCrossing parameters and/or
SetHighChanLimit, SetLowChanLimit or SetChanOffset methods are generated.
Generally, in order to maximize the efficiency of utilization of an A/D convertor it's
convenient Start, Measure or EnableIntTrigger family of methods. GetChanValue,
GetChanValue8 methods and GetChanValue16 may seem like a redundant code. This
may be due to a different setting of Offset parameters of some samples and/or due
to generation of SetChanOffset method.
It's also important to turn off all not needed methods in the component inspector
and not to generate the code. This is valid for all components. Besides simplifying
of code for this method, this can reduce the code for the rest of the methods.
The ADC device encapsulates two convertors (A,B) which can be in certain
conditions used as independent on each other if Independent mode selected. In this
mode, only one convertor (A or B) is used by the ADC component and the ADC
device can be shared by two ADC components. Property Part of A/D convertor
specifies, which of the convertors is used by the component. That means, method
of one component returns ERR_BUSY, if on the other convertor (component) the
measurement is proceeded in other mode than this measurement method
Pgina 2 de 4 Component documentation - General info
21/03/2014 http://127.0.0.1:62853/help/ntopic/com.freescale.doc.processorexpert.components/Beans/...
requires. Table Mode coverage for 56800/E derivatives below shows, which mode
is used by which method.
Mode coverage for 56800/E derivatives
Version specific information for ADC devices on MCF521x, MCF521xx,
MCF5221x, MCF5222x, MCF5223x derivatives:
Note: For these CPUs, besides a defined channel list, also a sample list is defined.
The channel list is used for selection and allocation of measuring pins and for
specification of a mode, either Single Ended or Differential. It's possible to assign a
channel number (indirectly pin) and other settings while considering HW limitations
(watched by PE) for each sample. Then all methods work with samples instead of
channels.
GetHighLimitStatus, GetLowLimitStatus a GetZeroCrossStatus methods return statuses
of samples 0-7 in appropriate bites of the returned value when Start, Measure or
EnableExtTrigger measuring methods were used. If MeasureChan or
EnableExtChanTrigger measuring method were used, these 'Get' methods return
their statuses in sample 0 (bit0) position. The rest of statuses of samples 1-7 are
in corresponding bites 1-7. Status of sample 0 is lost.
With any settings of the component the code is optimal; however, in case the code
would seem too large to meet the need of the application it is recommended to
follow the instructions bellow.
It's recommended not to combine measurement methods Start, Measure or
EnableExtTrigger together with MeasureChan or EnableExtChanTrigger, because this
A/D converter mode
for 56800/E
derivatives
Component method
using the mode
Relevant settings of the
component properties
Once Sequential
Measure Mode=Sequential
MeasureChan Mode=Sequential
Start
Mode=Sequential
Interrupt service=Enabled
Once Simultaneous
Measure Mode=Simultaneous
MeasureChan Mode=Simultaneous
Start
Mode=Simultaneous
Interrupt service=Enabled
Loop Sequential Start
Mode=Sequential
Interrupt service=Disabled
Loop Simultaneous Start
Mode=Simultaneous
Interrupt service=Disabled
Triggered Sequential EnableIntTrigger Mode=Sequential
Triggered
Simultaneous
EnableIntChanTrigger Mode=Simultaneous
Pgina 3 de 4 Component documentation - General info
21/03/2014 http://127.0.0.1:62853/help/ntopic/com.freescale.doc.processorexpert.components/Beans/...
can lead to a larger and slower code, particularly when every sample has different
setting of High limit, Low limit, Offset or ZeroCrossing parameters and/or
SetHighChanLimit, SetLowChanLimit or SetChanOffset methods are generated.
Generally, in order to maximize the efficiency of utilization of an A/D convertor it's
convenient Start, Measure or EnableExtTrigger family of methods. GetChanValue,
GetChanValue8 methods and GetChanValue16 may seem like a redundant code. This
may be due to a different setting of Offset parameters of some samples and/or due
to generation of SetChanOffset method.
It's also important to turn off all not needed methods in the component inspector
and not to generate the code. This is valid for all components. Besides simplifying
of code for this method, this can reduce the code for the rest of the methods.
The type of the parameter Value(s) of GetValue and GetChanValue methods is word.
The ADC device encapsulates two convertors (A,B) which can be in certain
conditions used as independent on each other if Independent mode selected. In this
mode, only one convertor (A or B) is used by the ADC component and the ADC
device can be shared by two ADC components. Property Part of A/D convertor
specifies, which of the convertors is used by the component. That means, method
of one component returns ERR_BUSY, if on the other convertor (component) the
measurement is proceeded in other mode than this measurement method
requires.
Version specific information for QADC devices on MCF5216/14 derivatives:
Note: For these CPUs, besides a defined channel list, also a sample list is defined.
The channel list is used for selection and allocation of measuring pins. It's possible
to assign a channel number (indirectly pin) and other settings while considering HW
limitations (watched by PE) for each sample. Then all methods work with samples
instead of channels.
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 word value for the Right justified and Left
justified/unsigned mode and an 16-bit integer value (-32768 - 32767) for the Left
justified/signed mode.
PROCESSOR EXPERT is trademark of Freescale Semiconductor, Inc.
Copyright 1997 - 2013 Freescale Semiconductor, Inc.
Pgina 4 de 4 Component documentation - General info
21/03/2014 http://127.0.0.1:62853/help/ntopic/com.freescale.doc.processorexpert.components/Beans/...

You might also like