In a program using a SAMD21 SERCOM as SPI in master mode I have the following code:
SERCOM0->SPI.INTENSET.bit.TXC = 1; SERCOM0->SPI.INTENCLR.bit.DRE = 1;
At entry the bit DRE is set and TXC is cleared. After the first statement the bits TXC and DRE are set. After the second statement one would expect that only TXC is set, but BOTH bits are cleared.
The problem is fixed by swapping the statements.
The odd behaviour is not described in the SAMD21 Errata document.
Has anyone seen such behaviour?
Thanks for a reply, Jerry
The program section is a driver for a MAX7219 8-digit 7 segment LED interface