spike filter details?

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

Does anyone have details (hopefully a schematic) of the reset spike filter?  I've been testing ADC0 on 8-pin tinies like the t13 and t85, without disabling reset.  I'm getting noise, about 3LSB, that I don't see on other ADC inputs.  For example just reading ADC0 with nothing connected gives a reading of 1023 only about 50% of the time, whereas ADC1, 2, & 3 all give a consistent, stable, and noise-free reading of 1023 with the pullup enabled.

The "noise" seems to have a pattern, so I suspect there's some sort of RC oscillation going on between capacitance in the reset spike filter and the ~10pf S/H ADC capacitor.  Adding an external 10nf capacitor does not eliminate the noise.

 

 

 

 

 

I have no special talents.  I am only passionately curious. - Albert Einstein

 

Last Edited: Fri. Feb 21, 2020 - 12:15 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What if you add a stronger pullup to ADC0,like 10K...does the issue go away?   Or what if you provide an actual signal to convert (rather than an almost floating input)....how does that signal convert on ADC0 vs being on ADC1?

 

like the t13 and t85, without disabling reset.

In any case, if the pin is still used for reset, can it be used at the same time for adc? ....wouldn't make sense...a low signal would reset the chip (unless setting the ADC mux to 0 , overrides the pin reset functionality)

 

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

Last Edited: Fri. Feb 21, 2020 - 03:27 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandies wrote:
In any case, if the pin is still used for reset, can it be used at the same time for adc? ....wouldn't make sense...a low signal would reset the chip (unless setting the ADC mux to 0 , overrides the pin reset functionality)

I have an app where I used the ADC / RESET pin on a T25, I needed one more ADC input and that one was the only one I had left.

the ADC signal I needed to measure was always above the reset threshold, so it worked fine, although I did have to compensate for the internal pull up resistor that exists on that pin.

So sometimes it does make sense!

 

Jim

 

 

 

 

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

ralphd wrote:
I'm getting noise, about 3LSB, that I don't see on other ADC inputs.

Can you show a scope pic of this noise?

 

 

 

 

 

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

Life would be easier if you would just select an appropriately sized micro for your project and leave the poor Reset\ pin alone! wink

 

JC

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

Patient: "Doctor, it hurts when I do this."

Doctor: "Well don't do that."

 

Ross McKenzie ValuSoft Melbourne Australia

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

DocJC wrote:

Life would be easier if you would just select an appropriately sized micro for your project and leave the poor Reset\ pin alone! wink

 

JC

This is Ralph we're talking about, Doc... You know better ;-)
Besides, the likes of AtomicZombie do this kind of thing all the time...

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

ki0bk wrote:

ralphd wrote:
I'm getting noise, about 3LSB, that I don't see on other ADC inputs.

Can you show a scope pic of this noise?

 

 

I haven't hooked up the scope.  It's a simple test.  Here's the core of the code:

 

ADCSRA = (0 << ADPS2) | (1 << ADPS1) | (1 << ADPS0) | (1 << ADEN);
while (1) {
    ADCSRA |= (1 << ADSC);
    while ( bit_is_set(ADCSRA, ADSC) );
    uint16_t result = ADCW;
}

I've tried different prescalers, and still get the same result.  About half the readings are 0x3FF, and the rest are in the 0x3E8-0x3F8 range.  With a 1k external pullup on RESET, the readings are all solid at 0x3FF.

But I'm not asking how to make it work.  I want to know why it behaves the way it does, hence my question about the spike filter.

 

I have no special talents.  I am only passionately curious. - Albert Einstein

 

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

The spike filter probably has some R & C components to it.  Any bit of load fights against the pull up and nudges it down.  You are only talking about perhaps 10-20 counts...out of 1023, that is only 1-2%.

When you add a stronger pullup, the tug of war changes to the pullup's favor.

 

 

  

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

The spike filter isn't the only mystery connected to RESET.  Slowly over the past few years I've come to the conclusion that there is likely a diode between Vcc and the output driver circuit (including the pullup resistor).

A diode with less than 1uA of current could explain why the voltage on the reset pin is around 4.8V instead of 5V.  There also must circuitry to detect the >11.5V for high-voltage programming.

 

I have no special talents.  I am only passionately curious. - Albert Einstein

 

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

Out of curiosity, do you have a 100nF bypass across Vcc and GND?
Note that the pull-ups on reset is a bit weaker than that on other GPIO pins, but likely not enough to account for your observations.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

I had long thought that such "spike filters" are digital, much like the one that is often present on comparator outputs. Basically a shift register and a multi-input gate so that all of the bits in the register have to be the same value before the signal is passed through. No evidence that this is actually the case, however.

 

On the other hand, resistors and capacitors are really costly on a digital chip and gates are "dirt" cheap.

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

Last Edited: Sun. Feb 23, 2020 - 02:25 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Are you doing a 'fair' comparison? For example, with the reset pin not disabled, its input may be disabled (I don't know, check DIOE in alt pin chart). The adc pins also have an input disable bit. If they are not all the same, then you have one additional difference unaccounted for.

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

joeymorin wrote:
Out of curiosity, do you have a 100nF bypass across Vcc and GND? Note that the pull-ups on reset is a bit weaker than that on other GPIO pins, but likely not enough to account for your observations.

 

I have a 220n bypass cap on my breadboard with one leg in the row for the Vcc pin, and the other leg connected to G through a short 24AWG jumper.  I tested with both a t13 and a t85.  The t85 I tested with also has it's own on-chip .1u cap.

http://nerdralph.blogspot.com/20...

 

I have no special talents.  I am only passionately curious. - Albert Einstein

 

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

ka7ehk wrote:

I had long thought that such "spike filters" are digital, much like the one that is often present on comparator outputs. Basically a shift register and a multi-input gate so that all of the bits in the register have to be the same value before the signal is passed through. No evidence that this is actually the case, however.

 

On the other hand, resistors and capacitors are really costly on a digital chip and gates are "dirt" cheap.

 

I've wondered if the fact that the minimum reset pulse width varies significantly (.4 - 2us) with voltage can give any insight to the spike filter circuit, such as whether it is digital or analog.

 

It's getting a bit off-topic, but I'd disagree on the cost of of on-chip resistors.  Precision on-chip resistors are costly, but I'd bet the on-chip pullup resistors take up no more area than an extra FET.  Capacitors probably take up more area than a FET once you get over a few pF.

 

I have no special talents.  I am only passionately curious. - Albert Einstein