Differential ADC with same pin for positive and negative differential input

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

For differential ADC I am seeing both the positive and negative differential input as the same pin. For example on p. 283 of ATmega2560's datasheet in the first row of Table 26-5, for MUX5:0=001000, ADC0 is both the positive and negative differential input. I don't understand how the same pin can be both. 

https://ww1.microchip.com/downloads/en/devicedoc/atmel-2549-8-bit-avr-microcontroller-atmega640-1280-1281-2560-2561_datasheet.pdf#page=283

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

LogLog wrote:
I don't understand how the same pin can be both. 

 

Why not? IN+ and IN- are multiplexed to the same I/O pin. This may seem useless, but definitely not impossible.

And in fact it's not useless, because it allows you to measure the input offset voltage of the amplifier, which can then be used to correct actual readings.

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

And you probably already know this, but I'll mention it just in case.

 

On AVR's both of the differential inputs must have a positive voltage, (V+ >= Vin >= Gnd).

You can't feed an actual negative voltage into the V- pin of the differential pair.

 

JC

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

Surely, that just shows that you can multiplex the inputs to the same pin?

 

Obviously, you wouldn't do that while actually trying to measure a differential signal.

 

There are many instances where multiple functions can be multiplexed onto a single - but you can only actually use one of them at any one time!

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sometimes you can map 2 (or more!) peripherals to the same pin. Sometimes they will work fine together, sometimes they won't.

The combinations that are most prone to conflicts are, if one of them is digital and the other analog (AVRs usually have the option to disable digital buffers on pins that may be used with analog signals); or if both are outputs. In particular, you definitely don't want a peripheral outputing HIGH while another outputs LOW to the same pin... this may amount to an internal short. The hardware may or may not prevent this from happening; datasheets often don't address such situations, because no one thought about it...

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


El Tangas wrote:
And in fact it's not useless, because it allows you to measure the input offset voltage of the amplifier, which can then be used to correct actual readings.

 

Imagine the chip designers at their morning coffee.  "I laid out the differential with all the combinations.  But there is the redundant X<>X.  what do I do now?"  "Hey, I can take the rest of the day off, since my measure-the-offset feature is now done."

 

So then they put it into the datasheet:

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

Last Edited: Tue. Dec 3, 2019 - 01:34 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yup. That ever elusive line that separates bug from feature. As Obi-Wan would say, it's just a matter of point of view smiley