Reading ADC->INTFLAG.reg seems to clear the RESRDY bit. On samd20 and samd21. What am I missing?
I thought this was a hardware bug. But it turned out to be a toolchain problem. I was using an old 4.8.3 20131129. Just downloaded the latest 5.3.1 20160307 - everything works just fine now.
I don't know how toolchain can cause this. Wierd !
On SAMD21 both INTFLAG and RESULT are located within the same 32-bit word. Old toolchain generates a 32-bit "ldr" instruction for INTFLAG and ends up reading RESULT too. The new toolchain generates an 8-bit "ldrb".
© 2018 Microchip Technology Inc.