Atmel ARM-Based Evaluation Kit for SAM4S16C, 32-Bit ARM® Cortex® Microcontroller ATSAM4S-WPIR-RD ATSAM4S-WPIR-RD データシート

製品コード
ATSAM4S-WPIR-RD
ページ / 1231
SAM4S Series [DATASHEET]
Atmel-11100G-ATARM-SAM4S-Datasheet_27-May-14
944
1. Select the manual write of duty-cycle values and the automatic update by setting the field UPDM to ‘1’ 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. Enable the synchronous channels by writing CHID0 in the PWM_ENA register.
5. If an update of the period value and/or of the dead-time values is required, write registers that need to be 
updated (PWM_CPRDUPDx, PWM_DTUPDx), else go to 
6. Set UPDULOCK to ‘1’ in PWM_SCUC.
7. 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.
8. If an update of the duty-cycle values and/or the update period is required, check first that write of new update 
values is possible by polling the flag WRDY (or by waiting for the corresponding interrupt) in the PWM_ISR2.
9. Write registers that need to be updated (PWM_CDTYUPDx, PWM_SCUPUPD).
10. The update of these registers will occur at the next PWM period of the synchronous channels when the 
Update Period is elapsed. Go to 
 for new values.
Figure 39-11. Method 2 (UPDM=1)
Method 3: Automatic write of duty-cycle values and automatic trigger of the update
In this mode, the update of the duty cycle values is made automatically by the Peripheral DMA Controller (PDC). 
The update of the period value, 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_DTUPDx and 
PWM_SCUPUPD).
To trigger the update of the period value and the dead-time values, the user must use the bit UPDULOCK 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 value is triggered automatically after an update period.
CCNT0
CDTYUPD
0x20
0x40
0x60
UPRCNT
0x0
0x1
0x0
0x1
0x0
0x1
CDTY
0x20
0x40
UPRUPD
0x1
0x3
WRDY
0x60
0x0
0x1
0x2
0x3
0x0
0x1
0x2
UPR
0x1
0x3