ATtiny1616 -> Comparator Hysteresis Variance

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

I'm using a resistor divider, the fabulously low 0.55v reference, and "50mV" hysteresis to net a turn off and on point of the equivalent of 9.5v and 14.5v. It works very well.

However there could be a problem.

 

The datasheet shows a massive potential difference in the hysteresis which I need to understand. Would anyone know what can cause it to differ this much? I'm thinking possibilities are low Vdd, die temperature?

 

 

Attachment(s): 

Last Edited: Thu. Nov 19, 2020 - 08:31 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


There is some more data there.

 

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

I missed that but it doesn't match the 20 - 120mV range for the 50mV setting. I might have to ask them...

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

The datasheet shows a massive potential difference in the hysteresis which I need to understand.

  Do you mean the variation in hysteresis amount ?  That is prob just due to internal chip design....why are you extremely sensitive to hysterysis?  Can you use one of the lower settings, like 10-60mV?...They prob intend it more for squaring up signals with different levels of noise, rather than establishing exact trip points.  Could you use the ADC?  Then you get to choose everything.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

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

If you need to understand the variation in hysteresis, it's due to the implementation in the silicon. In the macro world, we'd set the hysteresis using a feedback network of nice linear resistors. In the cmos world a linear resistor is approximated using a transistor biased into it's linear region of operation. Looking at the charts, the dip below 0.5V is due to transistors entering pinch-off and losing linearity. Similarly, the bump above 4V is due to transistors approaching saturation and losing linearity.

 

The hysteresis on a comparator is intended for noise immunity. Your application of triggering on a 50% voltage swing would be better suited to a dual comparator design. If you're locked into the tiny1616 and a single comparator, use the DAC to set low/high trip level as the AC trips on/off. If the DAC is tied up elsewhere, you might try switched VREF to get two thresholds.

 

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

The hysteresis on a comparator is intended for noise immunity.

 By that we are mostly referring to built-in comparator hysteresis (many comparators include none at all).  You can add a few parts to a comparator to get pretty exact trip points (using an accurate ref voltage for absolute trips, or a divider for ratiometric trips).   As mentioned, if you want widely spaced trips, a dual comparator setup gives an additional degree of flexibility.  

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

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

Indeed, a couple of external resistors would be a cheap, easy, accurate solution. Too often we get caught up with solving entirely within the micro.

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

Big problem with many AVR comparators is that you do not have direct access to the comparator out AND what you have is often clock sync'd. That makes it impossible to use external hysteresis setting.

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

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

ka7ehk wrote:

Big problem with many AVR comparators is that you do not have direct access to the comparator out AND what you have is often clock sync'd. That makes it impossible to use external hysteresis setting.

 

It's ok, these newer devices have asynch output from the comparator(s).

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

I'm actually already doing what one suggested by using two comparators and DAC's for trip points which works fine, but I was hoping to repurpose one as a faster UVLO (I have to use an ADC at the moment). 

 

I don't believe the comparators on this particular chip have output pins at all, unless it's routed through event system which has two outputs?

 

Note the ATtiny1616 has three comparators and three 8-bit DACS - wonderful little chip it is.

Edit - they do have outputs, I stand corrected. Shall use resistors in the next revision.

Last Edited: Fri. Nov 20, 2020 - 11:35 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

snoopy33 wrote:

I'm using a resistor divider, the fabulously low 0.55v reference, and "50mV" hysteresis to net a turn off and on point of the equivalent of 9.5v and 14.5v. It works very well.

50mV hyst on 550mv is 9.09%, but you seem to suggest 9.5 & 14.5 points, a much larger span  ?

- so you must be adding more Hyst yourself ?

 

If you want to reduce the error source of the Chip Hyst, use the lowest Hyst setting and increase your own added hyst slightly to compensate.

 

 

snoopy33 wrote:

..

The datasheet shows a massive potential difference in the hysteresis which I need to understand. Would anyone know what can cause it to differ this much? I'm thinking possibilities are low Vdd, die temperature?

..

I missed that but it doesn't match the 20 - 120mV range for the 50mV setting. I might have to ask them...

That wide range is their design limits, includes Process Voltage and Temperature. The curves show typicals for a sample device.

If you are chasing accurate set points, you need to avoid the chip variances.

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

No sorry its been a long day.

I am using the 50mV for one circuit, a "ZCD" of about 1.5v and 4v (resistors take it down, IIRC 100k/3.9k).

The other circuit needs precision and is using the remaining two comparators. It would be nice if I could reallocate one of these for a UVLO purpose hence the ask. I'm going to go with the resistor as it somehow bypassed me that the comparators can output to pin.