gwideman
Posts: 45
Joined: Tue Mar 01, 2016 8:18 pm

Re: Documentation bugs: RPi2&3 GPIO electrical specs

Wed Jun 20, 2018 9:52 am

Z80 Refugee wrote:
Wed Jun 20, 2018 8:57 am
It's really quite simple .... [points answered below]
> do not apply a noisy signal to an RPi input and expect reliable results.
No signals, nor ground nor power are completely free of noise.

> Hysteresis protects inputs from a slow monotonic transition, not a noisy one.
One of the key protections that a Schmitt input provides is against noise during what would otherwise be the near-metastable input voltage range. And one particular variety of that noise to be avoided is noise on the power/ground caused by the current spike of the slow transition-in-progress of this particular input and its downstream stages shorting the power supply. This supply noise couples back to the input and results in oscillation and a burst of transitions at the output. And that's not the only source of noise.

> All digital systems are susceptible to metastability. If an input isn't held at a defined logic level for the specified length of time before the sample clock edge...

Right -- one might distinguish two parts to the metastability problem: (a) a slowly transitioning input that passes through the the metastable range of a subsequent (non-clocked) stage, and (b) an input that transitions slowly or rapidly, at a time that fails to meet setup and hold for a clocked stage. A Schmitt input helps explicitly the (a) part of the problem, and for slow signals greatly improves the statistics for the (b) part of the problem, but doesn't eliminated it. For GPIOs which have no accompanying clock, one would hope that the SoC contains synchronizer stages to address the type (b) problem. (Various ATMEGA and ARM literature indeed show such synchronizers on GPIOs and interrupt inputs).

> If you have a noisy signal, by definition that's analogue
At some level, all signals are analog!

>and you need to make it non-noisy before applying it to a digital input. You must not rely on a little bit of input hysteresis to eliminate noise.

Yet all signals include noise. And consequently Schmitt trigger ICs tout their noise immunity as a feature. See for example https://assets.nexperia.com/documents/d ... 4LVT14.pdf "it has a greater noise margin than conventional inverters"... "High noise immunity".

> There is no need for the hysteresis on the RPi inputs to be specified,
For what it's worth, I've accepted that RPi foundation doesn't have that spec, and there's no benefit to pressing the point.

> you must supply input signals that meet the logic high and low voltage specifications.
> If your actual signals don't match the specifications, you need to provide conditioning before they get to the RPi.

Sure, regardless of hysteresis, the basic logic level specs have to be met, and RPi foundation published those specs. Yay!

gwideman
Posts: 45
Joined: Tue Mar 01, 2016 8:18 pm

Re: Documentation bugs: RPi2&3 GPIO electrical specs

Wed Jun 20, 2018 9:59 am

joan wrote:
Wed Jun 20, 2018 9:29 am
Is hysteresis really that difficult to measure. I sort of expected this to be a pretty standard test from a hardware viewpoint. Is there no standard testing device? Wouldn't something as simple as a digital POT allow a test?
Hysteresis is easy to measure. However you would only be measuring that one device. That measurement doesn't tell you how the next device behaves. You could measure a whole lot of devices and derive some statistical distribution, but that still doesn't tell you the range of values that the manufacturer could deliver to you next week.

So instead we depend on the manufacturer to tell us "here's the range of values we guarantee to stay within". (And they test the devices and reject ones that fail the specs -- at least up to some level of statistical confidence.) Those are the specs that one can use to design with some level of assurance that your design will work with parts delivered in the future.

User avatar
joan
Posts: 13621
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Documentation bugs: RPi2&3 GPIO electrical specs

Wed Jun 20, 2018 10:17 am

gwideman wrote:
Wed Jun 20, 2018 9:59 am
joan wrote:
Wed Jun 20, 2018 9:29 am
Is hysteresis really that difficult to measure. I sort of expected this to be a pretty standard test from a hardware viewpoint. Is there no standard testing device? Wouldn't something as simple as a digital POT allow a test?
Hysteresis is easy to measure. However you would only be measuring that one device. That measurement doesn't tell you how the next device behaves. You could measure a whole lot of devices and derive some statistical distribution, but that still doesn't tell you the range of values that the manufacturer could deliver to you next week.

