Datasheet

Table Of Contents
53.6.3.3 Register Lock Update
Prescaler (PRESC), FILTER, and CCx registers are buffered (PRESCBUF, FILTERBUF, CCBUFx
registers, respectively). When a new value is written in a buffer register, the corresponding Buffer Valid bit
is set in the Buffer Status register (STATUS.FILTERBUFV, STATUS.PRESCBUFV, STATUS.CCBUFVx).
By default, a register is updated with the its buffer register's value on UPDATE condition, which
represents:
The next filter transition in QDEC and HALL mode of operation
The overflow/underflow or re-trigger event detection in COUNT mode of operation
The buffer valid flags in the STATUS register are automatically cleared by hardware when the data is
copied from the buffer to the corresponding register.
It is possible to lock the updates by writing a '1' to the Lock Update bit in Control B Set register
(CTRLBSET.LUPD).
The lock feature is disabled by writing a '1' to the Lock Update bit in Control B Clear register
(CTRLBCLR.LUPD). When a buffer valid status flag is '1' and updating is not locked, the data from the
buffer register will be copied into the corresponding register on UPDATE condition.
It is also possible to modify the LUPD bit behavior by hardware, by writing a '1' to the Auto-lock bit in
Control A register (CTRLA.ALOCK). When the bit is '1', the Lock Update bit in Control B register
(CTRLBSET.LUPD) is set when the UPDATE condition is detected.
53.6.3.4 Software Command and Event Actions
The PDEC peripheral supports software commands and event actions. The software commands are
applied by the Software Command bit field in the Control B register (CTRLBSET.CMD,
CTRLBCLR.CMD). The event actions are available in the Event Action bit-field in Event Control register
(EVCTRL.EVACT).
53.6.3.4.1 Re-trigger Software Command or Event Action
A re-trigger command can be issued from software by using PDEC Command bits in Control B Set
register (CTRLBSET.CMD = RETRIGGER) or when the re-trigger event action is configured in the Input
Event Action bits in Event Control register (EVCTRL.EVACT = RETRIGGER) and an event is detected by
hardware.
When the re-trigger command is detected during counting operation, the counter will be reloaded or
cleared, depending on the counting direction (DIR). If the re-trigger command is detected when the
counter is stopped, the counter will resume counting operation from the value in the COUNT register.
Note:  When re-trigger event action is enabled, enabling the counter will not start the counter. The
counter will start on the next incoming event and restart on any following event.
53.6.3.4.2 Count Event Action
The count action can be selected in the Event Control register (EVCTRL.EVACT) and can be used to
count external events. When an event is received, the counter increments the value.
53.6.3.4.3 Force Update Software Command
A Force Update command can be issued by writing the PDEC Command bits in Control B Set register
(CTRLBSET.CMD = UPDATE). When the command is issued, the buffered registers will be updated.
53.6.3.4.4 Force Read Synchronization Software Command
A Force Read Synchronization command can be issued writing the PDEC Command bits in Control B Set
register (CTRLBSET.CMD = READSYNC). When the command is issued, a COUNT register read
synchronization is forced.
Note:  This command should be used to read the most updated COUNT internal value.
SAM D5x/E5x Family Data Sheet
PDEC – Position Decoder
© 2019 Microchip Technology Inc.
Datasheet
DS60001507E-page 1956