Using only 4 ADC channels?

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi everyone,

I would like to use only 4 ADC channels on a Mega168 and configure the other ones as output pins to control LEDs.

Is that possible or are all 8 channels configured as analog inputs>

Thanks a lot,
tappo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

Of course you can use only four of them and rest design as outputs.

Look to datasheet for details.

Adam

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

IIRC correctly the higher numbered pins can toggle without it effecting the lower numbered pins, or was it vice versa?

It is in the datasheet.

Regards,

Alan To

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi everyone,
thanks for the answers!

I cant find the pages in the datasheed which describe whether the higher numbered pins effect lower ones or vv.

Could you tell me where you found it? I looke in teh ADC description and the genereal I/O description.

Thanks a lot,
Tappo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

It is in section "21.5.2 Analog Noise Canceling Techniques"

The quote is:
"If any ADC [3..0] port pins are used as digital outputs, it is essential that these do not
switch while a conversion is in progress. However, using the 2-wire Interface (ADC4 and ADC5) will only affect the conversion on ADC4 and ADC5 and not the other ADC channels."

Regards,

Alan To

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Alan,
thank you very much, exaclty what I was looking for.

Best,
Tappo