So instead we depend on the manufacturer to tell us "here's the range of values we guarantee to stay within". (And they test the devices and reject ones that fail the specs -- at least up to some level of statistical confidence.) Those are the specs that one can use to design with some level of assurance that your design will work with parts delivered in the future.
Then the Pi is the wrong tool for the task. A different component is needed. How much would Pi sales increase if the figure was known? If that was quantified the Foundation could see if it was worth the expense.

User avatar
Z80 Refugee
Posts: 358
Joined: Sun Feb 09, 2014 1:53 pm

Re: Documentation bugs: RPi2&3 GPIO electrical specs

Wed Jun 20, 2018 11:08 am

Exactly. If you need a specific hysteresis, build it into your signal conditioning and don't rely on any inherent input noise immunity - which has been my point but people seem to want to pick it over. I could have gone into vast detail about how all signals have some noise, but for brevity... Digital signals overcome the noise by having a sufficiently wide margin between what counts as a zero and what counts as a one, and the transition between the two is supposed to be monotonic or all bets are off (ie correct operation is not guaranteed).

No, hysteresis is not easy to measure unless you have access to the logic node inside the input buffer - which you don't. The supplier could choose to provide a "typical" value for the hysteresis without it committing themselves to guaranteed performance, but the whole point of not providing a typical value is to ensure nobody does something stupid by relying on it. I'll say it again in the hope that the nit-pickers will understand the main point: unspecified input hysteresis is for sharpening up slow signal transitions, not for eliminating noise. It's function is to eliminate the voltage range within which an input is at an undefined logic level, but the input high and low specs still apply.
Last edited by Z80 Refugee on Wed Jun 20, 2018 12:18 pm, edited 1 time in total.
Military and Automotive Electronics Design Engineer (retired)

For the best service: make your thread title properly descriptive, and put all relevant details in the first post (including links - don't make us search)!

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 20942
Joined: Sat Jul 30, 2011 7:41 pm

Re: Documentation bugs: RPi2&3 GPIO electrical specs

Wed Jun 20, 2018 12:14 pm

joan wrote:
Wed Jun 20, 2018 10:17 am
gwideman wrote:
Wed Jun 20, 2018 9:59 am
joan wrote:
Wed Jun 20, 2018 9:29 am
Is hysteresis really that difficult to measure. I sort of expected this to be a pretty standard test from a hardware viewpoint. Is there no standard testing device? Wouldn't something as simple as a digital POT allow a test?
Hysteresis is easy to measure. However you would only be measuring that one device. That measurement doesn't tell you how the next device behaves. You could measure a whole lot of devices and derive some statistical distribution, but that still doesn't tell you the range of values that the manufacturer could deliver to you next week.

So instead we depend on the manufacturer to tell us "here's the range of values we guarantee to stay within". (And they test the devices and reject ones that fail the specs -- at least up to some level of statistical confidence.) Those are the specs that one can use to design with some level of assurance that your design will work with parts delivered in the future.
Then the Pi is the wrong tool for the task. A different component is needed. How much would Pi sales increase if the figure was known? If that was quantified the Foundation could see if it was worth the expense.
10?

It's clearly not worth the expense.

Broadcom do not provide these figures, and don't test for it in production. Since adding the test would a) Cost money b) Reduce the number of 'working' SoC's coming off the line c) Would not benefit the vast vast majority of users who really don't give a damn about it, it would be commercially stupid to add it. It would add cost to EVERY Pi for the benefit of a tiny number of people.


I'm with Joan, if you absolutely need this value (i.e. you cannot design around it), then you are using the wrong device. Which is fine, we would be more than happy for people to use something else, after all, we cannot satisfy everyone.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

gwideman
Posts: 45
Joined: Tue Mar 01, 2016 8:18 pm

Re: Documentation bugs: RPi2&3 GPIO electrical specs

Wed Jun 20, 2018 10:32 pm

As OP, I have twice acknowledged that the thread answered as much of my original question as it's going to, so its main purpose is served, and I've accepted that we won't be hearing a hysteresis spec. And thanks to jamesh for his long-suffering attention.

Z80 Refugee and I agree that hysteresis manages slow transitions only by transforming monotonic transitions cleanly into a binary values with a sharp transition, but differ on whether that function entails rejecting some amount of noise and some amount of non-monotonicity. Readers can study this subject for themselves to make up their minds.

