924
11100B–ATARM–31-Jul-12
SAM4S Series [Preliminary]
Sequence for Method 3:
1.
Select the automatic write of duty-cycle values and automatic update by setting the field
UPDM to 2 in the PWM_SCM register.
2.
Define the synchronous channels by the bits SYNCx in the PWM_SCM register.
3.
Define the update period by the field UPR in the PWM_SCUP register.
4.
Define when the WRDY flag and the corresponding PDC transfer request must be set in
the update period by the PTRM bit and the PTRCS field in the PWM_SCM register (at
the end of the update period or when a comparison matches).
5.
Define the PDC transfer settings for the duty-cycle values and enable it in the PDC
registers
6.
Enable the synchronous channels by writing CHID0 in the PWM_ENA register.
7.
If an update of the period value and/or of the dead-time values is required, write regis-
ters that need to be updated (PWM_CPRDUPDx, PWM_DTUPDx), else go to
8.
Set UPDULOCK to 1 in PWM_SCUC.
9.
The update of these registers will occur at the beginning of the next PWM period. At
this moment the bit UPDULOCK is reset, go to
for new values.
10. If an update of the update period value is required, check first that write of a new update
value is possible by polling the flag WRDY (or by waiting for the corresponding inter-
rupt) in the PWM_ISR2 register, else go to
11. Write the register that needs to be updated (PWM_SCUPUPD).
12. The update of this register will occur at the next PWM period of the synchronous chan-
nels when the Update Period is elapsed. Go to
for new values.
13. Check the end of the PDC transfer by the flag ENDTX. If the transfer has ended, define
a new PDC transfer in the PDC registers for new duty-cycle values. Go to
Figure 37-12. Method 3 (UPDM=2 and PTRM=0)
CCNT0
CDTYUPD
0x20
0x40
0x60
UPRCNT
0x0
0x1
0x0
0x1
0x0
0x1
CDTY
UPRUPD
0x1
0x3
transfer request
WRDY
0x0
0x1
0x2
0x3
0x0
0x1
0x2
UPR
0x1
0x3
0x80
0xA0
0xB0
0x20
0x40
0x60
0x80
0xA0
Содержание SAM4S Series
Страница 44: ...44 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Страница 412: ...412 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Страница 1105: ...1105 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Страница 1142: ...1142 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 3 100 ball VFBGA Package Drawing ...
Страница 1143: ...1143 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 4 64 lead LQFP Package Drawing ...
Страница 1145: ...1145 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 5 64 lead QFN Package Drawing ...