theboot900
Well-known member
So im sharing an analog pin to read analog in from a multiplexer. The multiplexer gets enabled, reads various values then gets disabled.
That same pin then switches into a digital out pin (as part of a 16 bit parallel output to a display).
This all works fine, however i am getting some jitter on the analogRead 12 bit (+-2) which wasn't there before the multiplexer (MC74HC4067ADWG) This is usable however i was reading on another thread about not having an analog pin switched to pinMode(i, INPUT) before doing an analog read but instead use pinMode(x, INPUT_DISABLE). I wanted to try this to see if it reduces some jitter.
But i would like to confirm ive got this correct and dont blow anything. This will be the flow
1) pinMode(x, INPUT_DISABLE)
2) EnableMultiplexer
3) AnalogRead Multiplexer
4) DisableMultiplexer
5) pinMode(x, OUTPUT)
6) Digital out to Screen
Does setting pinMode(x, INPUT_DISABLE) disable the currently set OUTPUT mode on the pin as well. I don't want to pass voltage in from the multiplexer analogValues while the pin is in OUTPUT mode. Im assuming pinmode will set the pin in only one specific state in the different calls but would like to confirm
That same pin then switches into a digital out pin (as part of a 16 bit parallel output to a display).
This all works fine, however i am getting some jitter on the analogRead 12 bit (+-2) which wasn't there before the multiplexer (MC74HC4067ADWG) This is usable however i was reading on another thread about not having an analog pin switched to pinMode(i, INPUT) before doing an analog read but instead use pinMode(x, INPUT_DISABLE). I wanted to try this to see if it reduces some jitter.
But i would like to confirm ive got this correct and dont blow anything. This will be the flow
1) pinMode(x, INPUT_DISABLE)
2) EnableMultiplexer
3) AnalogRead Multiplexer
4) DisableMultiplexer
5) pinMode(x, OUTPUT)
6) Digital out to Screen
Does setting pinMode(x, INPUT_DISABLE) disable the currently set OUTPUT mode on the pin as well. I don't want to pass voltage in from the multiplexer analogValues while the pin is in OUTPUT mode. Im assuming pinmode will set the pin in only one specific state in the different calls but would like to confirm