www.diamondsystems.com
Zeta User Manual Rev 1.0
Page 49
14.6
Pulse Width Modulator Features
14.6.1
Overview
Zeta
“A” models include 4 24
-bit pulse width modulator circuits (PWMs). These circuits can be programmed to
produce an output square wave up to 25MHz with a duty cycle anywhere from 0% to 100% (these limits are of
course DC signals). The output polarity is programmable. PWM outputs are available on digital I/O port C pins.
PWM operation is as follows: Each PWM contains a period counter and a duty cycle counter which are
programmed for the desired values. When the PWM starts, both counters start to count down simultaneously,
and the output pulse is set to the desired active polarity. When the duty cycle counter reaches 0, it stops, and the
output changes to the inactive polarity. When the period counter reaches zero, both counters reload, the output
is made active again, and the cycle repeats.
The PWM duty cycle can be updated in real time without having to stop the circuit from running.
14.6.2
PWM Commands
The PWMs are configured and managed with a series of commands. These commands are implemented in the
Diamond Systems Universal Driver software. Configuration commands operate on a single PWM at a time,
however start, stop, and reset commands may operate on a single PWM or all PWMs at the same time.
Command
Function
0
Stop one or all PWMs. When a PWM is stopped, its output returns to its inactive state, and
the counters are reloaded with their initial values. If the PWM is subsequently restarted, it
will start at the beginning of its waveform, i.e. the start of the active output pulse. Stopping
a PWM is not the same as resetting it. See command 4 below.
1
Load the period or duty cycle counter with user-defined value
2
Select output pulse polarity
3
Enable / disable PWM output. This must be done in conjunction with command 5 below.
4
Reset one or all PWMs. When a PWM is reset, it stops running, and any DIO line assigned to
that PWM for output is released to normal DIO operation. The direction of the DIO line will
revert to its value prior to the PWM operation.
5
Enable / disable PWM output signal on designated Port C DIO pin.
6
Select clock source for period and duty cycle counters, either 50MHz or 1MHz. Both
counters will use the same clock source.
7
Start one or all PWMs. All selected PWMs will start their active output pulses at the same
time.
14.6.3
PWM Output Signals
When a PWM output is enabled with command 5, the corresponding DIO pin on port C is forced to output mode
regardless of its current configuration. To make the pulse appear on the output pin, command 3 must also be
executed, otherwise the output will be held in inactive mode (the opposite of the selected polarity for the PWM
output). When a PWM is reset, the corresponding digital I/O line returns to its previous direction and data status.
PWM signals are available on digital I/O port C pins as defined below.
NOTE: The voltage levels of the PWM signals will match the configuration of the digital I/O circuit, either 3.3v or
5V depending on the DIO configuration jumper settings on jumper block JP1.
DIO Bit
Alternate Signal
C4
PWM 0 output
C5
PWM 1 output
C6
PWM 2 output
C7
PWM 3 output