MAN0878-09-EN_XLE_XLT_UserManual
A u g u s t 2 3 , 2 0 1 8
P a g e 92 | 158
12.4 Pulse Width Modulation (PWM) Functions
On units that support the PWM, two dedicated outputs are available that can be configured for
one of four modes of operation. Those modes are Normal, PWM, HSC (count = PV) and
Stepper.
12.4.1 Normal
When either Q1 or Q2 is configured for Normal operation, the digital output registers %Q1 and
%Q2 drives that respective output.
12.4.2 PWM
When either Q1 or Q2 is configured for PWM, the PWM function drives that respective output.
Both PWM channels may be individually enabled; however, when both PWM outputs are
enabled, both share the same output frequency (with the low going pulses synchronized).
Otherwise, each PWM’s pulse width can be independently adjusted.
The PWMs require three parameters (%AQs) to be set for operation. These parameters may
be set at run-time. The register set and prescale calculation differ depending upon the
XLE/XLT hardware being used, hardware revs A-R use the following resisters and scaling:
•
Prescale Count - Revision A-R or Legacy Modules
The prescale (%AQ5-6) count sets the resolution of the internal counter used for
generating the PWM output. The (prescale count + 1) is a divisor applied to a 16MHz clock
that drives the internal PWM counter. For the highest resolution PWM output, this value
should be set as low as possible (0 provides a 1/16 micro second resolution). Both the
Period and Duty cycle (pulse width) are based on
counts
of the internal PWM counter.
The frequency of the PWM output is calculated using the following formula:
Frequency =
(
)
t
PeriodCoun
t
escaleCoun
+
1
Pr
000
,
000
,
16
•
Pre-scale Count (Revision T and onwards or Gen2 or later)
NOTE: In Europe, the new XLE starts at Rev RA, and new XLT starts at Rev KA.
The pre-scale %AQ5 (PWM1) or %AQ6 (PWM2) count sets the resolution of the internal
counter used for generating the PWM output. The (pre-scale count + 1) is a divisor
applied to a 32MHz clock that drives the internal PWM counter. For the highest
resolution PWM output, this value should be set as low as possible (0 provides a 1/32
micro second resolution). Both the Period and Duty cycle (pulse width) are based on
counts
of the internal PWM counter.
The frequency of the PWM output is calculated using the following formula:
Frequency =
(
)
t
PeriodCoun
t
escaleCoun
+
1
Pr
000
,
000
,
32