Datasheet

dsPIC30F
DS70043F-page 28 © 2005 Microchip Technology Inc.
9.3.2 PWM TIME BASE
The PWM time base is provided by a 15-bit timer with
a prescaler and postscaler. The PWM time base can be
configured for four different modes of operation:
Free Running mode
Single-Shot mode
Continuous Up/Down Count mode
Continuous Up/Down Count mode with interrupts
for double-updates
The Up/Down Counting modes support center aligned
PWM generation. The Single-Shot mode allows the
PWM module to support pulse control of certain
Electronically Commutated Motors (ECMs).
Table 9-1 lists the frequencies and resolutions that can
be attained as a function of the dsPIC30F device
instruction cycle frequency.
TABLE 9-1: EXAMPLE PWM FREQUENCIES AND RESOLUTIONS, 1:1 PRESCALER
9.4 QEI Module
Quadrature encoders (also referred to as Incremental
encoders or Optical encoders) are used in position and
speed detection of rotating motion systems.
Quadrature encoders enable closed loop control of
many motor control applications, such as Switched
Reluctance (SR) motor and AC Induction Motor
(ACIM).
Typically, three outputs, termed: Phase A, Phase B and
INDEX, provide information that can be decoded to
provide information on the movement of the motor shaft
including distance and direction.
A Quadrature Decoder captures the phase signals and
index pulse and converts the information into a numeric
count of the position pulses. Generally, the count will
increment when the shaft is rotating one direction and
decrement when the shaft is rotating in the other
direction.
The QEI module (Figure 9-3) includes:
Three input pins for two-phase signals and index
pulse
Programmable digital noise filters on inputs
Quadrature decoder providing counter pulses and
count direction
16-bit up/down position counter
Count direction status
X2 and X4 count resolution
Two modes of position counter reset
General Purpose16-bit Timer/Counter mode
Interrupts generated by QEI or counter events
T
CY (FCY) PTPER Value PWM Resolution PWM Frequency*
33 ns (30 MHz) 0x7FFF 16 bits 915 Hz
33 ns (30 MHz) 0x03FF 11 bits 29.3 KHz
50 ns (20 MHz) 0x7FFF 16 bits 610 Hz
50 ns (20 MHz) 0x01FF 10 bits 39.1 KHz
100 ns (10 MHz) 0x7FFF 16 bits 305 Hz
100 ns (10 MHz) 0x00FF 9 bits 39.1 KHz
200 ns (5 MHz) 0x7FFF 16 bits 153 Hz
200 ns (5 MHz) 0x007F 8 bits 39.1 KHz
* PWM frequencies will be 1/2 the value indicated for center aligned operation.