ADC pin control register

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ADC pin control register

2,285 Views
JohnBarber
Contributor II
Hi,
I'm using the MC9S08DZ60 and I am confused about how to use the pin control register when using the ADC. The datasheet says, that this register is used to disable the I/O port control of MCU pins used as analog inputs.
 
If i want to use say channel AD1 to AD convert an analog signal, should I enable or disable the AD1 pin I/O control?
 
/John
Labels (1)
0 Kudos
4 Replies

580 Views
JohnBarber
Contributor II
Thanks for answering,
but the question was unanswered.
 
The text from the datasheet doesn't help me. It was the text that made me confused.
 
Two clear questions:
1. Is it possible to perform AD conversions with the I/O port control disabled?
 
2. Is it possible to perform AD conversions with the I/O port control enabled?
 
If the answer is yes in both cases, what is then the point of the ADC pin control register?
 
/John 
 
0 Kudos

580 Views
fabio
Contributor IV
Hi John,

The APCTL registers are used to disable the digital input buffers on selected pins. Note that when you select an ADC channel through the ADCH bits (ADCSC1 register), the corresponding pin is automatically configured as an input, but the digital input circuitry remains operating and can interfere in the analog signal you are trying to measure.

By using the APCTL register you can disable the input circuitry, minimizing such effects.

So, answering your questions:

1. Is it possible to perform AD conversions with the I/O port control disabled?
A: yes, this is the preferred way to do it.

2. Is it possible to perform AD conversions with the I/O port control enabled?
A: yes, but the digital input circuitry may interfere with the analog source.

Best regards,

0 Kudos

580 Views
JohnBarber
Contributor II
Thanks!
0 Kudos

580 Views
8_BitMCU
Contributor I

Hey John,

"If i want to use say channel AD1 to AD convert an analog signal, should I enable or disable the AD1 pin I/O control?"

[Han] You are correct. It is suggested in the datasheet to have this done.

Your answer was found in datasheet under the ADC chapter.

10.6.1.3 Analog Input Pins
The external analog inputs are typically shared with digital I/O pins on MCU devices. The pin I/O control is disabled by setting the appropriate control bit in one of the pin control registers. Conversions can be performed on inputs without the associated pin control register bit set. It is recommended that the pin control register bit always be set when using a pin as an analog input. This avoids problems with contention because the output buffer will be in its high impedance state and the pullup is disabled. Also, the input
buffer draws DC current when its input is not at either VDD or VSS. Setting the pin control register bits for all pins used as analog inputs should be done to achieve lowest operating current.

Since you are newbie, here are my hints reading Freescale datasheet.

1) Many Freescale peripherals are shared among S08 Core. It is very convenient when you migrate to other MCUs because your coding is really minimal due to that fact. However, sometime the same peripheral can be different among MCU. Hints:  Always read the introduction of each peripheral.  It will tell you how the peripheral in a specific MCU differs.

2) Don't get overwhelmed by the register settings. For some reason the functional description of each MCU peripheral is always at the end of its chapter. Try reading the functional description of the peripheral before digging to the registers settings.

Good luck let me know if u need more help.

Prospective Freescale buddy,

Han

0 Kudos