Setting interrupt is changing mode of pin

I am developing an application using a Seeed Xiao nRF52840 development board and the Arduino IDE.  I configured pin 3 (=29 on the chip) as an INPUT (with an external pullup) and attached an CHANGE interrupt to this pin.  I was noticing unexpected behaviour and after looking with an oscilloscope I determined that the 20K internal pullup resistor has been applied to the pin.  I have confirmed this by looking at the value of the register for this pin (at address: 0x50000774).

After intital call to pinMode: pinMode(SIGNAL_PIN, INPUT);

the register value is binary 10 (expected value for a simple digital input without any internal pullup or pulldown). 

But after the interrupt is attached: attachInterrupt(digitalPinToInterrupt(SIGNAL_PIN), process_signal, CHANGE);

the pin register has the binary value  110000000000001100  Which indicates that the pin has an internal pullup applied.  
I have been through the arduino core code and I can't find anywhere that the interrupt should override the pinmode - the bit masks that preserve the orginal setting all look right. 
Can anyone explain whether this is expected behaviour?  If not, could you point me in some potential sources of the error?  Thanks!
Stephen 

  

Parents Reply Children
No Data
Related