Author Topic: ATmega32M1 - ISRC current source peripheral and excess pin voltage  (Read 1105 times)

0 Members and 1 Guest are viewing this topic.

Offline HwAoRrDkTopic starter

  • Super Contributor
  • ***
  • Posts: 1477
  • Country: gb
The ATmega32M1 has a current source peripheral that can output a constant 100uA current from its ISRC pin. It also has a dedicated ADC channel for reading the voltage at the ISRC pin.

I was looking into hooking up the ISRC output to a potentiometer, and then using the ADC to read the position of the pot. I was planning on using a 47K pot, getting me a max voltage of 4.7V. However, the thought occurred that of course following V=IR, if a resistive load greater than 50K is attached to the ISRC pin, can the voltage at the pin go higher than 5V?

I'm guessing... probably not? Because the supply for the current source is AVCC, which like the supply to the entire chip, is no more than 5V? :-//

There's little detail in the ATmega32M1 datasheet regarding this, save for the following snippet:

Quote
To protect the device against big value [resistors], the ADC must be configured with AVCC as internal reference to perform the first measurement. Afterwards, another internal reference can be chosen according to the previous measured value to refine the result.

I'm not sure what exactly they mean by "protect the device"? If the current source's pin voltage is incapable of going above AVCC, why would they say that? To my knowledge, it's fine for an input voltage to an AVR's ADC to be > AREF, so long as it is <= VCC. On the other hand, if it can exceed AVCC, how is changing the AREF going to protect anything?

Adding further confusion, later in the ISRC section (where they give an example of using an external resistor to set a LIN bus address according to the ADC reading) there is a table giving typical voltages for various external resistor values with this note following it:

Quote
Note: 5V range: Max. Rload 30K?. 3V range: Max. Rload 15K?.

Why would they say max 30K? That's only 3V input to the ADC... ???

So I don't know if I what I plan to do is okay or not, or if I need to protect the ISRC ADC input from excess resistance/voltages or not. If I did need to, I suppose a diode would do? Either a schottky to VCC, or a 5.1V zener to ground?
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3240
  • Country: gb
Re: ATmega32M1 - ISRC current source peripheral and excess pin voltage
« Reply #1 on: January 15, 2018, 04:04:17 pm »
The ATmega32M1 has a current source peripheral that can output a constant 100uA current from its ISRC pin. It also has a dedicated ADC channel for reading the voltage at the ISRC pin.

I was looking into hooking up the ISRC output to a potentiometer, and then using the ADC to read the position of the pot. I was planning on using a 47K pot, getting me a max voltage of 4.7V. However, the thought occurred that of course following V=IR, if a resistive load greater than 50K is attached to the ISRC pin, can the voltage at the pin go higher than 5V?

I'm guessing... probably not? Because the supply for the current source is AVCC, which like the supply to the entire chip, is no more than 5V? :-//

If a current source is powered from a 5v supply, how could it's output exceed 5v?  The answer is that it can not.  Any current source will have a limited output voltage range, known as the compliance range.

There's little detail in the ATmega32M1 datasheet regarding this, save for the following snippet:

Quote
To protect the device against big value [resistors], the ADC must be configured with AVCC as internal reference to perform the first measurement. Afterwards, another internal reference can be chosen according to the previous measured value to refine the result.

I'm not sure what exactly they mean by "protect the device"? If the current source's pin voltage is incapable of going above AVCC, why would they say that? To my knowledge, it's fine for an input voltage to an AVR's ADC to be > AREF, so long as it is <= VCC. On the other hand, if it can exceed AVCC, how is changing the AREF going to protect anything?

Adding further confusion, later in the ISRC section (where they give an example of using an external resistor to set a LIN bus address according to the ADC reading) there is a table giving typical voltages for various external resistor values with this note following it:

Quote
Note: 5V range: Max. Rload 30K?. 3V range: Max. Rload 15K?.

Why would they say max 30K? That's only 3V input to the ADC... ???

So I don't know if I what I plan to do is okay or not, or if I need to protect the ISRC ADC input from excess resistance/voltages or not. If I did need to, I suppose a diode would do? Either a schottky to VCC, or a 5.1V zener to ground?

That bit of text in the datasheet is gibberish, it sounds like it was written by an intern with poor English skills.  The resistance limits are likely due to the compliance of the current source,  i.e. the maximum voltage it can deliver whilst still delivering a constant current.  This will always be somewhat less than the supply rail voltage, sometimes significantly less.

They are suggesting you use AVCC as a reference for the first reading in case the voltage on the IREF pin exceeds the internal reference voltage.  If the result shows the voltage is lower than Vref, then you can take a second reading using Vref to get increased resolution.
« Last Edit: January 15, 2018, 04:05:51 pm by mikerj »
 

Offline HwAoRrDkTopic starter

  • Super Contributor
  • ***
  • Posts: 1477
  • Country: gb
Re: ATmega32M1 - ISRC current source peripheral and excess pin voltage
« Reply #2 on: January 15, 2018, 04:21:16 pm »
If a current source is powered from a 5v supply, how could it's output exceed 5v?  The answer is that it can not.  Any current source will have a limited output voltage range, known as the compliance range.

That's what I thought! But then I read that paragraph saying "protect the device" in the datasheet and started to doubt myself. |O

The resistance limits are likely due to the compliance of the current source,  i.e. the maximum voltage it can deliver whilst still delivering a constant current.  This will always be somewhat less than the supply rail voltage, sometimes significantly less.

Ah, I see. If that were the case, it would be helpful if they would actually state that, rather than just hint at it in a footnote for a table of examples. I couldn't find anything describing the characteristics of the current source in the Electrical Characteristics section of the datasheet at all. Maybe I will have to reconsider what value of potentiometer to use. Or maybe just try it and see if the current dips under loads > 30K.

Thanks for the help. :-+
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3240
  • Country: gb
Re: ATmega32M1 - ISRC current source peripheral and excess pin voltage
« Reply #3 on: January 16, 2018, 09:42:44 am »
I couldn't find any specification on the current source either.  I think it's safe to say that isn't one of their better datasheets!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf