110
7734Q–AVR–02/12
AT90PWM81/161
12.5.3
Fifty Percent Waveform Configuration
When PSCOUTn0 and PSCOUTn1 have the same characteristics, it’s possible to configure the
PSC in a Fifty Percent mode. When the PSC is in this configuration, it duplicates the OCRn-
SBH/L and OCRnRBH/L registers in OCRnSAH/L and OCRnRAH/L registers. So it is not
necessary to program OCRnSAH/L and OCRnRAH/L registers.
12.6
Update of Values
The update of PSC waveform registers are done in the following way:
Immediately when the PSC is stopped
At the PSC end of cycle when the PSC is running
At the PSC end of cycle following the required condition when LOCK or AUTOLOCK modes
are used
To avoid asynchronous and incoherent values in a cycle, if an update of one of several values is
necessary, all values can be updated at the same time at the end of the cycle by the PSC. The
new set of values is calculated by software and the update is initiated by software.
Figure 12-11. Update at the end of complete PSC cycle.
The software can stop the cycle before the end to update the values and restart a new PSC
cycle.
12.6.1
Value Update Synchronization
New timing values or PSC output configuration can be written during the PSC cycle. Thanks to
LOCK and AUTOLOCK configuration bits, the new whole set of values can be taken into
account with the following conditions:
When AUTOLOCK configuration is selected, the update of the PSC internal registers will be
done at the end of the PSC cycle following a write in the Output Compare Register RB. The
AUTOLOCK configuration bit is taken into account at the end of the first PSC cycle.
When LOCK configuration bit is set, there is no update. The update of the PSC internal
registers will be done at the end of the PSC cycle if the LOCK bit is released to zero.
The registers which update is synchronized thanks to LOCK and AUTOLOCK are PSOCn,
POM2, OCRnSAH/L, OCRnRAH/L, OCRnSBH/L and OCRnRBH/L.
See these register’s description starting on
page 135.When set, AUTOLOCK configuration bit prevails over LOCK configuration bit.
Software
PSC
Regulation Loop
Calculation
Writting in
PSC Registers
Cycle
With Set i
Cycle
With Set i
Cycle
With Set i
Cycle
With Set i
Cycle
With Set j
End of Cycle
Request for
an Update