Analog-to-Digital Converter (ADC)
MC68HC08AZ32
304
Analog-to-Digital Converter (ADC)
MOTOROLA
ADC port I/O pins
PTB7/ATD7-PTB0/ATD0 are general purpose I/O pins that shares with
the ADC channels.
The Channel select bits define which ADC channel/port pin will be used
as the input signal. The ADC overrides the port I/O logic by forcing that
pin as input to the ADC. The remaining ADC channels/port pins are
controlled by the port I/O logic and can be used as general purpose I/O.
Writes to the port register or DDR will not have any affect on the port pin
that is selected by the ADC. Read of a port pin which is in use by the
ADC will return a logic zero.
Voltage
conversion
When the input voltage to the ADC equals to VREFH, the ADC converts
the signal to $FF (full scale). If the input voltage equals to A
VSS
/VREFL
,
the ADC converts it to $00. Input voltages between VREFH and
A
VSS
/VREFL is a straight-line linear conversion. All other input voltages
will result in $FF if greater than VREFH
and $00 if less than
A
VSS
/VREFL.
NOTE:
Input voltage should not exceed the analog supply voltages.
Conversion time
Conversion starts after a write to the ADSCR. Conversion time in terms
of the number of bus cycles is a function of oscillator frequency, bus
frequency, and ADIV prescaler bits. For example, with oscillator
frequency of 4MHz, bus frequency of 8MHz and ADC clock frequency of
1MHz, one conversion will take between 16 ADC and 17 ADC clock
cycles or between 16 and 17
μ
s in this case. There will be 128 bus cycles
between each conversion. Sample rate is approximately 60kHz.
Conversion time =
# Bus cycles = Conversion time x Bus frequency
4-adc
16-17 ADC cycles
ADC frequency