Forum Rule: Always post complete source code & details to reproduce any issue!
-

Originally Posted by
PaulStoffregen
Try adding this at the beginning of setup()?
Code:
pinMode(A1, INPUT_DISABLE);
Does it help?
This did the trick indeed! Thank you Paul.
j.
-

Originally Posted by
joi
This did the trick indeed! Thank you Paul.
j.
Could someone explain why this works. Should the library have set this?
thanks
-
Senior Member+

Originally Posted by
bicycleguy
Could someone explain why this works. Should the library have set this?
thanks
Assuming Paul had an idea to know to suggest this and follow-up is coming. Perhaps a change to be made in pin setup in analog read usage so it just works ...
-
The modification of analog input pin like INPUT_DISABLE, INPUT_PULLUP, etc. before reading should remain possible, because sometimes it may be useful to read a low impedance signal with a pullup attached, for instance to detect a signal failure caused by a crackling potentiometer or a broken connection, etc., while having the easy option to detach the pullup in software so get the best reading.
To define a fixed default behavior would waste this feature altogether and require additional circuits or freaky coding in such use cases.
-
Senior Member+

Originally Posted by
bicycleguy
Could someone explain why this works. Should the library have set this?
thanks
Looking at INPUT_DISABLE it changes the hysteresis handling of the pin. That explains why it was resistant to change mid-value as shown in post #10
Code:
} else { // INPUT_DISABLE
*(p->pad) = IOMUXC_PAD_DSE(7) | IOMUXC_PAD_HYS;
Something about this passed before - perhaps in the beta - Paul knows … how it gets applied will be forthcoming ...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules