Академический Документы
Профессиональный Документы
Культура Документы
Peripheral Features (see Note 1): Motor Control PWM Module Features:
• High current sink/source I/O pins: 25 mA/25 mA • Up to 8 PWM output channels
• Up to 5 external interrupt sources - Complementary or Independent Output modes
• Timer module with programmable prescaler: - Edge and Center Aligned modes
• 4 duty cycle generators
- Up to five 16-bit timers/counters; optionally
pair up 16-bit timers into 32-bit timer modules • Dedicated time-base with 4 modes
• Programmable output polarity
• 16-bit Capture input functions
• Dead-time control for Complementary mode
• 16-bit Compare/PWM output functions
• Manual output control
- Dual Compare mode available
• Trigger for A/D conversions
d s P I C 3 0 L F 1 0 0 1 AT P - I / P T- 0 0 0
Custom ID
Trademark
Package
Family PT = TQFP 10x10
PT = TQFP 12x12
L = Low Voltage PF = TQFP 14x14
SO = SOIC
Memory SP = SDIP
Type P = DIP
FLASH = F S = Die (Waffle Pack)
Memory Size in Bytes W = Die (Wafers)
0 = ROMless
1 = 1K to 6K
2 = 7K to 12K Temperature
3 = 13K to 24K I = Industrial -40°C to +85°C
4 = 25K to 48K E = Extended High Temp -40°C to +125°C
5 = 49K to 96K
6 = 97K to 192K
7 = 193K to 384K P = Pilot
8 = 385K to 768K
9 = 769K and Up T = Tape and Reel
Program Memory
UART
SPITM
I2CTM
SRAM EEPROM Timer Input Output Comp/ A/D 12-bit
Device Pins
Bytes Bytes 16-bit Cap Std PWM 100 Ksps
Bytes Instructions
UART
SPITM
I2CTM
CAN
SRAM EEPROM Timer Input Codec
Device Pins Comp/ 12-bit
Bytes Bytes 16-bit Cap Interface
Bytes Instructions Std PWM 100 Ksps
AN6/SCK1/INT0/OCFA/RB6 1 18 AN7/IC2/OC2/RB7
AN5/U1RX/SDI1/SDA/CN7/RB5 2 17 IC1/OC1/RD8
dsPIC30FXXXX
AN4/U1TX/SDO1/SCL/CN6/RB4 3 16 OSC1/CLKIN
MCLR 4 15 OSC2/CLKO/RC15
Vss 5 14 VDD
AN0/VREF+/CN2/PGD/RB0 6 13 SOSC2/T2CK/U1ATX/C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
AN4/IC7/CN6/RB4 12 37 SCL/RG2
AN3/CN5/RB3 13 36 SDA/RG3
AN2/CN4/RB2 14 35 SCK1/INT0/RF6
AN1/VREF-/CN3/PGC/RB1 15 34 U1RX/SDI1/RF2
AN0/VREF+/CN2/PGD/RB0 16 33 U1TX/SDO1/RF3
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
AVSS
VSS
AN7/RB7
AN12/RB12
AN13/RB13
AN14/RB14
AN15/OCFB/CN12/RB15
AVDD
AN8/RB8
AN9/RB9
AN10/RB10
AN11/RB11
VDD
U2RX/CN17/RF4
U2TX/CN18/RF5
AN6/OCFA/RB6
80-Pin TQFP
Part No.: 30F4015 / 30F5013 / 30F5014
30F6013 / 30F6014
OC8/CN16/RD7
OC6/CN14/RD5
OC7/CN15/RD6
IC6/CN19/RD13
OC5/CN13/RD4
CSDO/RG13
CSCK/RG14
CSDI/RG12
C2RX/RG0
C2TX/RG1
C1RX/RF0
RA6/CN22
RA7/CN23
C1TX/RF1
IC5/RD12
OC4/RD3
OC3/RD2
OC2/RD1
VDD
VSS
80
79
78
77
76
75
74
73
72
71
70
69
68
67
66
65
64
63
62
61
COFS/RG15 1 60 SOSC1/T1CK/CN0/RC14
T2CK/RC1 2 59 SOSC2/CN1/RC13
T3CK/RC2 3 58 OC1/RD0
T4CK/RC3 4 57 IC4/RD11
T5CK/RC4 5 56 IC3/RD10
SCLK2/CN8/RG6 6 55 IC2/RD9
SDI2/CN9/RG7 7 54 IC1/RD8
SDO2/CN10/RG8 8 53 INT4/RA15
MCLR 9 52 INT3/RA14
SS2/CN11/RG9 10 dsPIC30FXXXX 51 VSS
VSS 11 50 OSC2/CLKO/RC15
VDD 12 49 OSC1/CLKIN
INT1/RA12 13 48 VDD
INT2/RA13 14 47 SCL/RG2
AN5/CN7/RB5 15 46 SDA/RG3
AN4/CN6/RB4 16 45 SCK1/INT0/RF6
AN3/CN5/RB3 17 44 SDI1/RF7
AN2/CN4/RB2 18 43 SDO1/RF8
AN1/CN3/PGC/RB1 19 42 U1RX/RF2
AN0/CN2/PGD/RB0 20 41 U1TX/RF3
21
22
34
35
36
37
38
39
40
23
24
25
26
27
28
29
30
31
32
33
AVSS
VSS
AN6/OCFA/RB6
AN10/RB10
AN7/RB7
VREF-/RA9
VREF+/RA10
AVDD
AN8/RB8
AN9/RB9
AN11/RB11
VDD
AN12/RB12
AN13/RB13
AN14/RB14
AN15/OCFB/CN12/RB15
IC8/CN21/RD15
U2TX/CN18/RF5
U2RX/CN17/RF4
IC7/CN20/RD14
TABLE 2-1: dsPIC30F POWER CONVERSION AND MOTION CONTROL FAMILY VARIANTS
UART
SPITM
I2CTM
CAN
SRAM EEPROM Timer Input A/D 10-bit Quad
Device Pins Bytes/ Comp/ Cntrl
Bytes Bytes 16-bit Cap 500 Ksps Enc
Instructions Std PWM PWM
MCLR 1 28 AVDD
AN0/VREF+/CN2/PGD/RB0 2 27 AVSS
AN1/VREF-/CN3/PGC/RB1 3 26 PWM0/RE0
dsPIC30FXXXX
AN2/CN4/RB2 4 25 PWM1/RE1
AN3/INDX/CN5/RB3 5 24 PWM2/RE2
AN4/QEA/IC7/CN6/RB4 6 23 PWM3/RE3
AN5/QEB/IC8/CN7/RB5 7 22 PWM4/RE4
VSS 8 21 PWM5/RE5
OSC1/CLKIN 9 20 VDD
OSC2/CLKO/RC15 10 19 VSS
SOSC2/T2CK/U1ATX/CN1/RC13 11 18 U1RX/SDI1/SDA/C1RX/RF2
SOSC1/T1CK/U1ARX/CN0/RC14 12 17 U1TX/SDO1/SCL/C1TX/RF3
VDD 13 16 FLTA/INT0/SCK1/OCFA/RE8
OC2/IC2/INT2/RD1 14 15 OC1/IC1/INT1/RD0
MCLR 1 40 AV D D
AN0/ V R E F +/CN2/PGD/ RB0 2 39 AV SS
AN1/ V R E F - /CN3/PGC/ RB1 3 38 PWM0/ RE0
AN2/ CN4/ RB2 4 37 PWM1/ RE1
AN3/I NDX/ CN5/ RB3 5 36 PWM2/ RE2
AN4/QEA/I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0/RE0
C1RX/RF0
C1TX/RF1
OC4/RD3
OC3/RD2
OC2/RD1
VDD
VSS
64
63
62
61
60
59
58
57
56
55
54
53
52
51
50
49
PWM5/RE5 1 48 SOSC1/T1CK/CN0/RC14
PWM6/RE6 2 47 SOSC2/T4CK/CN1/RC13
PWM7/RE7 3 46 OC1/RD0
SCK2/CN8/RG6 4 45 IC4/INT4/RD11
SDI2/CN9/RG7 5 44 IC3/INT3/RD10
SDO2/CN10/RG8 6 43 IC2/FLTB/INT2/RD9
MCLR 7 42 IC1/FLTA/INT1/RD8
SS2/CN11/RG9 8 41 VSS
VSS 9 dsPIC30FXXXX 40 OSC2/CLKO/RC15
VDD 10 39 OSC1/CLKIN
AN5/QEB/IC8/CN7/RB5 11 38 VDD
AN4/QEA/IC7/CN6/RB4 12 37 SCL/RG2
AN3/INDX/CN5/RB3 13 36 SDA/RG3
AN2/CN4/RB2 14 35 SCK1/INT0/RF6
AN1/VREF-/CN3/PGC/RB1 15 34 U1RX/SDI1/RF2
AN0/VREF+/CN2/PGD/RB0 16 33 U1TX/SDO1/RF3
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
AN6/OCFA/RB6
AN7/RB7
AN12/RB12
AN13/RB13
AN14/RB14
AVDD
AN8/RB8
AN9/RB9
AN10/RB10
AN11/RB11
VDD
U2RX/C2RX/CN17/RF4
U2TX/C2TX/CN18/RF5
AN15/CN12/OCFB/RB15
AVSS
VSS
OC8/CN16/UPDN/RD7
OC6/CN14/RD5
OC7/CN15/RD6
IC6/CN19/RD13
OC5/CN13/RD4
PWM2/RE2
PWM0/RE0
PWM3/RE3
PWM1/RE1
PWM4/RE4
C2RX/RG0
C2TX/RG1
C1RX/RF0
C1TX/RF1
IC5/RD12
OC4/RD3
OC3/RD2
OC2/RD1
VDD
VSS
80
79
78
77
76
75
74
73
72
71
70
69
68
67
66
65
64
63
62
61
PWM5/RE5 1 60 SOSC1/T1CK/CN0/RC14
PWM6/RE6 2 59 SOSC2/CN1/RC13
PWM7/RE7 3 58 OC1/RD0
T2CK/RC1 4 57 IC4/RD11
T4CK/RC3 5 56 IC3/RD10
SCLK2/CN8/RG6 6 55 IC2/RD9
SDI2/CN9/RG7 7 54 IC1/RD8
SDO2/CN10/RG8 8 53 INT4/RA15
MCLR 9 52 INT3/RA14
SS2/CN11/RG9 10 51 VSS
dsPIC30FXXXX
VSS 11 50 OSC2/CLKO/RC15
VDD 12 49 OSC1/CLKIN
FLTA/INT1/RE8 13 48 VDD
FLTB/INT2/RE9 14 47 SCL/RG2
AN5/QEB/CN7/RB5 15 46 SDA/RG3
AN4/QEA/CN6/RB4 16 45 SCK1/INT0/RF6
AN3/INDX/CN5/RB3 17 44 SDI1/RF7
AN2/CN4/RB2 18 43 SDO1/RF8
AN1/CN3/PGC/RB1 19 42 U1RX/RF2
AN0/CN2/PGD/RB0 20 41 U1TX/RF3
21
22
34
35
36
37
38
39
40
23
24
25
26
27
28
29
30
31
32
33
IC7/CN20/RD14
AN6/OCFA/RB6
AN7/RB7
VREF-/RA9
VREF+/RA10
AN8/RB8
AN9/RB9
AN10/RB10
AN11/RB11
AN12/RB12
AN13/RB13
AN14/RB14
U2TX/CN18/RF5
IC8/CN21/RD15
U2RX/CN17/RF4
AN15/OCFB/CN12/RB15
AVSS
VSS
AVDD
VDD
D15 D0
W0 / WREG
PUSH.S Shadow
W1
DO Shadow
W2
W3 Legend
W4
DSP Operand W5
Registers
W6
W7
Working Registers
W8
W9
DSP Address
Registers W10
W11
W12 / DSP Offset
W13 / DSP Write Back
W14 / Frame Pointer
W15 / Stack Pointer
PC23 PC0
0 0 Program Counter
7 0
TABPAG
TBLPAG Data Table Page Address
7 0
PSVPAG Program Space Visibility Page Address
15 0
RCOUNT REPEAT Loop Counter
15 0
DCOUNT DO Loop Counter
23 22 0
0 DOSTART 0 DO Loop Start Address
23 22 0
0 DOEND 0 DO Loop End Address
15 0
CORCON Core Configuration Register
SRH SRL
MS Byte LS Byte
Address 16-bits Address
MSB LSB
0x0001 0x0000
2 Kbyte SFR Space
SFR Space 0x07FF 0x07FE
0x0801 0x0800
0x8001 0x8000
X Data
Unimplemented (X)
Optionally
Mapped
into Program
Memory
0xFFFF 0xFFFE
S
a
40 40-bit Accumulator A 40 Round t 16
40-bit Accumulator B u
Logic r
a
Carry/Borrow OUT t
Saturate e
Carry/Borrow IN Adder
Enable
Negate
40
40 40
Barrel
16
Shifter
X Data Bus
40
Sign Extend
Y Data Bus
32 16
Zero-backfill
32
32
16-bit
Multiplier/Scaler
Operand Latches
16 16
To/From W Array
User Memory
000084
The interrupt controller and processor exceptions are
Space
Alternate Vector Table
responsible for pre-processing the interrupts prior to 0000FE
them being presented to the processor core. The inter- 000100
rupts and traps are enabled, prioritized, and controlled User FLASH
using centralized special function registers: Program Memory
(48K instructions)
• IFS0<15:0>, IFS1<15:0>, IFS2<15:0>
All interrupt request flags are maintained in these 017FFE
three registers. The flags are set by their respec- 018000
Reserved
tive peripherals or external signals, and they are (Read 0’s)
cleared via software. 7FEFFE
7FF000
• IEC0<15:0>, IEC1<15:0>, IEC2<15:0> Data FLASH
All interrupt enable control bits are maintained in (4 K bytes)
7FFFFE
these three registers. These control bits are used 800000
to individually enable interrupts from the peripher-
als or external signals.
• IPC0<15:0>... IPC11<7:0>
The user assignable priority level associated with Reserved
each of these 45 interrupts is held centrally in
these twelve registers.
• IPL<2:0> The current CPU priority level is explic-
itly stored in the 16-bit Status register that resides
Configuration Memory
The Quadrature Encoder Interface (QEI) module pro- 8.7 Output Compare/PWM Module
vides the interface to incremental encoders for obtain- Overview
ing motor positioning data. Incremental encoders are
very useful and specific to motor control applications. The Output Compare module features are quite useful
in applications requiring operational modes such as:
The Quadrature Encoder Interface (QEI) is a key
feature requirement for several motor control • Generation of variable width output pulses
applications, such as Switched Reluctance (SR) motor • Simple PWM Operation
and AC Induction Motor (ACIM). The operational
The dsPIC30F device will support up to eight Output
features of the QEI are, but not limited to:
Compare channels with the following key operational
• Three input channels for two phase signals and features:
index pulse
• Timer2 and Timer3 Selection mode
• 16-bit up/down position counter
• Simple Output Compare Match mode
• Count direction status
• Dual Output Compare Match mode
• Position Measurement (x2 and x4) mode
• Simple Glitchless PWM mode
• Programmable digital noise filters on inputs
• Output Compare during CPU SLEEP and IDLE
• Alternate 16-bit Timer/Counter mode mode
• Quadrature Encoder Interface interrupts • Interrupt on output compare/PWM event
• Interrupt on PWM fault detect condition
• The PICmicro family meets the specifications contained in the Microchip Data Sheet.
• Microchip believes that its family of PICmicro microcontrollers is one of the most secure products of its kind on the market today,
when used in the intended manner and under normal conditions.
• There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our knowl-
edge, require using the PICmicro microcontroller in a manner outside the operating specifications contained in the data sheet.
The person doing so may be engaged in theft of intellectual property.
• Microchip is willing to work with the customer who is concerned about the integrity of their code.
• Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
mean that we are guaranteeing the product as “unbreakable”.
• Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of
our product.
If you have any further questions about this matter, please contact the local sales office nearest to you.
01/18/02