
RTD Embedded Technologies, Inc.
|
www.rtd.com
27
DM34216HR
User’s Manual
BDM-610010056 Rev A
An interrupt is generated at the beginning of every period.
The width register is checked at the beginning of every period. If the width register is modified in the middle of a period, the output will not be
affected until the next period.
Initializing the PWM
The following is a list of typical steps needed to initialize the PWM outputs.
1.
Set the corresponding pins as input in the Advanced_DIO function block (
2.
Set the PWM function block to the Uninitialized state (
3.
Setup the DMA for the PWM channel
4.
Setup the channel’s width (
5.
Set the start and stop triggers (
6.
Set the pacer clock (
7.
Set the PWM function block to the Reset state (
8.
Start the DMA
9.
Start the PWM function block (
5.6.2
I
NCREMENTAL
E
NCODER
The DM34216HR features a 32-bit incremental encoder functional block with DMA.
An Incremental Encoder is used to detect the relative position of a shaft or linear actuator. A typical implementation is a slotted wheel with two
optical sensors positioned such that when one sensor is positioned over a slot, the other is positioned between slots. The output of the optical
sensors is shown in Figure 9
, with one sensor named “A,” and the other named “B.” At every edge of the “A” or “B” input, the counter either
increments or decrements. The direction can be interpreted from the state of the signals, i.e. which signal leads.
Figure 9: Incremental Encoder Signals
The encoders include a “Phase Filter” that prevents the counter from counting on certain transitions. This allows the encode
rs to count pulses,
and other specialized applications.
Encoder inputs can be configured as single ended or pseudo-differential. In pseudo-
differential mode, the “+” and “
-
“ inputs must be the
inverse of each other in order for the encoder to see a change.
Output -
Interrupt
Pacer Clock Frequency
Period_Clock Edge
CHn_PWM_WIDTH + 1
GBC_SYS_CLK_FREQ