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

GPIO level twilight zone

Thu Feb 04, 2016 12:28 pm

I have been following paulv's experiments with the GPIO.

I connected up a pot between ground and 3V3 so I could set the voltage on the wiper between 0 and 3V3. I then attached the wiper to a GPIO set as an input and displayed level changes.

On my Pi
  • voltages above 1.55 were displayed as high.
  • voltages below 1.26 were displayed as low.
  • voltages between 1.27 and 1.54 continually changed state between high and low (every few microseconds).
I was wondering if the continual state change was the expected behaviour for voltages in the "grey" area.

Aydan
Posts: 713
Joined: Fri Apr 13, 2012 11:48 am
Location: Germany, near Lake Constance

Re: GPIO level twilight zone

Thu Feb 04, 2016 3:49 pm

Be careful with such experiments, you could actually kill the PGIO input stage this way.
The GPIO is a digital Input/Outpout, meaning any signal level that does not conform to CMOS High or Low levels is invalid and might, as you have already experienced, result in erratic and undefined behaviour.
The forbidden area in the logic level specs is forbidden for a reason.

Regards
Aydan

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

Re: GPIO level twilight zone

Thu Feb 04, 2016 4:01 pm

Aydan wrote:Be careful with such experiments, you could actually kill the PGIO input stage this way.
The GPIO is a digital Input/Outpout, meaning any signal level that does not conform to CMOS High or Low levels is invalid and might, as you have already experienced, result in erratic and undefined behaviour.
The forbidden area in the logic level specs is forbidden for a reason.

Regards
Aydan
Noted.

However people do connect analogue devices to the Pi GPIO in this fashion, from memory something like a Sharp GP2D120 can give a "item in range" signal if connected to a GPIO as the analogue output varies.

Also the "grey" area hasn't been documented.

jahboater
Posts: 5408
Joined: Wed Feb 04, 2015 6:38 pm
Location: West Dorset

Re: GPIO level twilight zone

Thu Feb 04, 2016 4:29 pm

Could a schmitt trigger help?
"We are in the beginning of a mass extinction, and all you can talk
about is money and fairy tales of eternal economic growth."
- Greta Thunberg

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

Re: GPIO level twilight zone

Thu Feb 04, 2016 4:39 pm

jahboater wrote:Could a schmitt trigger help?
I have no idea. I have an impression they are enabled by default. See http://www.mosaic-industries.com/embedd ... ifications

jahboater
Posts: 5408
Joined: Wed Feb 04, 2015 6:38 pm
Location: West Dorset

Re: GPIO level twilight zone

Thu Feb 04, 2016 5:01 pm

I saw "you can configure the input gate to act as a Schmitt trigger". Maybe its not the default.
Looks like you can switch hysteresis on and off as well.
I've no idea how any of this is done.
"We are in the beginning of a mass extinction, and all you can talk
about is money and fairy tales of eternal economic growth."
- Greta Thunberg

Return to “Advanced users”