The part that's missing (IMNSHO) is a TODR that would 'toggle/flip' the nominated bit(s) of the port.
You're putting a 32kHz crystal on a Due board?
I could not imagine using an RTC without setting it to the real time, but I have a poor imagination.
the SAMD (Zero/etc) has a "Toggle" register.On Due, there is also "bit banding", just to complicate the decision process. In theory, digitalRead() could be sped up slightly using bit-banding.One of the things that slows down digitalWrite() on the ARMs is maintaining the "digitalWrite(pin, 1) on a pin configured for input, enables the internal pullup" behavior from the AVR. On AVR, that was essentially a side effect of the implementation, "free" WRT implementation cost. On the ARM GPIO peripherals, the pullups are controlled via a separate register, so there has to be a check in the digitalWrite() code path. :-(
It already has one, according to the schematic. My board is actually an Iteaduino Due, and it definitely has two crystals.Ah. On the SAMD chips (Zero, but NOT Due), the "RTC" peripheral has several modes. In addition to the clock/calendar mode, used with a slow clock input or crystal, there are also 16 and 32bit "counter" modes with configurable prescalers and "top" values that operate up to the full system clock speed. Sort of a SysTick on steroids. It's pretty easy to set it up to count microseconds (48MHz/3 GCLK, /16 RTC prescaler) and interrupt every millisecond ("top" = 999) I had assumed that the Due SAM3X was the same peripheral, but looking more closely I see that I was wrong...