921
11100B–ATARM–31-Jul-12
SAM4S Series [Preliminary]
Sequence for Method 1:
1.
Select the manual write of duty-cycle values and the manual update by setting the
UPDM field to 0 in the PWM_SCM register
2.
Define the synchronous channels by the SYNCx bits in the PWM_SCM register.
3.
Enable the synchronous channels by writing CHID0 in the PWM_ENA register.
4.
If an update of the period value and/or the duty-cycle values and/or the dead-time val-
ues is required, write registers that need to be updated (PWM_CPRDUPDx,
PWM_CDTYUPDx and PWM_DTUPDx).
5.
Set UPDULOCK to 1 in PWM_SCUC.
6.
The update of the registers will occur at the beginning of the next PWM period. At this
moment the UPDULOCK bit is reset, go to
) for new values.
Figure 37-10. Method 1 (UPDM = 0)
Method 2: Manual write of duty-cycle values and automatic trigger of the update
In this mode, the update of the period value, the duty-cycle values, the dead-time values and the
update period value must be done by writing in their respective update registers with the CPU
(respectively PWM_CPRDUPDx, PWM_CDTYUPDx, PWM_DTUPDx and PWM_SCUPUPD).
To trigger the update of the period value and the dead-time values, the user must use the bit
UPDULOCK of the
“PWM Sync Channels Update Control Register”
(PWM_SCUC) which
allows to update synchronously (at the same PWM period) the synchronous channels:
• If the bit UPDULOCK is set to 1, the update is done at the next PWM period of the
synchronous channels.
• If the UPDULOCK bit is not set to 1, the update is locked and cannot be performed.
After writing the UPDULOCK bit to 1, it is held at this value until the update occurs, then it is
read 0.
The update of the duty-cycle values and the update period is triggered automatically after an
update period.
To configure the automatic update, the user must define a value for the Update Period by the
UPR field in the
“PWM Sync Channels Update Period Register”
(PWM_SCUP). The PWM con-
troller waits UPR+1 period of synchronous channels before updating automatically the duty
values and the update period value.
CCNT0
CDTYUPD
0x20
0x40
0x60
UPDULOCK
CDTY
0x20
0x40
0x60
Summary of Contents for SAM4S Series
Page 44: ...44 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Page 412: ...412 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Page 1105: ...1105 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Page 1143: ...1143 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 4 64 lead LQFP Package Drawing ...
Page 1145: ...1145 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 5 64 lead QFN Package Drawing ...