Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Data Sheet
High-Performance, 16-Bit
Digital Signal Controllers
Preliminary
DS70143C
Note the following details of the code protection feature on Microchip devices:
Microchip products meet the specification contained in their particular Microchip Data Sheet.
Microchip believes that its family of products is one of the most secure families 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
knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchips Data
Sheets. Most likely, the person doing so is 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
products. Attempts to break Microchips code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts
allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
Trademarks
The Microchip name and logo, the Microchip logo, Accuron,
dsPIC, KEELOQ, microID, MPLAB, PIC, PICmicro, PICSTART,
PRO MATE, PowerSmart, rfPIC and SmartShunt are
registered trademarks of Microchip Technology Incorporated
in the U.S.A. and other countries.
AmpLab, FilterLab, Migratable Memory, MXDEV, MXLAB,
SEEVAL, SmartSensor and The Embedded Control Solutions
Company are registered trademarks of Microchip Technology
Incorporated in the U.S.A.
Analog-for-the-Digital Age, Application Maestro, CodeGuard,
dsPICDEM, dsPICDEM.net, dsPICworks, ECAN,
ECONOMONITOR, FanSense, FlexROM, fuzzyLAB,
In-Circuit Serial Programming, ICSP, ICEPIC, Linear Active
Thermistor, Mindi, MiWi, MPASM, MPLIB, MPLINK, PICkit,
PICDEM, PICDEM.net, PICLAB, PICtail, PowerCal,
PowerInfo, PowerMate, PowerTool, REAL ICE, rfLAB,
rfPICDEM, Select Mode, Smart Serial, SmartTel, Total
Endurance, UNI/O, WiperLock and ZENA are trademarks of
Microchip Technology Incorporated in the U.S.A. and other
countries.
SQTP is a service mark of Microchip Technology Incorporated
in the U.S.A.
All other trademarks mentioned herein are property of their
respective companies.
2006, Microchip Technology Incorporated, Printed in the
U.S.A., All Rights Reserved.
Printed on recycled paper.
DS70143C-page ii
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
dsPIC30F6011A/6012A/6013A/6014A High-Performance
Digital Signal Controllers
Note: This data sheet summarizes features of this group
of dsPIC30F devices and is not intended to be a complete
reference source. For more information on the CPU,
peripherals, register descriptions and general device
functionality, refer to the dsPIC30F Family Reference
Manual (DS70046). For more information on the device
instruction set and programming, refer to the dsPIC30F/
33F Programmers Reference Manual (DS70157).
DSP Features:
Dual data fetch
Modulo and Bit-Reversed modes
Two 40-bit wide accumulators with optional
saturation logic
17-bit x 17-bit single-cycle hardware fractional/
integer multiplier
All DSP instructions are single cycle:
- Multiply-Accumulate (MAC) operation
Single-cycle 16 shift
Peripheral Features:
High-current sink/source I/O pins: 25 mA/25 mA
Five 16-bit timers/counters; optionally pair up
16-bit timers into 32-bit timer modules
16-bit Capture input functions
16-bit Compare/PWM output functions:
Data Converter Interface (DCI) supports common
audio Codec protocols, including I2S and AC97
3-wire SPI modules (supports 4 Frame modes)
I2C module supports Multi-Master/Slave mode
and 7-bit/10-bit addressing
Two addressable UART modules with FIFO
buffers
Two CAN bus modules compliant with CAN 2.0B
standard
Analog Features:
12-bit Analog-to-Digital Converter (ADC) with:
- 200 Ksps conversion rate
- Up to 16 input channels
- Conversion available during Sleep and Idle
Programmable Low-Voltage Detection (PLVD)
Programmable Brown-out Reset
Preliminary
DS70143C-page 1
dsPIC30F6011A/6012A/6013A/6014A
Special Microcontroller Features (Cont.):
CMOS Technology:
Output
ADC
SRAM EEPROM Timer Input
Codec
Comp/Std
12-bit
Bytes
16-bit Cap
Interface
Bytes Instructions Bytes
PWM
100 Ksps
UART
SPI
I C
CAN
64
132K
44K
6144
2048
16 ch
64
144K
48K
8192
4096
AC97, I2S
16 ch
dsPIC30F6013A
80
132K
44K
6144
2048
16 ch
dsPIC30F6014A
80
144K
48K
8192
4096
AC97, I2S
16 ch
Device
Pins
dsPIC30F6011A
dsPIC30F6012A
DS70143C-page 2
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
Pin Diagrams
64
63
62
61
60
59
58
57
56
55
54
53
52
51
50
49
RG13
RG12
RG14
C2RX/RG0
C2TX/RG1
C1TX/RF1
C1RX/RF0
VDD
VSS
OC8/CN16/RD7
OC7/CN15/RD6
OC6/IC6/CN14/RD5
OC5/IC5/CN13/RD4
OC4/RD3
OC3/RD2
EMUD2/OC2/RD1
64-Pin TQFP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
dsPIC30F6011A
48
47
46
45
44
43
42
41
40
39
38
37
36
35
34
33
EMUC1/SOSCO/T1CK/CN0/RC14
EMUD1/SOSCI/T4CK/CN1/RC13
EMUC2/OC1/RD0
IC4/INT4/RD11
IC3/INT3/RD10
IC2/INT2/RD9
IC1/INT1/RD8
VSS
OSC2/CLKO/RC15
OSC1/CLKI
VDD
SCL/RG2
SDA/RG3
EMUC3/SCK1/INT0/RF6
U1RX/SDI1/RF2
EMUD3/U1TX/SDO1/RF3
PGC/EMUC/AN6/OCFA/RB6
PGD/EMUD/AN7/RB7
AVDD
AVSS
AN8/RB8
AN9/RB9
AN10/RB10
AN11/RB11
VSS
VDD
AN12/RB12
AN13/RB13
AN14/RB14
AN15/OCFB/CN12/RB15
U2RX/CN17/RF4
U2TX/CN18/RF5
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
RG15
T2CK/RC1
T3CK/RC2
SCK2/CN8/RG6
SDI2/CN9/RG7
SDO2/CN10/RG8
MCLR
SS2/CN11/RG9
VSS
VDD
AN5/IC8/CN7/RB5
AN4/IC7/CN6/RB4
AN3/CN5/RB3
AN2/SS1/LVDIN/CN4/RB2
AN1/VREF-/CN3/RB1
AN0/VREF+/CN2/RB0
Note:
Preliminary
DS70143C-page 3
dsPIC30F6011A/6012A/6013A/6014A
Pin Diagrams (Continued)
64
63
62
61
60
59
58
57
56
55
54
53
52
51
50
49
CSDO/RG13
CSDI/RG12
CSCK/RG14
C2RX/RG0
C2TX/RG1
C1TX/RF1
C1RX/RF0
VDD
VSS
OC8/CN16/RD7
OC7/CN15/RD6
OC6/IC6/CN14/RD5
OC5/IC5/CN13/RD4
OC4/RD3
OC3/RD2
EMUD2/OC2/RD1
64-Pin TQFP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
dsPIC30F6012A
48
47
46
45
44
43
42
41
40
39
38
37
36
35
34
33
EMUC1/SOSCO/T1CK/CN0/RC14
EMUD1/SOSCI/T4CK/CN1/RC13
EMUC2/OC1/RD0
IC4/INT4/RD11
IC3/INT3/RD10
IC2/INT2/RD9
IC1/INT1/RD8
VSS
OSC2/CLKO/RC15
OSC1/CLKI
VDD
SCL/RG2
SDA/RG3
EMUC3/SCK1/INT0/RF6
U1RX/SDI1/RF2
EMUD3/U1TX/SDO1/RF3
PGC/EMUC/AN6/OCFA/RB6
PGD/EMUD/AN7/RB7
AVDD
AVSS
AN8/RB8
AN9/RB9
AN10/RB10
AN11/RB11
VSS
VDD
AN12/RB12
AN13/RB13
AN14/RB14
AN15/OCFB/CN12/RB15
U2RX/CN17/RF4
U2TX/CN18/RF5
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
COFS/RG15
T2CK/RC1
T3CK/RC2
SCK2/CN8/RG6
SDI2/CN9/RG7
SDO2/CN10/RG8
MCLR
SS2/CN11/RG9
VSS
VDD
AN5/IC8/CN7/RB5
AN4/IC7/CN6/RB4
AN3/CN5/RB3
AN2/SS1/LVDIN/CN4/RB2
AN1/VREF-/CN3/RB1
AN0/VREF+/CN2/RB0
Note:
DS70143C-page 4
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
Pin Diagrams (Continued)
IC5/RD12
OC4/RD3
OC3/RD2
EMUD2/OC2/RD1
OC6/CN14/RD5
OC5/CN13/RD4
IC6/CN19/RD13
OC8/CN16/RD7
OC7/CN15/RD6
C2RX/RG0
C2TX/RG1
C1TX/RF1
C1RX/RF0
VDD
VSS
RG14
CN23/RA7
CN22/RA6
RG12
80
79
78
77
76
75
74
73
72
71
70
69
68
67
66
65
64
63
62
61
RG13
80-Pin TQFP
RG15
T2CK/RC1
1
2
60
EMUC1/SOSCO/T1CK/CN0/RC14
59
EMUD1/SOSCI/CN1/RC13
58
EMUC2/OC1/RD0
57
T3CK/RC2
T4CK/RC3
T5CK/RC4
4
5
56
IC4/RD11
IC3/RD10
SCK2/CN8/RG6
55
IC2/RD9
SDI2/CN9/RG7
54
IC1/RD8
SDO2/CN10/RG8
MCLR
53
INT4/RA15
52
SS2/CN11/RG9
VSS
VDD
10
51
INT3/RA14
VSS
12
49
OSC2/CLKO/RC15
OSC1/CLKI
INT1/RA12
VDD
dsPIC30F6013A
11
50
13
48
INT2/RA13
14
47
SCL/RG2
AN5/CN7/RB5
15
46
SDA/RG3
AN4/CN6/RB4
AN3/CN5/RB3
16
45
EMUC3/SCK1/INT0/RF6
SDI1/RF7
Note:
30
31
32
33
34
35
36
37
38
39
40
VSS
VDD
AN12/RB12
AN13/RB13
AN14/RB14
AN15/OCFB/CN12/RB15
IC7/CN20/RD14
IC8/CN21/RD15
U2RX/CN17/RF4
U2TX/CN18/RF5
28
AN9/RB9
29
27
AN11/RB11
26
AVSS
AN8/RB8
AN10/RB10
25
AVDD
U1TX/RF3
24
41
VREF-/RA9
20
VREF+/RA10
U1RX/RF2
PGD/EMUD/AN0/CN2/RB0
22
EMUD3/SDO1/RF8
42
23
43
19
21
18
AN7/RB7
AN2/SS1/LVDIN/CN4/RB2
PGC/EMUC/AN1/CN3/RB1
AN6/OCFA/RB6
17
44
Preliminary
DS70143C-page 5
dsPIC30F6011A/6012A/6013A/6014A
Pin Diagrams (Continued)
IC5/RD12
OC4/RD3
OC3/RD2
EMUD2/OC2/RD1
OC7/CN15/RD6
OC6/CN14/RD5
OC5/CN13/RD4
IC6/CN19/RD13
OC8/CN16/RD7
C2RX/RG0
C2TX/RG1
C1TX/RF1
C1RX/RF0
VDD
VSS
CSCK/RG14
CN23/RA7
CN22/RA6
CSDI/RG12
80
79
78
77
76
75
74
73
72
71
70
69
68
67
66
65
64
63
62
61
CSDO/RG13
80-Pin TQFP
60
EMUC1/SOSCO/T1CK/CN0/RC14
59
EMUD1/SOSCI/CN1/RC13
58
EMUC2/OC1/RD0
57
56
IC4/RD11
IC3/RD10
55
IC2/RD9
IC1/RD8
COFS/RG15
T2CK/RC1
T3CK/RC2
T4CK/RC3
T5CK/RC4
SCK2/CN8/RG6
4
5
7
54
SDO2/CN10/RG8
53
INT4/RA15
MCLR
52
INT3/RA14
VSS
SDI2/CN9/RG7
51
SS2/CN11/RG9
VSS
10
11
50
VDD
12
49
OSC2/CLKO/RC15
OSC1/CLKI
INT1/RA12
13
48
VDD
14
47
SCL/RG2
15
46
SDA/RG3
INT2/RA13
AN5/CN7/RB5
dsPIC30F6014A
Note:
29
30
31
32
33
34
35
36
37
38
39
40
VSS
VDD
AN12/RB12
AN13/RB13
AN14/RB14
AN15/OCFB/CN12/RB15
IC7/CN20/RD14
IC8/CN21/RD15
U2RX/CN17/RF4
U2TX/CN18/RF5
28
AN9/RB9
AN11/RB11
27
AN10/RB10
26
AVSS
U1TX/RF3
AN8/RB8
41
AVDD
20
25
U1RX/RF2
PGD/EMUD/AN0/CN2/RB0
24
EMUD3/SDO1/RF8
42
VREF+/RA10
43
19
23
18
VREF-/RA9
AN2/SS1/LVDIN/CN4/RB2
PGC/EMUC/AN1/CN3/RB1
21
SDI1/RF7
22
EMUC3/SCK1/INT0/RF6
44
AN7/RB7
45
AN6/OCFA/RB6
16
17
AN4/CN6/RB4
AN3/CN5/RB3
DS70143C-page 6
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
Table of Contents
1.0 Device Overview .......................................................................................................................................................................... 9
2.0 CPU Architecture Overview........................................................................................................................................................ 15
3.0 Memory Organization ................................................................................................................................................................. 25
4.0 Address Generator Units............................................................................................................................................................ 39
5.0 Interrupts .................................................................................................................................................................................... 45
6.0 Flash Program Memory.............................................................................................................................................................. 51
7.0 Data EEPROM Memory ............................................................................................................................................................. 57
8.0 I/O Ports ..................................................................................................................................................................................... 63
9.0 Timer1 Module ........................................................................................................................................................................... 69
10.0 Timer2/3 Module ........................................................................................................................................................................ 73
11.0 Timer4/5 Module ....................................................................................................................................................................... 79
12.0 Input Capture Module................................................................................................................................................................. 83
13.0 Output Compare Module ............................................................................................................................................................ 87
14.0 SPI Module................................................................................................................................................................................. 91
15.0 I2C Module ................................................................................................................................................................................. 95
16.0 Universal Asynchronous Receiver Transmitter (UART) Module .............................................................................................. 103
17.0 CAN Module ............................................................................................................................................................................. 111
18.0 Data Converter Interface (DCI) Module.................................................................................................................................... 123
19.0 12-bit Analog-to-Digital Converter (ADC) Module .................................................................................................................... 133
20.0 System Integration ................................................................................................................................................................... 143
21.0 Instruction Set Summary .......................................................................................................................................................... 163
22.0 Development Support............................................................................................................................................................... 171
23.0 Electrical Characteristics .......................................................................................................................................................... 175
24.0 Packaging Information.............................................................................................................................................................. 215
Appendix A: Revision History............................................................................................................................................................. 221
Appendix B: Device Comparisons ..................................................................................................................................................... 223
Appendix C: Migration from dsPIC30F601x to dsPIC30F601xA Devices.......................................................................................... 225
Index .................................................................................................................................................................................................. 227
The Microchip Web Site ..................................................................................................................................................................... 233
Customer Change Notification Service .............................................................................................................................................. 233
Customer Support .............................................................................................................................................................................. 233
Reader Response .............................................................................................................................................................................. 234
Product Identification System ............................................................................................................................................................ 235
Errata
An errata sheet, describing minor operational differences from the data sheet and recommended workarounds, may exist for current
devices. As device/documentation issues become known to us, we will publish an errata sheet. The errata will specify the revision
of silicon and revision of document to which it applies.
To determine if an errata sheet exists for a particular device, please check with one of the following:
Microchips Worldwide Web site; http://www.microchip.com
Your local Microchip sales office (see last page)
When contacting a sales office, please specify which device, revision of silicon and data sheet (include literature number) you are
using.
Preliminary
DS70143C-page 7
dsPIC30F6011A/6012A/6013A/6014A
NOTES:
DS70143C-page 8
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
1.0
DEVICE OVERVIEW
Preliminary
DS70143C-page 9
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 1-1:
Interrupt
Controller
16
24
16
16
Data Latch
Data Latch
Y Data
RAM
X Data
RAM
Address
Latch
Address
Latch
16
24
Address Latch
Program Memory
(Up to 144 Kbytes)
16
Data EEPROM
(Up to 4 Kbytes)
16
AN0/VREF+/CN2/RB0
AN1/VREF-/CN3/RB1
AN2/SS1/LVDIN/CN4/RB2
AN3/CN5/RB3
AN4/IC7/CN6/RB4
AN5/IC8/CN7/RB5
PGC/EMUC/AN6/OCFA/RB6
PGD/EMUD/AN7/RB7
AN8/RB8
AN9/RB9
AN10/RB10
AN11/RB11
AN12/RB12
AN13/RB13
AN14/RB14
AN15/OCFB/CN12/RB15
16
X RAGU
X WAGU
Y AGU
16
Effective Address
16
Data Latch
ROM Latch
16
24
PORTB
T2CK/RC1
T3CK/RC2
EMUD1/SOSCI/T4CK/CN1/RC13
EMUC1/SOSCO/T1CK/CN0/RC14
OSC2/CLKO/RC15
IR
16
16
16 x 16
W Reg Array
Decode
Instruction
Decode &
Control
16 16
Control Signals
to Various Blocks
Power-up
Timer
DSP
Engine
ALU<16>
POR/BOR
Reset
MCLR
VDD, VSS
AVDD, AVSS
CAN1,
CAN2
EMUC2/OC1/RD0
EMUD2/OC2/RD1
OC3/RD2
OC4/RD3
OC5/IC5/CN13/RD4
OC6/IC6/CN14/RD5
OC7/CN15/RD6
OC8/CN16/RD7
IC1/INT1/RD8
IC2/INT2/RD9
IC3/INT3/RD10
IC4/INT4/RD11
Divide
Unit
Oscillator
Start-up Timer
Timing
Generation
OSC1/CLKI
PORTC
Watchdog
Timer
Low-Voltage
Detect
16
16
PORTD
12-bit ADC
Input
Capture
Module
Output
Compare
Module
I2C
Timers
DCI
SPI1,
SPI2
UART1,
UART2
C1RX/RF0
C1TX/RF1
U1RX/SDI1/RF2
EMUD3/U1TX/SDO1/RF3
U2RX/CN17/RF4
U2TX/CN18/RF5
EMUC3/SCK1/INT0/RF6
PORTF
C2RX/RG0
C2TX/RG1
SCL/RG2
SDA/RG3
SCK2/CN8/RG6
SDI2/CN9/RG7
SDO2/CN10/RG8
SS2/CN11/RG9
*CSDI/RG12
*CSDO/RG13
*CSCK/RG14
*COFS/RG15
* CSDI, CSDO, CSCK, and COFS are codec functions on dsPIC30F6012A only
PORTG
DS70143C-page 10
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 1-2:
Y Data Bus
X Data Bus
Interrupt
Controller
16
24
16
16
16
Data Latch
Data Latch
Y Data
RAM
X Data
RAM
Address
Latch
Address
Latch
16
24
Address Latch
Program Memory
(Up to 144 Kbytes)
16
Data EEPROM
(Up to 4 Kbytes)
16
PORTA
PGD/EMUD/AN0/CN2/RB0
PGC/EMUC/AN1/CN3/RB1
AN2/SS1/LVDIN/CN4/RB2
AN3/CN5/RB3
AN4/CN6/RB4
AN5/CN7/RB5
AN6/OCFA/RB6
AN7/RB7
AN8/RB8
AN9/RB9
AN10/RB10
AN11/RB11
AN12/RB12
AN13/RB13
AN14/RB14
AN15/OCFB/CN12/RB15
16
X RAGU
X WAGU
Y AGU
16
Effective Address
16
Data Latch
ROM Latch
16
24
PORTB
T2CK/RC1
T3CK/RC2
T4CK/RC3
T5CK/RC4
EMUD1/SOSCI/CN1/RC13
EMUC1/SOSCO/T1CK/CN0/RC14
OSC2/CLKO/RC15
IR
16
16
16 x 16
W Reg Array
Decode
Instruction
Decode &
Control
Control Signals
to Various Blocks
OSC1/CLKI
Power-up
Timer
DSP
Engine
EMUC2/OC1/RD0
EMUD2/OC2/RD1
OC3/RD2
OC4/RD3
OC5/CN13/RD4
OC6/CN14/RD5
OC7/CN15/RD6
OC8/CN16/RD7
IC1/RD8
IC2/RD9
IC3/RD10
IC4/RD11
IC5/RD12
IC6/CN19/RD13
IC7/CN20/RD14
IC8/CN21/RD15
Divide
Unit
Oscillator
Start-up Timer
Timing
Generation
ALU<16>
POR/BOR
Reset
MCLR
VDD, VSS
AVDD, AVSS
CAN1,
CAN2
PORTC
16 16
Watchdog
Timer
Low-Voltage
Detect
12-bit ADC
Timers
16
16
PORTD
Input
Capture
Module
DCI
Output
Compare
Module
I2C
SPI1,
SPI2
UART1,
UART2
C1RX/RF0
C1TX/RF1
U1RX/RF2
U1TX/RF3
U2RX/CN17/RF4
U2TX/CN18/RF5
EMUC3/SCK1/INT0/RF6
SDI1/RF7
EMUD3/SDO1/RF8
PORTF
C2RX/RG0
C2TX/RG1
SCL/RG2
SDA/RG3
SCK2/CN8/RG6
SDI2/CN9/RG7
SDO2/CN10/RG8
SS2/CN11/RG9
*CSDI/RG12
*CSDO/RG13
*CSCK/RG14
*COFS/RG15
* CSDI, CSDO, CSCK, and COFS are codec functions on dsPIC30F6014A only
PORTG
Preliminary
DS70143C-page 11
dsPIC30F6011A/6012A/6013A/6014A
Table 1-1 provides a brief description of device I/O
pinouts and the functions that may be multiplexed to a
port pin. Multiple functions may exist on one port pin.
When multiplexing occurs, the peripheral modules
functional requirements may force an override of the
data direction of the port pin.
TABLE 1-1:
Buffer
Type
AN0-AN15
Analog
Pin Name
Description
Analog input channels.
AN0 and AN1 are also used for device programming data and
clock inputs, respectively.
AVDD
AVSS
CLKI
ST/CMOS
CLKO
CN0-CN23
ST
COFS
CSCK
CSDI
CSDO
I/O
I/O
I
O
ST
ST
ST
C1RX
C1TX
C2RX
C2TX
I
O
I
O
ST
ST
EMUD
EMUC
EMUD1
I/O
I/O
I/O
ST
ST
ST
EMUC1
EMUD2
EMUC2
EMUD3
I/O
I/O
I/O
I/O
ST
ST
ST
ST
EMUC3
I/O
ST
IC1-IC8
ST
INT0
INT1
INT2
INT3
INT4
I
I
I
I
I
ST
ST
ST
ST
ST
External interrupt 0.
External interrupt 1.
External interrupt 2.
External interrupt 3.
External interrupt 4.
LVDIN
Analog
MCLR
I/P
ST
OCFA
OCFB
OC1-OC8
I
I
O
ST
ST
Legend: CMOS =
ST
=
I
=
DS70143C-page 12
Preliminary
Analog
O
P
= Analog input
= Output
= Power
dsPIC30F6011A/6012A/6013A/6014A
TABLE 1-1:
Buffer
Type
OSC1
ST/CMOS
OSC2
I/O
PGD
PGC
I/O
I
ST
ST
RA6-RA7
RA9-RA10
RA12-RA15
I/O
I/O
I/O
ST
ST
ST
Pin Name
Description
RB0-RB15
I/O
ST
RC1-RC4
RC13-RC15
I/O
I/O
ST
ST
RD0-RD15
I/O
ST
RF0-RF8
I/O
ST
RG0-RG3
RG6-RG9
RG12-RG15
I/O
I/O
I/O
ST
ST
ST
SCK1
SDI1
SDO1
SS1
SCK2
SDI2
SDO2
SS2
I/O
I
O
I
I/O
I
O
I
ST
ST
ST
ST
ST
ST
SCL
SDA
I/O
I/O
ST
ST
SOSCO
SOSCI
O
I
ST/CMOS
T1CK
T2CK
T3CK
T4CK
T5CK
I
I
I
I
I
ST
ST
ST
ST
ST
U1RX
U1TX
U1ARX
U1ATX
U2RX
U2TX
I
O
I
O
I
O
ST
ST
ST
UART1 Receive.
UART1 Transmit.
UART1 Alternate Receive.
UART1 Alternate Transmit.
UART2 Receive.
UART2 Transmit.
VDD
VSS
VREF+
Analog
Analog
VREF-
Legend: CMOS =
ST
=
I
=
Preliminary
Analog
O
P
= Analog input
= Output
= Power
DS70143C-page 13
dsPIC30F6011A/6012A/6013A/6014A
NOTES:
DS70143C-page 14
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
2.0
CPU ARCHITECTURE
OVERVIEW
2.1
Core Overview
Preliminary
DS70143C-page 15
dsPIC30F6011A/6012A/6013A/6014A
The core does not support a multi-stage instruction
pipeline. However, a single stage instruction prefetch
mechanism is used, which accesses and partially
decodes instructions a cycle ahead of execution, in
order to maximize available execution time. Most
instructions execute in a single cycle with certain
exceptions.
The core features a vectored exception processing
structure for traps and interrupts, with 62 independent
vectors. The exceptions consist of up to 8 traps (of
which 4 are reserved) and 54 interrupts. Each interrupt
is prioritized based on a user-assigned priority between
1 and 7 (1 being the lowest priority and 7 being the
highest), in conjunction with a predetermined natural
order. Traps have fixed priorities ranging from 8 to 15.
2.2
Programmers Model
2.2.1
2.2.2
STATUS REGISTER
2.2.3
PROGRAM COUNTER
When a byte operation is performed on a working register, only the Least Significant Byte (LSB) of the target
register is affected. However, a benefit of memory
mapped working registers is that both the Least and
Most Significant Bytes can be manipulated through
byte wide data memory space accesses.
DS70143C-page 16
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 2-1:
PROGRAMMERS MODEL
D15
D0
W0/WREG
PUSH.S Shadow
W1
DO Shadow
W2
W3
Legend
W4
DSP Operand
Registers
W5
W6
W7
Working Registers
W8
W9
DSP Address
Registers
W10
W11
W12/DSP Offset
W13/DSP Write Back
W14/Frame Pointer
W15/Stack Pointer
SPLIM
AD39
AD31
AD0
ACCA
DSP
Accumulators
ACCB
PC22
PC0
Program Counter
0
0
7
TABPAG
TBLPAG
7
PSVPAG
0
RCOUNT
15
0
DCOUNT
DO Loop Counter
22
0
DOSTART
DOEND
22
15
0
Core Configuration Register
CORCON
OA
OB
SA
SB OAB SAB DA
SRH
OV
STATUS Register
SRL
Preliminary
DS70143C-page 17
dsPIC30F6011A/6012A/6013A/6014A
2.3
Divide Support
TABLE 2-1:
Note:
DIVIDE INSTRUCTIONS
Instruction
Function
DIVF
DIV.sd
DIV.ud
DIV.sw
DIV.uw
DS70143C-page 18
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
2.4
DSP Engine
TABLE 2-2:
7.
Note:
Instruction
Algebraic Operation
CLR
A=0
ED
A = (x y)2
EDAC
A = A + (x y)
No
MAC
A = A + (x * y)
Yes
MAC
A = A + x2
No
MOVSAC
No change in A
Yes
MPY
A=x*y
No
MPY
A=x2
No
MPY.N
A=x*y
No
MSC
A=Ax*y
Yes
Preliminary
DS70143C-page 19
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 2-2:
40
S
a
40 Round t 16
u
Logic r
a
t
e
40-bit Accumulator A
40-bit Accumulator B
Carry/Borrow Out
Carry/Borrow In
Saturate
Adder
Negate
40
40
40
16
X Data Bus
Barrel
Shifter
40
Y Data Bus
Sign-Extend
32
16
Zero Backfill
32
33
17-bit
Multiplier/Scaler
16
16
To/From W Array
DS70143C-page 20
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
2.4.1
MULTIPLIER
2.4.2.1
3.
2.4.2
4.
5.
6.
OA:
ACCA overflowed into guard bits
OB:
ACCB overflowed into guard bits
SA:
ACCA saturated (bit 31 overflow and saturation)
or
ACCA overflowed into guard bits and saturated
(bit 39 overflow and saturation)
SB:
ACCB saturated (bit 31 overflow and saturation)
or
ACCB overflowed into guard bits and saturated
(bit 39 overflow and saturation)
OAB:
Logical OR of OA and OB
SAB:
Logical OR of SA and SB
Preliminary
DS70143C-page 21
dsPIC30F6011A/6012A/6013A/6014A
The SA and SB bits are modified each time data
passes through the adder/subtracter but can only be
cleared by the user. When set, they indicate that the
accumulator has overflowed its maximum range (bit 31
for 32-bit saturation, or bit 39 for 40-bit saturation) and
will be saturated (if saturation is enabled). When saturation is not enabled, SA and SB default to bit 39 overflow and thus indicate that a catastrophic overflow has
occurred. If the COVTE bit in the INTCON1 register is
set, SA and SB bits will generate an arithmetic warning
trap when saturation is disabled.
The overflow and saturation status bits can optionally
be viewed in the STATUS register (SR) as the logical
OR of OA and OB (in bit OAB) and the logical OR of SA
and SB (in bit SAB). This allows programmers to check
one bit in the STATUS register to determine if either
accumulator has overflowed, or one bit to determine if
either accumulator has saturated. This would be useful
for complex number arithmetic which typically uses
both the accumulators.
The device supports three saturation and overflow
modes:
1.
2.
3.
DS70143C-page 22
2.4.2.2
2.
2.4.2.3
Round Logic
The round logic is a combinational block which performs a conventional (biased) or convergent (unbiased) round function during an accumulator write
(store). The Round mode is determined by the state of
the RND bit in the CORCON register. It generates a 16bit, 1.15 data value which is passed to the data space
write saturation logic. If rounding is not indicated by the
instruction, a truncated 1.15 data value is stored and
the least significant word (lsw) is simply discarded.
Conventional rounding takes bit 15 of the accumulator,
zero-extends it and adds it to the ACCxH word (bits 16
through 31 of the accumulator). If the ACCxL word
(bits 0 through 15 of the accumulator) is between
0x8000 and 0xFFFF (0x8000 included), ACCxH is
incremented. If ACCxL is between 0x0000 and
0x7FFF, ACCxH is left unchanged. A consequence of
this algorithm is that over a succession of random
rounding operations, the value will tend to be biased
slightly positive.
Convergent (or unbiased) rounding operates in the
same manner as conventional rounding, except when
ACCxL equals 0x8000. If this is the case, the LSb
(bit 16 of the accumulator) of ACCxH is examined. If it
is 1, ACCxH is incremented. If it is 0, ACCxH is not
modified. Assuming that bit 16 is effectively random in
nature, this scheme will remove any rounding bias that
may accumulate.
The SAC and SAC.R instructions store either a truncated (SAC) or rounded (SAC.R) version of the contents
of the target accumulator to data memory via the X bus
(subject to data saturation, see Section 2.4.2.4 Data
Space Write Saturation). Note that for the MAC class
of instructions, the accumulator write back operation
will function in the same manner, addressing combined
MCU (X and Y) data space though the X bus. For this
class of instructions, the data is always subject to
rounding.
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
2.4.2.4
2.4.3
BARREL SHIFTER
Preliminary
DS70143C-page 23
dsPIC30F6011A/6012A/6013A/6014A
NOTES:
DS70143C-page 24
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
3.0
MEMORY ORGANIZATION
3.1
Preliminary
DS70143C-page 25
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 3-1:
FIGURE 3-2:
000000
000002
000004
Vector Tables
Vector Tables
Reserved
(Read 0s)
Data EEPROM
(2 Kbytes)
00007E
000080
000084
0000FE
000100
User Memory
Space
User Memory
Space
Reserved
Reserved
Alternate Vector Table
User Flash
Program Memory
(48K instructions)
015FFE
016000
Reserved
(Read 0s)
7FF7FE
7FF800
Data EEPROM
(4 Kbytes)
7FFFFE
800000
F7FFFE
F80000
F8000E
F80010
Configuration Memory
Space
Configuration Memory
Space
8005BE
8005C0
Reserved
DS70143C-page 26
7FEFFE
7FF000
8005BE
8005C0
8005FE
800600
Reserved
Device Configuration
Registers
Reserved
DEVID (2)
017FFE
018000
Reserved
8005FE
800600
Device Configuration
Registers
00007E
000080
000084
0000FE
000100
7FFFFE
800000
Reserved
000000
000002
000004
F7FFFE
F80000
F8000E
F80010
Reserved
FEFFFE
FF0000
FFFFFE
DEVID (2)
Preliminary
FEFFFE
FF0000
FFFFFE
dsPIC30F6011A/6012A/6013A/6014A
TABLE 3-1:
Access
Space
Access Type
<23>
<22:16>
<15>
<14:1>
Instruction Access
User
TBLRD/TBLWT
User
(TBLPAG<7> = 0)
TBLPAG<7:0>
Data EA<15:0>
TBLRD/TBLWT
Configuration
(TBLPAG<7> = 1)
TBLPAG<7:0>
Data EA<15:0>
User
FIGURE 3-3:
<0>
PC<22:1>
PSVPAG<7:0>
Data EA<14:0>
Program Counter
Select
Using
Program
Space
Visibility
EA
PSVPAG Reg
8 bits
15 bits
EA
Using
Table
Instruction
1/0
User/
Configuration
Space
Select
Note:
TBLPAG Reg
8 bits
16 bits
24-bit EA
Byte
Select
Program space visibility cannot be used to access bits <23:16> of a word in program memory.
Preliminary
DS70143C-page 27
dsPIC30F6011A/6012A/6013A/6014A
3.1.1
2.
3.
4.
Figure 3-3 shows how the EA is created for table operations and data space accesses (PSV = 1). Here,
P<23:0> refers to a program space word, whereas
D<15:0> refers to a data space word.
FIGURE 3-4:
PC Address
0x000000
0x000002
0x000004
0x000006
Program Memory
Phantom Byte
(read as 0)
DS70143C-page 28
23
16
00000000
00000000
00000000
00000000
TBLRDL.W
TBLRDL.B (Wn<0> = 0)
TBLRDL.B (Wn<0> = 1)
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 3-5:
23
16
00000000
00000000
00000000
00000000
TBLRDH.B (Wn<0> = 0)
Program Memory
Phantom Byte
(read as 0)
3.1.2
TBLRDH.B (Wn<0> = 1)
Preliminary
DS70143C-page 29
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 3-6:
Program Space
0x000100
Data Space
0x0000
PSVPAG(1)
0x02
8
15
EA<15> = 0
Data 16
Space
15
EA
EA<15> = 1
0x8000
15
Address
Concatenation 23
23
15
0
0x010000
CORCON,#2
#0x02, W0
W0, PSVPAG
0x8000, W0
Data Read
Note 1: PSVPAG is an 8-bit register, containing bits <22:15> of the program space address (i.e., it defines
the page in program space to which the upper half of data space is being mapped).
DS70143C-page 30
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
3.2
3.2.2
The core has two data spaces. The data spaces can be
considered either separate (for some DSP instructions), or as one unified linear address range (for MCU
instructions). The data spaces are accessed using two
Address Generation Units (AGUs) and separate data
paths.
3.2.1
DATA SPACES
The X data space is used by all instructions and supports all Addressing modes. There are separate read
and write data buses. The X read data bus is the return
data path for all instructions that view data space as
combined X and Y address space. It is also the X
address space data path for the dual operand read
instructions (MAC class). The X write data bus is the
only write path to data space for all instructions.
The X data space also supports Modulo Addressing for
all instructions, subject to addressing mode restrictions. Bit-Reversed Addressing is only supported for
writes to X data space.
The Y data space is used in concert with the X data
space by the MAC class of instructions (CLR, ED, EDAC,
MAC, MOVSAC, MPY, MPY.N and MSC) to provide two
concurrent data read paths. No writes occur across the
Y bus. This class of instructions dedicates two W register pointers, W10 and W11, to always address Y data
space, independent of X data space, whereas W8 and
W9 always address X data space. Note that during
accumulator write back, the data address space is considered a combination of X and Y data spaces, so the
write occurs across the X bus. Consequently, the write
can be to any address in the entire data space.
The Y data space can only be used for the data
prefetch operation associated with the MAC class of
instructions. It also supports Modulo Addressing for
automated circular buffers. Of course, all other instructions can access the Y data address space through the
X data path as part of the composite linear space.
The boundary between the X and Y data spaces is
defined as shown in Figure 3-7 and Figure 3-8 and is
not user programmable. Should an EA point to data
outside its own assigned address space, or to a location outside physical memory, an all zero word/byte will
be returned. For example, although Y address space is
visible by all non-MAC instructions using any addressing mode, an attempt by a MAC instruction to fetch data
from that space using W8 or W9 (X space pointers) will
return 0x0000.
Preliminary
DS70143C-page 31
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 3-7:
2 Kbyte
SFR Space
LSB
Address
16 bits
LSB
0x0000
0x0001
SFR Space
0x07FE
0x0800
0x07FF
0x0801
8 Kbyte
Near
Data
Space
0x17FF
0x1801
0x17FE
0x1800
0x1FFF
0x1FFE
Y Data RAM (Y)
0x1FFF
0x1FFE
0x2001
0x2000
0x8001
0x8000
X Data
Unimplemented (X)
Optionally
Mapped
into Program
Memory
0xFFFE
0xFFFF
DS70143C-page 32
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 3-8:
2 Kbyte
SFR Space
LSB
Address
16 bits
LSB
0x0000
0x0001
SFR Space
0x07FE
0x0800
0x07FF
0x0801
8 Kbyte
Near
Data
Space
0x17FF
0x1801
0x17FE
0x1800
0x1FFF
0x1FFE
Y Data RAM (Y)
0x27FF
0x27FE
0x2801
0x2800
0x8001
0x8000
X Data
Unimplemented (X)
Optionally
Mapped
into Program
Memory
0xFFFE
0xFFFF
Preliminary
DS70143C-page 33
dsPIC30F6011A/6012A/6013A/6014A
DATA SPACE FOR MCU AND DSP (MAC CLASS) INSTRUCTIONS EXAMPLE
SFR SPACE
SFR SPACE
X SPACE
FIGURE 3-9:
UNUSED
UNUSED
X SPACE
Y SPACE
X SPACE
(Y SPACE)
UNUSED
TABLE 3-2:
3.2.4
EFFECT OF INVALID
MEMORY ACCESSES
Attempted Operation
Data Returned
EA = an unimplemented address
0x0000*
0x0000
0x0000
3.2.3
DS70143C-page 34
DATA ALIGNMENT
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
All word accesses must be aligned to an even address.
Misaligned word data fetches are not supported so
care must be taken when mixing byte and word operations, or translating from 8-bit MCU code. Should a misaligned read or write be attempted, an address error
trap will be generated. If the error occurred on a read,
the instruction underway is completed, whereas if it
occurred on a write, the instruction will be executed but
the write will not occur. In either case, a trap will then
be executed, allowing the system and/or user to examine the machine state prior to execution of the address
fault.
FIGURE 3-10:
15
3.2.6
DATA ALIGNMENT
MSB
87
LSB
0001
Byte1
Byte 0
0000
0003
Byte3
Byte 2
0002
0005
Byte5
Byte 4
0004
All byte loads into any W register are loaded into the
LSB. The MSB is not modified.
A sign-extend (SE) instruction is provided to allow
users to translate 8-bit signed data to 16-bit signed
values. Alternatively, for 16-bit unsigned data, users
can clear the MSB of any W register by executing a
zero-extend (ZE) instruction on the appropriate
address.
SOFTWARE STACK
There is a Stack Pointer Limit register (SPLIM) associated with the Stack Pointer. SPLIM is uninitialized at
Reset. As is the case for the Stack Pointer, SPLIM<0>
is forced to 0 because all stack operations must be
word aligned. Whenever an Effective Address (EA) is
generated using W15 as a source or destination
pointer, the address thus generated is compared with
the value in SPLIM. If the contents of the Stack Pointer
(W15) and the SPLIM register are equal and a push
operation is performed, a Stack Error Trap will not
occur. The Stack Error Trap will occur on a subsequent
push operation. Thus, for example, if it is desirable to
cause a Stack Error Trap when the stack grows beyond
address 0x2000 in RAM, initialize the SPLIM with the
value, 0x1FFE.
3.2.5
FIGURE 3-11:
0x0000
15
PC<15:0>
000000000 PC<22:16>
<Free Word>
Preliminary
DS70143C-page 35
dsPIC30F6011A/6012A/6013A/6014A
3.2.7
DS70143C-page 36
Preliminary
SFR Name
Address
(Home)
Bit 15
Bit 14
Bit 13
Bit 12
Bit 11
Bit 10
Bit 9
Bit 8
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset State
Preliminary
DS70143C-page 37
W0
0000
W0 / WREG
W1
0002
W1
W2
0004
W2
W3
0006
W3
W4
0008
W4
W5
000A
W5
W6
000C
W6
W7
000E
W7
W8
0010
W8
W9
0012
W9
W10
0014
W10
W11
0016
W11
W12
0018
W12
W13
001A
W13
W14
001C
W14
W15
001E
W15
SPLIM
0020
SPLIM
ACCAL
0022
ACCAL
ACCAH
0024
ACCAH
ACCAU
0026
ACCBL
0028
ACCBL
ACCBH
002A
ACCBH
ACCBU
002C
PCL
002E
PCH
0030
TBLPAG
0032
TBLPAG
PSVPAG
0034
PSVPAG
RCOUNT
0036
RCOUNT
DCOUNT
0038
DCOUNT
DOSTARTL
003A
DOSTARTH
003C
DOENDL
003E
DOENDH
0040
Sign-Extension (ACCA<39>)
ACCAU
Sign-Extension (ACCB<39>)
ACCBU
PCL
PCH
DOSTARTL
Legend:
u = uninitialized bit
Note:
Refer to dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
DOSTARTH
DOENDL
DOENDH
dsPIC30F6011A/6012A/6013A/6014A
TABLE 3-3:
SFR Name
Address
(Home)
Bit 15
Bit 14
Bit 13
Bit 12
Bit 11
Bit 10
Bit 9
Bit 8
Bit 7
Bit 6
Bit 5
Bit 4
IPL0
RA
Bit 3
Bit 2
Bit 1
Bit 0
Reset State
SR
0042
OA
OB
SA
SB
OAB
SAB
DA
DC
IPL2
IPL1
CORCON
0044
US
EDT
DL2
DL1
DL0
SATA
SATB
OV
IPL3
PSV
RND
IF
MODCON
0046
XMODEN
YMODEN
XMODSRT
0048
XS<15:1>
XMODEND
YMODSRT
004A
XE<15:1>
004C
YS<15:1>
YMODEND
004E
YE<15:1>
XBREV
0050
BREN
DISICNT
0052
BSRAM
0750
SSRAM
0752
BWM<3:0>
SATDW ACCSAT
YWM<3:0>
XWM<3:0>
XB<14:0>
DISICNT<13:0>
Legend:
u = uninitialized bit
Note:
Refer to dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
Preliminary
2006 Microchip Technology Inc.
dsPIC30F6011A/6012A/6013A/6014A
DS70143C-page 38
TABLE 3-3:
dsPIC30F6011A/6012A/6013A/6014A
4.0
4.1.2
MCU INSTRUCTIONS
4.1
4.1.1
Register Direct
Register Indirect
Register Indirect Post-modified
Register Indirect Pre-modified
5-bit or 10-bit Literal
Note:
TABLE 4-1:
Not all instructions support all the addressing modes given above. Individual instructions may support different subsets of
these addressing modes.
Addressing Mode
Description
Register Direct
Register Indirect
Register Indirect with Register Offset The sum of Wn and Wb forms the EA.
Register Indirect with Literal Offset
Preliminary
DS70143C-page 39
dsPIC30F6011A/6012A/6013A/6014A
4.1.3
Register Direct
Register Indirect
Register Indirect Post-modified
Register Indirect Pre-modified
Register Indirect with Register Offset (Indexed)
Register Indirect with Literal Offset
8-bit Literal
16-bit Literal
Note:
4.1.4
Register Indirect
Register Indirect Post-modified by 2
Register Indirect Post-modified by 4
Register Indirect Post-modified by 6
Register Indirect with Register Offset (Indexed)
4.1.5
OTHER INSTRUCTIONS
4.2
Modulo Addressing
Modulo Addressing is a method of providing an automated means to support circular data buffers using
hardware. The objective is to remove the need for software to perform data address boundary checks when
executing tightly looped code, as is typical in many
DSP algorithms.
MAC INSTRUCTIONS
Modulo Addressing can operate in either data or program space (since the data pointer mechanism is
essentially the same for both). One circular buffer can
be supported in each of the X (which also provides the
pointers into program space) and Y data spaces. Modulo Addressing can operate on any W register pointer.
However, it is not advisable to use W14 or W15 for Modulo Addressing since these two registers are used as
the Stack Frame Pointer and Stack Pointer,
respectively.
In general, any particular circular buffer can only be
configured to operate in one direction, as there are certain restrictions on the buffer start address (for incrementing buffers), or end address (for decrementing
buffers) based upon the direction of the buffer.
The only exception to the usage restrictions is for buffers which have a power-of-2 length. As these buffers
satisfy the start and end address criteria, they may
operate in a Bidirectional mode (i.e., address boundary
checks will be performed on both the lower and upper
address boundaries).
DS70143C-page 40
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
4.2.1
4.2.2
The Modulo Addressing scheme requires that a starting and an ending address be specified and loaded into
the 16-bit Modulo Buffer Address registers: XMODSRT,
XMODEND, YMODSRT, YMODEND (see Table 3-3).
Note:
W ADDRESS REGISTER
SELECTION
The Modulo and Bit-Reversed Addressing Control register MODCON<15:0> contains enable flags as well as
a W register field to specify the W address registers.
The XWM and YWM fields select which registers will
operate with Modulo Addressing. If XWM = 15, X
RAGU and X WAGU Modulo Addressing is disabled.
Similarly, if YWM = 15, Y AGU Modulo Addressing is
disabled.
The X Address Space Pointer W register (XWM), to
which Modulo Addressing is to be applied, is stored in
MODCON<3:0> (see Table 3-3). Modulo Addressing is
enabled for X data space when XWM is set to any value
other than 15 and the XMODEN bit is set at
MODCON<15>.
The Y Address Space Pointer W register (YWM), to
which Modulo Addressing is to be applied, is stored in
MODCON<7:4>. Modulo Addressing is enabled for Y
data space when YWM is set to any value other than
15 and the YMODEN bit is set at MODCON<14>.
FIGURE 4-1:
Byte
Address
0x1100
MOV
MOV
MOV
MOV
MOV
MOV
#0x1100,W0
W0,XMODSRT
#0x1163,W0
W0,MODEND
#0x8001,W0
W0,MODCON
MOV
#0x0000,W0
MOV
#0x1110,W1
;point W1 to buffer
DO
MOV
AGAIN,#0x31
W0,[W1++]
0x1163
Preliminary
DS70143C-page 41
dsPIC30F6011A/6012A/6013A/6014A
4.2.3
MODULO ADDRESSING
APPLICABILITY
4.3
Bit-Reversed Addressing
4.3.1
BIT-REVERSED ADDRESSING
IMPLEMENTATION
2.
3.
DS70143C-page 42
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 4-2:
b7 b6 b5 b4
b3 b2 b1
0
Bit Locations Swapped Left-to-Right
Around Center of Binary Value
b7 b6 b5 b1
b2 b3 b4
Bit-Reversed Address
Pivot Point
XB = 0x0008 for a 16-word Bit-Reversed Buffer
TABLE 4-2:
A3
A2
A1
A0
Bit-Reversed Address
Decimal
A3
A2
A1
A0
Decimal
0
12
10
14
10
11
13
12
13
11
14
15
15
TABLE 4-3:
4096
0x0800
2048
0x0400
1024
0x0200
512
0x0100
256
0x0080
128
0x0040
64
0x0020
32
0x0010
16
0x0008
0x0004
0x0002
0x0001
Preliminary
DS70143C-page 43
dsPIC30F6011A/6012A/6013A/6014A
NOTES:
DS70143C-page 44
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
5.0
INTERRUPTS
INTCON1<15:0>, INTCON2<15:0>
Global interrupt control functions are derived from
these two registers. INTCON1 contains the control and status flags for the processor exceptions.
The INTCON2 register controls the external
interrupt request signal behavior and the use of
the alternate vector table.
Note:
Certain interrupts have specialized control bits for features like edge or level triggered interrupts, interrupton-change, etc. Control of these features remains
within the peripheral module which generates the
interrupt.
The DISI instruction can be used to disable the processing of interrupts of priorities 6 and lower for a certain number of instructions, during which the DISI bit
(INTCON2<14>) remains set.
When an interrupt is serviced, the PC is loaded with the
address stored in the vector location in program memory that corresponds to the interrupt. There are 63 different vectors within the IVT (refer to Table 5-1). These
vectors are contained in locations 0x000004 through
0x0000FE of program memory (refer to Table 5-1).
These locations contain 24-bit addresses and in order
to preserve robustness, an address error trap will take
place should the PC attempt to fetch any of these
words during normal execution. This prevents execution of random data as a result of accidentally decrementing a PC into vector space, accidentally mapping
a data space address into vector space, or the PC rolling over to 0x000000 after reaching the end of implemented program memory space. Execution of a GOTO
instruction to this vector space will also generate an
address error trap.
Preliminary
DS70143C-page 45
dsPIC30F6011A/6012A/6013A/6014A
5.1
TABLE 5-1:
Interrupt Priority
INT
Number
1
2
3
4
5
6
9
10
11
12
13
14
Interrupt Source
7
15
T3 Timer 3
8
16
SPI1
9
17
U1RX UART1 Receiver
10
18
U1TX UART1 Transmitter
11
19
ADC ADC Convert Done
12
20
NVM NVM Write Complete
13
21
SI2C I2C Slave Interrupt
14
22
MI2C I2C Master Interrupt
15
23
Input Change Interrupt
16
24
INT1 External Interrupt 1
17
25
IC7 Input Capture 7
18
26
IC8 Input Capture 8
19
27
OC3 Output Compare 3
20
28
OC4 Output Compare 4
21
29
T4 Timer 4
22
30
T5 Timer 5
23
31
INT2 External Interrupt 2
24
32
U2RX UART2 Receiver
25
33
U2TX UART2 Transmitter
26
34
SPI2
27
35
C1 Combined IRQ for CAN1
28
36
IC3 Input Capture 3
29
37
IC4 Input Capture 4
30
38
IC5 Input Capture 5
31
39
IC6 Input Capture 6
32
40
OC5 Output Compare 5
33
41
OC6 Output Compare 6
34
42
OC7 Output Compare 7
35
43
OC8 Output Compare 8
36
44
INT3 External Interrupt 3
37
45
INT4 External Interrupt 4
38
46
C2 Combined IRQ for CAN2
39-40
47-48 Reserved
41
49
DCI Codec Transfer Done*
42
50
LVD Low-Voltage Detect
43-53
51-61 Reserved
Lowest Natural Order Priority
DS70143C-page 46
Vector
Number
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
5.2
Reset Sequence
5.2.1
Watchdog Time-out:
The watchdog has timed out, indicating that the
processor is no longer executing the correct flow
of code.
Uninitialized W Register Trap:
An attempt to use an uninitialized W register as
an address pointer will cause a Reset.
Illegal Instruction Trap:
Attempted execution of any unused opcodes will
result in an illegal instruction trap. Note that a
fetch of an illegal instruction does not result in an
illegal instruction trap if that instruction is flushed
prior to execution due to a flow change.
Brown-out Reset (BOR):
A momentary dip in the power supply to the
device has been detected which may result in
malfunction.
Trap Lockout:
Occurrence of multiple trap conditions
simultaneously will cause a Reset.
Software Reset Instruction
If the user does not intend to take corrective action in the event of a trap error condition, these vectors must be loaded with
the address of a default handler that simply contains the RESET instruction. If, on
the other hand, one of the vectors containing an invalid address is called, an
address error trap is generated.
5.3.1
TRAP SOURCES
The following traps are provided with increasing priority. However, since all traps can be nested, priority has
little effect.
2.
3.
4.
Traps
RESET SOURCES
5.3
1.
2.
3.
4.
Note:
Preliminary
DS70143C-page 47
dsPIC30F6011A/6012A/6013A/6014A
6.
FIGURE 5-1:
Decreasing
Priority
5.
IVT
2.
5.3.2
DS70143C-page 48
5.4
TRAP VECTORS
Reset - GOTO Instruction
Reset - GOTO Address
Reserved
Oscillator Fail Trap Vector
Address Error Trap Vector
Stack Error Trap Vector
Math Error Trap Vector
Reserved Vector
Reserved Vector
Reserved Vector
Interrupt 0 Vector
Interrupt 1 Vector
~
~
~
Interrupt 52 Vector
Interrupt 53 Vector
Reserved
Reserved
Reserved
Oscillator Fail Trap Vector
Address Error Trap Vector
Stack Error Trap Vector
Math Error Trap Vector
Reserved Vector
Reserved Vector
Reserved Vector
Interrupt 0 Vector
Interrupt 1 Vector
~
~
~
Interrupt 52 Vector
Interrupt 53 Vector
0x000000
0x000002
0x000004
0x000014
0x00007E
0x000080
0x000082
0x000084
0x000094
0x0000FE
Interrupt Sequence
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 5-2:
0x0000 15
INTERRUPT STACK
FRAME
5.6
A context saving option is available using shadow registers. Shadow registers are provided for the DC, N,
OV, Z and C bits in SR, and the registers W0 through
W3. The shadows are only one level deep. The shadow
registers are accessible using the PUSH.S and POP.S
instructions only.
PC<15:0>
SRL IPL3 PC<22:16>
<Free Word>
5.5
5.7
5.8
If the AIVT is not required, the program memory allocated to the AIVT may be used for other purposes.
AIVT is not a protected section and may be freely
programmed by the user.
Preliminary
DS70143C-page 49
SFR
Name1
ADR
INTCON1
0080 NSTDIS
Bit 14
Bit 13
Bit 12
Bit 11
Bit 10
Bit 9
Bit 8
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
OVATE
OVBTE
COVTE
MATHERR
ADDRERR
Bit 2
Bit 1
STKERR OSCFAIL
Bit 0
Reset State
INTCON2
0082 ALTIVT
DISI
INT4EP
INT3EP
INT2EP
INT1EP
IFS0
0084
CNIF
MI2CIF
SI2CIF
NVMIF
ADIF
U1TXIF
U1RXIF
SPI1IF
T3IF
T2IF
OC2IF
IC2IF
T1IF
OC1IF
IC1IF
INT0IF
IFS1
0086
IC6IF
IC5IF
IC4IF
IC3IF
C1IF
SPI2IF
U2TXIF
U2RXIF
INT2IF
T5IF
T4IF
OC4IF
OC3IF
IC8IF
IC7IF
INT1IF
IFS2
0088
LVDIF
DCIIF2
C2IF
INT4IF
INT3IF
OC8IF
OC7IF
OC6IF
OC5IF
IEC0
008C
CNIE
MI2CIE
SI2CIE
NVMIE
ADIE
U1TXIE U1RXIE
SPI1IE
T3IE
T2IE
OC2IE
IC2IE
T1IE
OC1IE
IC1IE
INT0IE
IEC1
008E
IC6IE
IC5IE
IC4IE
IC3IE
C1IE
SPI2IE
U2TXIE
U2RXIE
INT2IE
T5IE
T4IE
OC4IE
OC3IE
IC8IE
IC7IE
INT1IE
LVDIE
C2IE
INT4IE
INT3IE
OC8IE
OC7IE
OC6IE
OC5IE
Preliminary
IEC2
0090
IPC0
0094
T1IP<2:0>
OC1IP<2:0>
IC1IP<2:0>
INT0IP<2:0>
IPC1
0096
T31P<2:0>
T2IP<2:0>
OC2IP<2:0>
IC2IP<2:0>
IPC2
0098
ADIP<2:0>
U1TXIP<2:0>
U1RXIP<2:0>
SPI1IP<2:0>
IPC3
009A
CNIP<2:0>
MI2CIP<2:0>
SI2CIP<2:0>
NVMIP<2:0>
IPC4
009C
OC3IP<2:0>
IC8IP<2:0>
IC7IP<2:0>
INT1IP<2:0>
IPC5
009E
INT2IP<2:0>
T5IP<2:0>
T4IP<2:0>
OC4IP<2:0>
IPC6
00A0
C1IP<2:0>
SPI2IP<2:0>
U2TXIP<2:0>
U2RXIP<2:0>
IPC7
00A2
IC6IP<2:0>
IC5IP<2:0>
IC4IP<2:0>
IC3IP<2:0>
IPC8
00A4
OC8IP<2:0>
OC7IP<2:0>
OC6IP<2:0>
OC5IP<2:0>
IPC9
00A6
C2IP<2:0>
INT41IP<2:0>
INT3IP<2:0>
IPC10
00A8
LVDIP<2:0>
INTTREG 00B0
ILR<3:0>
Note
DCIIE
DCIIP<2:0>
VECNUM<5:0>
1: Refer to dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
2: These bits are not available on the dsPIC30F6011A and dsPIC30F6013A because the DCI module is not available on these devices.
dsPIC30F6011A/6012A/6013A/6014A
DS70143C-page 50
TABLE 5-2:
dsPIC30F6011A/6012A/6013A/6014A
6.0
6.2
The dsPIC30F family of devices contains internal program Flash memory for executing user code. There are
two methods by which the user can program this
memory:
1.
2.
6.1
6.3
FIGURE 6-1:
Run-Time Self-Programming
(RTSP)
Program Counter
NVMADR Reg EA
Using
NVMADR
Addressing
1/0
NVMADRU Reg
8 bits
16 bits
Working Reg EA
Using
Table
Instruction
User/Configuration
Space Select
1/0
TBLPAG Reg
8 bits
16 bits
24-bit EA
Preliminary
Byte
Select
DS70143C-page 51
dsPIC30F6011A/6012A/6013A/6014A
6.4
RTSP Operation
6.5
NVMCON
NVMADR
NVMADRU
NVMKEY
6.5.1
NVMCON REGISTER
6.5.2
NVMADR REGISTER
6.5.3
NVMADRU REGISTER
6.5.4
NVMKEY REGISTER
DS70143C-page 52
Control Registers
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
6.6
Programming Operations
4.
6.6.1
5.
2.
3.
EXAMPLE 6-1:
6.
6.6.2
write
Preliminary
DS70143C-page 53
dsPIC30F6011A/6012A/6013A/6014A
6.6.3
EXAMPLE 6-2:
; 31st_program_word
MOV
#LOW_WORD_31,W2
;
MOV
#HIGH_BYTE_31,W3
;
; Write PM low word into program latch
TBLWTL W2, [W0]
; Write PM high byte into program latch
TBLWTH W3, [W0++]
Note: In Example 6-2, the contents of the upper byte of W3 has no effect.
6.6.4
EXAMPLE 6-3:
DISI
#5
MOV
MOV
MOV
MOV
BSET
NOP
NOP
#0x55,W0
W0,NVMKEY
#0xAA,W1
W1,NVMKEY
NVMCON,#WR
DS70143C-page 54
;
;
;
;
;
;
;
;
;
Preliminary
File Name
Bit 15
Bit 14
Bit 13
NVMCON
0760
WR
WREN
WRERR
NVMADR
0762
NVMADRU
0764
NVMADR<23:16>
0766
KEY<7:0>
NVMKEY
Bit 9
Bit 8
Bit 7
TWRI
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
PROGOP<6:0>
NVMADR<15:0>
Bit 1
Bit 0
All RESETS
0000 0000 0000 0000
uuuu uuuu uuuu uuuu
Legend:
u = uninitialized bit
Note:
Refer to dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
Preliminary
DS70143C-page 55
dsPIC30F6011A/6012A/6013A/6014A
TABLE 6-1:
dsPIC30F6011A/6012A/6013A/6014A
NOTES:
DS70143C-page 56
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
7.0
NVMCON
NVMADR
NVMADRU
NVMKEY
Control bit WR initiates write operations similar to program Flash writes. This bit cannot be cleared, only set,
in software. They are cleared in hardware at the completion of the write operation. The inability to clear the
WR bit in software prevents the accidental or
premature termination of a write operation.
The WREN bit, when set, will allow a write operation.
On power-up, the WREN bit is clear. The WRERR bit is
set when a write operation is interrupted by a MCLR
Reset or a WDT Time-out Reset during normal operation. In these situations, following Reset, the user can
check the WRERR bit and rewrite the location. The
address register NVMADR remains unchanged.
Note:
7.1
Interrupt flag bit NVMIF in the IFS0 register is set when write is complete. It must be
cleared in software.
A TBLRD instruction reads a word at the current program word address. This example uses W0 as a
pointer to data EEPROM. The result is placed in
register W4 as shown in Example 7-1.
EXAMPLE 7-1:
MOV
MOV
MOV
TBLRDL
Preliminary
DS70143C-page 57
dsPIC30F6011A/6012A/6013A/6014A
7.2
7.2.1
EXAMPLE 7-2:
7.2.2
EXAMPLE 7-3:
DS70143C-page 58
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
7.3
2.
3.
EXAMPLE 7-4:
7.3.1
; Init pointer
; Get data
; Write data
MOV
#0x55,W0
; Write the 0x55 key
MOV
W0,NVMKEY
MOV
#0xAA,W1
; Write the 0xAA key
MOV
W1,NVMKEY
BSET
NVMCON,#WR
; Initiate program sequence
NOP
NOP
; Write cycle will complete in 2mS. CPU is not stalled for the Data Write Cycle
; User can poll WR bit, use NVMIF or Timer IRQ to determine write complete
Preliminary
DS70143C-page 59
dsPIC30F6011A/6012A/6013A/6014A
7.3.2
EXAMPLE 7-5:
MOV
MOV
MOV
MOV
TBLWTL
MOV
TBLWTL
MOV
TBLWTL
MOV
TBLWTL
MOV
TBLWTL
MOV
TBLWTL
MOV
TBLWTL
MOV
TBLWTL
MOV
TBLWTL
MOV
TBLWTL
MOV
TBLWTL
MOV
TBLWTL
MOV
TBLWTL
MOV
TBLWTL
MOV
TBLWTL
MOV
TBLWTL
MOV
MOV
DISI
#5
#LOW_ADDR_WORD,W0
#HIGH_ADDR_WORD,W1
W1,TBLPAG
#data1,W2
W2,[ W0]++
#data2,W2
W2,[ W0]++
#data3,W2
W2,[ W0]++
#data4,W2
W2,[ W0]++
#data5,W2
W2,[ W0]++
#data6,W2
W2,[ W0]++
#data7,W2
W2,[ W0]++
#data8,W2
W2,[ W0]++
#data9,W2
W2,[ W0]++
#data10,W2
W2,[ W0]++
#data11,W2
W2,[ W0]++
#data12,W2
W2,[ W0]++
#data13,W2
W2,[ W0]++
#data14,W2
W2,[ W0]++
#data15,W2
W2,[ W0]++
#data16,W2
W2,[ W0]++
#0x400A,W0
W0,NVMCON
MOV
MOV
MOV
MOV
BSET
NOP
NOP
#0x55,W0
W0,NVMKEY
#0xAA,W1
W1,NVMKEY
NVMCON,#WR
DS70143C-page 60
; Init pointer
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
7.4
Write Verify
7.5
Preliminary
DS70143C-page 61
dsPIC30F6011A/6012A/6013A/6014A
NOTES:
DS70143C-page 62
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
8.0
I/O PORTS
When a pin is shared with another peripheral or function that is defined as an input only, it is nevertheless
regarded as a dedicated port because there is no
other competing source of outputs. An example is the
INT4 pin.
8.1
A parallel I/O (PIO) port that shares a pin with a peripheral is, in general, subservient to the peripheral. The
peripherals output buffer data and control signals are
provided to a pair of multiplexers. The multiplexers
select whether the peripheral or the associated port
has ownership of the output data and control signals of
the I/O pad cell. Figure 8-2 shows how ports are shared
with other peripherals and the associated I/O cell (pad)
to which they are connected. Table 8-2 through
Table 8-9 show the formats of the registers for the
shared ports, PORTB through PORTG.
FIGURE 8-1:
Note:
Read TRIS
I/O Cell
TRIS Latch
Data Bus
WR TRIS
CK
Data Latch
D
WR LAT +
WR Port
I/O Pad
CK
Read LAT
Read Port
Preliminary
DS70143C-page 63
dsPIC30F6011A/6012A/6013A/6014A
8.2
FIGURE 8-2:
Peripheral Module
Peripheral Input Data
Peripheral Module Enable
I/O Cell
Peripheral Output Enable
1 Output Enable
0
PIO Module
Output Data
0
Read TRIS
I/O Pad
Data Bus
WR TRIS
CK
TRIS Latch
D
WR LAT +
WR Port
CK
Data Latch
Read LAT
Input Data
Read Port
DS70143C-page 64
Preliminary
SFR
Name
Addr.
Bit 14
Bit 13
Bit 12
Bit 11
Bit 9
TRISA10 TRISA9
Bit 8
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset State
TRISA7
TRISA6
TRISA
02C0
PORTA
02C2
RA15
RA14
RA13
RA12
RA10
RA9
RA7
RA6
LATA
02C4
LATA15
LATA14
LATA13
LATA12
LATA10
LATA9
LATA7
LATA6
Bit 4
Bit 3
Bit 1
Bit 0
Note
1:
2:
Refer to the dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
TABLE 8-2:
SFR
Name
Bit 10
Addr.
Bit 14
Bit 13
Bit 12
Bit 11
Bit 10
Bit 9
Bit 8
Bit 7
Bit 6
Bit 5
Bit 2
TRISB
TRISB9
TRISB8
PORTB
02C8
RB15
RB14
RB13
RB12
RB11
RB10
RB9
RB8
RB7
RB6
RB5
RB4
RB3
RB2
RB1
RB0
LATB
02CB
LATB15
LATB14
LATB13
LATB12
LATB11
LATB10
LATB9
LATB8
LATB7
LATB6
LATB5
LATB4
LATB3
LATB2
LATB1
LATB0
Note:
Refer to the dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
Preliminary
TABLE 8-3:
SFR
Name
Reset State
Addr.
Bit 14
Bit 13
Bit 11
Bit 10
Bit 9
Bit 8
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset State
TRISC
02CC
TRISC2
TRISC1
PORTC
02CE
RC15
RC14
RC13
RC2
RC1
LATC
02D0
LATC15
LATC14
LATC13
LATC2
LATC1
Note:
Refer to the dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
TABLE 8-4:
SFR
Name
Bit 12
Addr.
Bit 14
Bit 13
Bit 11
Bit 10
Bit 9
Bit 8
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset State
TRISC
02CC
TRISC4
TRISC3
TRISC2
TRISC1
PORTC
02CE
RC15
RC14
RC13
RC4
RC3
RC2
RC1
LATC
02D0
LATC15
LATC14
LATC13
LATC4
LATC3
LATC2
LATC1
Note:
Bit 12
Refer to the dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
DS70143C-page 65
dsPIC30F6011A/6012A/6013A/6014A
TABLE 8-1:
SFR
Name
Addr.
Bit 15
Bit 14
Bit 13
Bit 12
TRISD
02D2
PORTD
02D4
RD11
RD10
RD9
LATD
02D6
LATD11
LATD10
LATD9
Note:
Refer to the dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
TABLE 8-6:
SFR
Name
Addr.
Bit 11
Bit 10
Bit 9
Bit 8
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset State
TRISD8
TRISD7
TRISD6
RD8
RD7
RD6
RD5
RD4
RD3
RD2
RD1
RD0
LATD8
LATD7
LATD6
LATD5
LATD4
LATD3
LATD2
LATD1
LATD0
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset State
TRISD5 TRISD4 TRISD3 TRISD2 TRISD1 TRISD0 0000 1111 1111 1111
Bit 14
Bit 13
Bit 12
Bit 11
Bit 10
Bit 9
Bit 8
Bit 7
Bit 6
TRISD
TRISD8
TRISD7
TRISD6
PORTD
02D4
RD15
RD14
RD13
RD12
RD11
RD10
RD9
RD8
RD7
RD6
RD5
RD4
RD3
RD2
RD1
RD0
LATD
02D6
LATD15
LATD14
LATD13
LATD12
LATD11
LATD10
LATD9
LATD8
LATD7
LATD6
LATD5
LATD4
LATD3
LATD2
LATD1
LATD0
Note:
Refer to the dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
TABLE 8-7:
TRISD5 TRISD4 TRISD3 TRISD2 TRISD1 TRISD0 1111 1111 1111 1111
Preliminary
SFR
Name
Addr.
Bit 15
Bit 14
Bit 13
Bit 12
Bit 11
Bit 10
Bit 9
Bit 8
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
TRISF
02DE
TRISF6
TRISF5
TRISF4
TRISF3
TRISF2
TRISF1
TRISF0
PORTF
02E0
RF6
RF5
RF4
RF3
RF2
RF1
RF0
LATF
02E2
LATF6
LATF5
LATF4
LATF3
LATF2
LATF1
LATF0
Note:
Refer to the dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
TABLE 8-8:
Reset State
SFR
Name
Addr.
Bit 15
Bit 14
Bit 13
Bit 12
Bit 11
Bit 10
Bit 9
Bit 8
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset State
TRISF
02DE
TRISF8
TRISF7
TRISF6
TRISF5
TRISF4
TRISF3
TRISF2
TRISF1
TRISF0
PORTF
02E0
RF8
RF7
RF6
RF5
RF4
RF3
RF2
RF1
RF0
LATF
02E2
LATF8
LATF7
LATF6
LATF5
LATF4
LATF3
LATF2
LATF1
LATF0
Note:
Refer to the dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
TABLE 8-9:
SFR
Name
Addr.
Bit 14
Bit 13
Bit 12
Bit 10
Bit 9
Bit 8
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset State
TRISG
02E4
TRISG9
TRISG8
TRISG7
TRISG6
TRISG3
TRISG2
TRISG1
TRISG0
PORTG
02E6
RG15
RG14
RG13
RG12
RG9
RG8
RG7
RG6
RG3
RG2
RG1
RG0
LATG
02E8
LATG15
LATG14
LATG13
LATG12
LATG9
LATG8
LATG7
LATG6
LATG3
LATG2
LATG1
LATG0
Note:
Bit 11
Refer to the dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
dsPIC30F6011A/6012A/6013A/6014A
DS70143C-page 66
TABLE 8-5:
dsPIC30F6011A/6012A/6013A/6014A
8.3
TABLE 8-10:
SFR
Name
Addr.
Bit 15
Bit 14
Bit 13
Bit 12
Bit 11
Bit 10
Bit 9
Bit 8
Reset State
CNEN1
00C0
CN15IE
CN14IE
CN13IE
CN12IE
CN11IE
CN10IE
CN9IE
CN8IE
CNEN2
00C2
CNPU1
00C4
CN9PUE
CN8PUE
CNPU2
00C6
Note:
Refer to the dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
TABLE 8-11:
SFR
Name
Addr.
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
CNEN1
00C0
CN7IE
CN6IE
CN5IE
CN4IE
CN3IE
CN2IE
CNEN2
00C2
CN18IE
CNPU1
00C4
CN7PUE
CN6PUE
CN5PUE
CN4PUE
CN3PUE
CN2PUE
00C6
CNPU2
Note:
Bit 2
Bit 1
Bit 0
Reset State
CN1IE
CN0IE
CN17IE
CN16IE
CN1PUE
CN0PUE
CN18PUE CN17PUE
CN16PUE
Refer to the dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
TABLE 8-12:
SFR
Name
Addr.
Bit 15
Bit 14
Bit 13
Bit 12
Bit 11
Bit 10
Bit 9
Bit 8
Reset State
CNEN1
00C0
CN15IE
CN14IE
CN13IE
CN12IE
CN11IE
CN10IE
CN9IE
CN8IE
CNEN2
00C2
CNPU1
00C4
CN9PUE
CN8PUE
CNPU2
00C6
Note:
Refer to the dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
TABLE 8-13:
SFR
Name
Addr.
CNEN1
00C0
CN7IE
CN6IE
CN5IE
CN4IE
CN3IE
CN2IE
CNEN2
00C2
CN23IE
CN22IE
CN21IE
CN20IE
CN19IE
CN18IE
CNPU1
00C4
CN7PUE
CN6PUE
CN5PUE
CN4PUE
CN3PUE
CN2PUE
CNPU2
00C6
Note:
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset State
CN1IE
CN0IE
CN17IE
CN16IE
CN1PUE
CN0PUE
CN16PUE
Refer to the dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
Preliminary
DS70143C-page 67
dsPIC30F6011A/6012A/6013A/6014A
NOTES:
DS70143C-page 68
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
9.0
TIMER1 MODULE
Preliminary
DS70143C-page 69
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 9-1:
Comparator x 16
TSYNC
1
Reset
Sync
TMR1
0
T1IF
Event Flag
0
1
CK
TGATE
TCS
TGATE
TGATE
TON
SOSCO/
T1CK
1x
LPOSCEN
SOSCI
9.1
Gate
Sync
01
TCY
00
9.3
9.2
TCKPS<1:0>
2
Timer Prescaler
Prescaler
1, 8, 64, 256
DS70143C-page 70
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
9.4
9.5.1
Timer Interrupt
Enabling an interrupt is accomplished via the respective timer interrupt enable bit, T1IE. The timer interrupt
enable bit is located in the IEC0 Control register in the
interrupt controller.
When the CPU enters Sleep mode, the RTC will continue to operate provided the 32 kHz external crystal
oscillator is active and the control bits have not been
changed. The TSIDL bit should be cleared to 0 in
order for RTC to continue operation in Idle mode.
9.5
Real-Time Clock
9.5.2
FIGURE 9-2:
RTC INTERRUPTS
RECOMMENDED
COMPONENTS FOR
TIMER1 LP OSCILLATOR
RTC
C1
SOSCI
32.768 kHz
XTAL
dsPIC30FXXXX
SOSCO
C2
C1 = C2 = 18 pF; R = 100K
Preliminary
DS70143C-page 71
SFR Name
Addr.
Bit 14
Bit 13
Bit 12
Bit 11
Bit 10
Bit 9
Bit 8
Bit 7
Bit 6
TMR1
0100
Timer1 Register
PR1
0102
Period Register 1
T1CON
0104
TON
TSIDL
TGATE
Bit 5
Bit 4
Bit 2
Bit 1
Bit 0
Reset State
uuuu uuuu uuuu uuuu
1111 1111 1111 1111
TCKPS1 TCKPS0
Bit 3
Refer to dsPIC30F Family Reference ManuaI (DS70046) for descriptions of register bit fields.
TSYNC
TCS
Preliminary
2006 Microchip Technology Inc.
dsPIC30F6011A/6012A/6013A/6014A
DS70143C-page 72
TABLE 9-1:
dsPIC30F6011A/6012A/6013A/6014A
10.0
TIMER2/3 MODULE
Preliminary
DS70143C-page 73
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 10-1:
TMR3HLD
16
16
Write TMR2
Read TMR2
16
Reset
TMR3
TMR2
MSB
LSB
Sync
Comparator x 32
PR3
PR2
T3IF
Event Flag
CK
TGATE (T2CON<6>)
TCS
TGATE
TGATE
(T2CON<6>)
TON
T2CK
Note:
TCKPS<1:0>
2
1x
Gate
Sync
01
TCY
00
Prescaler
1, 8, 64, 256
Timer configuration bit T32 (T2CON<3>) must be set to 1 for a 32-bit timer/counter operation. All control
bits are respective to the T2CON register.
DS70143C-page 74
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 10-2:
PR2
Equal
Reset
T2IF
Event Flag
Comparator x 16
TMR2
Sync
0
1
CK
TGATE
TCS
TGATE
TGATE
TON
T2CK
FIGURE 10-3:
TCKPS<1:0>
2
1x
Gate
Sync
01
TCY
00
Prescaler
1, 8, 64, 256
PR3
ADC Event Trigger
Equal
Comparator x 16
TMR3
Reset
0
1
CK
TGATE
TCS
TGATE
T3IF
Event Flag
TGATE
T3CK
Sync
TON
1x
01
TCY
Preliminary
TCKPS<1:0>
2
Prescaler
1, 8, 64, 256
00
DS70143C-page 75
dsPIC30F6011A/6012A/6013A/6014A
10.1
10.4
The 32-bit timer can be placed in the Gated Time Accumulation mode. This mode allows the internal TCY to
increment the respective timer when the gate input signal (T2CK pin) is asserted high. Control bit TGATE
(T2CON<6>) must be set to enable this mode. When in
this mode, Timer2 is the originating clock source. The
TGATE setting is ignored for Timer3. The timer must be
enabled (TON = 1) and the timer clock source set to
internal (TCS = 0).
The falling edge of the external signal terminates the
count operation but does not reset the timer. The user
must reset the timer in order to start counting from zero.
10.2
10.3
10.5
Timer Interrupt
Timer Prescaler
DS70143C-page 76
Preliminary
Bit 15
Bit 14
Bit 13
Bit 12
Bit 11
Bit 10
Bit 9
Bit 8
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset State
TMR2
0106
Timer2 Register
TMR3HLD
0108
TMR3
010A
Timer3 Register
PR2
010C
Period Register 2
PR3
010E
Period Register 3
T2CON
0110
TON
TSIDL
TGATE
TCKPS1 TCKPS0
T32
TCS
T3CON
0112
TON
TSIDL
TGATE
TCKPS1 TCKPS0
TCS
Refer to dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
Preliminary
DS70143C-page 77
dsPIC30F6011A/6012A/6013A/6014A
TABLE 10-1:
dsPIC30F6011A/6012A/6013A/6014A
NOTES:
DS70143C-page 78
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
11.0
TIMER4/5 MODULE
This section describes the second 32-bit General Purpose Timer module (Timer4/5) and associated Operational modes. Figure 11-1 depicts the simplified block
diagram of the 32-bit Timer4/5 module. Figure 11-2 and
Figure 11-3 show Timer4/5 configured as two
independent 16-bit timers, Timer4 and Timer5,
respectively.
FIGURE 11-1:
TMR5HLD
16
16
Write TMR4
Read TMR4
16
Reset
Equal
TMR5
TMR4
MSB
LSB
Sync
Comparator x 32
PR5
PR4
0
T5IF
Event Flag
CK
TGATE (T4CON<6>)
TCS
TGATE
TGATE
(T4CON<6>)
TON
T4CK
Note:
TCKPS<1:0>
2
1x
Gate
Sync
01
TCY
00
Prescaler
1, 8, 64, 256
Timer configuration bit T32 (T4CON<3>) must be set to 1 for a 32-bit timer/counter operation. All control
bits are respective to the T4CON register.
Preliminary
DS70143C-page 79
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 11-2:
Reset
Comparator x 16
TMR4
Sync
T4IF
Event Flag
CK
TGATE
TCS
TGATE
1
TGATE
TON
T4CK
TCKPS<1:0>
2
1x
FIGURE 11-3:
Gate
Sync
01
TCY
00
Prescaler
1, 8, 64, 256
PR5
ADC Event Trigger
Equal
Reset
TMR5
0
1
CK
TGATE
TCS
TGATE
T5IF
Event Flag
Comparator x 16
TGATE
TON
T5CK
Sync
1x
01
TCY
Note:
TCKPS<1:0>
2
Prescaler
1, 8, 64, 256
00
In the dsPIC30F6011A and dsPIC30F6012A devices, there is no T5CK pin. Therefore, in this device the
following modes should not be used for Timer5:
TCS = 1 (16-bit Counter)
TCS = 0, TGATE = 1 (Gated Time Accumulation)
DS70143C-page 80
Preliminary
SFR Name
Addr.
Bit 14
Bit 13
Bit 12
Bit 11
Bit 10
Bit 9
Bit 8
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset State
TMR4
0114
Timer 4 Register
TMR5HLD
0116
TMR5
0118
Timer 5 Register
PR4
011A
Period Register 4
PR5
011C
Period Register 5
T4CON
011E
TON
TSIDL
TGATE
TCKPS1
TCKPS0
T32
TCS
T5CON
0120
TON
TSIDL
TGATE
TCKPS1
TCKPS0
TCS
Legend: u = uninitialized
Note:
Refer to dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
Preliminary
DS70143C-page 81
dsPIC30F6011A/6012A/6013A/6014A
TABLE 11-1:
dsPIC30F6011A/6012A/6013A/6014A
NOTES:
DS70143C-page 82
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
12.0
12.1
Frequency/Period/Pulse Measurements
Additional Sources of External Interrupts
12.1.1
FIGURE 12-1:
CAPTURE PRESCALER
There are four input capture prescaler settings specified by bits ICM<2:0> (ICxCON<2:0>). Whenever the
capture channel is turned off, the prescaler counter will
be cleared. In addition, any Reset will clear the
prescaler counter.
T3_CNT
T2_CNT
16
ICx pin
Prescaler
1, 4, 16
3
Clock
Synchronizer
Edge
Detection
Logic
16
ICTMR
FIFO
R/W
Logic
ICM<2:0>
Mode Select
ICxBUF
ICBNE, ICOV
ICI<1:0>
ICxCON
Interrupt
Logic
Data Bus
Note:
Set Flag
ICxIF
Where x is shown, reference is made to the registers or bits associated to the respective input capture
channels 1 through N.
Preliminary
DS70143C-page 83
dsPIC30F6011A/6012A/6013A/6014A
12.1.2
12.2
12.1.3
The input capture module consists of up to 8 input capture channels. Each channel can select between one of
two timers for the time base, Timer2 or Timer3.
Selection of the timer resource is accomplished
through SFR bit, ICTMR (ICxCON<7>). Timer3 is the
default timer resource available for the input capture
module.
12.1.4
12.2.1
CPU Sleep mode allows input capture module operation with reduced functionality. In the CPU Sleep mode,
the ICI<1:0> bits are not applicable and the input capture module can only function as an external interrupt
source.
The capture module must be configured for interrupt
only on rising edge (ICM<2:0> = 111) in order for the
input capture module to be used while the device is in
Sleep mode. The prescale settings of 4:1 or 16:1 are
not applicable in this mode.
12.2.2
12.3
DS70143C-page 84
Preliminary
SFR Name
Addr.
Preliminary
IC1BUF
0140
IC1CON
0142
IC2BUF
0144
IC2CON
0146
IC3BUF
0148
IC3CON
014A
IC4BUF
014C
IC4CON
014E
IC5BUF
0150
IC5CON
0152
IC6BUF
0154
IC6CON
0156
IC7BUF
0158
IC7CON
015A
IC8BUF
015C
IC8CON
015E
Bit 14
Bit 13
Bit 12
Bit 11
Bit 10
Bit 9
ICSIDL
Bit 8
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 1
ICI<1:0>
ICOV
ICBNE
ICM<2:0>
ICI<1:0>
ICOV
ICBNE
ICM<2:0>
ICI<1:0>
ICOV
ICBNE
ICM<2:0>
ICI<1:0>
ICOV
ICBNE
ICM<2:0>
ICI<1:0>
ICOV
ICBNE
ICM<2:0>
ICI<1:0>
ICOV
ICBNE
ICM<2:0>
ICI<1:0>
ICOV
ICBNE
ICM<2:0>
ICI<1:0>
ICOV
ICBNE
ICM<2:0>
ICTMR
ICSIDL
ICTMR
ICSIDL
ICTMR
ICSIDL
ICTMR
ICSIDL
ICTMR
ICSIDL
ICTMR
ICSIDL
ICTMR
ICSIDL
ICTMR
Reset State
Bit 0
Bit 2
Refer to dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
DS70143C-page 85
dsPIC30F6011A/6012A/6013A/6014A
TABLE 12-1:
dsPIC30F6011A/6012A/6013A/6014A
NOTES:
DS70143C-page 86
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
13.0
FIGURE 13-1:
OCxRS
Output
Logic
OCxR
OCTSEL
Note:
OCx
OCFA
(for x = 1, 2, 3 or 4)
or OCFB
(for x = 5, 6, 7 or 8)
Output
Enable
OCM<2:0>
Mode Select
Comparator
S Q
R
TMR3<15:0> T2P2_MATCH
T3P3_MATCH
Where x is shown, reference is made to the registers associated with the respective output compare
channels 1 through N.
Preliminary
DS70143C-page 87
dsPIC30F6011A/6012A/6013A/6014A
13.1
13.2
13.3.1
4.
DS70143C-page 88
13.4.1
TCY.
3.
13.4
13.3
13.3.2
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
13.4.2
PWM PERIOD
TMRx is cleared.
The OCx pin is set.
- Exception 1: If PWM duty cycle is 0x0000,
the OCx pin will remain low.
- Exception 2: If duty cycle is greater than PRx,
the pin will remain high.
The PWM duty cycle is latched from OCxRS into
OCxR.
The corresponding timer interrupt flag is set.
EQUATION 13-1:
PWM period = [(PRx) + 1] 4 TOSC
(TMRx prescale value)
PWM frequency is defined as 1/[PWM period].
FIGURE 13-2:
Duty Cycle
TMR3 = PR3
T3IF = 1
(Interrupt Flag)
OCxR = OCxRS
TMR3 = PR3
T3IF = 1
(Interrupt Flag)
OCxR = OCxRS
13.5
13.6
13.7
The output compare channels have the ability to generate an interrupt on a compare match, for whichever
Match mode has been selected.
For all modes except the PWM mode, when a compare
event occurs, the respective interrupt flag (OCxIF) is
asserted and an interrupt will be generated if enabled.
The OCxIF bit is located in the corresponding IFS
status register and must be cleared in software. The
interrupt is enabled via the respective compare interrupt enable (OCxIE) bit located in the corresponding
IEC control register.
For the PWM mode, when an event occurs, the respective timer interrupt flag (T2IF or T3IF) is asserted and
an interrupt will be generated if enabled. The IF bit is
located in the IFS0 status register and must be cleared
in software. The interrupt is enabled via the respective
timer interrupt enable bit (T2IE or T3IE) located in the
IEC0 control register. The output compare interrupt flag
is never set during the PWM mode of operation.
Preliminary
DS70143C-page 89
SFR Name
Addr.
OC1RS
0180
OC1R
0182
OC1CON
0184
Bit 14
Bit 13
Bit 12
Bit 11
Bit 10
Bit 9
Bit 8
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
OCSIDL
Reset State
0000 0000 0000 0000
Bit 0
OCFLT
OCTSEL
OCM<2:0>
Preliminary
OC2RS
0186
OC2R
0188
OC2CON
018A
OC3RS
018C
OC3R
018E
OC3CON
0190
OC4RS
0192
OC4R
0194
OC4CON
0196
OC5RS
0198
OC5R
019A
OC5CON
019C
OC6RS
019E
OC6R
01A0
OC6CON
01A2
OC7RS
01A4
OC7R
01A6
OC7CON
01A8
OC8RS
01AA
OC8R
01AC
OC8CON
01AE
OCSIDL
OCSIDL
OCSIDL
OCSIDL
OCSIDL
OCSIDL
OCSIDL
OCFLT
OCM<2:0>
OCFLT
OCTSEL
OCM<2:0>
OCFLT
OCTSEL
OCM<2:0>
OCFLT
OCTSEL
OCM<2:0>
OCFLT
OCTSEL
OCM<2:0>
OCFLT
OCFLT
OCTSE
Refer to dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
OCTSEL
OCTSEL
OCM<2:0>
OCM<2:0>
dsPIC30F6011A/6012A/6013A/6014A
DS70143C-page 90
TABLE 13-1:
dsPIC30F6011A/6012A/6013A/6014A
14.0
SPI MODULE
The Serial Peripheral Interface (SPI) module is a synchronous serial interface. It is useful for communicating
with other peripheral devices, such as EEPROMs, shift
registers, display drivers and A/D converters, or other
microcontrollers. It is compatible with Motorola's SPI
and SIOP interfaces.
14.1
14.1.1
The receive operation is double-buffered. When a complete byte is received, it is transferred from SPIxSR to
SPIxBUF.
A control bit, DISSDO, is provided to the SPIxCON register to allow the SDOx output to be disabled. This will
allow the SPI module to be connected in an input only
configuration. SDO can also be used for general
purpose I/O.
If the receive buffer is full when new data is being transferred from SPIxSR to SPIxBUF, the module will set the
SPIROV bit indicating an overflow condition. The transfer of the data from SPIxSR to SPIxBUF will not be
completed and the new data will be lost. The module
will not respond to SCL transitions while SPIROV is 1,
effectively disabling the module until SPIxBUF is read
by user software.
Transmit writes are also double-buffered. The user
writes to SPIxBUF. When the master or slave transfer
is completed, the contents of the shift register (SPIxSR)
are moved to the receive buffer. If any transmit data has
been written to the buffer register, the contents of the
transmit buffer are moved to SPIxSR. The received
data is thus placed in SPIxBUF and the transmit data in
SPIxSR is ready for the next transfer.
Note:
14.1.2
14.2
SDOx DISABLE
Preliminary
DS70143C-page 91
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 14-1:
Write
SPIxBUF
SPIxBUF
Receive
Transmit
SPIxSR
SDIx
bit 0
SDOx
SSx
Shift
Clock
Clock
Control
SS and FSYNC
Control
Edge
Select
Secondary
Prescaler
1:1 1:8
SCKx
Primary
Prescaler
1, 4, 16, 64
FCY
FIGURE 14-2:
SPI Master
SPI Slave
SDOx
SDIy
SDIx
Shift Register
(SPIxSR)
MSb
SDOy
LSb
Shift Register
(SPIySR)
MSb
SCKx
Serial Clock
PROCESSOR 1
LSb
SCKy
PROCESSOR 2
Note: x = 1 or 2, y = 1 or 2.
DS70143C-page 92
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
14.3
14.5
14.4
Preliminary
DS70143C-page 93
SFR
Name
Addr.
Bit 15
SPI1STAT
0220
SPI1CON
0222
SPI1BUF
0224
Note:
Bit 14
Bit 13
Bit 12
SPIEN
SPISIDL
FRMEN
SPIFSD
Bit 10
DISSDO MODE16
Bit 9
Bit 8
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset State
SPIROV
SPITBF
SMP
CKE
SSEN
CKP
MSTEN
SPRE2
SPRE1
SPRE0
PPRE1
PPRE0
Refer to dsPIC30F Family Reference ManuaI (DS70046) for descriptions of register bit fields.
TABLE 14-2:
SFR Name
Addr.
Bit 15
Bit 14
Bit 13
Bit 12
SPI2STAT
0226
SPIEN
SPISIDL
SPI2CON
0228
FRMEN
SPIFSD
SPI2BUF
022A
Note:
Bit 11
Bit 11
Bit 10
DISSDO MODE16
Bit 9
Bit 8
Bit 7
Bit 6
Bit 5
Bit 4
SPIROV
SMP
CKE
SSEN
CKP
MSTEN
SPRE2
Refer to dsPIC30F Family Reference ManuaI (DS70046) for descriptions of register bit fields.
Bit 3
Bit 2
Bit 1
Bit 0
Reset State
SPITBF
SPIRBF
PPRE1
PPRE0
SPRE1 SPRE0
Preliminary
2006 Microchip Technology Inc.
dsPIC30F6011A/6012A/6013A/6014A
DS70143C-page 94
TABLE 14-1:
dsPIC30F6011A/6012A/6013A/6014A
15.0
I2C MODULE
15.1.1
15.1
15.1.2
I2C has a 2-pin interface: the SCL pin is clock and the
SDA pin is data.
15.1.3
I2C REGISTERS
FIGURE 15-1:
PROGRAMMERS MODEL
I2CRCV (8 bits)
Bit 7
Bit 0
Bit 7
Bit 0
I2CTRN (8 bits)
I2CBRG (9 bits)
Bit 8
Bit 0
I2CCON (16 bits)
Bit 15
Bit 0
Bit 15
Bit 0
Bit 0
Preliminary
DS70143C-page 95
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 15-2:
I2CRCV
Read
SCL
Shift
Clock
I2CRSR
LSB
SDA
Addr_Match
Match Detect
Write
I2CADD
Read
Start and
Stop bit Detect
I2CSTAT
Write
Control Logic
Start, Restart,
Stop bit Generate
Write
I2CCON
Collision
Detect
Acknowledge
Generation
Clock
Stretching
Read
Read
Write
I2CTRN
LSB
Shift
Clock
Read
Reload
Control
BRG Down
Counter
DS70143C-page 96
Write
I2CBRG
FCY
Preliminary
Read
dsPIC30F6011A/6012A/6013A/6014A
15.2
15.3.2
TABLE 15-1:
0x01-0x03
Reserved
0x04-0x07
0x08-0x77
0x78-0x7b
0x7c-0x7f
Reserved
15.3
15.4
In 10-bit mode, the basic receive and transmit operations are the same as in the 7-bit mode. However, the
criteria for address match is more complex.
The I2C specification dictates that a slave must be
addressed for a write operation with two address bytes
following a Start bit.
15.3.1
0x00
SLAVE RECEPTION
SLAVE TRANSMISSION
15.4.1
Preliminary
DS70143C-page 97
dsPIC30F6011A/6012A/6013A/6014A
15.4.2
15.5
15.5.1
15.5.2
15.5.3
15.6
DS70143C-page 98
15.5.4
15.7
Interrupts
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
15.8
Slope Control
15.9
IPMI Support
In Master Receive mode, the first byte transmitted contains the slave address of the transmitting device
(7 bits) and the data direction bit. In this case, the data
direction bit (R_W) is logic 1. Thus, the first byte transmitted is a 7-bit slave address, followed by a 1 to indicate receive bit. Serial data is received via SDA while
SCL outputs the serial clock. Serial data is received
8 bits at a time. After each byte is received, an ACK bit
is transmitted. Start and Stop conditions indicate the
beginning and end of transmission.
15.12.1
Transmission of a data byte, a 7-bit address, or the second half of a 10-bit address is accomplished by simply
writing a value to the I2CTRN register. The user should
only write to I2CTRN when the module is in a Wait
state. This action will set the Buffer Full Flag (TBF) and
allow the Baud Rate Generator to begin counting and
start the next transmission. Each bit of address/data
will be shifted out onto the SDA pin after the falling
edge of SCL is asserted. The Transmit Status Flag,
TRSTAT (I2CSTAT<14>), indicates that a master
transmit is in progress.
15.12.2
When the interrupt is serviced, the source for the interrupt can be checked by reading the contents of the
I2CRCV to determine if the address was device
specific or a general call address.
Preliminary
DS70143C-page 99
dsPIC30F6011A/6012A/6013A/6014A
15.12.3
EQUATION 15-1:
I2CBRG =
15.12.4
FCY
1,111,111
CLOCK ARBITRATION
15.12.5
CY
( FFSCK
MULTI-MASTER COMMUNICATION,
BUS COLLISION AND BUS
ARBITRATION
Multi-master operation support is achieved by bus arbitration. When the master outputs address/data bits
onto the SDA pin, arbitration takes place when the
master outputs a 1 on SDA by letting SDA float high
while another master asserts a 0. When the SCL pin
floats high, data should be stable. If the expected data
on SDA is a 1 and the data sampled on the SDA
pin = 0, then a bus collision has taken place. The
master will set the MI2CIF pulse and reset the master
portion of the I2C port to its Idle state.
15.13.2
For the I2C, the I2CSIDL bit selects if the module will
stop on Idle or continue on Idle. If I2CSIDL = 0, the
module will continue operation on assertion of the Idle
mode. If I2CSIDL = 1, the module will stop on Idle.
DS70143C-page 100
Preliminary
Bit 14
Bit 13
Bit 12
Bit 11
Bit 10
Bit 9
Bit 8
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset State
I2CRCV
0200
Receive Register
I2CTRN
0202
Transmit Register
I2CBRG
0204
I2CCON
0206
I2CEN
A10M
DISSLW
SMEN
GCEN
STREN
I2CSTAT
0208
ACKSTAT
TRSTAT
BCL
GCSTAT
ADD10
IWCOL
I2COV
I2CADD
020A
Note:
Refer to dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
ACKDT
ACKEN
RCEN
PEN
RSEN
SEN
D_A
R_W
RBF
TBF
Address Register
Preliminary
DS70143C-page 101
dsPIC30F6011A/6012A/6013A/6014A
TABLE 15-2:
dsPIC30F6011A/6012A/6013A/6014A
NOTES:
DS70143C-page 102
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
16.0
UNIVERSAL ASYNCHRONOUS
RECEIVER TRANSMITTER
(UART) MODULE
16.1
FIGURE 16-1:
UTX8
Write
Transmit Control
Control TSR
Control Buffer
Generate Flags
Generate Interrupt
Load TSR
UxTXIF
UTXBRK
Data
0 (Start)
UxTX
1 (Stop)
Parity
Parity
Generator
16 Divider
Control
Signals
Note:
x = 1 or 2.
Preliminary
DS70143C-page 103
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 16-2:
16
Write
Read
Read Read
UxMODE
Write
UxSTA
0
Start bit Detect
Parity Check
Stop bit Detect
Shift Clock Generation
Wake Logic
Load RSR
to Buffer
Receive Shift Register
(UxRSR)
Control
Signals
FERR
UxRX
8-9
PERR
LPBACK
From UxTX
1
16 Divider
DS70143C-page 104
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
16.2
16.2.1
16.3
16.3.1
16.2.2
1.
2.
3.
4.
16.2.3
Transmitting Data
5.
16.3.2
16.3.3
Preliminary
DS70143C-page 105
dsPIC30F6011A/6012A/6013A/6014A
16.3.4
TRANSMIT INTERRUPT
16.4.2
b)
16.3.5
TRANSMIT BREAK
16.4.3
a)
b)
16.4.1
2.
3.
4.
5.
Set up the UART (see Section 16.3.1 Transmitting in 8-bit data mode).
Enable the UART (see Section 16.3.1 Transmitting in 8-bit data mode).
A receive interrupt will be generated when one
or more data words have been received,
depending on the receive interrupt settings
specified by the URXISEL bits (UxSTA<7:6>).
Read the OERR bit to determine if an overrun
error has occurred. The OERR bit must be reset
in software.
Read the received data from UxRXREG. The act
of reading UxRXREG will move the next word to
the top of the receive FIFO, and the PERR and
FERR values will be updated.
DS70143C-page 106
c)
Switching between the Interrupt modes during operation is possible, though generally not advisable during
normal operation.
Receiving Data
RECEIVE INTERRUPT
16.4
Preliminary
16.5
16.5.1
dsPIC30F6011A/6012A/6013A/6014A
16.5.2
16.6
16.5.3
16.5.4
IDLE STATUS
16.5.5
RECEIVE BREAK
Setting the ADDEN bit (UxSTA<5>) enables this special mode in which a 9th bit (URX8) value of 1 identifies the received word as an address, rather than data.
This mode is only applicable for 9-bit data communication. The URXISEL control bit does not have any
impact on interrupt generation in this mode since an
interrupt (if enabled) will be generated every time the
received word has the 9th bit set.
16.7
Loopback Mode
16.8
EQUATION 16-1:
BAUD RATE
Preliminary
DS70143C-page 107
dsPIC30F6011A/6012A/6013A/6014A
16.9
16.10.2
Auto-Baud Support
For the UART, the USIDL bit selects if the module will
stop operation when the device enters Idle mode or
whether the module will continue on Idle. If USIDL = 0,
the module will continue operation during Idle mode. If
USIDL = 1, the module will stop on Idle.
DS70143C-page 108
Preliminary
Bit 15
Bit 14
Bit 13
Bit 12
Bit 11
Bit 10
Bit 9
Bit 8
Bit 7
Bit 6
Bit 5
WAKE
LPBACK
ABAUD
U1MODE
020C
UARTEN
USIDL
U1STA
020E
UTXISEL
U1TXREG
0210
U1RXREG
0212
U1BRG
0214
Legend:
u = uninitialized bit
Note:
Refer to the dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
TABLE 16-2:
SFR
Name
Addr.
Bit 4
Bit 3
PERR
Bit 0
Reset State
TRMT
UTX8
Transmit Register
URX8
Receive Register
Bit 1
UTXBF
UTXBRK UTXEN
RIDLE
Bit 2
OERR
Bit 14
Bit 13
Bit 12
Bit 11
Bit 10
Bit 9
Bit 8
Bit 7
Bit 6
Bit 5
Bit 4
WAKE
LPBACK
ABAUD
Bit 3
Bit 2
Bit 1
Bit 0
Reset State
Preliminary
U2MODE
0216
UARTEN
USIDL
U2STA
0218
UTXISEL
U2TXREG
021A
UTX8
Transmit Register
U2RXREG
021C
URX8
Receive Register
U2BRG
021E
Legend:
u = uninitialized bit
Note:
Refer to the dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
UTXBRK UTXEN
UTXBF
TRMT
RIDLE
PERR
PDSEL1 PDSEL0
FERR
OERR
DS70143C-page 109
dsPIC30F6011A/6012A/6013A/6014A
TABLE 16-1:
dsPIC30F6011A/6012A/6013A/6014A
NOTES:
DS70143C-page 110
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
17.0
CAN MODULE
17.1
Overview
17.2
Frame Types
Preliminary
DS70143C-page 111
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 17-1:
BUFFERS
Acceptance Filter
RXF2
MESSAGE
MSGREQ
TXABT
TXLARB
TXERR
MTXBUFF
TXB2
MESSAGE
MSGREQ
TXABT
TXLARB
TXERR
MTXBUFF
MESSAGE
TXB1
MSGREQ
TXABT
TXLARB
TXERR
MTXBUFF
TXB0
A
c
c
e
p
t
R
X
B
0
Message
Queue
Control
Acceptance Mask
RXM0
Acceptance Filter
RXF3
Acceptance Filter
RXF0
Acceptance Filter
RXF4
Acceptance Filter
RXF1
Acceptance Filter
RXF5
Identifier
M
A
B
Data Field
Data Field
PROTOCOL
ENGINE
Note 1:
RERRCNT
TERRCNT
Err Pas
Bus Off
Transmit
Error
Counter
CRC Generator
R
X
B
1
Identifier
Receive
Error
Counter
Transmit Shift
A
c
c
e
p
t
Receive Shift
Protocol
Finite
State
Machine
CRC Check
Transmit
Logic
Bit
Timing
Logic
CiTX(1)
CiRX(1)
Bit Timing
Generator
DS70143C-page 112
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
17.3
Modes of Operation
Initialization Mode
Disable Mode
Normal Operation Mode
Listen Only Mode
Loopback Mode
Error Recognition Mode
Note:
17.3.1
INITIALIZATION MODE
17.3.2
DISABLE MODE
17.3.3
17.3.4
17.3.5
17.3.6
LOOPBACK MODE
If the Loopback mode is activated, the module will connect the internal transmit signal to the internal receive
signal at the module boundary. The transmit and
receive pins revert to their port I/O function.
Preliminary
DS70143C-page 113
dsPIC30F6011A/6012A/6013A/6014A
17.4
17.4.1
17.4.4
Message Reception
RECEIVE BUFFERS
17.4.2
17.4.3
RECEIVE OVERRUN
17.4.5
RECEIVE ERRORS
17.4.6
RECEIVE INTERRUPTS
DS70143C-page 114
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
Receive Error Interrupts:
A receive error interrupt will be indicated by the
ERRIF bit. This bit shows that an error condition
occurred. The source of the error can be determined by checking the bits in the CAN Interrupt
status register, CiINTF.
- Invalid Message Received:
If any type of error occurred during reception of
the last message, an error will be indicated by
the IVRIF bit.
- Receiver Overrun:
The RXnOVR bit indicates that an overrun
condition occurred.
- Receiver Warning:
The RXWAR bit indicates that the receive error
counter (RERRCNT<7:0>) has reached the
warning limit of 96.
- Receiver Error Passive:
The RXEP bit indicates that the receive error
counter has exceeded the error passive limit of
127 and the module has gone into error passive
state.
17.5
17.5.1
Message Transmission
TRANSMIT BUFFERS
17.5.2
17.5.3
17.5.4
ABORTING MESSAGE
TRANSMISSION
17.5.5
TRANSMISSION ERRORS
TRANSMISSION SEQUENCE
Preliminary
DS70143C-page 115
dsPIC30F6011A/6012A/6013A/6014A
17.5.6
TRANSMIT INTERRUPTS
17.6
Transmit Interrupt:
At least one of the three transmit buffers is empty
(not scheduled) and can be loaded to schedule a
message for transmission. Reading the TXnIF
flags will indicate which transmit buffer is available
and caused the interrupt.
FIGURE 17-2:
17.6.1
BIT TIMING
The time segments and also the nominal bit time are
made up of integer units of time called time quanta or
TQ. By definition, the nominal bit time has a minimum
of 8 TQ and a maximum of 25 TQ. Also, by definition,
the minimum nominal bit time is 1 sec corresponding
to a maximum bit rate of 1 MHz.
Input Signal
Sync
Prop
Segment
Phase
Segment 1
Phase
Segment 2
Sync
Sample Point
TQ
DS70143C-page 116
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
17.6.2
PRESCALER SETTING
17.6.5
EQUATION 17-1:
PROPAGATION SEGMENT
17.6.6
17.6.4
PHASE SEGMENTS
TQ = 2 (BRP<5:0> + 1) / FCAN
17.6.3
SAMPLE POINT
SYNCHRONIZATION
17.6.6.1
Hard Synchronization
17.6.6.2
Resynchronization
Preliminary
DS70143C-page 117
SFR Name
Addr
Bit 15
Bit 14
Bit 13
C1RXF0SID
0300
Bit 12
Bit 11
Bit 10
C1RXF0EIDH
0302
C1RXF0EIDL
0304
C1RXF1SID
0308
C1RXF1EIDH 030A
C1RXF1EIDL
030C
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
C1RXF2EIDL
0314
C1RXF3SID
Bit 0
0318
C1RXF3EIDH 031A
C1RXF3EIDL
031C
Preliminary
C1RXF4SID
0320
C1RXF4EIDH
0322
C1RXF4EIDL
0324
C1RXF5SID
0328
C1RXF5EIDH 032A
C1RXF5EIDL
032C
C1RXM0SID
0330
C1RXM0EIDH 0332
C1RXM0EIDL
0334
C1RXM1SID
MIDE
MIDE
0338
C1RXM1EIDH 033A
C1RXM1EIDL 033C
TXRTR
TXRB1
SRR
C1TX2DLC
0344
0346
C1TX2B2
0348
C1TX2B3
034A
C1TX2B4
034C
C1TX2CON
034E
C1TX1SID
0350
C1TX1EID
0352
C1TX1DLC
0354
TXRTR
TXRB1
DLC<3:0>
C1TX2B1
TXRB0
Reset State
Bit 1
0310
0342
0312
0340
Bit 7
C1RXF2SID
C1TX2EID
Bit 8
C1RXF2EIDH
C1TX2SID
Bit 9
TXREQ
TXPRI<1:0>
SRR
DLC<3:0>
dsPIC30F6011A/6012A/6013A/6014A
DS70143C-page 118
TABLE 17-1:
SFR Name
C1TX1B1
Addr
Bit 14
Bit 13
Bit 12
Bit 11
Bit 10
Bit 9
Bit 8
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset State
0356
C1TX1B2
0358
C1TX1B3
035A
C1TX1B4
035C
C1TX1CON
035E
C1TX0SID
0360
C1TX0EID
0362
TXRTR
TXRB1
TXREQ
TXPRI<1:0>
SRR
Preliminary
C1TX0DLC
0364
0366
C1TX0B2
0368
C1TX0B3
036A
C1TX0B4
036C
C1TX0CON
036E
C1RX1SID
0370
C1RX1EID
0372
C1RX1DLC
0374
C1RX1B1
0376
C1RX1B2
0378
C1RX1B3
037A
C1RX1B4
037C
C1RX1CON
037E
C1RX0SID
0380
C1RX0EID
0382
C1RX0DLC
0384
C1RX0B1
0386
C1RX0B2
0388
C1RX0B3
038A
C1RX0B4
038C
C1RX0CON
038E
TXPRI<1:0>
SRR
RXFUL
RXRB0
DLC<3:0>
RXRTRRO
FILHIT<2:0>
SRR
DS70143C-page 119
C1CTRL
0390
CANCAP
CSIDL
ABAT
CANCKS
0392
REQOP<2:0>
C1CFG2
0394
WAKFIL
SEG2PH<2:0>
C1INTF
0396
RX0OVR
RX1OVR
TXBO
TXEP
RXEP
C1INTE
0398
C1EC
039A
RXFUL
OPMODE<2:0>
DLC<3:0>
SAM
ICODE<2:0>
SJW<1:0>
SEG2PHTS
RXRB0
TXREQ
C1CFG1
DLC<3:0>
C1TX0B1
TXRB0
BRP<5:0>
SEG1PH<2:0>
PRSEG<2:0>
IVRIF
WAKIF
ERRIF
TX2IF
TX1IF
TX0IF
RX1IF
IVRIE
WAKIE
ERRIE
TX2IE
TX1IE
TX0IE
RX1E
dsPIC30F6011A/6012A/6013A/6014A
TABLE 17-1:
Addr
.
SFR Name
C2RXF0SID
C2RXF0EIDH
C2RXF0EIDL
C2RXF1SID
03C0
03C2
03C4
03C8
C2RXF1EIDH 03CA
C2RXF1EIDL 03CC
C2RXF2SID 03D0
Bit 14
Bit 13
Bit 12
Bit 11
Bit 10
Bit 9
Bit 8
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset State
EXIDE
000u
0000
uuuu
EXIDE 000u
uuuu
uuuu
uu00
uuuu
uuuu
uuuu
0000
uuuu
uu0u
uuuu
0000
uu0u
Preliminary
C2RXF2EIDH 03D2
C2RXF2EIDL 03D4
C2RXF3SID 03D8
C2RXF3EIDH 03DA
C2RXF3EIDL 03DC
C2RXF4SID 03E0
C2RXF4EIDH 03E2
C2RXF4EIDL 03E4
C2RXF5SID 03E8
C2RXF5EIDH 03EA
C2RXF5EIDL 03EC
C2RXM0SID 03F0
MIDE
C2RXM0EIDH 03F2
C2RXM1SID 03F8
MIDE
C2RXM1EIDH 03FA
C2TX2SID
0400
Transmit Buffer 2 Standard Identifier <10:6>
C2TX2B1
0406
Transmit Buffer 2 Byte 1
Transmit Buffer 2 Byte 0
C2TX2B2
0408
Transmit Buffer 2 Byte 3
Transmit Buffer 2 Byte 2
C2TX2B3
040A
Transmit Buffer 2 Byte 5
Transmit Buffer 2 Byte 4
C2TX2B4
040C
Transmit Buffer 2 Byte 7
Transmit Buffer 2 Byte 6
C2TX2CON 040E
TXPRI<1:0>
C2TX1SID
0410
Transmit Buffer 1 Standard Identifier <10:6>
C2TX1DLC
0414
Transmit Buffer 1 Extended Identifier <5:0>
TXRTR TXRB1
TXRB0
DLC<3:0>
Refer to dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
uuuu
uu00
u000
0000
uuuu
uuuu
uuuu
uuuu
uuuu
0000
u000
0000
uuuu
uuuu
0000
uuuu
uuuu
uuuu
uuuu
uuuu
uuuu
uuuu
0000
uuuu
uuuu
uuuu
uuuu
0000
uuuu
uuuu
u000
uuuu
uuuu
uuuu
uuuu
0000
uuuu
uuuu
u000
dsPIC30F6011A/6012A/6013A/6014A
DS70143C-page 120
TABLE 17-2:
SFR Name
Preliminary
2006 Microchip Technology Inc.
C2TX1B1
C2TX1B2
C2TX1B3
C2TX1B4
C2TX1CON
C2TX0SID
C2TX0EID
C2TX0DLC
C2TX0B1
C2TX0B2
C2TX0B3
C2TX0B4
C2TX0CON
C2RX1SID
C2RX1EID
C2RX1DLC
C2RX1B1
C2RX1B2
C2RX1B3
C2RX1B4
C2RX1CON
C2RX0SID
C2RX0EID
C2RX0DLC
C2RX0B1
C2RX0B2
C2RX0B3
C2RX0B4
C2RX0CON
C2CTRL
C2CFG1
C2CFG2
C2INTF
C2INTE
C2EC
Addr
.
Bit 14
Bit 13
Bit 12
Bit 11
Bit 10
Bit 9
Bit 8
Bit 7
Bit 6
Bit 5
Bit 3
Bit 2
Bit 1
Bit 0
0416
Transmit Buffer 1 Byte 1
Transmit Buffer 1 Byte 0
0418
Transmit Buffer 1 Byte 3
Transmit Buffer 1 Byte 2
041A
Transmit Buffer 1 Byte 5
Transmit Buffer 1 Byte 4
041C
Transmit Buffer 1 Byte 7
Transmit Buffer 1 Byte 6
041E
TXPRI<1:0>
0424
Transmit Buffer 0 Extended Identifier <5:0>
TXRTR TXRB1
TXRB0
DLC<3:0>
0426
Transmit Buffer 0 Byte 1
Transmit Buffer 0 Byte 0
0428
Transmit Buffer 0 Byte 3
Transmit Buffer 0 Byte 2
042A
Transmit Buffer 0 Byte 5
Transmit Buffer 0 Byte 4
042C
Transmit Buffer 0 Byte 7
Transmit Buffer 0 Byte 6
042E
TXPRI<1:0>
RXRB0
DLC<3:0>
0436
Receive Buffer 1 Byte 1
Receive Buffer 1 Byte 0
0438
Receive Buffer 1 Byte 3
Receive Buffer 1 Byte 2
043A
Receive Buffer 1 Byte 5
Receive Buffer 1 Byte 4
043C
Receive Buffer 1 Byte 7
Receive Buffer 1 Byte 6
043E
RXFUL
RXRTRRO
FILHIT<2:0>
0440
RXRB0
DLC<3:0>
0446
Receive Buffer 0 Byte 1
Receive Buffer 0 Byte 0
0448
Receive Buffer 0 Byte 3
Receive Buffer 0 Byte 2
044A
Receive Buffer 0 Byte 5
Receive Buffer 0 Byte 4
044C
Receive Buffer 0 Byte 7
Receive Buffer 0 Byte 6
044E
RXFUL
ICODE<2:0>
0452
SJW<1:0>
BRP<5:0>
WAKFIL
SEG2PH<2:0>
SEG2PHTS SAM
SEG1PH<2:0>
PRSEG<2:0>
0454
0456 RX0OVR
RX1OVR
TXBO
TXEP
RXEP TXWAR RXWAR EWARN
IVRIF
WAKIF ERRIF TX2IF
TX1IF
TX0IF RX1IF RX0IF
0458
IVRIE
WAKIE ERRIE TX2IE
TX1IE
TX0IE RX1E RX0IE
045A
Transmit Error Count Register
Receive Error Count Register
Bit 4
Refer to dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
Reset State
uuuu
uuuu
uuuu
uuuu
0000
uuuu
uuuu
uuuu
uuuu
uuuu
uuuu
uuuu
0000
000u
0000
uuuu
uuuu
uuuu
uuuu
uuuu
0000
000u
0000
uuuu
uuuu
uuuu
uuuu
uuuu
0000
0000
0000
0u00
0000
0000
0000
uuuu
uuuu
uuuu
uuuu
0000
u000
0000
uuuu
uuuu
uuuu
uuuu
uuuu
0000
uuuu
uuuu
uuuu
uuuu
uuuu
uuuu
uuuu
0000
uuuu
uuuu
uuuu
uuuu
uuuu
uuuu
uuuu
0000
0100
0000
0uuu
0000
0000
0000
uuuu
uuuu
uuuu
uuuu
0000
uuuu
uuuu
uuuu
uuuu
uuuu
uuuu
uuuu
0000
uuuu
uuuu
000u
uuuu
uuuu
uuuu
uuuu
0000
uuuu
uuuu
000u
uuuu
uuuu
uuuu
uuuu
0000
1000
0000
uuuu
0000
0000
0000
uuuu
uuuu
uuuu
uuuu
0000
uuuu
uuuu
u000
uuuu
uuuu
uuuu
uuuu
0000
uuuu
uuuu
uuuu
uuuu
uuuu
uuuu
uuuu
0000
uuuu
uuuu
uuuu
uuuu
uuuu
uuuu
uuuu
0000
0000
0000
uuuu
0000
0000
0000
dsPIC30F6011A/6012A/6013A/6014A
DS70143C-page 121
TABLE 17-2:
dsPIC30F6011A/6012A/6013A/6014A
NOTES:
DS70143C-page 122
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
18.0
DATA CONVERTER
INTERFACE (DCI) MODULE
18.2.3
18.1
Module Introduction
18.2.3.1
Data values are always stored left justified in the buffers since most Codec data is represented as a signed
2s complement fractional number. If the received word
length is less than 16 bits, the unused LSbs in the
receive buffer registers are set to 0 by the module. If
the transmitted word length is less than 16 bits, the
unused LSbs in the transmit buffer register are ignored
by the module. The word length setup is described in
subsequent sections of this document.
18.2.5
COFS PIN
18.2.4
18.2
CSDI PIN
TRANSMIT/RECEIVE SHIFT
REGISTER
18.2.1
18.2.6
CSCK PIN
The CSCK pin provides the serial clock for the DCI
module. The CSCK pin may be configured as an input
or output using the CSCKD control bit in the DCICON1
SFR. When configured as an output, the serial clock is
provided by the dsPIC30F. When configured as an
input, the serial clock must be provided by an external
device.
18.2.2
CSDO PIN
The DCI module contains a buffer control unit for transferring data between the shadow buffer memory and
the serial shift register. The buffer control unit is a simple 2-bit address counter that points to word locations
in the shadow buffer memory. For the receive memory
space (high address portion of DCI buffer memory), the
address counter is concatenated with a 0 in the MSb
location to form a 3-bit address. For the transmit memory space (high portion of DCI buffer memory), the
address counter is concatenated with a 1 in the MSb
location.
Note:
Preliminary
DS70143C-page 123
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 18-1:
Sample Rate
CSCK
Generator
FSD
Word Size Selection bits
Frame
Synchronization
Generator
COFS
Receive Buffer
Registers w/Shadow
DCI Buffer
Control Unit
15
Transmit Buffer
Registers w/Shadow
0
DCI Shift Register
CSDI
CSDO
DS70143C-page 124
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
18.3
18.3.1
18.3.4
18.3.2
18.3.3
EQUATION 18-1:
COFSG PERIOD
Multi-Channel mode
I2S mode
AC-Link mode (16-bit)
AC-Link mode (20-bit)
18.3.5
Preliminary
DS70143C-page 125
dsPIC30F6011A/6012A/6013A/6014A
18.3.6
FIGURE 18-2:
CSDI/CSDO
FIGURE 18-3:
MSB
LSB
CSDO or CSDI
SYNC
FIGURE 18-4:
CSCK
CSDI or CSDO
MSB
LSB MSB
LSB
WS
Note:
A 5-bit transfer is shown here for illustration purposes. The I2S protocol does not specify word length this
will be system dependent.
DS70143C-page 126
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
18.3.7
EQUATION 18-2:
TABLE 18-1:
FBCK =
FCY
2 (BCG + 1)
FS (KHz)
FCSCK/FS
FCSCK (MHz)(1)
FOSC (MHZ)
PLL
FCY (MIPS)
BCG(2)
256
2.048
8.192
8.192
12
256
3.072
6.144
12.288
32
32
1.024
8.192
16.384
44.1
32
1.4112
5.6448
11.2896
48
64
3.072
6.144
16
24.576
Note 1: When the CSCK signal is applied externally (CSCKD = 1), the external clock high and low times must meet
the device timing requirements.
2: When the CSCK signal is applied externally (CSCKD = 1), the BCG<11:0> bits have no effect on the
operation of the DCI module.
Preliminary
DS70143C-page 127
dsPIC30F6011A/6012A/6013A/6014A
18.3.8
18.3.11
18.3.9
DATA JUSTIFICATION
CONTROL BIT
18.3.10
DS70143C-page 128
18.3.12
18.3.13
SYNCHRONOUS DATA
TRANSFERS
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
18.3.14
18.3.16
18.3.15
Note:
18.3.17
Note:
The transmit status bits only indicate status for buffer locations that are used by the
module. If the buffer length is set to less
than four words, for example, the unused
buffer locations will not affect the transmit
status bits.
Preliminary
DS70143C-page 129
dsPIC30F6011A/6012A/6013A/6014A
18.3.18
18.5
The SLOT<3:0> status bits in the DCISTAT SFR indicate the current active time slot. These bits will correspond to the value of the frame sync generator counter.
The user may poll these status bits in software when a
DCI interrupt occurs to determine what time slot data
was last received and which time slot data should be
loaded into the TXBUF registers.
18.3.19
18.3.20
18.3.21
18.4
DS70143C-page 130
18.5.1
18.5.2
If the DCISIDL control bit is cleared (default), the module will continue to operate normally even in Idle mode.
If the DCISIDL bit is set, the module will halt when Idle
mode is asserted.
18.6
18.6.1
18.6.2
The 20-bit AC-Link mode allows all bits in the data time
slots to be transmitted and received but does not maintain data alignment in the TXBUF and RXBUF
registers.
The 20-bit AC-Link mode functions similar to the MultiChannel mode of the DCI module, except for the duty
cycle of the frame synchronization signal. The AC-Link
frame synchronization signal should remain high for 16
CSCK cycles and should be low for the following
240 cycles.
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
The 20-bit mode treats each 256-bit AC-Link frame as
sixteen, 16-bit time slots. In the 20-bit AC-Link mode,
the module operates as if COFSG<3:0> = 1111 and
WS<3:0> = 1111. The data alignment for 20-bit data
slots is ignored. For example, an entire AC-Link data
frame can be transmitted and received in a packed
fashion by setting all bits in the TSCON and RSCON
SFRs. Since the total available buffer length is 64 bits,
it would take 4 consecutive interrupts to transfer the
AC-Link frame. The application software must keep
track of the current AC-Link frame segment.
18.7
I2S
Mode Operation
18.7.1
18.7.2
Preliminary
DS70143C-page 131
SFR Name
Addr.
Bit 15
Bit 14
Bit 13
Bit 12
Bit 11
Bit 10
DCICON1
0240
DCIEN
DCISIDL
DLOOP
CSCKD
DCICON2
0242
BLEN1
BLEN0
DCICON3
0244
DCISTAT
0246
Bit 9
Bit 8
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
CSDOM
DJST
COFSM1
COFSG<3:0>
Bit 0
WS<3:0>
BCG<11:0>
SLOT3
SLOT2
SLOT1
SLOT0
Reset State
ROV
RFUL
TUNF
TMPTY
Preliminary
TSCON
0248
TSE15
TSE14
TSE13
TSE12
TSE11
TSE10
TSE9
TSE8
TSE7
TSE6
TSE5
TSE4
TSE3
TSE2
TSE1
TSE0
RSCON
024C
RSE15
RSE14
RSE13
RSE12
RSE11
RSE10
RSE9
RSE8
RSE7
RSE6
RSE5
RSE4 RSE3
RSE2
RSE1
RSE0
RXBUF0
0250
RXBUF1
0252
RXBUF2
0254
RXBUF3
0256
TXBUF0
0258
TXBUF1
025A
TXBUF2
025C
TXBUF3
025E
Note:
Refer to dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
dsPIC30F6011A/6012A/6013A/6014A
DS70143C-page 132
TABLE 18-2:
dsPIC30F6011A/6012A/6013A/6014A
19.0
12-BIT ANALOG-TO-DIGITAL
CONVERTER (ADC) MODULE
The ADCON1, ADCON2 and ADCON3 registers control the operation of the ADC module. The ADCHS register selects the input channels to be converted. The
ADPCFG register configures the port pins as analog
inputs or as digital I/O. The ADCSSL register selects
inputs for scanning.
FIGURE 19-1:
Note:
VREF+
VREF-
AN1
0001
AN2
0010
AN3
0011
AN4
0100
AN5
0101
AN6
0110
AN7
0111
AN8
AN9
AN10
AN11
AN12
AN13
AN14
AN15
1000
DAC
12-bit SAR
Conversion Logic
16-word, 12-bit
Dual Port
RAM
Sample/Sequence
Control
Sample
1001
1010
Input
Switches
1011
Input MUX
Control
1100
1101
1110
1111
VREFAN1
Comparator
Bus Interface
0000
Data
Format
AN0
S/H
CH0
Preliminary
DS70143C-page 133
dsPIC30F6011A/6012A/6013A/6014A
19.1
19.3
19.2
Conversion Operation
2.
3.
4.
5.
6.
7.
DS70143C-page 134
The BUFM bit will split the 16-word results buffer into
two 8-word groups. Writing to the 8-word buffers will be
alternated on each interrupt event.
Use of the BUFM bit will depend on how much time is
available for the moving of the buffers after the
interrupt.
If the processor can quickly unload a full buffer within
the time it takes to acquire and convert one channel,
the BUFM bit can be 0 and up to 16 conversions (corresponding to the 16 input channels) may be done per
interrupt. The processor will have one acquisition and
conversion time to move the sixteen conversions.
If the processor cannot unload the buffer within the
acquisition and conversion time, the BUFM bit should be
1. For example, if SMPI<3:0> (ADCON2<5:2>) = 0111,
then eight conversions will be loaded into 1/2 of the
buffer, following which an interrupt occurs. The next
eight conversions will be loaded into the other 1/2 of the
buffer. The processor will have the entire time between
interrupts to move the eight conversions.
The ALTS bit can be used to alternate the inputs
selected during the sampling sequence. The input
multiplexer has two sets of sample inputs: MUX A and
MUX B. If the ALTS bit is 0, only the MUX A inputs are
selected for sampling. If the ALTS bit is 1 and
SMPI<3:0> = 0000 on the first sample/convert
sequence, the MUX A inputs are selected and, on the
next acquire/convert sequence, the MUX B inputs are
selected.
The CSCNA bit (ADCON2<10>) will allow the multiplexer input to be alternately scanned across a
selected number of analog inputs for the MUX A group.
The inputs are selected by the ADCSSL register. If a
particular bit in the ADCSSL register is 1, the corresponding input is selected. The inputs are always
scanned from lower to higher numbered inputs, starting
after each interrupt. If the number of inputs selected is
greater than the number of samples taken per interrupt,
the higher numbered inputs are unused.
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
19.4
EXAMPLE 19-1:
19.5
ADCS<5:0> = 2
Aborting a Conversion
19.6
EQUATION 19-1:
ADC CONVERSION
CLOCK AND SAMPLING
RATE CALCULATION
Therefore,
Set ADCS<5:0> = 19
TCY
(ADCS<5:0> + 1)
2
33.33 nsec
=
(19 + 1)
2
Actual TAD =
= 334 nsec
If SSRC<2:0> = 111 and SAMC<4:0> = 00001
Since,
Sampling Time = Acquisition Time + Conversion Time
= 1 TAD + 14 TAD
= 15 x 334 nsec
Therefore,
Sampling Rate =
ADC CONVERSION
CLOCK
1
(15 x 334 nsec)
= ~200 kHz
Preliminary
DS70143C-page 135
dsPIC30F6011A/6012A/6013A/6014A
19.7
ADC Speeds
The dsPIC30F 12-bit ADC specifications permit a maximum of 200 ksps sampling rate. The table below summarizes the conversion speeds for the dsPIC30F 12-bit
ADC and the required operating conditions.
TABLE 19-1:
Speed
Up to 200
ksps(1)
TAD
Sampling
Minimum Time Min
334 ns
1 TAD
Rs Max
VDD
Temperature
2.5 k
4.5V to 5.5V
-40C to +85C
Channels Configuration
VREF- VREF+
CHX
ANx
S/H
Up to 100
ksps
668 ns
1 TAD
2.5 k
3.0V to 5.5V
ADC
-40C to +125C
VREF- VREF+
or
or
AVSS AVDD
CHX
ANx
S/H
ADC
ANx or VREF-
Note 1: External VREF- and VREF+ pins must be used for correct operation. See Figure 19-2 for recommended
circuit.
DS70143C-page 136
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
The following figure depicts the recommended circuit
for the conversion rates above 100 ksps. The
dsPIC30F6014A is shown as an example.
FIGURE 19-2:
63
62
61
65
64
VSS
69
68
67
66
60
59
3
4
58
5
6
56
54
8
9
53
57
C2
0.1 F
dsPIC30F6014A
C6
0.01 F
VDD
49
R1
10
AVDD
C5
1 F
AVDD
C4
0.1 F
AVDD
C3
0.01 F
40
39
38
37
36
35
34
33
41
VDD
42
20
VSS
43
19
30
18
29
44
28
45
17
AVSS
27
16
AVDD
46
VREF-
47
15
VREF+
14
22
VDD
21
C7
0.1 F
VDD
50
13
C1
0.01 F
C8
1 F
VDD
VSS
VDD
R2
10
VDD
52
VSS
VDD
See Note 1:
55
10
VDD
VDD
80
79
78
77
76
75
74
73
72
VDD
VDD
VDD
Note 1: Ensure adequate bypass capacitors are provided on each VDD pin.
19.7.1
= 334 ns
Preliminary
DS70143C-page 137
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 19-3:
TSAMP
= 1 TAD
ADCLK
TCONV
= 14 TAD
TCONV
= 14 TAD
SAMP
DONE
ADCBUF0
ADCBUF1
Instruction Execution BSET ADCON1, ASAM
19.8
FIGURE 19-4:
Rs
VA
ANx
RIC 250
VT = 0.6V
Sampling
Switch
RSS 3 k
RSS
CPIN
VT = 0.6V
I leakage
500 nA
CHOLD
= DAC capacitance
= 18 pF
VSS
Legend: CPIN
= input capacitance
VT
= threshold voltage
I leakage = leakage current at the pin due to
various junctions
RIC
= interconnect resistance
RSS
= sampling switch resistance
CHOLD
= sample/hold capacitance (from DAC)
Note: CPIN value depends on device package and is not tested. Effect of CPIN negligible if Rs 2.5 k.
DS70143C-page 138
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
19.9
FIGURE 19-5:
19.10.2
RAM Contents:
d11 d10 d09 d08 d07 d06 d05 d04 d03 d02 d01 d00
Read to Bus:
Signed Fractional
d11 d10 d09 d08 d07 d06 d05 d04 d03 d02 d01 d00
Fractional
d11 d10 d09 d08 d07 d06 d05 d04 d03 d02 d01 d00
Signed Integer
Integer
d11 d11 d11 d11 d11 d10 d09 d08 d07 d06 d05 d04 d03 d02 d01 d00
d11 d10 d09 d08 d07 d06 d05 d04 d03 d02 d01 d00
Preliminary
DS70143C-page 139
dsPIC30F6011A/6012A/6013A/6014A
19.13 Configuring Analog Port Pins
An external RC filter is sometimes added for antialiasing of the input signal. The R component should be
selected to ensure that the sampling time requirements
are satisfied. Any external components connected (via
high-impedance) to an analog input pin (capacitor,
zener diode, etc.) should have very little leakage
current at the pin.
DS70143C-page 140
Preliminary
Preliminary
SFR
Name
Addr.
Bit 15
Bit 14
Bit 13
Bit 12
ADCBUF0
0280
ADCBUF1
0282
ADCBUF2
0284
ADCBUF3
0286
ADCBUF4
0288
ADCBUF5
028A
ADCBUF6
028C
ADCBUF7
028E
ADCBUF8
0290
ADCBUF9
0292
ADCBUFA
0294
ADCBUFB
0296
ADCBUFC 0298
ADCBUFD 029A
ADCBUFE 029C
ADCBUFF
029E
ADCON1
02A0
ADON
ADSIDL
VCFG<2:0>
Bit 11
Bit 10
Bit 9
Bit 8
Bit 7
FORM<1:0>
Bit 6
Bit 5
SSRC<2:0>
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset State
ASAM
SAMP
DONE
BUFM
ALTS
ADCON2
02A2
ADCON3
02A4
ADCHS
02A6
ADPCFG
02A8
PCFG6 PCFG5
PCFG4
PCFG0
ADCSSL
02AA
CSSL11
CSSL6
CSSL4
CSSL3
CSSL0
CSCNA
SAMC<4:0>
CH0NB
CSSL12
CH0SB<3:0>
CSSL10 CSSL9
CSSL8
BUFS
ADRC
CSSL7
Legend:
u = uninitialized bit
Note:
Refer to dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
SMPI<3:0>
ADCS<5:0>
CSSL5
CH0NA
CH0SA<3:0>
CSSL2
CSSL1
DS70143C-page 141
dsPIC30F6011A/6012A/6013A/6014A
TABLE 19-2:
dsPIC30F6011A/6012A/6013A/6014A
NOTES:
DS70143C-page 142
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
20.0
SYSTEM INTEGRATION
20.1
Preliminary
DS70143C-page 143
dsPIC30F6011A/6012A/6013A/6014A
TABLE 20-1:
Oscillator Mode
Description
XTL
XT
XT w/PLL 4x
XT w/PLL 8x
XT w/PLL 16x
LP
HS
HS/2 w/PLL 4x
HS/2 w/PLL 8x
HS/3 w/PLL 4x
HS/3 w/PLL 8x
EC
ECIO
EC w/PLL 4x
External clock input (4-10 MHz), OSC2 pin is I/O, 4x PLL enabled
EC w/PLL 8x
External clock input (4-10 MHz), OSC2 pin is I/O, 8x PLL enabled
EC w/PLL 16x
External clock input (4-7.5 MHz), OSC2 pin is I/O, 16x PLL enabled(1)
ERC
ERCIO
FRC
FRC w/PLL 4x
FRC w/PLL 8x
LPRC
Note 1:
2:
3:
4:
5:
DS70143C-page 144
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 20-1:
OSC1
OSC2
Primary
Oscillator
PLL
x4, x8, x16
PLL
Lock
COSC<2:0>
Primary Osc
TUN<3:0>
4
NOSC<2:0>
Primary
Oscillator
Stability Detector
OSWEN
Internal Fast RC
Oscillator (FRC)
POR Done
Oscillator
Start-up
Timer
Clock
Secondary Osc
Switching
and Control
Block
SOSCO
SOSCI
32 kHz LP
Oscillator
Secondary
Oscillator
Stability Detector
Internal LowPower RC
Oscillator (LPRC)
Programmable
Clock Divider System
Clock
2
POST<1:0>
LPRC
FCKSM<1:0>
2
Fail-Safe Clock
Monitor (FSCM)
CF
Oscillator Trap
to Timer1
Preliminary
DS70143C-page 145
dsPIC30F6011A/6012A/6013A/6014A
20.2
Oscillator Configurations
20.2.1
TABLE 20-2:
Oscillator Mode
Oscillator
Source
FOS<2:0>
FPR<4:0>
OSC2 Function
ECIO w/PLL 4x
PLL
I/O
ECIO w/PLL 8x
PLL
I/O
PLL
I/O
FRC w/PLL 4x
PLL
I/O
FRC w/PLL 8x
PLL
I/O
PLL
I/O
XT w/PLL 4x
PLL
OSC2
XT w/PLL 8x
PLL
OSC2
XT w/PLL 16x
PLL
OSC2
HS/2 w/PLL 4x
PLL
OSC2
HS/2 w/PLL 8x
PLL
OSC2
PLL
OSC2
HS/3 w/PLL 4x
PLL
OSC2
HS/3 w/PLL 8x
PLL
OSC2
PLL
OSC2
ECIO
External
I/O
XT
External
OSC2
HS
External
OSC2
EC
External
CLKOUT
ERC
External
CLKOUT
ERCIO
External
I/O
XTL
External
OSC2
LP
Secondary
(Note 1, 2)
FRC
Internal FRC
(Note 1, 2)
Internal LPRC
(Note 1, 2)
LPRC
Note 1:
2:
DS70143C-page 146
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
20.2.2
20.2.5
20.2.3
LP OSCILLATOR CONTROL
20.2.4
TUN<3:0>
Bits
Fin
4 MHz-10 MHz
4 MHz-10 MHz
4 MHz-7.5 MHz
0111
0110
0101
0100
0011
0010
0001
0000
Fout
16 MHz-40 MHz
32 MHz-80 MHz
64 MHz-120 MHz
When a 16x PLL is used, the FRC oscillator must not be tuned to a frequency
greater than 7.5 MHz.
TABLE 20-4:
TABLE 20-3:
Preliminary
1111
1110
1101
1100
1011
1010
1001
1000
FRC TUNING
FRC Frequency
+5.25%
+4.50%
+3.75%
+3.00%
+2.25%
+1.50%
+0.75%
Center Frequency (oscillator is
running at calibrated frequency)
-0.75%
-1.50%
-2.25%
-3.00%
-3.75%
-4.50%
-5.25%
-6.00%
DS70143C-page 147
dsPIC30F6011A/6012A/6013A/6014A
20.2.6
LOW-POWER RC OSCILLATOR
(LPRC)
2.
3.
20.2.7
COSC<2:0> bits are loaded with FRC oscillator selection. This will effectively shut-off the original oscillator
that was trying to start.
Primary
Secondary
Internal FRC
Internal LPRC
DS70143C-page 148
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
20.2.8
PROTECTION AGAINST
ACCIDENTAL WRITES TO OSCCON
20.3
Preliminary
DS70143C-page 149
dsPIC30F6011A/6012A/6013A/6014A
REGISTER 20-1:
U-0
R-y
R-y
R-y
U-0
COSC<2:0>
R/W-y
R/W-y
R/W-y
NOSC<2:0>
bit 15
bit 8
R/W-0
R/W-0
POST<1:0>
R-0
U-0
R/W-0
U-0
R/W-0
R/W-0
LOCK
CF
LPOSCEN
OSWEN
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15
Unimplemented: Read as 0
bit 14-12
bit 11
Unimplemented: Read as 0
bit 10-8
bit 7-6
bit 5
bit 4
Unimplemented: Read as 0
bit 3
bit 2
Unimplemented: Read as 0
bit 1
bit 0
DS70143C-page 150
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
REGISTER 20-2:
U-0
U-0
U-0
U-0
U-0
U-0
U-0
U-0
bit 15
bit 8
U-0
U-0
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
TUN<3:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 15 -4
Unimplemented: Read as 0
bit 3-0
TUN<3:0>: Lower two bits of TUN field. The four bit field specified by TUN<3:0> specifies the user
tuning capability for the internal fast RC oscillator (nominal 7.37 MHz).
0111 = Maximum Frequency
0110 =
0101 =
0100 =
0011 =
0010 =
0001 =
0000 = Center Frequency, Oscillator is running at calibrated frequency
1111 =
1110 =
1101 =
1100 =
1011 =
1010 =
1001 =
1000 = Minimum Frequency
Preliminary
DS70143C-page 151
dsPIC30F6011A/6012A/6013A/6014A
REGISTER 20-3:
U-0
U-0
U-0
U-0
U-0
U-0
U-0
U-0
bit 23
bit 16
R/P
R/P
FCKSM<1:0>
U-0
U-0
U-0
R/P
R/P
R/P
FOS<2:0>
bit 15
bit 8
U-0
U-0
U-0
R/P
R/P
R/P
R/P
R/P
FPR<4:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
bit 23-16
Unimplemented: Read as 0
bit 15-14
bit 13-11
Unimplemented: Read as 0
bit 10-8
bit 7-5
Unimplemented: Read as 0
bit 4-0
FPR<4:0>: Oscillator Selection within Primary Group bits, see Table 20-2.
DS70143C-page 152
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
20.4
Reset
FIGURE 20-2:
RESET
Instruction
Digital
Glitch Filter
MCLR
Sleep or Idle
WDT
Module
POR
VDD Rise
Detect
VDD
Brown-out
Reset
BOR
BOREN
R
SYSRST
Trap Conflict
Illegal Opcode/
Uninitialized W Register
Preliminary
DS70143C-page 153
dsPIC30F6011A/6012A/6013A/6014A
20.4.1
FIGURE 20-3:
MCLR
Internal POR
TOST
OST Time-out
TPWRT
PWRT Time-out
Internal Reset
FIGURE 20-4:
VDD
MCLR
Internal POR
TOST
OST Time-out
TPWRT
PWRT Time-out
Internal Reset
DS70143C-page 154
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 20-5:
VDD
MCLR
Internal POR
TOST
OST Time-out
TPWRT
PWRT Time-out
Internal Reset
20.4.1.1
20.4.2
20.4.1.2
BOR: PROGRAMMABLE
BROWN-OUT RESET
Preliminary
DS70143C-page 155
dsPIC30F6011A/6012A/6013A/6014A
Concurrently, the POR time-out (TPOR) and the PWRT
time-out (TPWRT) will be applied before the internal
Reset is released. If TPWRT = 0 and a crystal oscillator
is being used, then a nominal delay of TFSCM = 100 s
is applied. The total delay in this case is
(TPOR + TFSCM).
FIGURE 20-6:
EXTERNAL POWER-ON
RESET CIRCUIT (FOR
SLOW VDD POWER-UP)
VDD
R
R1
C
MCLR
dsPIC30F
Note:
DS70143C-page 156
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
Table 20-5 shows the Reset conditions for the RCON
register. Since the control bits within the RCON register
are R/W, the information in the table implies that all the
bits are negated prior to the action specified in the
condition column.
TABLE 20-5:
Condition
Power-on Reset
Program
Counter
0x000000
Brown-out Reset
0x000000
0x000000
0x000000
0x000000
0x000000
0x000000
WDT Wake-up
PC + 2
PC + 2(1)
0x000004
Trap Reset
0x000000
0x000000
Note 1:
When the wake-up is due to an enabled interrupt, the PC is loaded with the corresponding interrupt vector.
TABLE 20-6:
Condition
Program
Counter
Power-on Reset
Brown-out Reset
0x000000
0x000000
0
u
0
u
0
u
0
u
0
u
0
u
0
u
1
0
1
1
0x000000
0x000000
0x000000
0x000000
0x000000
PC + 2
PC + 2(1)
u
u
u
u
u
u
u
u
1
0
u
u
u
0
u
u
0
1
1
u
1
0
u
u
0
0
1
1
u
u
u
u
u
u
u
u
0x000004
0x000000
0x000000
u
1
u
u
u
1
u
u
u
u
u
u
u
u
u
u
u
u
u
u
u
u
u
u
u
u
u
Note
1: When the wake-up is due to an enabled interrupt, the PC is loaded with the corresponding interrupt vector.
Preliminary
DS70143C-page 157
dsPIC30F6011A/6012A/6013A/6014A
20.5
20.5.1
20.7
20.5.2
20.6
20.7.1
DS70143C-page 158
SLEEP MODE
Low-Voltage Detect
Power-Saving Modes
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
Any interrupt that is individually enabled (using the
corresponding IE bit) and meets the prevailing priority
level will be able to wake-up the processor. The processor will process the interrupt and branch to the ISR. The
Sleep status bit in RCON register is set upon wake-up.
Note:
20.7.2
IDLE MODE
Any Reset, other than POR, will set the Idle status bit.
On a POR, the Idle bit is cleared.
If Watchdog Timer is enabled, then the processor will
wake-up from Idle mode upon WDT time-out. The Idle
and WDTO status bits are both set.
Unlike wake-up from Sleep, there are no time delays
involved in wake-up from Idle.
20.8
2.
3.
4.
5.
6.
Preliminary
DS70143C-page 159
dsPIC30F6011A/6012A/6013A/6014A
20.9
The Peripheral Module Disable (PMD) registers provide a method to disable a peripheral module by stopping all clock sources supplied to that module. When a
peripheral is disabled via the appropriate PMD control
bit, the peripheral is in a minimum power consumption
state. The control and status registers associated with
the peripheral will also be disabled so writes to those
registers will have no effect and read values will be
invalid.
A peripheral module will only be enabled if both the
associated bit in the PMD register is cleared and the
peripheral is supported by the specific dsPIC DSC variant. If the peripheral is present in the device, it is
enabled in the PMD register by default.
Note:
If a PMD bit is set, the corresponding module is disabled after a delay of 1 instruction
cycle. Similarly, if a PMD bit is cleared, the
corresponding module is enabled after a
delay of 1 instruction cycle (assuming the
module control registers are already
configured to enable module operation).
2.
DS70143C-page 160
Preliminary
SFR
Name
RCON
Addr
.
Bit 14
Bit 13
Bit 12
Bit 11
OSCCON 0742
OSCTUN 0744
COSC<2:0>
Bit 10
T2MD
T1MD
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
EXTR
SWR
SWDTEN
WDTO
SLEEP
IDLE
BOR
POR
LOCK
CF
NOSC<2:0>
0770
T5MD
T4MD
T3MD
PMD2
0772 IC8MD
IC7MD
POST<1:0>
DCIMD
I2CMD
IC2MD
IC1MD
OC8MD OC7MD
U2MD
U1MD
OC6MD
SPI2MD SPI1MD
Reset State
Depends on type of Reset.
C2MD
C1MD
ADCMD
OC2MD
OC1MD
Refer to dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
TABLE 20-8:
File Name
Bit 8
LVDL<3:0>
PMD1
Note:
Bit 9
Bits 23-16
Bit 15
Bit 14
Bit 13
Bit 12
Bit 11
Bit 10
Bit 9
Bit 8
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Preliminary
FOSC
F80000
FWDT
F80002
FWDTEN
FWPSA<1:0>
FBORPOR
F80004
MCLREN
BOREN
BORV<1:0>
FBS
F80006
RBS<1:0>
EBS
BSS<2:0>
FSS
F80008
RSS<1:0>
SSS<2:0>
FGS
F8000A
Note:
FCKSM<1:0>
FOS<2:0>
ESS<1:0>
Refer to dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
Bit 1
Bit 0
FPR<4:0>
FWPSB<3:0>
FPWRT<1:0>
GSS<1:0>
BWRP
SWRP
GWRP
DS70143C-page 161
dsPIC30F6011A/6012A/6013A/6014A
TABLE 20-7:
dsPIC30F6011A/6012A/6013A/6014A
NOTES:
DS70143C-page 162
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
21.0
Preliminary
DS70143C-page 163
dsPIC30F6011A/6012A/6013A/6014A
All instructions are a single word, except for certain
double word instructions, which were made double
word instructions so that all the required information is
available in these 48 bits. In the second word, the
8 MSbs are 0s. If this second word is executed as an
instruction (by itself), it will execute as a NOP.
Most single-word instructions are executed in a single
instruction cycle, unless a conditional test is true or the
Program Counter is changed as a result of the instruction. In these cases, the execution takes two instruction
cycles with the additional instruction cycle(s) executed
as a NOP. Notable exceptions are the BRA (unconditional/computed branch), indirect CALL/GOTO, all table
reads and writes, and RETURN/RETFIE instructions,
TABLE 21-1:
Field
#text
Description
Means literal defined by text
(text)
[text]
{ }
<n:m>
.b
.d
.S
.w
Acc
AWB
bit4
C, DC, N, OV, Z
MCU status bits: Carry, Digit Carry, Negative, Overflow, Sticky Zero
Expr
lit1
lit4
lit5
lit8
lit10
10-bit unsigned literal {0...255} for Byte mode, {0:1023} for Word mode
lit14
lit16
lit23
None
DSP status bits: ACCA Overflow, ACCB Overflow, ACCA Saturate, ACCB Saturate
PC
Program Counter
Slit10
Slit16
Slit6
DS70143C-page 164
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
TABLE 21-1:
Field
Description
Wb
Wd
Wdo
Destination W register
{ Wnd, [Wnd], [Wnd++], [Wnd--], [++Wnd], [--Wnd], [Wnd+Wb] }
Wm,Wn
Wm*Wm
Wm*Wn
Wn
Wnd
Wns
WREG
Ws
Wso
Source W register
{ Wns, [Wns], [Wns++], [Wns--], [++Wns], [--Wns], [Wns+Wb] }
Wx
Wxd
Wy
Wyd
Preliminary
DS70143C-page 165
dsPIC30F6011A/6012A/6013A/6014A
TABLE 21-2:
Base
Instr #
Assembly
Mnemonic
ADD
ADDC
AND
ASR
BCLR
BRA
Description
# of
# of
Words Cycles
Status Flags
Affected
ADD
Acc
Add Accumulators
ADD
f = f + WREG
OA,OB,SA,SB
C,DC,N,OV,Z
ADD
f,WREG
WREG = f + WREG
C,DC,N,OV,Z
ADD
#lit10,Wn
Wd = lit10 + Wd
C,DC,N,OV,Z
ADD
Wb,Ws,Wd
Wd = Wb + Ws
C,DC,N,OV,Z
ADD
Wb,#lit5,Wd
Wd = Wb + lit5
C,DC,N,OV,Z
OA,OB,SA,SB
ADD
Wso,#Slit4,Acc
ADDC
f = f + WREG + (C)
C,DC,N,OV,Z
ADDC
f,WREG
C,DC,N,OV,Z
ADDC
#lit10,Wn
Wd = lit10 + Wd + (C)
C,DC,N,OV,Z
ADDC
Wb,Ws,Wd
Wd = Wb + Ws + (C)
C,DC,N,OV,Z
ADDC
Wb,#lit5,Wd
Wd = Wb + lit5 + (C)
C,DC,N,OV,Z
AND
f = f .AND. WREG
N,Z
AND
f,WREG
N,Z
AND
#lit10,Wn
Wd = lit10 .AND. Wd
N,Z
AND
Wb,Ws,Wd
Wd = Wb .AND. Ws
N,Z
AND
Wb,#lit5,Wd
Wd = Wb .AND. lit5
N,Z
ASR
C,N,OV,Z
ASR
f,WREG
C,N,OV,Z
ASR
Ws,Wd
C,N,OV,Z
ASR
Wb,Wns,Wnd
N,Z
ASR
Wb,#lit5,Wnd
N,Z
BCLR
f,#bit4
Bit Clear f
None
BCLR
Ws,#bit4
Bit Clear Ws
None
BRA
C,Expr
Branch if Carry
1 (2)
None
BRA
GE,Expr
1 (2)
None
BRA
GEU,Expr
1 (2)
None
BRA
GT,Expr
1 (2)
None
BRA
GTU,Expr
1 (2)
None
BRA
LE,Expr
1 (2)
None
BRA
LEU,Expr
1 (2)
None
BRA
LT,Expr
1 (2)
None
BRA
LTU,Expr
1 (2)
None
BRA
N,Expr
Branch if Negative
1 (2)
None
BRA
NC,Expr
1 (2)
None
BRA
NN,Expr
1 (2)
None
BRA
NOV,Expr
1 (2)
None
BRA
NZ,Expr
1 (2)
None
BRA
OA,Expr
1 (2)
None
BRA
OB,Expr
1 (2)
None
BRA
OV,Expr
Branch if Overflow
1 (2)
None
BRA
SA,Expr
1 (2)
None
BRA
SB,Expr
1 (2)
None
BRA
Expr
Branch Unconditionally
None
BRA
Z,Expr
Branch if Zero
1 (2)
None
BRA
Wn
Computed Branch
None
BSET
BSET
f,#bit4
Bit Set f
None
BSET
Ws,#bit4
Bit Set Ws
None
BSW
BSW.C
Ws,Wb
None
BSW.Z
Ws,Wb
None
DS70143C-page 166
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
TABLE 21-2:
Base
Instr #
Assembly
Mnemonic
BTG
10
11
12
13
BTSC
BTSS
BTST
BTSTS
Description
# of
# of
Words Cycles
Status Flags
Affected
BTG
f,#bit4
Bit Toggle f
None
BTG
Ws,#bit4
Bit Toggle Ws
None
BTSC
f,#bit4
1
(2 or 3)
None
BTSC
Ws,#bit4
1
(2 or 3)
None
BTSS
f,#bit4
1
(2 or 3)
None
BTSS
Ws,#bit4
1
(2 or 3)
None
BTST
f,#bit4
Bit Test f
BTST.C
Ws,#bit4
Bit Test Ws to C
BTST.Z
Ws,#bit4
Bit Test Ws to Z
BTST.C
Ws,Wb
C
Z
BTST.Z
Ws,Wb
BTSTS
f,#bit4
BTSTS.C
Ws,#bit4
BTSTS.Z
Ws,#bit4
14
CALL
CALL
lit23
Call subroutine
None
CALL
Wn
None
15
CLR
CLR
f = 0x0000
None
CLR
WREG
WREG = 0x0000
None
CLR
Ws
Ws = 0x0000
None
CLR
Acc,Wx,Wxd,Wy,Wyd,AWB
Clear Accumulator
OA,OB,SA,SB
16
CLRWDT
CLRWDT
WDTO,Sleep
17
COM
COM
f=f
N,Z
COM
f,WREG
WREG = f
N,Z
COM
Ws,Wd
Wd = Ws
N,Z
CP
C,DC,N,OV,Z
CP
Wb,#lit5
C,DC,N,OV,Z
CP
Wb,Ws
C,DC,N,OV,Z
CP0
C,DC,N,OV,Z
CP0
Ws
C,DC,N,OV,Z
CPB
C,DC,N,OV,Z
CPB
Wb,#lit5
C,DC,N,OV,Z
CPB
Wb,Ws
C,DC,N,OV,Z
18
19
20
CP
CP0
CPB
21
CPSEQ
CPSEQ
Wb, Wn
1
(2 or 3)
None
22
CPSGT
CPSGT
Wb, Wn
1
(2 or 3)
None
23
CPSLT
CPSLT
Wb, Wn
1
(2 or 3)
None
24
CPSNE
CPSNE
Wb, Wn
1
(2 or 3)
None
25
DAW
DAW
Wn
Wn = decimal adjust Wn
26
DEC
DEC
f = f -1
C,DC,N,OV,Z
DEC
f,WREG
WREG = f -1
C,DC,N,OV,Z
DEC
Ws,Wd
Wd = Ws - 1
C,DC,N,OV,Z
DEC2
f = f -2
C,DC,N,OV,Z
DEC2
f,WREG
WREG = f -2
C,DC,N,OV,Z
DEC2
Ws,Wd
Wd = Ws - 2
C,DC,N,OV,Z
DISI
#lit14
None
27
28
DEC2
DISI
Preliminary
DS70143C-page 167
dsPIC30F6011A/6012A/6013A/6014A
TABLE 21-2:
Base
Instr #
Assembly
Mnemonic
29
DIV
Description
# of
# of
Words Cycles
Status Flags
Affected
DIV.S
Wm,Wn
18
DIV.SD
Wm,Wn
18
N,Z,C,OV
N,Z,C,OV
DIV.U
Wm,Wn
18
N,Z,C,OV
DIV.UD
Wm,Wn
18
N,Z,C,OV
18
N,Z,C,OV
30
DIVF
DIVF
31
DO
DO
#lit14,Expr
None
DO
Wn,Expr
None
Wm,Wn
32
ED
ED
Wm*Wm,Acc,Wx,Wy,Wxd
OA,OB,OAB,
SA,SB,SAB
33
EDAC
EDAC
Wm*Wm,Acc,Wx,Wy,Wxd
Euclidean Distance
OA,OB,OAB,
SA,SB,SAB
34
EXCH
EXCH
Wns,Wnd
None
35
FBCL
FBCL
Ws,Wnd
36
FF1L
FF1L
Ws,Wnd
37
FF1R
FF1R
Ws,Wnd
38
GOTO
GOTO
Expr
Go to address
None
GOTO
Wn
Go to indirect
None
INC
f=f+1
C,DC,N,OV,Z
INC
f,WREG
WREG = f + 1
C,DC,N,OV,Z
INC
Ws,Wd
Wd = Ws + 1
C,DC,N,OV,Z
INC2
f=f+2
C,DC,N,OV,Z
INC2
f,WREG
WREG = f + 2
C,DC,N,OV,Z
C,DC,N,OV,Z
39
40
41
INC
INC2
IOR
INC2
Ws,Wd
Wd = Ws + 2
IOR
f = f .IOR. WREG
N,Z
IOR
f,WREG
N,Z
IOR
#lit10,Wn
Wd = lit10 .IOR. Wd
N,Z
IOR
Wb,Ws,Wd
Wd = Wb .IOR. Ws
N,Z
IOR
Wb,#lit5,Wd
Wd = Wb .IOR. lit5
N,Z
OA,OB,OAB,
SA,SB,SAB
42
LAC
LAC
Wso,#Slit4,Acc
Load Accumulator
43
LNK
LNK
#lit14
None
44
LSR
LSR
C,N,OV,Z
LSR
f,WREG
C,N,OV,Z
LSR
Ws,Wd
C,N,OV,Z
LSR
Wb,Wns,Wnd
N,Z
LSR
Wb,#lit5,Wnd
N,Z
MAC
Wm*Wn,Acc,Wx,Wxd,Wy,Wyd
,
AWB
OA,OB,OAB,
SA,SB,SAB
MAC
Wm*Wm,Acc,Wx,Wxd,Wy,Wyd
OA,OB,OAB,
SA,SB,SAB
MOV
f,Wn
Move f to Wn
None
MOV
Move f to f
N,Z
MOV
f,WREG
Move f to WREG
N,Z
MOV
#lit16,Wn
None
MOV.b
#lit8,Wn
None
MOV
Wn,f
Move Wn to f
None
MOV
Wso,Wdo
Move Ws to Wd
None
MOV
WREG,f
45
46
MAC
MOV
MOV.D
MOV.D
47
MOVSAC
MOVSAC
DS70143C-page 168
Move WREG to f
N,Z
Wns,Wd
None
Ws,Wnd
None
None
Acc,Wx,Wxd,Wy,Wyd,AWB
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
TABLE 21-2:
Base
Instr #
Assembly
Mnemonic
48
MPY
Description
# of
# of
Words Cycles
Status Flags
Affected
MPY
Wm*Wn,Acc,Wx,Wxd,Wy,Wyd
Multiply Wm by Wn to Accumulator
OA,OB,OAB,
SA,SB,SAB
MPY
Wm*Wm,Acc,Wx,Wxd,Wy,Wyd
Square Wm to Accumulator
OA,OB,OAB,
SA,SB,SAB
49
MPY.N
MPY.N
Wm*Wn,Acc,Wx,Wxd,Wy,Wyd
None
50
MSC
MSC
Wm*Wm,Acc,Wx,Wxd,Wy,Wyd
,
AWB
OA,OB,OAB,
SA,SB,SAB
51
MUL
MUL.SS
Wb,Ws,Wnd
None
MUL.SU
Wb,Ws,Wnd
None
MUL.US
Wb,Ws,Wnd
None
MUL.UU
Wb,Ws,Wnd
None
MUL.SU
Wb,#lit5,Wnd
None
MUL.UU
Wb,#lit5,Wnd
None
52
53
54
NEG
NOP
POP
MUL
W3:W2 = f * WREG
None
NEG
Acc
Negate Accumulator
OA,OB,OAB,
SA,SB,SAB
NEG
f=f+1
C,DC,N,OV,Z
NEG
f,WREG
WREG = f + 1
C,DC,N,OV,Z
NEG
Ws,Wd
Wd = Ws + 1
C,DC,N,OV,Z
NOP
No Operation
None
NOPR
No Operation
None
POP
None
POP
Wdo
None
POP.D
Wnd
None
All
None
PUSH
Wso
None
PUSH.D
Wns
None
None
POP.S
55
PUSH
PUSH
PUSH.S
56
PWRSAV
PWRSAV
WDTO,Sleep
57
RCALL
RCALL
Expr
Relative Call
None
RCALL
Wn
Computed Call
None
#lit1
58
REPEAT
REPEAT
#lit14
None
REPEAT
Wn
None
59
RESET
RESET
None
60
RETFIE
RETFIE
3 (2)
None
61
RETLW
RETLW
3 (2)
None
62
RETURN
RETURN
3 (2)
None
63
RLC
RLC
C,N,Z
RLC
f,WREG
C,N,Z
RLC
Ws,Wd
C,N,Z
RLNC
N,Z
RLNC
f,WREG
N,Z
64
65
RLNC
RRC
#lit10,Wn
RLNC
Ws,Wd
N,Z
RRC
C,N,Z
RRC
f,WREG
C,N,Z
RRC
Ws,Wd
C,N,Z
Preliminary
DS70143C-page 169
dsPIC30F6011A/6012A/6013A/6014A
TABLE 21-2:
Base
Instr #
Assembly
Mnemonic
66
RRNC
Description
# of
# of
Words Cycles
Status Flags
Affected
RRNC
N,Z
RRNC
f,WREG
N,Z
RRNC
Ws,Wd
N,Z
67
SAC
SAC
Acc,#Slit4,Wdo
Store Accumulator
None
SAC.R
Acc,#Slit4,Wdo
None
68
SE
SE
Ws,Wnd
Wnd = sign-extended Ws
C,N,Z
69
SETM
SETM
f = 0xFFFF
None
SETM
WREG
WREG = 0xFFFF
None
SETM
Ws
Ws = 0xFFFF
None
SFTAC
Acc,Wn
OA,OB,OAB,
SA,SB,SAB
SFTAC
Acc,#Slit6
OA,OB,OAB,
SA,SB,SAB
SL
f = Left Shift f
C,N,OV,Z
SL
f,WREG
C,N,OV,Z
SL
Ws,Wd
Wd = Left Shift Ws
C,N,OV,Z
SL
Wb,Wns,Wnd
N,Z
SL
Wb,#lit5,Wnd
N,Z
SUB
Acc
Subtract Accumulators
OA,OB,OAB,
SA,SB,SAB
SUB
f = f - WREG
C,DC,N,OV,Z
SUB
f,WREG
WREG = f - WREG
C,DC,N,OV,Z
SUB
#lit10,Wn
Wn = Wn - lit10
C,DC,N,OV,Z
SUB
Wb,Ws,Wd
Wd = Wb - Ws
C,DC,N,OV,Z
SUB
Wb,#lit5,Wd
Wd = Wb - lit5
C,DC,N,OV,Z
SUBB
f = f - WREG - (C)
C,DC,N,OV,Z
SUBB
f,WREG
C,DC,N,OV,Z
SUBB
#lit10,Wn
Wn = Wn - lit10 - (C)
C,DC,N,OV,Z
SUBB
Wb,Ws,Wd
Wd = Wb - Ws - (C)
C,DC,N,OV,Z
70
71
72
73
74
75
76
SFTAC
SL
SUB
SUBB
SUBR
SUBBR
SWAP
SUBB
Wb,#lit5,Wd
Wd = Wb - lit5 - (C)
SUBR
f = WREG - f
C,DC,N,OV,Z
SUBR
f,WREG
WREG = WREG - f
C,DC,N,OV,Z
SUBR
Wb,Ws,Wd
Wd = Ws - Wb
C,DC,N,OV,Z
SUBR
Wb,#lit5,Wd
Wd = lit5 - Wb
C,DC,N,OV,Z
SUBBR
f = WREG - f - (C)
C,DC,N,OV,Z
SUBBR
f,WREG
C,DC,N,OV,Z
C,DC,N,OV,Z
SUBBR
Wb,Ws,Wd
Wd = Ws - Wb - (C)
C,DC,N,OV,Z
SUBBR
Wb,#lit5,Wd
Wd = lit5 - Wb - (C)
C,DC,N,OV,Z
SWAP.b
Wn
Wn = nibble swap Wn
None
SWAP
Wn
Wn = byte swap Wn
None
None
77
TBLRDH
TBLRDH
Ws,Wd
78
TBLRDL
TBLRDL
Ws,Wd
Read Prog<15:0> to Wd
None
79
TBLWTH
TBLWTH
Ws,Wd
None
80
TBLWTL
TBLWTL
Ws,Wd
Write Ws to Prog<15:0>
None
81
ULNK
ULNK
None
82
XOR
XOR
f = f .XOR. WREG
N,Z
XOR
f,WREG
N,Z
XOR
#lit10,Wn
Wd = lit10 .XOR. Wd
N,Z
XOR
Wb,Ws,Wd
Wd = Wb .XOR. Ws
N,Z
XOR
Wb,#lit5,Wd
Wd = Wb .XOR. lit5
N,Z
ZE
Ws,Wnd
Wnd = Zero-extend Ws
C,Z,N
83
ZE
DS70143C-page 170
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
22.0
DEVELOPMENT SUPPORT
22.1
Preliminary
DS70143C-page 171
dsPIC30F6011A/6012A/6013A/6014A
22.2
MPASM Assembler
22.5
22.6
22.3
22.4
DS70143C-page 172
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
22.7
22.9
22.8
Preliminary
DS70143C-page 173
dsPIC30F6011A/6012A/6013A/6014A
22.11 PICSTART Plus Development
Programmer
DS70143C-page 174
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
23.0
ELECTRICAL CHARACTERISTICS
This section provides an overview of dsPIC30F electrical characteristics. Additional information will be provided in future
revisions of this document as it becomes available.
For detailed information about the dsPIC30F architecture and core, refer to dsPIC30F Family Reference Manual
(DS70046).
Absolute maximum ratings for the dsPIC30F family are listed below. Exposure to these maximum rating conditions for
extended periods may affect device reliability. Functional operation of the device at these or any other conditions above
the parameters indicated in the operation listings of this specification is not implied.
Stresses above those listed under Absolute Maximum Ratings may cause permanent damage to the
device. This is a stress rating only and functional operation of the device at those or any other conditions above those
indicated in the operation listings of this specification is not implied. Exposure to maximum rating conditions for
extended periods may affect device reliability.
23.1
DC Characteristics
TABLE 23-1:
VDD Range
Temp Range
dsPIC30F601xA-30I
dsPIC30F601xA-20E
4.5-5.5V
-40C to 85C
30
4.5-5.5V
-40C to 125C
20
3.0-3.6V
-40C to 85C
20
3.0-3.6V
-40C to 125C
15
2.5-3.0V
-40C to 85C
10
Preliminary
DS70143C-page 175
dsPIC30F6011A/6012A/6013A/6014A
TABLE 23-2:
Symbol
Min
TJ
TA
Typ
Max
Unit
-40
+125
-40
+85
TJ
-40
+150
TA
-40
+125
dsPIC30F601xA-30I
dsPIC30F601xA-20E
Operating Junction Temperature Range
Operating Ambient Temperature Range
Power Dissipation:
Internal chip power dissipation:
P INT = V D D ( ID D IO H)
I/O Pin power dissipation:
P I/O = ( { V D D V O H } IOH ) + ( VO L I O L )
Maximum Allowed Power Dissipation
TABLE 23-3:
PD
PINT + PI/O
PDMAX
(TJ - TA)/JA
Symbol
JA
JA
JA
JA
Max
Unit
Notes
34
C/W
34
C/W
39
C/W
39
C/W
Junction to ambient thermal resistance, Theta-ja (JA) numbers are achieved by package simulations.
TABLE 23-4:
DC CHARACTERISTICS
Param
No.
Typ
Symbol
Characteristic
Min
Typ(1)
Max
Units
Conditions
Operating Voltage(2)
DC10
VDD
Supply Voltage
2.5
5.5
Industrial temperature
DC11
VDD
Supply Voltage
3.0
5.5
Extended temperature
(3)
DC12
VDR
1.5
DC16
VPOR
VSS
DC17
SVDD
0.05
Note 1:
2:
3:
Data in Typ column is at 5V, 25C unless otherwise stated. Parameters are for design guidance only and
are not tested.
These parameters are characterized but not tested in manufacturing.
This is the limit to which VDD can be lowered without losing RAM data.
DS70143C-page 176
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
TABLE 23-5:
DC CHARACTERISTICS
Parameter
No.
Typical(1)
Max
Units
Conditions
3.1
3.2
6
6
mA
mA
25C
85C
DC31c
DC31e
3.1
5.7
6
9
mA
mA
125C
25C
DC31f
DC31g
5.5
5.5
9
9
mA
mA
85C
125C
DC30a
DC30b
10
10
15
15
mA
mA
25C
85C
DC30c
DC30e
10
17
15
26
mA
mA
125C
25C
DC30f
DC30g
17
17
26
26
mA
mA
85C
125C
DC23a
DC23b
19
20
30
30
mA
mA
25C
85C
DC23c
DC23e
20
32
30
50
mA
mA
125C
25C
DC23f
DC23g
32
33
50
50
mA
mA
85C
125C
DC24a
DC24b
45
45
68
68
mA
mA
25C
85C
DC24c
DC24e
46
74
68
105
mA
mA
125C
25C
DC24f
DC24g
74
75
105
105
mA
mA
85C
125C
DC27a
DC27b
84
84
105
105
mA
mA
25C
85C
DC27d
DC27e
140
138
180
180
mA
mA
25C
85C
DC27f
DC29a
138
203
180
250
mA
mA
125C
25C
3.3V
0.128 MIPS
LPRC (512 kHz)
5V
3.3V
(1.8 MIPS)
FRC (7.37 MHz)
5V
3.3V
4 MIPS
5V
3.3V
10 MIPS
5V
3.3V
20 MIPS
5V
5V
30 MIPS
DC29b
202
250
mA
85C
Note 1: Data in Typ column is at 5V, 25C unless otherwise stated. Parameters are for design guidance only and
are not tested.
2: The supply current is mainly a function of the operating voltage and frequency. Other factors such as I/O
pin loading and switching rate, oscillator type, internal code execution pattern and temperature also have
an impact on the current consumption. The test conditions for all IDD measurements are as follows: OSC1
driven with external square wave from rail to rail. All I/O pins are configured as Inputs and pulled to VDD.
MCLR = VDD, WDT, FSCM, LVD and BOR are disabled. CPU, SRAM, Program Memory and Data Memory
are operational. No peripheral modules are operating.
Preliminary
DS70143C-page 177
dsPIC30F6011A/6012A/6013A/6014A
TABLE 23-6:
DC CHARACTERISTICS
Parameter
No.
Typical(1)
Max
Units
Conditions
2.5
2.6
5
5
mA
mA
25C
85C
DC51c
DC51e
2.6
5.5
5
8
mA
mA
125C
25C
DC51f
DC51g
5.3
5.2
8
8
mA
mA
85C
125C
DC50a
DC50b
6.7
6.7
13
13
mA
mA
25C
85C
DC50c
DC50e
6.8
8.5
13
19
mA
mA
125C
25C
DC50f
DC50g
8.5
8.6
19
19
mA
mA
85C
125C
DC43a
DC43b
8.7
8.7
20
20
mA
mA
25C
85C
DC43c
DC43e
8.8
14
20
31
mA
mA
125C
25C
DC43f
DC43g
14
14
31
31
mA
mA
85C
125C
DC44a
DC44b
16
17
37
37
mA
mA
25C
85C
DC44c
DC44e
17
28
37
62
mA
mA
125C
25C
DC44f
DC44g
28
28
62
62
mA
mA
85C
125C
DC47a
DC47b
28
29
65
65
mA
mA
25C
85C
DC47d
DC47e
48
49
110
110
mA
mA
25C
85C
DC47f
DC49a
49
69
110
150
mA
mA
125C
25C
3.3V
0.128 MIPS
LPRC (512 kHz)
5V
3.3V
(1.8 MIPS)
FRC (7.37 MHz)
5V
3.3V
4 MIPS
5V
3.3V
10 MIPS
5V
3.3V
20 MIPS
5V
5V
30 MIPS
DC49b
70
150
mA
85C
Note 1: Data in Typ column is at 5V, 25C unless otherwise stated. Parameters are for design guidance only and
are not tested.
2: Base IIDLE current is measured with Core off, Clock on and all modules turned off.
DS70143C-page 178
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
TABLE 23-7:
DC CHARACTERISTICS
Parameter
No.
Typical
Max
Units
Conditions
0.5
25C
DC60b
40
85C
DC60c
24
65
125C
DC60e
0.7
25C
DC60f
55
85C
DC60g
35
90
125C
DC61a
20
25C
DC61b
20
85C
DC61c
20
125C
DC61e
18
40
25C
DC61f
16
40
85C
DC61g
15
40
125C
DC62a
10
25C
DC62b
10
85C
DC62c
10
125C
DC62e
15
25C
DC62f
15
85C
DC62g
15
125C
DC63a
30
55
25C
DC63b
34
55
85C
DC63c
35
55
125C
DC63e
36
60
25C
DC63f
39
60
85C
DC63g
40
60
125C
DC66a
20
35
25C
DC66b
22
35
85C
DC66c
23
35
125C
DC66e
24
40
25C
DC66f
26
40
85C
DC66g
26
40
125C
3.3V
Base Power Down Current(1)
5V
3.3V
Watchdog Timer Current: IWDT(2)
5V
3.3V
Timer 1 w/32 kHz Crystal: ITI32(2)
5V
3.3V
BOR On: IBOR(2)
5V
3.3V
Low Voltage Detect: ILVD(2)
5V
Note 1: Base IPD is measured with all peripherals and clocks shut down. All I/Os are configured as inputs and
pulled high. LVD, BOR, WDT, etc. are all switched off.
2: The current is the additional current consumed when the module is enabled. This current should be
added to the base IPD current.
Preliminary
DS70143C-page 179
dsPIC30F6011A/6012A/6013A/6014A
TABLE 23-8:
DC CHARACTERISTICS
Param
Symbol
No.
Min
Typ(1)
Max
Units
I/O pins:
with Schmitt Trigger buffer
VSS
0.2 VDD
DI15
MCLR
VSS
0.2 VDD
DI16
VSS
0.2 VDD
VIL
DI10
Characteristic
Conditions
mode)(3)
DI17
OSC1 (in RC
VSS
0.3 VDD
DI18
SDA, SCL
VSS
0.3 VDD
SMbus disabled
SDA, SCL
VSS
0.2 VDD
SMbus enabled
DI19
VIH
DI20
I/O pins:
with Schmitt Trigger buffer
0.8 VDD
VDD
DI25
MCLR
0.8 VDD
VDD
DI26
VDD
DI27
0.9 VDD
VDD
DI28
SDA, SCL
0.7 VDD
VDD
SMbus disabled
DI29
SDA, SCL
0.8 VDD
VDD
SMbus enabled
50
250
400
ICNPU
CNXX Pull-up
Current(2)
DI30
IIL
Input Leakage
Current(2)(4)(5)
DI50
I/O ports
0.01
DI51
0.50
DI55
MCLR
0.05
DI56
OSC1
0.05
Note 1:
2:
3:
4:
5:
Data in Typ column is at 5V, 25C unless otherwise stated. Parameters are for design guidance only and
are not tested.
These parameters are characterized but not tested in manufacturing.
In RC oscillator configuration, the OSC1/CLKl pin is a Schmitt Trigger input. It is not recommended that
the dsPIC30F device be driven with an external clock while in RC mode.
The leakage current on the MCLR pin is strongly dependent on the applied voltage level. The specified
levels represent normal operating conditions. Higher leakage current may be measured at different input
voltages.
Negative current is defined as current sourced by the pin.
DS70143C-page 180
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
TABLE 23-9:
DC CHARACTERISTICS
Param
Symbol
No.
VOL
Characteristic
Min
Typ(1)
Max
Units
0.6
Conditions
DO10
I/O ports
TBD
DO16
OSC2/CLKOUT
0.6
TBD
VOH
DO20
I/O ports
VDD 0.7
TBD
DO26
OSC2/CLKOUT
VDD 0.7
TBD
COSC2
OSC2/SOSC2 pin
15
pF
DO56
CIO
50
pF
RC or EC Osc mode
DO58
CB
SCL, SDA
400
pF
In I2C mode
FIGURE 23-1:
LV10
LVDIF
(LVDIF set by hardware)
Preliminary
DS70143C-page 181
dsPIC30F6011A/6012A/6013A/6014A
TABLE 23-10: ELECTRICAL CHARACTERISTICS: LVDL
Standard Operating Conditions: 2.5V to 5.5V
(unless otherwise stated)
Operating temperature -40C TA +85C for Industrial
-40C TA +125C for Extended
DC CHARACTERISTICS
Param
No.
LV10
Characteristic(1)
Symbol
VPLVD
Min
Typ
Max
Units
LVDL = 0000(2)
LVDL = 0001(2)
0010(2)
LVDL = 0011(2)
LVDL = 0100
2.50
2.65
LVDL = 0101
2.70
2.86
LVDL = 0110
2.80
2.97
LVDL = 0111
3.00
3.18
LVDL = 1000
3.30
3.50
LVDL = 1001
3.50
3.71
LVDL = 1010
3.60
3.82
LVDL = 1011
3.80
4.03
LVDL = 1100
4.00
4.24
LVDL = 1101
4.20
4.45
LVDL = 1110
4.50
4.77
LVDL = 1111
LVDL =
LV15
Note 1:
2:
VLVDIN
Conditions
FIGURE 23-2:
BO10
(Device in Brown-out Reset)
BO15
DS70143C-page 182
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
TABLE 23-11: ELECTRICAL CHARACTERISTICS: BOR
Standard Operating Conditions: 2.5V to 5.5V
(unless otherwise stated)
Operating temperature -40C TA +85C for Industrial
-40C TA +125C for Extended
DC CHARACTERISTICS
Param
No.
BO10
Symbol
VBOR
Min
Typ(1)
Max
Units
BORV = 11(3)
BORV = 10
2.6
2.71
Characteristic
BOR Voltage(2) on
VDD transition high to
low
BORV = 01
4.1
4.4
BORV = 00
4.58
4.73
mV
Conditions
Not in operating
range
BO15
VBHYS
Note 1:
Data in Typ column is at 5V, 25C unless otherwise stated. Parameters are for design guidance only and
are not tested.
These parameters are characterized but not tested in manufacturing.
11 values not in usable operating range.
2:
3:
DC CHARACTERISTICS
Param
No.
Symbol
Characteristic
Min
Typ(1)
Max
Units
Conditions
D120
ED
Byte Endurance
100K
1M
E/W
D121
VDRW
VMIN
5.5
D122
TDEW
ms
D123
TRETD
Characteristic Retention
40
100
Year
D124
IDEW
10
30
mA
Row Erase
EP
Cell Endurance
10K
100K
E/W
D131
VPR
VMIN
5.5
-40C TA +85C
VMIN = Minimum operating
voltage
D132
VEB
4.5
5.5
D133
VPEW
3.0
5.5
D134
TPEW
ms
D135
TRETD
Characteristic Retention
40
100
Year
D136
TEB
ms
D137
IPEW
10
30
mA
Row Erase
D138
IEB
10
30
mA
Bulk Erase
Note 1:
2:
Preliminary
DS70143C-page 183
dsPIC30F6011A/6012A/6013A/6014A
23.2
The information contained in this section defines dsPIC30F AC characteristics and timing parameters.
AC CHARACTERISTICS
FIGURE 23-3:
VDD/2
CL
Pin
RL
VSS
CL
Pin
RL = 464
CL = 50 pF for all pins except OSC2
5 pF for OSC2 output
VSS
FIGURE 23-4:
Q1
Q2
Q3
Q4
Q1
OSC1
OS20
OS30
OS25
OS30
OS31
OS31
CLKOUT
OS40
DS70143C-page 184
Preliminary
OS41
dsPIC30F6011A/6012A/6013A/6014A
TABLE 23-14: EXTERNAL CLOCK TIMING REQUIREMENTS
Standard Operating Conditions: 2.5V to 5.5V
(unless otherwise stated)
Operating temperature -40C TA +85C for Industrial
-40C TA +125C for Extended
AC CHARACTERISTICS
Param
No.
OS10
Symbol
FOSC
Characteristic
External CLKIN Frequency(2)
(External clocks allowed only
in EC mode)
Oscillator Frequency(2)
Min
Typ(1)
Max
Units
Conditions
DC
4
4
4
40
10
10
7.5(3)
MHz
MHz
MHz
MHz
EC
EC with 4x PLL
EC with 8x PLL
EC with 16x PLL
DC
0.4
4
4
4
4
10
10
10
10
12(4)
12(4)
12(4)
32.768
4
4
10
10
10
7.5(3)
25
20(4)
20(4)
15(3)
25
25
22.5(3)
MHz
MHz
MHz
MHz
MHz
MHz
MHz
MHz
MHz
MHz
MHz
MHz
MHz
kHz
RC
XTL
XT
XT with 4x PLL
XT with 8x PLL
XT with 16x PLL
HS
HS/2 with 4x PLL
HS/2 with 8x PLL
HS/2 with 16x PLL
HS/3 with 4x PLL
HS/3 with 8x PLL
HS/3 with 16x PLL
LP
OS20
TOSC
TOSC = 1/FOSC
OS25
TCY
33
DC
ns
(2)
OS30
TosL,
TosH
.45 x TOSC
ns
EC
OS31
TosR,
TosF
20
ns
EC
OS40
TckR
ns
ns
OS41
TckF
Note 1:
2:
3:
4:
5:
6:
(2)(6)
Data in Typ column is at 5V, 25C unless otherwise stated. Parameters are for design guidance only and
are not tested.
These parameters are characterized but not tested in manufacturing.
Limited by the PLL output frequency range.
Limited by the PLL input frequency range.
Instruction cycle period (TCY) equals four times the input oscillator time base period. All specified values
are based on characterization data for that particular oscillator type under standard operating conditions
with the device executing code. Exceeding these specified limits may result in an unstable oscillator
operation and/or higher than expected current consumption. All devices are tested to operate at Min.
values with an external clock applied to the OSC1/CLKI pin. When an external clock input is used, the
Max. cycle time limit is DC (no clock) for all devices.
Measurements are taken in EC or ERC modes. The CLKOUT signal is measured on the OSC2 pin.
CLKOUT is low for the Q1-Q2 period (1/2 TCY) and high for the Q3-Q4 period (1/2 TCY).
Preliminary
DS70143C-page 185
dsPIC30F6011A/6012A/6013A/6014A
TABLE 23-15: PLL CLOCK TIMING SPECIFICATIONS (VDD = 2.5 TO 5.5 V)
Standard Operating Conditions: 2.5V to 5.5V
(unless otherwise stated)
Operating temperature -40C TA +85C for Industrial
-40C TA +125C for Extended
AC CHARACTERISTICS
Param
No.
Characteristic(1)
Symbol
Min
Typ(2)
Max
Units
Conditions
OS50
FPLLI
4
4
4
4
4
4
5(3)
5(3)
5(3)
4
4
4
10
10
7.5(4)
10
10
7.5(4)
10
10
7.5(4)
8.33(3)
8.33(3)
7.5(4)
MHz
MHz
MHz
MHz
MHz
MHz
MHz
MHz
MHz
MHz
MHz
MHz
EC with 4x PLL
EC with 8x PLL
EC with 16x PLL
XT with 4x PLL
XT with 8x PLL
XT with 16x PLL
HS/2 with 4x PLL
HS/2 with 8x PLL
HS/2 with 16x PLL
HS/3 with 4x PLL
HS/3 with 8x PLL
HS/3 with 16x PLL
OS51
FSYS
16
120
MHz
OS52
TLOC
20
50
Note 1:
2:
3:
4:
Param
No.
Characteristic
OS61
x4 PLL
x8 PLL
x16 PLL
Note 1:
Typ(1)
Max
Units
Conditions
0.251
0.413
-40C TA +85C
0.251
0.413
-40C TA +125C
0.256
0.47
-40C TA +85C
0.256
0.47
-40C TA +125C
0.355
0.584
-40C TA +85C
0.355
0.584
-40C TA +125C
0.362
0.664
-40C TA +85C
0.362
0.664
-40C TA +125C
0.67
0.92
-40C TA +85C
0.632
0.956
-40C TA +85C
0.632
0.956
-40C TA +125C
DS70143C-page 186
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
TABLE 23-17: INTERNAL CLOCK TIMING EXAMPLES
Clock
Oscillator
Mode
FOSC
(MHz)(1)
TCY (sec)(2)
MIPS(3)
w/o PLL
MIPS(3)
w PLL x4
MIPS(3)
w PLL x8
MIPS(3)
w PLL x16
EC
0.200
20.0
0.05
XT
Note 1:
2:
3:
1.0
1.0
4.0
8.0
16.0
10
0.4
2.5
10.0
20.0
25
0.16
6.25
1.0
1.0
4.0
8.0
16.0
10
0.4
2.5
10.0
20.0
Param
No.
Characteristic
Typ
Max
Units
Conditions
FRC
FRC with 4x PLL
FRC with 8x PLL
FRC with 16x PLL
+0.04
+0.16
-40C TA +85C
VDD = 3.0-3.6V
+0.07
+0.23
-40C TA +125C
VDD = 4.5-5.5V
+0.31
+0.62
-40C TA +85C
VDD = 3.0-3.6V
+0.34
+0.77
-40C TA +125C
VDD = 4.5-5.5V
+0.44
+0.87
-40C TA +85C
VDD = 3.0-3.6V
+0.48
+1.08
-40C TA +125C
VDD = 4.5-5.5V
+0.71
+1.23
-40C TA +125C
VDD = 4.5-5.5V
-40C TA +125C
VDD = 3.0-5.5V
(1)
FRC
-0.7
0.5
-40C TA +85C
VDD = 3.0-3.6V
-0.7
0.7
-40C TA +125C
VDD = 3.0-3.6V
-0.7
0.5
-40C TA +85C
VDD = 4.5-5.5V
-40C
+125C
VDD = 4.5-5.5V
-0.7
Note 1:
2:
+0.75
MHz(1)
0.7
TA
Frequency calibrated at 7.372 MHz 2%, 25C and 5V. TUN bits (OSCCON<3:0>) can be used to
compensate for temperature drift.
Overall FRC variation can be calculated by adding the absolute values of jitter, accuracy and drift
percentages.
Preliminary
DS70143C-page 187
dsPIC30F6011A/6012A/6013A/6014A
TABLE 23-19: INTERNAL LPRC ACCURACY
Standard Operating Conditions: 2.5V to 5.5V
(unless otherwise stated)
Operating temperature -40C TA +85C for Industrial
-40C TA +125C for Extended
AC CHARACTERISTICS
Param
No.
Characteristic
Min
Typ
Max
Units
Conditions
-35
+35
FIGURE 23-5:
I/O Pin
(Input)
DI35
DI40
I/O Pin
(Output)
New Value
Old Value
DO31
DO32
AC CHARACTERISTICS
Param
No.
Symbol
Characteristic(1)(2)(3)
Min
Typ(4)
Max
Units
Conditions
20
ns
DO31
TIOR
DO32
TIOF
20
ns
DI35
TINP
20
ns
TRBP
2 TCY
ns
DI40
Note 1:
2:
3:
4:
These parameters are asynchronous events not related to any internal clock edges
Measurements are taken in RC mode and EC mode where CLKOUT output is 4 x TOSC.
These parameters are characterized but not tested in manufacturing.
Data in Typ column is at 5V, 25C unless otherwise stated.
DS70143C-page 188
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 23-6:
VDD
SY12
MCLR
SY10
Internal
POR
SY11
PWRT
Time-out
OSC
Time-out
SY30
Internal
RESET
Watchdog
Timer
RESET
SY13
SY20
SY13
I/O Pins
SY35
FSCM
Delay
Note: Refer to Figure 23-3 for load conditions.
Preliminary
DS70143C-page 189
dsPIC30F6011A/6012A/6013A/6014A
TABLE 23-21: RESET, WATCHDOG TIMER, OSCILLATOR START-UP TIMER, POWER-UP TIMER
AND BROWN-OUT RESET TIMING REQUIREMENTS
Standard Operating Conditions: 2.5V to 5.5V
(unless otherwise stated)
Operating temperature -40C TA +85C for Industrial
-40C TA +125C for Extended
AC CHARACTERISTICS
Param
Symbol
No.
Characteristic(1)
Min
Typ(2)
Max
Units
Conditions
SY10
TmcL
-40C to +85C
SY11
TPWRT
3
12
50
4
16
64
6
22
90
ms
-40C to +85C
User programmable
SY12
TPOR
10
30
-40C to +85C
SY13
TIOZ
0.8
1.0
SY20
TWDT1
1.4
2.1
2.8
ms
1.4
2.1
2.8
ms
TWDT2
Width(4)
SY25
TBOR
100
SY30
TOST
1024 TOSC
SY35
TFSCM
500
900
-40C to +85C
Note 1:
2:
3:
4:
DS70143C-page 190
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 23-7:
0V
Enable Band Gap
(see Note)
Band Gap
Stable
SY40
Param
No.
SY40
Note 1:
2:
Symbol
TBGAP
Characteristic(1)
Min
Typ(2)
Max
Units
Conditions
40
65
Preliminary
DS70143C-page 191
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 23-8:
TxCK
Tx11
Tx10
Tx15
Tx20
OS60
TMRX
AC CHARACTERISTICS
Param
No.
TA10
TA11
Symbol
TTXH
TTXL
Characteristic
TxCK High Time
Min
Typ
Max
Units
Conditions
Synchronous,
no prescaler
0.5 TCY + 20
ns
Synchronous,
with prescaler
10
ns
Asynchronous
10
ns
Synchronous,
no prescaler
0.5 TCY + 20
ns
Synchronous,
with prescaler
10
ns
Asynchronous
TA15
TTXP
10
ns
TCY + 10
ns
Synchronous,
with prescaler
Greater of:
20 ns or
(TCY + 40)/N
Asynchronous
20
ns
DC
50
kHz
1.5
TCY
OS60
Ft1
TA20
0.5 TCY
N = prescale
value
(1, 8, 64, 256)
DS70143C-page 192
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
TABLE 23-24: TYPE B TIMER (TIMER2 AND TIMER4) EXTERNAL CLOCK TIMING
REQUIREMENTS(1)
Standard Operating Conditions: 2.5V to 5.5V
(unless otherwise stated)
Operating temperature -40C TA +85C for Industrial
-40C TA +125C for Extended
AC CHARACTERISTICS
Param
No.
TB10
TB11
TB15
Symbol
TtxH
TtxL
TtxP
Characteristic
TxCK High Time
Min
Typ
Max
Units
Conditions
Synchronous,
no prescaler
0.5 TCY + 20
ns
Synchronous,
with prescaler
10
ns
Synchronous,
no prescaler
0.5 TCY + 20
ns
Synchronous,
with prescaler
10
ns
TCY + 10
ns
1.5 TCY
TB20
TCKEXTMRL
Greater of:
20 ns or
(TCY + 40)/N
0.5 TCY
N = prescale
value
(1, 8, 64, 256)
TABLE 23-25: TYPE C TIMER (TIMER3 AND TIMER5) EXTERNAL CLOCK TIMING
REQUIREMENTS(1)
Standard Operating Conditions: 2.5V to 5.5V
(unless otherwise stated)
Operating temperature -40C TA +85C for Industrial
-40C TA +125C for Extended
AC CHARACTERISTICS
Param
No.
Symbol
Characteristic
Min
Typ
Max
Units
Conditions
TC10
TtxH
Synchronous
0.5 TCY + 20
ns
TC11
TtxL
Synchronous
0.5 TCY + 20
ns
TC15
TtxP
TCY + 10
ns
N = prescale
value
(1, 8, 64, 256)
1.5
TCY
Synchronous,
with prescaler
TC20
TCKEXTMRL
Greater of:
20 ns or
(TCY + 40)/N
0.5 TCY
Preliminary
DS70143C-page 193
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 23-9:
IC10
IC11
IC15
AC CHARACTERISTICS
Param
No.
Symbol
IC10
TccL
Characteristic(1)
ICx Input Low Time
No Prescaler
Min
Max
Units
0.5 TCY + 20
ns
10
ns
0.5 TCY + 20
ns
10
ns
(2 TCY + 40)/N
ns
With Prescaler
IC11
TccH
No Prescaler
With Prescaler
IC15
Note 1:
TccP
Conditions
N = prescale
value (1, 4, 16)
FIGURE 23-10:
OCx
(Output Compare
or PWM Mode)
OC10
OC11
Param
Symbol
No.
Characteristic(1)
Typ(2)
Max
Units
Conditions
OC10
TccF
ns
OC11
TccR
ns
Note 1:
2:
DS70143C-page 194
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 23-11:
OC20
OCFA/OCFB
OC15
OCx
AC CHARACTERISTICS
Para
m
No.
Symb
ol
Characteristic(1)
Min
Typ(2)
Max
Units
Conditions
OC15 TFD
50
ns
OC20 TFLT
50
ns
Note 1:
2:
Preliminary
DS70143C-page 195
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 23-12:
CSCK
(SCKE = 0)
CS11
CS10
CS21
CS20
CS20
CS21
CSCK
(SCKE = 1)
COFS
CS55 CS56
CS35
CS51
CSDO
HIGH-Z
70
CS50
LSb
MSb
CS30
CSDI
HIGH-Z
CS31
LSb IN
MSb IN
CS40 CS41
DS70143C-page 196
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
TABLE 23-29: DCI MODULE (MULTICHANNEL, I2S MODES) TIMING REQUIREMENTS
Standard Operating Conditions: 2.5V to 5.5V
(unless otherwise stated)
Operating temperature -40C TA +85C for Industrial
-40C TA +125C for Extended
AC CHARACTERISTICS
Param
No.
CS10
Symbol
TcSCKL
Characteristic(1)
Min
Typ(2)
Max
Units
Conditions
TCY/2 + 20
ns
30
ns
TCY/2 + 20
ns
30
ns
CS11
TcSCKH
CS20
TcSCKF
10
25
ns
CS21
TcSCKR
10
25
ns
CS30
TcSDOF
10
25
ns
Time(4)
CS31
TcSDOR
10
25
ns
CS35
TDV
10
ns
CS36
TDIV
10
20
ns
CS40
TCSDI
20
ns
CS41
THCSDI
20
ns
CS50
TcoFSF
10
25
ns
CS51
TcoFSR
10
25
ns
CS55
TscoFS
20
ns
CS56
THCOFS
20
ns
Note 1:
2:
3:
4:
Preliminary
DS70143C-page 197
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 23-13:
BIT_CLK
(CSCK)
CS61
CS60
CS62
CS21
CS20
CS71
CS70
CS72
SYNC
(COFS)
CS75
CS76
CS80
SDO
(CSDO)
MSb
LSb
LSb
CS76
CS75
MSb IN
SDI
(CSDI)
CS65 CS66
AC CHARACTERISTICS
Param
No.
Symbol
Characteristic(1)(2)
Min
Typ(3)
Max
Units
36
36
40.7
40.7
81.4
45
45
10
ns
ns
ns
ns
10
ns
19.5
1.3
20.8
10
25
s
s
s
ns
10
25
ns
TBD
TBD
ns
TBD
TBD
ns
Conditions
CS60
CS61
CS62
CS65
TBCLKL
TBCLKH
TBCLK
TSACL
CS66
THACL
CS70
CS71
CS72
CS75
TSYNCLO
TSYNCHI
TSYNC
TRACL
CS76
TFACL
CS77
TRACL
CS78
TFACL
Note 1:
2:
3:
DS70143C-page 198
Preliminary
Note 1
Note 1
Note 1
CLOAD = 50 pF, VDD =
5V
CLOAD = 50 pF, VDD =
5V
CLOAD = 50 pF, VDD =
3V
CLOAD = 50 pF, VDD =
3V
dsPIC30F6011A/6012A/6013A/6014A
TABLE 23-30: DCI MODULE (AC-LINK MODE) TIMING REQUIREMENTS (CONTINUED)
Standard Operating Conditions: 2.5V to 5.5V
(unless otherwise stated)
Operating temperature -40C TA +85C for Industrial
-40C TA +125C for Extended
AC CHARACTERISTICS
Param
No.
Characteristic(1)(2)
Symbol
CS80
Min
Typ(3)
Max
Units
Conditions
TOVDACL
15
ns
edge of BIT_CLK
These parameters are characterized but not tested in manufacturing.
These values assume BIT_CLK frequency is 12.288 MHz.
Data in Typ column is at 5V, 25C unless otherwise stated. Parameters are for design guidance only and
are not tested.
Note 1:
2:
3:
FIGURE 23-14:
SCKx
(CKP = 0)
SP11
SP10
SP21
SP20
SP20
SP21
SCKx
(CKP = 1)
SP35
BIT14 - - - - - -1
MSb
SDOx
SP31
SDIx
LSb
SP30
MSb IN
LSb IN
BIT14 - - - -1
SP40 SP41
AC CHARACTERISTICS
Param
No.
SP10
Symbol
Characteristic(1)
Min
Typ(2)
Max
Units
Conditions
ns
TscL
TCY / 2
Time(3)
SP11
TscH
TCY/2
ns
SP20
TscF
ns
SP21
TscR
ns
Note 1:
2:
3:
4:
Preliminary
DS70143C-page 199
dsPIC30F6011A/6012A/6013A/6014A
TABLE 23-31: SPI MASTER MODE (CKE = 0) TIMING REQUIREMENTS
Standard Operating Conditions: 2.5V to 5.5V
(unless otherwise stated)
Operating temperature -40C TA +85C for Industrial
-40C TA +125C for Extended
AC CHARACTERISTICS
Param
No.
Symbol
Characteristic(1)
Min
Typ(2)
Max
Units
Conditions
SP30
TdoF
ns
SP31
TdoR
ns
SP35
TscH2doV,
TscL2doV
30
ns
SP40
TdiV2scH,
TdiV2scL
20
ns
SP41
TscH2diL,
TscL2diL
20
ns
Note 1:
2:
3:
4:
FIGURE 23-15:
SCKX
(CKP = 0)
SP11
SP10
SP21
SP20
SP20
SP21
SCKX
(CKP = 1)
SP35
SDOX
MSb
SP40
SDIX
SP30,SP31
MSb IN
SP41
DS70143C-page 200
LSb
BIT14 - - - - - -1
BIT14 - - - -1
LSb IN
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
TABLE 23-32: SPI MODULE MASTER MODE (CKE = 1) TIMING REQUIREMENTS
Standard Operating Conditions: 2.5V to 5.5V
(unless otherwise stated)
Operating temperature -40C TA +85C for Industrial
-40C TA +125C for Extended
AC CHARACTERISTICS
Param
No.
Symbol
Characteristic(1)
Min
Typ(2)
Max
Units
Conditions
SP10
TscL
TCY/2
ns
SP11
TscH
TCY/2
ns
ns
See parameter
D032
(4)
SP20
TscF
SP21
TscR
ns
See parameter
D031
SP30
TdoF
ns
See parameter
D032
SP31
TdoR
ns
SP35
See parameter
D031
30
ns
TscL2doV SCKX edge
30
ns
ns
ns
TscL2diL
to SCKX edge
These parameters are characterized but not tested in manufacturing.
Data in Typ column is at 5V, 25C unless otherwise stated. Parameters are for design guidance only and
are not tested.
The minimum clock period for SCK is 100 ns. Therefore, the clock generated in Master mode must not
violate this specification.
Assumes 50 pF load on all SPI pins.
SP36
SP40
SP41
Note 1:
2:
3:
4:
FIGURE 23-16:
SSX
SP52
SP50
SCKX
(CKP = 0)
SP71
SP70
SP73
SP72
SP72
SP73
SCKX
(CKP = 1)
SP35
MSb
SDOX
BIT14 - - - - - -1
LSb
SP51
SP30,SP31
SDIX
MSb IN
BIT14 - - - -1
LSb IN
SP41
SP40
Preliminary
DS70143C-page 201
dsPIC30F6011A/6012A/6013A/6014A
TABLE 23-33:
AC CHARACTERISTICS
Param
No.
Characteristic(1)
Symbol
Min
Typ(2)
Max
Units
Conditions
SP70
TscL
30
ns
SP71
TscH
30
ns
SP72
TscF
10
25
ns
SP73
TscR
10
25
ns
SP30
TdoF
SDOX
ns
See parameter
D032
SP31
TdoR
ns
See parameter
D031
SP35
30
ns
SP40
20
ns
SP41
TscH2diL,
TscL2diL
20
ns
SP50
120
ns
SP51
10
50
ns
SP52
1.5 TCY +
40
ns
Note 1:
2:
3:
DS70143C-page 202
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 23-17:
SSX
SP52
SP50
SCKX
(CKP = 0)
SP71
SP70
SP73
SP72
SP72
SP73
SCKX
(CKP = 1)
SP35
SP52
MSb
SDOX
BIT14 - - - - - -1
LSb
SP30,SP31
SDIX
MSb IN
SP51
BIT14 - - - -1
LSb IN
SP41
SP40
Preliminary
DS70143C-page 203
dsPIC30F6011A/6012A/6013A/6014A
TABLE 23-34: SPI MODULE SLAVE MODE (CKE = 1) TIMING REQUIREMENTS
Standard Operating Conditions: 2.5V to 5.5V
(unless otherwise stated)
Operating temperature -40C TA +85C for Industrial
-40C TA +125C for Extended
AC CHARACTERISTICS
Param
No.
Symbol
Characteristic(1)
Min
Typ(2)
Max
Units
Conditions
SP70
TscL
30
ns
SP71
TscH
30
ns
10
25
ns
10
25
ns
ns
See parameter
D032
ns
See parameter
D031
(3)
SP72
TscF
SP73
TscR
SP30
TdoF
SP31
TdoR
SP35
30
ns
SP40
TdiV2scH,
TdiV2scL
20
ns
SP41
TscH2diL,
TscL2diL
20
ns
SP50
TssL2scH,
TssL2scL
120
ns
SP51
TssH2doZ
SS to SDOX Output
High-impedance(4)
10
50
ns
SP52
TscH2ssH
TscL2ssH
1.5 TCY +
40
ns
SP60
TssL2doV
50
ns
Note 1:
2:
3:
4:
DS70143C-page 204
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 23-18:
SCL
IM31
IM34
IM30
IM33
SDA
Stop
Condition
Start
Condition
Note: Refer to Figure 23-3 for load conditions.
FIGURE 23-19:
IM21
IM11
IM10
SCL
IM11
IM26
IM10
IM25
IM33
SDA
In
IM40
IM40
IM45
SDA
Out
Note: Refer to Figure 23-3 for load conditions.
Preliminary
DS70143C-page 205
dsPIC30F6011A/6012A/6013A/6014A
TABLE 23-35: I2C BUS DATA TIMING REQUIREMENTS (MASTER MODE)
)
AC CHARACTERISTICS
Param
Symbol
No.
IM10
IM11
Min(1)
Max
Units
Conditions
TCY / 2 (BRG + 1)
TCY / 2 (BRG + 1)
THI:SCL
Characteristic
TCY / 2 (BRG + 1)
TCY / 2 (BRG + 1)
(2)
TCY / 2 (BRG + 1)
300
ns
20 + 0.1 CB
300
ns
1 MHz mode(2)
100
ns
1000
ns
20 + 0.1 CB
300
ns
1 MHz mode(2)
300
ns
250
ns
1 MHz mode
IM20
TF:SCL
IM21
TR:SCL
IM25
IM26
IM30
TSU:STA
IM31
Start Condition
Setup Time
IM33
IM34
100
ns
1 MHz mode(2)
TBD
ns
ns
0.9
1 MHz mode(2)
TBD
ns
TCY / 2 (BRG + 1)
TCY / 2 (BRG + 1)
TCY / 2 (BRG + 1)
TCY / 2 (BRG + 1)
TCY / 2 (BRG + 1)
TCY / 2 (BRG + 1)
TCY / 2 (BRG + 1)
ns
TCY / 2 (BRG + 1)
ns
TAA:SCL
IM45
Output Valid
From Clock
IM50
CB
Note 1:
2:
CB is specified to be
from 10 to 400 pF
CB is specified to be
from 10 to 400 pF
ns
3500
ns
1000
ns
1 MHz mode(2)
ns
4.7
1.3
1 MHz mode(2)
TBD
400
pF
BRG is the value of the I2C Baud Rate Generator. Refer to Section 21 Inter-Integrated Circuit
(I2C) in the dsPIC30F Family Reference Manual (DS70046).
Maximum pin capacitance = 10 pF for all I2C pins (for 1 MHz mode only).
DS70143C-page 206
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 23-20:
SCL
IS34
IS31
IS30
IS33
SDA
Stop
Condition
Start
Condition
FIGURE 23-21:
IS21
IS11
IS10
SCL
IS30
IS26
IS31
IS25
IS33
SDA
In
IS40
IS40
IS45
SDA
Out
Preliminary
DS70143C-page 207
dsPIC30F6011A/6012A/6013A/6014A
TABLE 23-36: I2C BUS DATA TIMING REQUIREMENTS (SLAVE MODE)
I)
AC CHARACTERISTICS
Param
No.
IS10
IS11
Symbol
TLO:SCL
THI:SCL
Characteristic
Clock Low Time
IS20
TF:SCL
IS21
TR:SCL
IS25
TSU:DAT
Data Input
Setup Time
IS26
THD:DAT
Data Input
Hold Time
IS30
TSU:STA
Start Condition
Setup Time
IS31
THD:STA
Start Condition
Hold Time
IS33
TSU:STO
Stop Condition
Setup Time
IS34
THD:STO
Stop Condition
Hold Time
IS40
TAA:SCL
Output Valid
From Clock
IS45
TBF:SDA
IS50
CB
Bus Capacitive
Loading
Note 1:
Min
Max
Units
4.7
1.3
1 MHz mode(1)
100 kHz mode
0.5
4.0
s
s
0.6
1 MHz mode(1)
100 kHz mode
400 kHz mode
1 MHz mode(1)
100 kHz mode
400 kHz mode
1 MHz mode(1)
100 kHz mode
400 kHz mode
1 MHz mode(1)
100 kHz mode
400 kHz mode
1 MHz mode(1)
100 kHz mode
400 kHz mode
1 MHz mode(1)
100 kHz mode
400 kHz mode
1 MHz mode(1)
100 kHz mode
400 kHz mode
1 MHz mode(1)
100 kHz mode
400 kHz mode
1 MHz mode(1)
100 kHz mode
400 kHz mode
1 MHz mode(1)
100 kHz mode
400 kHz mode
1 MHz mode(1)
0.5
20 + 0.1 CB
20 + 0.1 CB
250
100
100
0
0
0
4.7
0.6
0.25
4.0
0.6
0.25
4.7
0.6
0.6
4000
600
250
0
0
0
4.7
1.3
0.5
300
300
100
1000
300
300
0.9
0.3
s
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
s
s
s
s
s
s
s
s
s
s
s
ns
ns
ns
ns
ns
ns
s
s
s
pF
3500
1000
350
400
Conditions
Device must operate at a
minimum of 1.5 MHz
Device must operate at a
minimum of 10 MHz.
CB is specified to be from
10 to 400 pF
CB is specified to be from
10 to 400 pF
Maximum pin capacitance = 10 pF for all I2C pins (for 1 MHz mode only).
DS70143C-page 208
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 23-22:
CXTX Pin
(output)
New Value
Old Value
CA10 CA11
CXRX Pin
(input)
CA20
AC CHARACTERISTICS
Param
No.
CA10
Characteristic(1)
Symbol
TioF
Min
Typ(2)
Max
Units
Conditions
ns
ns
ns
CA11
TioR
CA20
Tcwf
500
Note 1:
2:
Preliminary
DS70143C-page 209
dsPIC30F6011A/6012A/6013A/6014A
TABLE 23-38: 12-BIT ADC MODULE SPECIFICATIONS
Standard Operating Conditions: 2.7V to 5.5V
(unless otherwise stated)
Operating temperature -40C TA +85C for Industrial
-40C TA +125C for Extended
AC CHARACTERISTICS
Param
No.
Symbol
Characteristic
Min.
Typ
Max.
Units
Conditions
Device Supply
AD01
AVDD
Greater of
VDD - 0.3
or 2.7
Lesser of
VDD + 0.3
or 5.5
AD02
AVSS
VSS - 0.3
VSS + 0.3
AD05
VREFH
AVDD
AD06
VREFL
AD07
VREF
Absolute Reference
Voltage
AD08
IREF
Current Drain
AD10
AD11
VIN
AVDD + 0.3
AD12
Leakage Current
0.001
0.610
AD13
Leakage Current
0.001
0.610
AD15
RSS
Switch Resistance
3.2K
AD16
CSAMPLE
Sample Capacitor
18
AD17
RIN
Recommended Impedance
of Analog Voltage Source
Reference Inputs
AVSS + 2.7
AVSS
AVDD - 2.7
AVSS - 0.3
AVDD + 0.3
150
.001
200
1
A
A
operating
off
VREFH
See Note
Analog Input
VREFL
AVSS - 0.3
pF
2.5K
DC Accuracy
AD20
Nr
Resolution
AD21
INL
Integral Nonlinearity(3)
<1
LSb
AD21A INL
Integral Nonlinearity(3)
<1
LSb
AD22
DNL
Differential Nonlinearity(3)
<1
LSb
AD22A DNL
Differential Nonlinearity(3)
<1
LSb
AD23
Gain Error(3)
+1.25
+1.5
+3
LSb
GERR
Note 1:
2:
3:
12 data bits
bits
The ADC conversion result never decreases with an increase in the input voltage, and has no missing
codes.
Parameters are characterized but not tested. Use as design guidance only.
Measurements taken with external VREF+ and VREF- used as the ADC voltage references.
DS70143C-page 210
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
TABLE 23-38: 12-BIT ADC MODULE SPECIFICATIONS (CONTINUED)
Standard Operating Conditions: 2.7V to 5.5V
(unless otherwise stated)
Operating temperature -40C TA +85C for Industrial
-40C TA +125C for Extended
AC CHARACTERISTICS
Param
No.
Symbol
Characteristic
Min.
Typ
Max.
Units
Conditions
AD23A GERR
Gain Error(3)
+1.25
+1.5
+3
LSb
AD24
EOFF
Offset Error
-2
-1.5
-1.25
LSb
AD24A EOFF
Offset Error
-2
-1.5
-1.25
LSb
AD25
Monotonicity(1)
Guaranteed
Dynamic Performance
AD30
THD
-71
dB
See Note 2
AD31
SINAD
68
dB
See Note 2
AD32
SFDR
83
dB
See Note 2
AD33
FNYQ
100
kHz
AD34
ENOB
10.95
11.1
bits
Note 1:
2:
3:
The ADC conversion result never decreases with an increase in the input voltage, and has no missing
codes.
Parameters are characterized but not tested. Use as design guidance only.
Measurements taken with external VREF+ and VREF- used as the ADC voltage references.
Preliminary
DS70143C-page 211
dsPIC30F6011A/6012A/6013A/6014A
FIGURE 23-23:
ADCLK
Instruction
Execution
Set SAMP
Clear SAMP
SAMP
ch0_dischrg
ch0_samp
eoc
AD61
AD60
TSAMP
AD55
DONE
ADIF
ADRES(0)
DS70143C-page 212
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
TABLE 23-39: 12-BIT ADC TIMING REQUIREMENTS
Standard Operating Conditions: 2.7V to 5.5V
(unless otherwise stated)
Operating temperature -40C TA +85C for Industrial
-40C TA +125C for Extended
AC CHARACTERISTICS
Param
No.
Symbol
Characteristic
Min.
Typ
Max.
Units
Conditions
Clock Parameters
AD50
TAD
AD51
tRC
334
ns
1.2
1.5
1.8
Conversion Rate
AD55
tCONV
Conversion Time
14 TAD
AD56
FCNV
Throughput Rate
200
ksps
ns
AD57
TSAMP
Sample Time
1 TAD
ns
AD60
tPCS
AD61
tPSS
AD62
AD63
Timing Parameters
Note 1:
1 TAD
ns
0.5 TAD
1.5
TAD
ns
tCSS
Conversion Completion to
Sample Start (ASAM = 1)
0.5 TAD
ns
tDPU
20
Because the sample caps will eventually lose charge, clock rates below 10 kHz can affect linearity
performance, especially at elevated temperatures.
Preliminary
DS70143C-page 213
dsPIC30F6011A/6012A/6013A/6014A
NOTES:
DS70143C-page 214
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
24.0
PACKAGING INFORMATION
24.1
Example
XXXXXXXXXXXX
XXXXXXXXXXXX
YYWWNNN
dsPIC30F6011A
-30I/PF e3
0512XXX
80-Lead TQFP
Example
XXXXXXXXXXXX
XXXXXXXXXXXX
YYWWNNN
Legend: XX...X
Y
YY
WW
NNN
e3
Note:
dsPIC30F6014A
-30I/PF e3
0512XXX
Customer-specific information
Year code (last digit of calendar year)
Year code (last 2 digits of calendar year)
Week code (week of January 1 is week 01)
Alphanumeric traceability code
Pb-free JEDEC designator for Matte Tin (Sn)
This package is Pb-free. The Pb-free JEDEC designator ( e3 )
can be found on the outer packaging for this package.
In the event the full Microchip part number cannot be marked on one line, it will
be carried over to the next line, thus limiting the number of available
characters for customer-specific information.
Preliminary
DS70143C-page 215
dsPIC30F6011A/6012A/6013A/6014A
64-Lead Plastic Thin Quad Flatpack (PT) 10x10x1 mm Body, 1.0/0.10 mm Lead Form (TQFP)
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
E
E1
#leads=n1
D1
2
1
B
n
CH x 45
A2
A1
F
Units
Dimension Limits
n
p
INCHES
NOM
64
.020
16
.043
.039
.006
.024
.039 REF.
3.5
.472
.472
.394
.394
.007
.009
.035
10
10
Preliminary
MAX
MILLIMETERS*
NOM
64
0.50
16
1.00
1.10
0.95
1.00
0.05
0.15
0.45
0.60
1.00 REF.
0
3.5
11.75
12.00
11.75
12.00
9.90
10.00
9.90
10.00
0.13
0.18
0.17
0.22
0.64
0.89
5
10
5
10
MAX
Number of Pins
Pitch
Pins per Side
n1
Overall Height
A
.039
.047
1.20
Molded Package Thickness
A2
.037
.041
1.05
Standoff
A1
.002
.010
0.25
Foot Length
L
.018
.030
0.75
Footprint
F
Foot Angle
0
7
7
Overall Width
E
.463
.482
12.25
Overall Length
D
.463
.482
12.25
Molded Package Width
E1
.390
.398
10.10
Molded Package Length
D1
.390
.398
10.10
c
Lead Thickness
.005
.009
0.23
Lead Width
B
.007
.011
0.27
Pin 1 Corner Chamfer
CH
.025
.045
1.14
5
15
15
Mold Draft Angle Top
DS70143C-page 216
MIN
MIN
dsPIC30F6011A/6012A/6013A/6014A
64-Lead Plastic Thin Quad Flatpack (PF) 14x14x1 mm Body, 1.0/0.10 mm Lead Form (TQFP)
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
E
E1
#leads = n1
D1 D
2
1
A
c
A1
Units
Number of Pins
Pitch
A2
L
Dimension Limits
n
p
INCHES
MIN
NOM
n1
Overall Height
A2
.037
Standoff
A1
.002
Foot Length
L
(F)
.018
Footprint
Foot Angle
Overall Width
(F)
MILLIMETERS*
MAX
MIN
MAX
NOM
64
64
.031 BSC
0.80 BSC
16
16
.047
.039
.024
1.20
.041
0.95
.006
0.05
.030
0.45
.039 REF
0
1.00
0.15
0.60
0.75
1.00 REF
3.5
3.5
.630 BSC
16.00 BSC
Overall Length
.630 BSC
16.00 BSC
E1
.551 BSC
14.00 BSC
D1
c
.551 BSC
Lead Thickness
1.05
14.00 BSC
.004
.008
0.09
0.20
.012
.015
.018
0.30
0.37
0.45
11
12
13
11
12
13
11
12
13
11
12
13
Lead Width
* Controlling Parameter
Notes:
Dimensions D1 and E1 do not include mold flash or protrusions. Mold flash or protrusions shall not exceed .010" (0.254mm) per side.
BSC: Basic Dimension. Theoretically exact value shown without tolerances.
See ASME Y14.5M
JEDEC Equivalent: MS-026
Revised 7-20-06
Drawing No. C04-066
Preliminary
DS70143C-page 217
dsPIC30F6011A/6012A/6013A/6014A
80-Lead Plastic Thin Quad Flatpack (PT) 12x12x1 mm Body, 1.0/0.10 mm Lead Form (TQFP)
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
E
E1
#leads=n1
p
D1
2
1
B
n
CH x 45
A
L
Units
Dimension Limits
n
p
Number of Pins
Pitch
Pins per Side
Overall Height
Molded Package Thickness
Standoff
Foot Length
Footprint
Foot Angle
Overall Width
Overall Length
Molded Package Width
n1
A
A2
A1
L
F
E
D
E1
A2
A1
INCHES
NOM
80
.020 BSC
20
.039
.043
.037
.039
.002
.004
.018
.024
.039 REF.
0
3.5
.551 BSC
.551 BSC
.472 BSC
MIN
MAX
MILLIMETERS*
NOM
80
0.50 BSC
20
1.00
1.10
0.95
1.00
0.05
0.10
0.45
0.60
1.00 REF.
0
3.5
14.00 BSC
14.00 BSC
12.00 BSC
MIN
.047
.041
.006
.030
7
MAX
1.20
1.05
0.15
0.75
7
5
10
15
5
10
15
Mold Draft Angle Top
5
10
15
5
10
15
Mold Draft Angle Bottom
* Controlling Parameter
Notes:
Dimensions D1 and E1 do not include mold flash or protrusions. Mold flash or protrusions shall not exceed .010" (0.254mm) per side.
BSC: Basic Dimension. Theoretically exact value shown without tolerances.
See ASME Y14.5M
REF: Reference Dimension, usually without tolerance, for information purposes only.
See ASME Y14.5M
Revised 07-22-05
JEDEC Equivalent: MS-026
Drawing No. C04-092
DS70143C-page 218
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
80-Lead Plastic Thin Quad Flatpack (PF) 14x14x1 mm Body, 1.0/0.10 mm Lead Form (TQFP)
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
E
E1
#leads = n1
D1 D
B
2
1
n
Units
Number of Pins
Pitch
Dimension Limits
n
p
n1
Overall Height
A
A1
(F)
A2
MILLIMETERS*
INCHES
MIN
NOM
MIN
MAX
NOM
MAX
80
80
.026
0.65
20
20
.047
1.20
A2
.037
Standoff
A1
.002
Foot Length
.018
Footprint
Foot Angle
Overall Width
.630 BSC
16.00 BSC
.039
.024
.041
0.95
.006
0.05
.030
0.45
3.5
0.15
0.60
3.5
Overall Length
.630 BSC
16.00 BSC
E1
.551 BSC
14.00 BSC
D1
c
.551 BSC
Lead Thickness
.004
1.05
0.75
1.00 REF.
.039 REF.
0
1.00
14.00 BSC
.008
0.09
0.20
.011
.013
.015
0.27
0.32
0.37
11
12
13
11
12
13
11
12
13
11
12
13
Lead Width
* Controlling Parameter
Notes:
Dimensions D1 and E1 do not include mold flash or protrusions. Mold flash or protrusions shall not exceed .010" (0.254mm) per side.
BSC: Basic Dimension. Theoretically exact value shown without tolerances.
See ASME Y14.5M
REF: Reference Dimension, usually without tolerance, for information purposes only.
See ASME Y14.5M
JEDEC Equivalent: MS-026
Revised 7-20-06
Drawing No. C04-116
Preliminary
DS70143C-page 219
dsPIC30F6011A/6012A/6013A/6014A
NOTES:
DS70143C-page 220
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
APPENDIX A:
REVISION HISTORY
Preliminary
DS70143C-page 221
dsPIC30F6011A/6012A/6013A/6014A
NOTES:
DS70143C-page 222
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
APPENDIX B:
DEVICE
COMPARISONS
TABLE B-1:
dsPIC30F6011
dsPIC30F6011A
132
132
6144
6144
2048
2048
Timers (16-bit)
Codec Interface
16 channels
16 channels
UART
SPI
I2C
CAN
PGC (ICSP Clock Input)
PGD (ICSP Data Input/Output)
Packages
I/O Pins (max)
TABLE B-2:
RB1/AN1
RB0/AN0
RB6/AN6
RB7/AN7
52
52
dsPIC30F6012
dsPIC30F6012A
144
144
8192
8192
4096
4096
Timers (16-bit)
Codec Interface
ADC 12-bit 100 ksps
AC97,
8
I2 S
AC97, I2S
16 channels
16 channels
UART
SPI
2C
CAN
PGC (ICSP Clock Input)
PGD (ICSP Data Input/Output)
Packages
I/O Pins (max)
RB1/AN1
RB0/AN0
RB6/AN6
RB7/AN7
52
52
Preliminary
DS70143C-page 223
dsPIC30F6011A/6012A/6013A/6014A
TABLE B-3:
dsPIC30F6013
dsPIC30F6013A
132
132
6144
6144
2048
2048
Timers (16-bit)
Codec Interface
16 channels
16 channels
UART
SPI
I2C
CAN
PGC (ICSP Clock Input)
PGD (ICSP Data Input/Output)
Packages
I/O Pins (max)
TABLE B-4:
RB1/AN1
RB0/AN0
RB1/AN1
RB0/AN0
68
68
dsPIC30F6014
dsPIC30F6014A
144
144
8192
8192
4096
4096
Timers (16-bit)
AC97, I2S
AC97, I2S
16 channels
16 channels
UART
SPI
I2C
CAN
PGC (ICSP Clock Input)
PGD (ICSP Data Input/Output)
Packages
I/O Pins (max)
DS70143C-page 224
RB1/AN1
RB0/AN0
RB1/AN1
RB0/AN0
68
68
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
APPENDIX C:
MIGRATION FROM
dsPIC30F601x TO
dsPIC30F601xA
DEVICES
C.3
C.1
C.2
Code Compatibility
2.
Oscillator Operation
presented
in
C.4
In support of the new Oscillator modes, the FOSC Configuration Register has been modified. The
dsPIC30F6011A/6012A/6013A/6014A device header
and include files provide the updated bit field definitions
and macros for the device Configuration Registers.
Please refer to these new macros when embedding
specific device configuration information in the C and
Assembly source files.
C.5
Electrical Characteristics
Preliminary
DS70143C-page 225
dsPIC30F6011A/6012A/6013A/6014A
C.6
Device Packages
DS70143C-page 226
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
INDEX
A
AC Characteristics ............................................................ 184
Internal FRC Jitter, Accuracy and Drift ..................... 187
Internal LPRC Accuracy............................................ 188
Load Conditions ........................................................ 184
AC Temperature and Voltage Specifications .................... 184
AC-Link Mode Operation .................................................. 130
16-bit Mode ............................................................... 130
20-bit Mode ............................................................... 130
ADC .................................................................................. 133
Aborting a Conversion .............................................. 135
ADCHS Register ....................................................... 133
ADCON1 Register..................................................... 133
ADCON2 Register..................................................... 133
ADCON3 Register..................................................... 133
ADCSSL Register ..................................................... 133
ADPCFG Register..................................................... 133
Configuring Analog Port Pins.............................. 64, 140
Connection Considerations....................................... 140
Conversion Operation ............................................... 134
Effects of a Reset...................................................... 139
Operation During CPU Idle Mode ............................. 139
Operation During CPU Sleep Mode.......................... 139
Output Formats ......................................................... 139
Power-down Modes .................................................. 139
Programming the Start of Conversion Trigger .......... 135
Register Map............................................................. 141
Result Buffer ............................................................. 134
Sampling Requirements............................................ 138
Selecting the Conversion Clock ................................ 135
Selecting the Conversion Sequence......................... 134
ADC Conversion Speeds .................................................. 136
Address Generator Units .................................................... 39
Alternate Vector Table ........................................................ 49
Analog-to-Digital Converter. See ADC.
Assembler
MPASM Assembler................................................... 172
Automatic Clock Stretch...................................................... 98
During 10-bit Addressing (STREN = 1)....................... 98
During 7-bit Addressing (STREN = 1)......................... 98
Receive Mode ............................................................. 98
Transmit Mode ............................................................ 98
B
Band Gap Start-up Time
Requirements............................................................ 191
Timing Characteristics .............................................. 191
Barrel Shifter ....................................................................... 23
Bit-Reversed Addressing .................................................... 42
Example ...................................................................... 43
Implementation ........................................................... 42
Modifier Values Table ................................................. 43
Sequence Table (16-Entry)......................................... 43
Block Diagrams
12-bit ADC Functional............................................... 133
16-bit Timer1 Module .................................................. 70
16-bit Timer2............................................................... 75
16-bit Timer3............................................................... 75
16-bit Timer4............................................................... 80
16-bit Timer5............................................................... 80
32-bit Timer2/3............................................................ 74
32-bit Timer4/5............................................................ 79
CAN Buffers and Protocol Engine............................. 112
C
C Compilers
MPLAB C18.............................................................. 172
MPLAB C30.............................................................. 172
CAN Module ..................................................................... 111
Baud Rate Setting .................................................... 116
CAN1 Register Map.................................................. 118
CAN2 Register Map.................................................. 120
Frame Types ............................................................ 111
I/O Timing Characteristics ........................................ 209
I/O Timing Requirements.......................................... 209
Message Reception.................................................. 114
Message Transmission............................................. 115
Modes of Operation .................................................. 113
Overview................................................................... 111
CLKOUT and I/O Timing
Characteristics.......................................................... 188
Requirements ........................................................... 188
Code Examples
Data EEPROM Block Erase ....................................... 58
Data EEPROM Block Write ........................................ 60
Data EEPROM Read.................................................. 57
Data EEPROM Word Erase ....................................... 58
Data EEPROM Word Write ........................................ 59
Erasing a Row of Program Memory ........................... 53
Initiating a Programming Sequence ........................... 54
Loading Write Latches ................................................ 54
Code Protection ................................................................ 143
Core Architecture
Overview..................................................................... 15
CPU Architecture Overview ................................................ 15
Customer Change Notification Service............................. 233
Customer Notification Service .......................................... 233
Customer Support............................................................. 233
D
Data Accumulators and Adder/Subtractor .......................... 21
Data Space Write Saturation ...................................... 23
Overflow and Saturation ............................................. 21
Round Logic ............................................................... 22
Write Back .................................................................. 22
Data Address Space........................................................... 31
Alignment.................................................................... 34
Alignment (Figure) ...................................................... 35
Effect of Invalid Memory Accesses (Table) ................ 34
Preliminary
DS70143C-page 227
dsPIC30F6011A/6012A/6013A/6014A
MCU and DSP (MAC Class) Instructions Example..... 34
Memory Map ............................................................... 31
Memory Map for dsPIC30F6011A/6013A ................... 32
Memory Map for dsPIC30F6012A/6014A ................... 33
Near Data Space ........................................................ 35
Software Stack ............................................................ 35
Spaces ........................................................................ 31
Width ........................................................................... 34
Data Converter Interface (DCI) Module ............................ 123
Data EEPROM Memory ...................................................... 57
Erasing ........................................................................ 58
Erasing, Block ............................................................. 58
Erasing, Word ............................................................. 58
Protection Against Spurious Write .............................. 61
Reading....................................................................... 57
Write Verify ................................................................. 61
Writing ......................................................................... 59
Writing, Block .............................................................. 60
Writing, Word .............................................................. 59
DC Characteristics ............................................................ 175
Brown-out Reset ............................................... 182, 183
I/O Pin Input Specifications ....................................... 181
I/O Pin Output Specifications .................................... 181
Idle Current (IIDLE) .................................................... 178
Low-Voltage Detect................................................... 181
LVDL ......................................................................... 182
Operating Current (IDD)............................................. 177
Power-Down Current (IPD) ........................................ 179
Program and EEPROM............................................. 183
DCI Module
Bit Clock Generator................................................... 127
Buffer Alignment with Data Frames .......................... 129
Buffer Control ............................................................ 123
Buffer Data Alignment ............................................... 123
Buffer Length Control ................................................ 129
COFS Pin .................................................................. 123
CSCK Pin .................................................................. 123
CSDI Pin ................................................................... 123
CSDO Mode Bit ........................................................ 130
CSDO Pin ................................................................. 123
Data Justification Control Bit ..................................... 128
Device Frequencies for Common Codec
CSCK Frequencies (Table)............................... 127
Digital Loopback Mode ............................................. 130
Enable ....................................................................... 125
Frame Sync Generator ............................................. 125
Frame Sync Mode Control Bits ................................. 125
I/O Pins ..................................................................... 123
Interrupts ................................................................... 130
Introduction ............................................................... 123
Master Frame Sync Operation .................................. 125
Operation .................................................................. 125
Operation During CPU Idle Mode ............................. 130
Operation During CPU Sleep Mode .......................... 130
Receive Slot Enable Bits........................................... 128
Receive Status Bits ................................................... 129
Register Map............................................................. 132
Sample Clock Edge Control Bit................................. 128
Slave Frame Sync Operation .................................... 126
Slot Enable Bits Operation with Frame Sync ............ 128
Slot Status Bits.......................................................... 130
Synchronous Data Transfers .................................... 128
DS70143C-page 228
Timing Characteristics
AC-Link Mode................................................... 198
Multichannel, I2S Modes................................... 196
Timing Requirements
AC-Link Mode................................................... 198
Multichannel, I2S Modes................................... 197
Transmit Slot Enable Bits ......................................... 128
Transmit Status Bits.................................................. 129
Transmit/Receive Shift Register ............................... 123
Underflow Mode Control Bit...................................... 130
Word Size Selection Bits .......................................... 125
Development Support ....................................................... 171
Device Configuration
Register Map ............................................................ 161
Device Configuration Registers ........................................ 159
FBORPOR ................................................................ 159
FBS........................................................................... 159
FGS .......................................................................... 159
FOSC........................................................................ 159
FSS........................................................................... 159
FWDT ....................................................................... 159
Device Overview . 1, 9, 15, 25, 39, 45, 51, 57, 63, 69, 73, 79,
83, 87, 91, 95, 103, 111, 123, 133, 163
Disabling the UART .......................................................... 105
Divide Support .................................................................... 18
Instructions (Table) ..................................................... 18
DSP Engine ........................................................................ 19
Multiplier ..................................................................... 21
Dual Output Compare Match Mode .................................... 88
Continuous Pulse Mode.............................................. 88
Single Pulse Mode...................................................... 88
E
Electrical Characteristics .................................................. 175
AC............................................................................. 184
DC ............................................................................ 175
Enabling and Setting Up UART
Setting Up Data, Parity and Stop Bit Selections ....... 105
Enabling the UART ........................................................... 105
Equations
ADC Conversion Clock ............................................. 135
Baud Rate................................................................. 107
Bit Clock Frequency.................................................. 127
COFSG Period.......................................................... 125
Serial Clock Rate ...................................................... 100
Time Quantum for Clock Generation ........................ 117
Errata .................................................................................... 7
External Clock Timing Characteristics
Type A, B and C Timer ............................................. 192
External Clock Timing Requirements ............................... 185
Type A Timer ............................................................ 192
Type B Timer ............................................................ 193
Type C Timer ............................................................ 193
External Interrupt Requests ................................................ 49
F
Fast Context Saving ........................................................... 49
Flash Program Memory ...................................................... 51
Control Registers ........................................................ 52
NVMADR ............................................................ 52
NVMADRU ......................................................... 52
NVMCON............................................................ 52
NVMKEY ............................................................ 52
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
I
I/O Pin Specifications
Input .......................................................................... 181
Output ....................................................................... 181
I/O Ports .............................................................................. 63
Parallel (PIO) .............................................................. 63
I2C 10-bit Slave Mode Operation ........................................ 97
Reception.................................................................... 98
Transmission............................................................... 97
I2C 7-bit Slave Mode Operation .......................................... 97
Reception.................................................................... 97
Transmission............................................................... 97
I2C Master Mode Operation ................................................ 99
Baud Rate Generator................................................ 100
Clock Arbitration........................................................ 100
Multi-Master Communication, Bus Collision and
Bus Arbitration .................................................. 100
Reception.................................................................... 99
Transmission............................................................... 99
I2C Master Mode Support ................................................... 99
I2C Module .......................................................................... 95
Addresses ................................................................... 97
Bus Data Timing Characteristics
Master Mode ..................................................... 205
Slave Mode ....................................................... 207
Bus Data Timing Requirements
Master Mode ..................................................... 206
Slave Mode ....................................................... 208
Bus Start/Stop Bits Timing Characteristics
Master Mode ..................................................... 205
Slave Mode ....................................................... 207
General Call Address Support .................................... 99
Interrupts..................................................................... 98
IPMI Support ............................................................... 99
Operating Function Description .................................. 95
Operation During CPU Sleep and Idle Modes .......... 100
Pin Configuration ........................................................ 95
Programmers Model................................................... 95
Register Map............................................................. 101
Registers..................................................................... 95
Slope Control .............................................................. 99
Software Controlled Clock Stretching
(STREN = 1) ....................................................... 98
Various Modes ............................................................ 95
I2S Mode Operation .......................................................... 131
Data Justification....................................................... 131
Frame and Data Word Length Selection................... 131
Idle Current (IIDLE) ............................................................ 178
In-Circuit Debugger (ICD 2) .............................................. 160
In-Circuit Serial Programming (ICSP) ......................... 51, 143
Initialization Condition for RCON Register Case 1 ........... 157
Initialization Condition for RCON Register Case 2 ........... 157
Input Capture (CAPX) Timing Characteristics .................. 194
Input Capture Module ......................................................... 83
Interrupts..................................................................... 84
Register Map............................................................... 85
Input Capture Operation During Sleep and Idle Modes ...... 84
CPU Idle Mode............................................................ 84
CPU Sleep Mode ........................................................ 84
Input Capture Timing Requirements ................................. 194
Input Change Notification Module ....................................... 67
Register Map for dsPIC30F6011A/6012 A
(Bits 7-0) ............................................................. 67
Register Map for dsPIC30F6011A/6012A
(Bits 15-8) ........................................................... 67
L
Load Conditions................................................................ 184
Low Voltage Detect (LVD) ................................................ 158
Low-Voltage Detect Characteristics.................................. 181
LVDL Characteristics ........................................................ 182
M
Memory Organization 1, 9, 15, 25, 39, 45, 51, 57, 63, 69, 73,
79, 83, 87, 91, 95, 103, 111, 123, 133, 163
Core Register Map ..................................................... 37
Microchip Internet Web Site.............................................. 233
Modes of Operation
Disable...................................................................... 113
Initialization............................................................... 113
Listen All Messages.................................................. 113
Listen Only................................................................ 113
Loopback .................................................................. 113
Normal Operation ..................................................... 113
Module ................................................................................ 95
Modulo Addressing ............................................................. 40
Applicability................................................................. 42
Operation Example..................................................... 41
Start and End Address ............................................... 41
W Address Register Selection.................................... 41
MPLAB ASM30 Assembler, Linker, Librarian ................... 172
MPLAB ICD 2 In-Circuit Debugger ................................... 173
MPLAB ICE 2000 High-Performance Universal
In-Circuit Emulator.................................................... 173
MPLAB ICE 4000 High-Performance Universal
In-Circuit Emulator.................................................... 173
MPLAB Integrated Development Environment
Software ................................................................... 171
MPLAB PM3 Device Programmer .................................... 173
MPLINK Object Linker/MPLIB Object Librarian ................ 172
N
NVM
Preliminary
DS70143C-page 229
dsPIC30F6011A/6012A/6013A/6014A
O
OC/PWM Module Timing Characteristics.......................... 195
Operating Current (IDD)..................................................... 177
Oscillator
Control Registers ...................................................... 149
Operating Modes (Table) .......................................... 144
System Overview ...................................................... 143
Oscillator Configurations ................................................... 146
Fail-Safe Clock Monitor............................................. 148
Fast RC (FRC) .......................................................... 147
Initial Clock Source Selection ................................... 146
Low-Power RC (LPRC) ............................................. 148
LP Oscillator Control ................................................. 147
Phase Locked Loop (PLL) ........................................ 147
Start-up Timer (OST) ................................................ 147
Oscillator Selection ........................................................... 143
Oscillator Start-up Timer
Timing Characteristics .............................................. 189
Timing Requirements ................................................ 190
Output Compare Interrupts ................................................. 89
Output Compare Module..................................................... 87
Register Map............................................................... 90
Timing Characteristics .............................................. 194
Timing Requirements ................................................ 194
Output Compare Operation During CPU Idle Mode............ 89
Output Compare Sleep Mode Operation............................. 89
DS70143C-page 230
S
Serial Peripheral Interface. See SPI
Simple Capture Event Mode............................................... 83
Buffer Operation ......................................................... 84
Hall Sensor Mode ....................................................... 84
Prescaler .................................................................... 83
Timer2 and Timer3 Selection Mode............................ 84
Simple OC/PWM Mode Timing Requirements ................. 195
Simple Output Compare Match Mode ................................ 88
Simple PWM Mode ............................................................. 88
Input Pin Fault Protection ........................................... 88
Period ......................................................................... 89
Software Simulator (MPLAB SIM) .................................... 172
Software Stack Pointer, Frame Pointer .............................. 16
CALL Stack Frame ..................................................... 35
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
SPI Module ......................................................................... 91
Framed SPI Support ................................................... 91
Operating Function Description .................................. 91
Operation During CPU Idle Mode ............................... 93
Operation During CPU Sleep Mode............................ 93
SDOx Disable ............................................................. 91
Slave Select Synchronization ..................................... 93
SPI1 Register Map...................................................... 94
SPI2 Register Map...................................................... 94
Timing Characteristics
Master Mode (CKE = 0) .................................... 199
Master Mode (CKE = 1) .................................... 200
Slave Mode (CKE = 1) .............................. 201, 203
Timing Requirements
Master Mode (CKE = 0) .................................... 199
Master Mode (CKE = 1) .................................... 201
Slave Mode (CKE = 0) ...................................... 202
Slave Mode (CKE = 1) ...................................... 204
Word and Byte Communication .................................. 91
STATUS Register ............................................................... 16
Symbols used in Opcode Descriptions ............................. 164
System Integration ............................................................ 143
Register Map for dsPIC30F601xA ............................ 161
T
Table Instruction Operation Summary ................................ 51
Temperature and Voltage Specifications
AC ............................................................................. 184
Timer1 Module .................................................................... 69
16-bit Asynchronous Counter Mode ........................... 69
16-bit Synchronous Counter Mode ............................. 69
16-bit Timer Mode....................................................... 69
Gate Operation ........................................................... 70
Interrupt....................................................................... 71
Operation During Sleep Mode .................................... 70
Prescaler..................................................................... 70
Real-Time Clock ......................................................... 71
Interrupts............................................................. 71
Oscillator Operation ............................................ 71
Register Map............................................................... 72
Timer2 and Timer3 Selection Mode .................................... 88
Timer2/3 Module ................................................................. 73
16-bit Timer Mode....................................................... 73
32-bit Synchronous Counter Mode ............................. 73
32-bit Timer Mode....................................................... 73
ADC Event Trigger...................................................... 76
Gate Operation ........................................................... 76
Interrupt....................................................................... 76
Operation During Sleep Mode .................................... 76
Register Map............................................................... 77
Timer Prescaler........................................................... 76
Timer4/5 Module ................................................................. 79
Register Map............................................................... 81
Timing Characteristics
ADC
Low-speed (ASAM = 0, SSRC = 000) .............. 212
Band Gap Start-up Time ........................................... 191
CAN Module I/O........................................................ 209
CLKOUT and I/O....................................................... 188
DCI Module
AC-Link Mode ................................................... 198
Multichannel, I2S Modes ................................... 196
External Clock........................................................... 184
I2C Bus Data
Master Mode ..................................................... 205
Slave Mode ....................................................... 207
Preliminary
DS70143C-page 231
dsPIC30F6011A/6012A/6013A/6014A
Trap Vectors........................................................................ 48
Traps ................................................................................... 47
Hard and Soft .............................................................. 48
Sources ....................................................................... 47
Address Error Trap ............................................. 47
Math Error Trap................................................... 47
Oscillator Fail Trap.............................................. 48
Stack Error Trap.................................................. 48
U
UART Module
Address Detect Mode ............................................... 107
Auto Baud Support.................................................... 108
Baud Rate Generator ................................................ 107
Enabling and Setting Up ........................................... 105
Framing Error (FERR)............................................... 107
Idle Status ................................................................. 107
Loopback Mode ........................................................ 107
Operation During CPU Sleep and Idle Modes .......... 108
Overview ................................................................... 103
Parity Error (PERR) .................................................. 107
Receive Break........................................................... 107
Receive Buffer (UxRXB) ........................................... 106
Receive Buffer Overrun Error (OERR Bit) ................ 106
Receive Interrupt....................................................... 106
Receiving Data.......................................................... 106
Receiving in 8-bit or 9-bit Data Mode........................ 106
Reception Error Handling.......................................... 106
Transmit Break.......................................................... 106
Transmit Buffer (UxTXB)........................................... 105
Transmit Interrupt...................................................... 106
Transmitting Data...................................................... 105
Transmitting in 8-bit Data Mode ................................ 105
Transmitting in 9-bit Data Mode ................................ 105
UART1 Register Map ................................................ 109
UART2 Register Map ................................................ 109
UART Operation
Idle Mode .................................................................. 108
Sleep Mode ............................................................... 108
Unit ID Locations............................................................... 143
Universal Asynchronous Receiver Transmitter. See UART.
W
Wake-up from Sleep ......................................................... 143
Wake-up from Sleep and Idle.............................................. 49
Watchdog Timer (WDT) ............................................ 143, 158
Enabling and Disabling ............................................. 158
Operation .................................................................. 158
Timing Characteristics .............................................. 189
Timing Requirements ................................................ 190
WWW Address.................................................................. 233
WWW, On-Line Support........................................................ 7
DS70143C-page 232
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
THE MICROCHIP WEB SITE
CUSTOMER SUPPORT
Distributor or Representative
Local Sales Office
Field Application Engineer (FAE)
Technical Support
Customers
should
contact
their
distributor,
representative or field application engineer (FAE) for
support. Local sales offices are also available to help
customers. A listing of sales offices and locations is
included in the back of this document.
Technical support is available through the web site
at: http://support.microchip.com
Preliminary
DS70143C-page 233
dsPIC30F6011A/6012A/6013A/6014A
READER RESPONSE
It is our intention to provide you with the best documentation possible to ensure successful use of your Microchip product. If you wish to provide your comments on organization, clarity, subject matter, and ways in which our documentation
can better serve you, please FAX your comments to the Technical Publications Manager at (480) 792-4150.
Please list the following information, and use this outline to provide us with your comments about this document.
To:
RE:
Reader Response
From: Name
Company
Address
City / State / ZIP / Country
Telephone: (_______) _________ - _________
Application (optional):
Would you like a reply?
Device: dsPIC30F6011A/6012A/
6013A/6014A
Questions:
N
Literature Number: DS70143C
2. How does this document meet your hardware and software development needs?
3. Do you find the organization of this document easy to follow? If not, why?
4. What additions to the document do you think would enhance the structure and subject?
5. What deletions from the document could be made without affecting the overall usefulness?
DS70143C-page 234
Preliminary
dsPIC30F6011A/6012A/6013A/6014A
PRODUCT IDENTIFICATION SYSTEM
To order or obtain information, e.g., on pricing or delivery, refer to the factory or the listed sales office.
d s P I C 3 0 F 6 0 11 AT - 3 0 I / P F - E S
Custom ID (3 digits) or
Engineering Sample (ES)
Trademark
Architecture
Package
PF = TQFP 14x14
S = Die (Waffle Pack)
W = Die (Wafers)
PT = TQFP 10x10
PT = TQFP 12x12
Flash
Memory Size in Bytes
0 = ROMless
1 = 1K to 6K
2 = 7K to 12K
3 = 13K to 24K
4 = 25K to 48K
5 = 49K to 96K
6 = 97K to 192K
7 = 193K to 384K
8 = 385K to 768K
9 = 769K and Up
Temperature
I = Industrial -40C to +85C
E = Extended High Temp -40C to +125C
Speed
30 = 30 MIPS
Device ID
Example:
dsPIC30F6011AT-30I/PF = 30 MIPS, Industrial temp., TQFP package, Rev. A
Preliminary
DS70143C-page 235
ASIA/PACIFIC
ASIA/PACIFIC
EUROPE
Corporate Office
2355 West Chandler Blvd.
Chandler, AZ 85224-6199
Tel: 480-792-7200
Fax: 480-792-7277
Technical Support:
http://support.microchip.com
Web Address:
www.microchip.com
India - Bangalore
Tel: 91-80-4182-8400
Fax: 91-80-4182-8422
India - New Delhi
Tel: 91-11-4160-8631
Fax: 91-11-4160-8632
Austria - Wels
Tel: 43-7242-2244-39
Fax: 43-7242-2244-393
Denmark - Copenhagen
Tel: 45-4450-2828
Fax: 45-4485-2829
India - Pune
Tel: 91-20-2566-1512
Fax: 91-20-2566-1513
France - Paris
Tel: 33-1-69-53-63-20
Fax: 33-1-69-30-90-79
Japan - Yokohama
Tel: 81-45-471- 6166
Fax: 81-45-471-6122
Germany - Munich
Tel: 49-89-627-144-0
Fax: 49-89-627-144-44
Atlanta
Alpharetta, GA
Tel: 770-640-0034
Fax: 770-640-0307
Boston
Westborough, MA
Tel: 774-760-0087
Fax: 774-760-0088
Chicago
Itasca, IL
Tel: 630-285-0071
Fax: 630-285-0075
Dallas
Addison, TX
Tel: 972-818-7423
Fax: 972-818-2924
Detroit
Farmington Hills, MI
Tel: 248-538-2250
Fax: 248-538-2260
Kokomo
Kokomo, IN
Tel: 765-864-8360
Fax: 765-864-8387
Los Angeles
Mission Viejo, CA
Tel: 949-462-9523
Fax: 949-462-9608
Santa Clara
Santa Clara, CA
Tel: 408-961-6444
Fax: 408-961-6445
Toronto
Mississauga, Ontario,
Canada
Tel: 905-673-0699
Fax: 905-673-6509
Australia - Sydney
Tel: 61-2-9868-6733
Fax: 61-2-9868-6755
China - Beijing
Tel: 86-10-8528-2100
Fax: 86-10-8528-2104
Korea - Gumi
Tel: 82-54-473-4301
Fax: 82-54-473-4302
China - Chengdu
Tel: 86-28-8665-5511
Fax: 86-28-8665-7889
China - Fuzhou
Tel: 86-591-8750-3506
Fax: 86-591-8750-3521
Korea - Seoul
Tel: 82-2-554-7200
Fax: 82-2-558-5932 or
82-2-558-5934
Malaysia - Penang
Tel: 60-4-646-8870
Fax: 60-4-646-5086
China - Qingdao
Tel: 86-532-8502-7355
Fax: 86-532-8502-7205
Philippines - Manila
Tel: 63-2-634-9065
Fax: 63-2-634-9069
China - Shanghai
Tel: 86-21-5407-5533
Fax: 86-21-5407-5066
Singapore
Tel: 65-6334-8870
Fax: 65-6334-8850
China - Shenyang
Tel: 86-24-2334-2829
Fax: 86-24-2334-2393
China - Shenzhen
Tel: 86-755-8203-2660
Fax: 86-755-8203-1760
Taiwan - Kaohsiung
Tel: 886-7-536-4818
Fax: 886-7-536-4803
China - Shunde
Tel: 86-757-2839-5507
Fax: 86-757-2839-5571
Taiwan - Taipei
Tel: 886-2-2500-6610
Fax: 886-2-2508-0102
China - Wuhan
Tel: 86-27-5980-5300
Fax: 86-27-5980-5118
Thailand - Bangkok
Tel: 66-2-694-1351
Fax: 66-2-694-1350
Italy - Milan
Tel: 39-0331-742611
Fax: 39-0331-466781
Netherlands - Drunen
Tel: 31-416-690399
Fax: 31-416-690340
Spain - Madrid
Tel: 34-91-708-08-90
Fax: 34-91-708-08-91
UK - Wokingham
Tel: 44-118-921-5869
Fax: 44-118-921-5820
China - Xian
Tel: 86-29-8833-7250
Fax: 86-29-8833-7256
10/19/06
DS70143C-page 236
Preliminary