Closed
Description
Hi,
The following sequence will leave the pin muxed to the ADC and fail on the digital write:
analogRead(pin);
pinMode(pin,OUTPUT);
digitalWrite(pin,HIGH);
A workaround is to insert a pinMode(pin,INPUT)
before the pinMode(pin,OUTPUT)
.
I think the issue is with commit e431bf7
to wiring_digital.c
. It sets the INEN bit without clearing the PMUXEN bit. It is also leaving any PULLEN and DRVSTR setting in place where as the previous revision was clearing the whole register except INEN. Not sure if the best fix is to just clear PMUXEN, or to set the whole register with PORT_PINCFG_INEN so everything else is cleared.
Metadata
Metadata
Assignees
Labels
No labels