There are indeed also many applications that could use hysteresis for which SoC input hysteresis would be unsuitable even if a VHYSmin spec was provided -- I think that was where Joan was going, but not sure. For example, if you were to connect a thermistor voltage divider and hope that input hysteresis would provide some thermostat-style hysteresis. You would get something like that behavior, but since the input's turn-on and turn-off points would be specified only to be in some range, and, even if measured are not adjustable, that would be impractical. So this instead calls for implementing this function with external linear circuitry (or A/D plus software).

Z80 notes that measuring hysteresis requires access to the logic node inside the input buffer. We have that by reading it in software. So measuring hysteresis of a particular input of a particular device is dead easy -- just apply a sequence of known input voltages, and in software read the binary value of that pin. That same software can drive a D/A to control that voltage, so all that's required is a D/A and some simple code.

I agree with jamesh that if Broadcom don't provide a hysteresis spec, then it's not worth any time and trouble to dwell on this issue.

OK, I think it's time to call it quits on this thread.

User avatar
Z80 Refugee
Posts: 358
Joined: Sun Feb 09, 2014 1:53 pm

Re: Documentation bugs: RPi2&3 GPIO electrical specs

Thu Jun 21, 2018 7:46 am

I meant measure with the precision required to caracterise the performance in a production test environment for guaranteed specifications. I agree it's not difficult to sample for a rough "typical" value - and I might just try that: it would be interesting to build an oscillator using GPIO pins as the input and output of a simulated inverter, with a very slow RC time constant. The voltage on C (monitored over time) will be revealing.
Military and Automotive Electronics Design Engineer (retired)

For the best service: make your thread title properly descriptive, and put all relevant details in the first post (including links - don't make us search)!

wpns
Posts: 85
Joined: Sat Sep 01, 2012 2:50 pm

Re: Documentation bugs: RPi2&3 GPIO electrical specs

Thu Sep 20, 2018 8:30 pm

Many thanks to jamesh for following up on this time and time again until we got the real numbers:

V(IL) 0.9V
V(IH) 1.6V

I'm working on building an interface to a burglar/fire alarm panel that puts out "10VDC-13.8VDC through 4K Ohms when high and Ground through 100 ohms when low", and have been searching high and low (if you see what I did there) for the above numbers.

Hard to believe it took 2.3 years, but I only spent a couple of hours searching, so I feel like I got off easy.

Thanks also to those who tried to explain _why_ such numbers are important, and continued to press the issue until we at least got the above!

gwideman
Posts: 45
Joined: Tue Mar 01, 2016 8:18 pm

Re: Documentation bugs: RPi2&3 GPIO electrical specs

Fri Sep 21, 2018 12:56 am

wpns wrote:
Thu Sep 20, 2018 8:30 pm
I'm working on building an interface to a burglar/fire alarm panel that puts out "10VDC-13.8VDC through 4K Ohms when high and Ground through 100 ohms when low", and have been searching high and low (if you see what I did there) for the above numbers.
... you will use something at least as sophisticated as a couple of resistors configured as a say 1:5 voltage divider, right?

Say 11k with 3.9k. 3.9/(3.9 + 11 + 4) = 0.206
So:
10V --> 2.06V
13.8V --> 2.84V

Also, I appreciate you commenting that you found this thread useful, though your application could easily satisfy any of the previously conjectured specs. :-).
Last edited by gwideman on Sat Sep 22, 2018 12:48 am, edited 1 time in total.

wpns
Posts: 85
Joined: Sat Sep 01, 2012 2:50 pm

Re: Documentation bugs: RPi2&3 GPIO electrical specs

Fri Sep 21, 2018 11:20 am

gwideman wrote:
Fri Sep 21, 2018 12:56 am
wpns wrote:
Thu Sep 20, 2018 8:30 pm
I'm working on building an interface to a burglar/fire alarm panel that puts out "10VDC-13.8VDC through 4K Ohms when high and Ground through 100 ohms when low", and have been searching high and low (if you see what I did there) for the above numbers.
... you will use something at least as sophisticated as a couple of resistors configured as a say 5:1 voltage divider, right?

Say 11k with 3.9k. 3.9/(3.9 + 11 + 4) = 0.206
So:
10V --> 2.06V
13.8V --> 2.84V

Also, I appreciate you commenting that you found this thread useful, though your application could easily satisfy any of the previously conjectured specs. :-).
Absolutely, and now that I know where the input levels are supposed to be, I can select those resistor values.

I also conjecture that I could have made something work, though now I _know_ it'll work!

Return to “Advanced users”