ADC_INTFLAG_RESRDY

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Reading ADC->INTFLAG.reg seems to clear the RESRDY bit. On samd20 and samd21. What am I missing?

This topic has a solution.
Last Edited: Fri. Nov 25, 2016 - 01:49 PM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't know how toolchain can cause this. Wierd !

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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".