Adc Inputs; Pf4/Adcin1; Adcin0; Program Example - Motorola MC68HC05T16 Technical Data Manual

Table of Contents

Advertisement

10.1
The ADC has two input channels: one dedicated input pin at ADCIN0 and one shared pin at

PF4/ADCIN1.

10.1.1
ADCIN1 multiplexes with PF4 at this pin. When the ADC1 bit of Port F Configuration register is
cleared, PF4/ADCIN1 is configured for PF4 and follows Port F DDR assignment. When ADC1 bit
is set, PF4 is configured as ADCIN1 analog input, and Port F DDR has no effect on this pin.
Reading PF4 when configured as an ADC input is zero.
10.1.2
ADCIN0 is a dedicated analog input channel.
10.2
The following example shows how to convert analog input channel 0 (ADCIN0). For ADCIN1
conversion, change #$00 to #$20. ADCSR is the ADC Control/Status register.
LDA
STA
DTA
BRSET 7, ADCSR, ATD
INC
10
LDA
AND
CMP
BLS
;out of range
ATD
...
MOTOROLA
10-2

ADC Inputs

PF4/ADCIN1

ADCIN0

Program Example

#$00
ADCSR
;ADC Control and Status Register
ADCSR
ADCSR
#$1F
#$1F
DTA
;analog value in ADC.
;ANALOG IN = ([AD4:0] +1)*0.15625V at Vdd = 5V
ANALOG TO DIGITAL CONVERTER
TPG
MC68HC05T16

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mc68hc705t16

Table of Contents