To initialize the
TCD:
- 1.Configure the static registers to the
desired functionality.
- 2.Write desired initial values to the
double-buffered registers.
- 3.Ensure that the Enable Ready bit
(ENRDY) in the Status register (TCD.STATUS) is set to '1'.
- 4.Enable the TCD by writing a '1' to the ENABLE bit in the
Control A register (TCD.CTRLA).
It is possible to disable the
TCD in two different
ways:
- 1.By writing a '0' to ENABLE in TCD.CTRLA. This disables the TCD instantly when synchronized to the TCD core domain.
- 2.By writing a '1' to the Disable at
End of Cycle Strobe bit (DISEOC) in the Control E register (TCD.CTRLE). This disables the TCD at the end of the TCD cycle.
The bit fields in the TCD.CTRLA register
are enable-protected, with exception of the ENABLE bit. They can only be written when
ENABLE is written to '0' first.