The device names, pin counts, memory sizes and peripheral availability of each device are listed in Tab le 1. The following pages show the devices’ pinout diagrams.
2.0Guidelines for Getting Started with 16-Bit Digital Signal Controllers.......................................................................................... 17
5.0Flash Program Memory.............................................................................................................................................................. 81
22.0 Controller Area Network (CAN) Module (dsPIC33EVXXXGM10X Devices Only).................................................................... 251
23.0 Charge Time Measurement Unit (CTMU) ................................................................................................................................ 277
25.0 Op Amp/Comparator Module ................................................................................................................................................... 299
26.0 Comparator Voltage Reference ................................................................................................................................................ 311
27.0 Special Features ...................................................................................................................................................................... 315
28.0 Instruction Set Summary .......................................................................................................................................................... 325
29.0 Development Support............................................................................................................................................................... 335
Index ................................................................................................................................................................................................. 433
The Microchip Web Site..................................................................................................................................................................... 439
Customer Change Notification Service .............................................................................................................................................. 439
Customer Support .............................................................................................................................................................................. 439
DS70005144C-page 10 2013-2014 Microchip Technology Inc.
dsPIC33EVXXXGM00X/10X FAMILY
TO OUR VALUED CUSTOMERS
It is our intention to provide our valued customers with the best documentation possible to ensure successful use of your Microchip
products. To this end, we will continue to improve our publications to better suit your needs. Our publications will be refined and
enhanced as new volumes and updates are introduced.
If you have any questions or comments regarding this publication, please contact the Marketing Communications Department via
E-mail at docerrors@microchip.com. We welcome your feedback.
Most Current Data Sheet
To obtain the most up-to-date version of this data sheet, please register at our Worldwide Web site at:
http://www.microchip.com
You can determine the version of a data sheet by examining its literature number found on the bottom outside corner of any page.
The last character of the literature number is the version number, (e.g., DS30000000A is version A of document DS30000000).
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:
• Microchip’s 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.
Customer Notification System
Register on our web site at www.microchip.com to receive the most current information on all of our products.
This device data sheet is based on the following
individual chapters of the “dsPIC33/PIC24 FamilyReference Manual”, which are available from the
Microchip web site (www.microchip.com). The follow-
ing documents should be considered as the general
reference for the operation of a particular module or
device feature:
• “Introduction” (DS70573)
• “CPU” (DS70359)
• “Data Memory” (DS70595)
• “Program Memory” (DS70613)
• “Flash Programming” (DS70609)
• “Interrupts” (DS70000600)
• “Oscillator” (DS70580)
• “Reset” (DS70602)
• “Watchdog Timer and Power-Saving Modes” (DS70615)
DS70005144C-page 12 2013-2014 Microchip Technology Inc.
dsPIC33EVXXXGM00X/10X FAMILY
PORTA
Power-up
Timer
Oscillator
Start-up
OSC1/CLKI
MCLR
VDD, VSS
UART1/2
Timing
Generation
CAN1
(1)
I2C1
ADC
Timers
Input
Capture
Output
Compare
AV
DD, AVSS
SPI1/2
Watchdog
Timer/
POR/BOR
PWM
Remappable
Pins
Note 1:This feature or peripheral is only available on dsPIC33EVXXXGM10X devices.
CTMU
SENT1/2
CPU
Refer to Figure 3-1 for CPU diagram details.
16
16
PORTB
PORTC
PORTD
PORTE
PORTF
PORTG
PORTS
Peripheral Modules
Timer
Deadman
Op Amp/
Comparator
Timer
1.0DEVICE OVERVIEW
This document contains device-specific information for
the dsPIC33EVXXXGM00X/10X family Digital Signal
Note 1: This data sheet summarizes the features
of the dsPIC33EVXXXGM00X/10X family
of devices. It is not intended to be a
comprehensive reference source. To
complement the information in this data
sheet, refer to the related section in the
“dsPIC33/PIC24 Family Reference Manual”, which is available from the Microchip
Controller (DSC) devices.
dsPIC33EVXXXGM00X/10X family devices contain
extensive Digital Signal Processor (DSP) functionality
with a high-performance, 16-bit MCU architecture.
Figure 1-1 shows a general block diagram of the core
and peripheral modules. Table 1-1 lists the functions of
the various pins shown in the pinout diagrams.
web site (www.microchip.com).
2: Some registers and associated bits
described in this section may not be
available on all devices. Refer to
Section 4.0 “Memory Organization” in
this data sheet for device-specific register
and bit information.
FIGURE 1-1:dsPIC33EVXXXGM00X/10X FAMILY BLOCK DIAGRAM
NoNoExternal clock source input. Always associated with OSC1 pin
function.
Oscillator crystal output. Connects to crystal or resonator in Crystal
Oscillator mode. Optionally functions as CLKO in RC and EC modes.
Always associated with OSC2 pin function.
NoNoOscillator crystal input. ST buffer when configured in RC mode; CMOS
otherwise.
Oscillator crystal output. Connects to crystal or resonator in Crystal
Oscillator mode. Optionally functions as CLKO in RC and EC modes.
Compare Fault A input (for compare channels).
Yes
Compare Outputs 1 to 4.
No
External Interrupt 0.
Yes
External Interrupt 1.
Yes
External Interrupt 2.
No
Timer1 external clock input.
Yes
Timer2 external clock input.
No
Timer3 external clock input.
No
Timer4 external clock input.
No
Timer5 external clock input.
No
CTMU pulse output.
No
CTMU External Edge Input 1.
No
CTMU External Edge Input 2.
Yes
UART1 Clear-to-Send.
Yes
UART1 Ready-to-Send.
Yes
UART1 receive.
Yes
UART1 transmit.
Yes
UART2 Clear-to-Send.
Yes
UART2 Ready-to-Send.
Yes
UART2 receive.
Yes
UART2 transmit.
No
Synchronous serial clock input/output for SPI1.
No
SPI1 data in.
No
SPI1 data out.
No
SPI1 slave synchronization or frame pulse I/O.
DS70005144C-page 14 2013-2014 Microchip Technology Inc.
I/PSTNo Master Clear (Reset) input. This pin is an active-low Reset to the
ST
Yes
I
ST
Yes
O
O
O
O
O
O
O
—
Yes
ST
Yes
ST
ST
ST
ST
I
ST—Yes
—
I
—
—
I
—
IOAnalog—No
IOAnalog—No
IOAnalog—No
IOAnalog—No
IOAnalog—No
I
ST
I
ST
I
ST
I
ST
—
—
I
ST
—
ST
ST
I
ST
ST
I
ST
ST
I
No
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
NO
NO
Yes
No
No
Yes
Yes
No
No
No
No
No
No
Synchronous serial clock input/output for SPI2.
SPI2 data in.
SPI2 data out.
SPI2 slave synchronization or frame pulse I/O.
Synchronous serial clock input/output for I2C1.
Synchronous serial data input/output for I2C1.
Alternate synchronous serial clock input/output for I2C1.
Alternate synchronous serial data input/output for I2C1.
PWM Fault Inputs 1 and 2.
PWM Fault Inputs 3 to 8.
PWM Fault Input 32.
PWM dead-time compensation input.
PWM Low Outputs 1 to 3.
PWM High Outputs 1 to 3.
PWM Synchronization Input 1.
PWM Synchronization Output 1.
Data I/O pin for Programming/Debugging Communication Channel 1.
Clock input pin for Programming/Debugging Communication Channel 1.
Data I/O pin for Programming/Debugging Communication Channel 2.
Clock input pin for Programming/Debugging Communication Channel 2.
Data I/O pin for Programming/Debugging Communication Channel 3.
Clock input pin for Programming/Debugging Communication Channel 3.
DS70005144C-page 16 2013-2014 Microchip Technology Inc.
dsPIC33EVXXXGM00X/10X FAMILY
2.0GUIDELINES FOR GETTING
STARTED WITH 16-BIT
DIGITAL SIGNAL
CONTROLLERS
Note 1: This data sheet summarizes the features
of the dsPIC33EVXXXGM00X/10X family
of devices. It is not intended to be a
comprehensive reference source. To
complement the information in this data
sheet, refer to the related section in the
“dsPIC33/PIC24 Family Reference Manual”, which is available from the Microchip
web site (www.microchip.com).
2: Some registers and associated bits
described in this section may not be
available on all devices. Refer to
Section 4.0 “Memory Organization” in
this data sheet for device-specific register
and bit information.
2.1Basic Connection Requirements
Getting started with the dsPIC33EVXXXGM00X/10X
family of 16-bit microcontrollers (MCUs) requires
attention to a minimal set of device pin connections
before proceeding with development. The following is a
list of pin names, which must always be connected:
DD and VSS pins
•All V
(see Section 2.2 “Decoupling Capacitors”)
•All AV
•V
•MCLR
• PGECx/PGEDx pins used for In-Circuit Serial
• OSC1 and OSC2 pins when external oscillator
DD and AVSS pins (regardless if ADC module
is not used)
(see Section 2.2 “Decoupling Capacitors”)
CAP
(see Section 2.3 “CPU Logic Filter Capacitor
Connection (VCAP)”)
pin
(see Section 2.4 “Master Clear (MCLR) Pin”)
Programming™ (ICSP™) and debugging purposes
(see Section 2.5 “ICSP Pins”)
source is used
(see Section 2.6 “External Oscillator Pins”)
2.2Decoupling Capacitors
The use of decoupling capacitors on every pair of
power supply pins, such as V
SS, is required.
AV
Consider the following criteria when using decoupling
capacitors:
• Value and type of capacitor: A value of 0.1 µF
(100 nF), 10V-20V is recommended. This
capacitor should be a Low Equivalent Series
Resistance (low-ESR), and have resonance
frequency in the range of 20 MHz and higher. It is
recommended to use ceramic capacitors.
• Placement on the Printed Circuit Board (PCB):
The decoupling capacitors should be placed as
close to the pins as possible. It is recommended
to place the capacitors on the same side of the
board as the device. If space is constricted, the
capacitor can be placed on another layer on the
PCB using a via; however, ensure that the trace
length from the pin to the capacitor is within
one-quarter inch (6 mm) in length.
• Handling high-frequency noise: If the board is
experiencing high-frequency noise, above tens of
MHz, add a second ceramic-type capacitor in
parallel to the above described decoupling
capacitor. The value of the second capacitor can
be in the range of 0.01 µF to 0.001 µF. Place this
second capacitor next to the primary decoupling
capacitor. In high-speed circuit designs, consider
implementing a decade pair of capacitances as
close to the power and ground pins as possible.
For example, 0.1 µF in parallel with 0.001 µF.
• Maximizing performance: On the board layout
from the power supply circuit, run the power and
return traces to the decoupling capacitors first,
and then to the device pins. This ensures that the
decoupling capacitors are first in the power chain.
Equally important is to keep the trace length
between the capacitor and the power pins to a
minimum, thereby reducing the PCB track
inductance.
DD, VSS, AVDD and
Note:The AV
connected, regardless of the ADC voltage
reference source.
Note 1: As an option, instead of a hard-wired connection, an
inductor (L1) can be substituted between V
DD and
AV
DD to improve ADC noise rejection. The inductor
impedance should be less than 1 and the inductor
capacity greater than 10 mA.
Where:
f
FCNV
2
--------------=
f
1
2 LC
------------- ----------=
L
1
2fC
----------------------
2
=
(i.e., ADC Conversion Rate/2)
Note 1: R 10 k is recommended. A suggested
starting value is 10 k. Ensure that the MCLR
pin V
IH and VIL specifications are met.
2: R1 470 will limit any current flow into
MCLR
from the external capacitor, C, in the
event of MCLR
pin breakdown due to Electrostatic Discharge (ESD) or Electrical
Overstress (EOS). Ensure that the MCLR
pin
V
IH and VIL specifications are met.
C
R1
(2)
R
(1)
VDD
MCLR
dsPIC33EV
JP
FIGURE 2-1:RECOMMENDED
MINIMUM CONNECTION
The placement of this capacitor should be close to the
CAP pin. It is recommended that the trace length
V
should not exceed one-quarter inch (6 mm).
2.4Master Clear (MCLR) Pin
The MCLR pin provides two specific device
functions:
• Device Reset
• Device Programming and Debugging
During device programming and debugging, the
resistance and capacitance that can be added to the
pin must be considered. Device programmers and
debuggers drive the MCLR
specific voltage levels (V
transitions must not be adversely affected. Therefore,
specific values of R and C will need to be adjusted
based on the application and PCB requirements.
For example, as shown in Figure 2-1, it is
recommended that the capacitor, C, be isolated from
the MCLR
pin during programming and debugging
operations.
Place the components as shown in Figure 2-2 within
one-quarter inch (6 mm) from the MCLR
pin. Consequently,
IH and VIL) and fast signal
pin.
2.2.1TANK CAPACITORS
On boards with power traces running longer than six
inches in length, it is suggested to use a tank capacitor
for integrated circuits including DSCs to supply a local
power source. The value of the tank capacitor should
be determined based on the trace resistance that
connects the power supply source to the device, and
the maximum current drawn by the device in the application. In other words, select the tank capacitor so that
it meets the acceptable voltage sag at the device.
Typical values range from 4.7 µF to 47 µF.
2.3CPU Logic Filter Capacitor
A low-ESR (<1 Ohms) capacitor is required on the VCAP
pin, which is used to stabilize the internal voltage regulator
output. The V
must have a capacitor greater than 4.7 µF (10 µF is
recommended), with at least a 16V rating connected to
the ground. The type can be ceramic or tantalum. See
Section 30.0 “Electrical Characteristics” for additional
information.
DS70005144C-page 18 2013-2014 Microchip Technology Inc.
Connection (V
CAP pin must not be connected to VDD, and
CAP)
FIGURE 2-2:EXAMPLE OF MCLR PIN
CONNECTIONS
dsPIC33EVXXXGM00X/10X FAMILY
Main Oscillator
Guard Ring
Guard Trace
Oscillator Pins
2.5ICSP Pins
The PGECx and PGEDx pins are used for ICSP and
debugging purposes. It is recommended to keep the
trace length between the ICSP connector and the ICSP
pins on the device as short as possible. If the ICSP connector is expected to experience an ESD event, a
series resistor is recommended, with the value in the
range of a few tens of Ohms, not exceeding 100 Ohms.
Pull-up resistors, series diodes and capacitors on the
PGECx and PGEDx pins are not recommended as they
will interfere with the programmer/debugger communications to the device. If such discrete components are
an application requirement, they should be removed
from the circuit during programming and debugging.
Alternatively, refer to the AC/DC characteristics and
timing requirements information in the respective
device Flash programming specification for information
on capacitive loading limits and pin Voltage Input High
IH) and Voltage Input Low (VIL) requirements.
(V
Ensure that the “Communication Channel Select” (i.e.,
PGECx/PGEDx pins) programmed into the device
matches the physical connections for the ICSP to
MPLAB
REAL ICE™.
For more information on MPLAB ICD 2, ICD 3 and
REAL ICE connection requirements, refer to the
following documents that are available on the
Microchip web site (www.microchip.com).
• “Using MPLAB
• “MPLAB® ICD 3 Design Advisory” (DS51764)
• “MPLAB® REAL ICE™ In-Circuit Emulator User’s
• “Using MPLAB
®
PICkit™ 3, MPLAB ICD 3 or MPLAB
®
ICD 3” (poster) (DS51765)
Guide” (DS51616)
(poster) (DS51749)
®
REAL ICE™ In-Circuit Emulator”
2.6External Oscillator Pins
FIGURE 2-3:SUGGESTED PLACEMENT
OF THE OSCILLATOR
CIRCUIT
2.7Oscillator Value Conditions on
Device Start-up
If the PLL of the target device is enabled and
configured for the device start-up oscillator, the
maximum oscillator source frequency must be limited
to 5 MHz < F
start-up conditions. This intends that, if the external
oscillator frequency is outside this range, the
application must start up in the FRC mode first. The
default PLL settings after a POR with an oscillator
frequency outside this range will violate the device
operating speed.
Once the device powers up, the application firmware
can initialize the PLL SFRs, CLKDIV and PLLFBD, to a
suitable value, and then perform a clock switch to the
Oscillator + PLL clock source.
Note:Clock switching must be enabled in the
IN < 13.6 MHz to comply with device PLL
device Configuration Word.
Many DSCs have options for at least two oscillators: a
high-frequency primary oscillator and a low-frequency
secondary oscillator. For more information, see
Section 9.0 “Oscillator Configuration”.
The oscillator circuit should be placed on the same
side of the board as the device. Also, place the
oscillator circuit close to the respective oscillator pins,
not exceeding one-half inch (12 mm) distance
between them. The load capacitors should be placed
next to the oscillator itself, on the same side of the
board. Use a grounded copper pour around the
oscillator circuit to isolate them from surrounding
circuits. The grounded copper pour should be routed
directly to the MCU ground. Do not run any signal
traces or power traces inside the ground pour. Also, if
using a two-sided board, avoid any traces on the
other side of the board where the crystal is placed as
shown in Figure 2-3.
Unused I/O pins should be configured as outputs and
driven to a logic low state.
Alternatively, connect a 1k to 10k resistor between V
and unused pins, and drive the output to logic low.
SS
dsPIC33EVXXXGM00X/10X FAMILY
NOTES:
DS70005144C-page 20 2013-2014 Microchip Technology Inc.
dsPIC33EVXXXGM00X/10X FAMILY
3.0CPU
Note 1: This data sheet summarizes the features
of the dsPIC33EVXXXGM00X/10X family
of devices. It is not intended to be a
comprehensive reference source. To
complement the information in this data
sheet, refer to “CPU” (DS70359) in the
“dsPIC33/PIC24 Family ReferenceManual”, which is available from the
Microchip web site (www.microchip.com).
2: Some registers and associated bits
described in this section may not be
available on all devices. Refer to
Section 4.0 “Memory Organization” in
this data sheet for device-specific register
and bit information.
The CPU has a 16-bit (data) modified Harvard architecture with an enhanced instruction set, including
significant support for digital signal processing. The
CPU has a 24-bit instruction word with a variable length
opcode field. The Program Counter (PC) is 23 bits wide
and addresses up to 4M x 24 bits of user program
memory space.
An instruction prefetch mechanism helps maintain
throughput and provides predictable execution. Most
instructions execute in a single-cycle effective execution rate, with the exception of instructions that change
the program flow, the double-word move (MOV.D)
instruction, PSV accesses and the table instructions.
Overhead-free program loop constructs are supported
using the DO and REPEAT instructions, both of which
are interruptible at any point.
3.1Registers
The dsPIC33EVXXXGM00X/10X family devices have
sixteen, 16-bit Working registers in the programmer’s
model. Each of the Working registers can act as a Data,
Address or Address Offset register. The sixteenth
Working register (W15) operates as a Software Stack
Pointer for interrupts and calls.
In addition, the dsPIC33EVXXXGM00X/10X devices
include two alternate Working register sets, which
consist of W0 through W14. The alternate registers can
be made persistent to help reduce the saving and
restoring of register content during Interrupt Service
Routines (ISRs). The alternate Working registers can
be assigned to a specific Interrupt Priority Level (IPL1
through IPL6) by configuring the CTXTx<2:0> bits in
the FALTREG Configuration register.
The alternate Working registers can also be accessed
manually by using the CTXTSWP instruction.
The CCTXI<2:0> and MCTXI<2:0> bits in the CTXTSTAT
register can be used to identify the current, and most
recent, manually selected Working register sets.
3.2Instruction Set
The device instruction set has two classes of instructions: the MCU class of instructions and the DSP class
of instructions. These two instruction classes are
seamlessly integrated into the architecture and execute from a single execution unit. The instruction set
includes many addressing modes and was designed
for optimum C compiler efficiency.
3.3Data Space Addressing
The Base Data Space can be addressed as 4K words
or 8 Kbytes and is split into two blocks, referred to as X
and Y data memory. Each memory block has its own
independent Address Generation Unit (AGU). The
MCU class of instructions operates solely through the
X memory AGU, which accesses the entire memory
map as one linear Data Space. On dsPIC33EV
devices, certain DSP instructions operate through the
X and Y AGUs to support dual operand reads, which
splits the data address space into two parts. The X and
Y Data Space boundary is device-specific.
The upper 32 Kbytes of the Data Space (DS) memory
map can optionally be mapped into Program Space (PS)
at any 16K program word boundary. The Program-toData Space mapping feature, known as Program Space
Visibility (PSV), lets any instruction access Program
Space as if it were Data Space. Moreover, the Base Data
Space address is used in conjunction with a Data Space
Read or Write Page register (DSRPAG or DSWPAG) to
form an Extended Data Space (EDS) address. The EDS
can be addressed as 8M words or 16 Mbytes. For more
information on EDS, PSV and table accesses, refer to
“Data Memory” (DS70595) and “Program Memory”
(DS70613) in the “dsPIC33/PIC24 Family ReferenceManual”.
On dsPIC33EV devices, overhead-free circular buffers
(Modulo Addressing) are supported in both X and Y
address spaces. The Modulo Addressing removes the
software boundary checking overhead for DSP
algorithms. The X AGU Circular Addressing can be
used with any of the MCU class of instructions. The X
AGU also supports Bit-Reversed Addressing to greatly
simplify input or output data reordering for radix-2 FFT
algorithms. Figure 3-1 illustrates the block diagram of
the dsPIC33EVXXXGM00X/10X family devices.
3.4Addressing Modes
The CPU supports these addressing modes:
• Inherent (no operand)
• Relative
•Literal
• Memory Direct
• Register Direct
• Register Indirect
Each instruction is associated with a predefined
addressing mode group, depending upon its functional
requirements. As many as six addressing modes are
supported for each instruction.
FIGURE 3-1:dsPIC33EVXXXGM00X/10X FAMILY CPU BLOCK DIAGRAM
DS70005144C-page 22 2013-2014 Microchip Technology Inc.
dsPIC33EVXXXGM00X/10X FAMILY
3.5Programmer’s Model
The programmer’s model for the dsPIC33EVXXXGM00X/
10X family is shown in Figure 3-2. All registers in the
programmer’s model are memory-mapped and can be
manipulated directly by instructions. Table 3-1 lists a
description of each register.
In addition to the registers contained in the
programmer’s model, the dsPIC33EVXXXGM00X/10X
family devices contain control registers for Modulo
Addressing and Bit-Reversed Addressing, and
interrupts. These registers are described in subsequent
sections of this document.
All registers associated with the programmer’s model
are memory-mapped, as shown in Table 4-1.
TABLE 3-1:PROGRAMMER’S MODEL REGISTER DESCRIPTIONS
Register(s) NameDescription
W0 through W15
W0 through W14
W0 through W14
ACCA, ACCB40-Bit DSP Accumulators
PC23-Bit Program Counter
SRALU and DSP Engine STATUS Register
SPLIMStack Pointer Limit Value Register
TBLPAGTable Memory Page Address Register
DSRPAGExtended Data Space (EDS) Read Page Register
RCOUNTREPEAT Loop Count Register
DCOUNTDO Loop Count Register
DOSTARTH
DOENDH, DOENDLDO Loop End Address Register (High and Low)
CORCONContains DSP Engine, DO Loop Control and Trap Status bits
Note 1:Memory-mapped W0 through W14 represents the value of the register in the currently active CPU context.
2:The DOSTARTH and DOSTARTL registers are read-only.
DS70005144C-page 24 2013-2014 Microchip Technology Inc.
dsPIC33EVXXXGM00X/10X FAMILY
3.6CPU Control Registers
REGISTER 3-1:SR: CPU STATUS REGISTER
R/W-0R/W-0R/W-0R/W-0R/C-0R/C-0R-0R/W-0
OAOBSA
(3)
bit 15bit 8
R/W-0R/W-0R/W-0R-0R/W-0R/W-0R/W-0R/W-0
IPL2
(1,2)
IPL1
(1,2)
IPL0
(1,2)
bit 7bit 0
Legend:C = Clearable bit
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown
bit 15OA: Accumulator A Overflow Status bit
1 = Accumulator A has overflowed
0 = Accumulator A has not overflowed
bit 14OB: Accumulator B Overflow Status bit
1 = Accumulator B has overflowed
0 = Accumulator B has not overflowed
bit 13SA: Accumulator A Saturation ‘Sticky’ Status bit
1 = Accumulator A is saturated or has been saturated at some time
0 = Accumulator A is not saturated
bit 12SB: Accumulator B Saturation ‘Sticky’ Status bit
1 = Accumulator B is saturated or has been saturated at some time
0 = Accumulator B is not saturated
bit 11OAB: OA || OB Combined Accumulator Overflow Status bit
1 = Accumulator A or B has overflowed
0 = Accumulator A and B have not overflowed
bit 10SAB: SA || SB Combined Accumulator ‘Sticky’ Status bit
1 = Accumulator A or B is saturated or has been saturated at some time
0 = Accumulator A and B have not been saturated
bit 9DA: DO Loop Active bit
1 = DO loop is in progress
0 = DO loop is not in progress
bit 8DC: MCU ALU Half Carry/Borrow
1 = A carry-out from the 4th low-order bit (for byte-sized data) or 8th low-order bit (for word-sized data)
of the result occurred
0 = No carry-out from the 4th low-order bit (for byte-sized data) or 8th low-order bit (for word-sized
data) of the result occurred
(3)
SB
OABSABDADC
RANOVZC
(3)
(3)
bit
Note 1:The IPL<2:0> bits are concatenated with the IPL3 bit (CORCON<3>) to form the CPU Interrupt Priority
Level. The value in parentheses indicates the IPL if IPL3 = 1. User interrupts are disabled when IPL3 = 1.
2:The IPL<2:0> Status bits are read-only when the NSTDIS bit (INTCON1<15>) = 1.
3:A data write to the SR register can modify the SA and SB bits by either a data write to SA and SB or by
clearing the SAB bit. To avoid a possible SA or SB bit write race condition, the SA and SB bits should not
be modified using the bit operations.
bit 7-5IPL<2:0>: CPU Interrupt Priority Level Status bits
111 = CPU Interrupt Priority Level is 7 (15); user interrupts are disabled
110 = CPU Interrupt Priority Level is 6 (14)
101 = CPU Interrupt Priority Level is 5 (13)
100 = CPU Interrupt Priority Level is 4 (12)
011 = CPU Interrupt Priority Level is 3 (11)
010 = CPU Interrupt Priority Level is 2 (10)
001 = CPU Interrupt Priority Level is 1 (9)
000 = CPU Interrupt Priority Level is 0 (8)
bit 4RA: REPEAT Loop Active bit
1 = REPEAT loop is in progress
0 = REPEAT loop is not in progress
bit 3N: MCU ALU Negative bit
1 = Result was negative
0 = Result was non-negative (zero or positive)
bit 2OV: MCU ALU Overflow bit
This bit is used for signed arithmetic (2’s complement). It indicates an overflow of the magnitude that
causes the sign bit to change state.
1 = Overflow occurred for signed arithmetic (in this arithmetic operation)
0 = Overflow has not occurred for signed arithmetic
bit 1Z: MCU ALU Zero bit
1 = An operation that affects the Z bit has set it at some time in the past
0 = The most recent operation that affects the Z bit has cleared it (i.e., a non-zero result)
bit 0C: MCU ALU Carry/Borrow
1 = A carry-out from the Most Significant bit (MSb) of the result occurred
0 = No carry-out from the Most Significant bit of the result occurred
bit
(1,2)
Note 1:The IPL<2:0> bits are concatenated with the IPL3 bit (CORCON<3>) to form the CPU Interrupt Priority
Level. The value in parentheses indicates the IPL if IPL3 = 1. User interrupts are disabled when IPL3 = 1.
2:The IPL<2:0> Status bits are read-only when the NSTDIS bit (INTCON1<15>) = 1.
3:A data write to the SR register can modify the SA and SB bits by either a data write to SA and SB or by
clearing the SAB bit. To avoid a possible SA or SB bit write race condition, the SA and SB bits should not
be modified using the bit operations.
DS70005144C-page 26 2013-2014 Microchip Technology Inc.
dsPIC33EVXXXGM00X/10X FAMILY
REGISTER 3-2:CORCON: CORE CONTROL REGISTER
R/W-0U-0R/W-0R/W-0R/W-0R-0R-0R-0
(1)
(1)
(2)
DL2DL1DL0
SFARNDIF
VAR
bit 15bit 8
R/W-0R/W-0R/W-1R/W-0R/C-0R-0R/W-0R/W-0
SATASATBSATDWACCSATIPL3
bit 7bit 0
Legend:C = Clearable bit
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown
bit 15VAR: Variable Exception Processing Latency Control bit
bit 14Unimplemented: Read as ‘0’
bit 13-12US<1:0>: DSP Multiply Unsigned/Signed Control bits
bit 11EDT: Early DO Loop Termination Control bit
bit 10-8DL<2:0>: DO Loop Nesting Level Status bits
bit 7SATA: ACCA Saturation Enable bit
bit 6SATB: ACCB Saturation Enable bit
bit 5SATDW: Data Space Write from DSP Engine Saturation Enable bit
bit 4ACCSAT: Accumulator Saturation Mode Select bit
—US1US0EDT
1 = Variable exception processing latency is enabled
0 = Fixed exception processing latency is enabled
11 = Reserved
10 = DSP engine multiplies are mixed-sign
01 = DSP engine multiplies are unsigned
00 = DSP engine multiplies are signed
1 = Terminates executing DO loop at the end of current loop iteration
0 = No effect
111 = 7 DO loops are active
•
•
•
001 = 1 DO loop is active
000 = 0 DO loops are active
1 = Accumulator A saturation is enabled
0 = Accumulator A saturation is disabled
1 = Accumulator B saturation is enabled
0 = Accumulator B saturation is disabled
1 = Data Space write saturation is enabled
0 = Data Space write saturation is disabled
REGISTER 3-2:CORCON: CORE CONTROL REGISTER (CONTINUED)
bit 3IPL3: CPU Interrupt Priority Level Status bit 3
1 = CPU Interrupt Priority Level is greater than 7
0 = CPU Interrupt Priority Level is less than 7
bit 2SFA: Stack Frame Active Status bit
1 = Stack frame is active; W14 and W15 address 0x0000 to 0xFFFF, regardless of DSRPAG and
DSWPAG values
0 = Stack frame is not active; W14 and W15 address of EDS or Base Data Space
bit 1RND: Rounding Mode Select bit
1 = Biased (conventional) rounding is enabled
0 = Unbiased (convergent) rounding is enabled
bit 0IF: Integer or Fractional Multiplier Mode Select bit
1 = Integer mode is enabled for DSP multiply
0 = Fractional mode is enabled for DSP multiply
Note 1:This bit is always read as ‘0’.
2:The IPL3 bit is concatenated with the IPL<2:0> bits (SR<7:5>) to form the CPU Interrupt Priority Level.
(2)
DS70005144C-page 28 2013-2014 Microchip Technology Inc.
dsPIC33EVXXXGM00X/10X FAMILY
REGISTER 3-3:CTXTSTAT: CPU W REGISTER CONTEXT STATUS REGISTER
U-0U-0U-0U-0U-0R-0R-0R-0
—————CCTXI2CCTXI1CCTXI0
bit 15bit 8
U-0U-0U-0U-0U-0R-0R/W-0R/W-0
—————MCTXI2MCTXI1MCTXI0
bit 7bit 0
Legend:
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown
bit 15-11Unimplemented: Read as ‘0’
bit 10-8CCTXI<2:0>: Current (W Register) Context Identifier bits
111 = Reserved
•
•
•
011 = Reserved
010 = Alternate Working Register Set 2 is currently in use
001 = Alternate Working Register Set 1 is currently in use
000 = Default register set is currently in use
bit 7-3Unimplemented: Read as ‘0’
bit 2-0MCTXI<2:0>: Manual (W Register) Context Identifier bits
111 = Reserved
•
•
•
011 = Reserved
010 = Alternate Working Register Set 2 was most recently manually selected
001 = Alternate Working Register Set 1 was most recently manually selected
000 = Default register set was most recently manually selected
The dsPIC33EVXXXGM00X/10X family ALU is 16 bits
wide and is capable of addition, subtraction, bit shifts
and logic operations. Unless otherwise mentioned,
arithmetic operations are two’s complement in nature.
Depending on the operation, the ALU can affect the
values of the Carry (C), Zero (Z), Negative (N),
Overflow (OV) and Digit Carry (DC) Status bits in the
SR register. The C and DC Status bits operate as
and Digit Borrow bits, respectively, for
Borrow
subtraction operations.
The ALU can perform 8-bit or 16-bit operations,
depending on the mode of the instruction that is used.
The data for the ALU operation can come from the W
register array or from the data memory, depending on
the addressing mode of the instruction. Similarly, the
output data from the ALU can be written to the W
register array or a data memory location.
For information on the SR bits affected by each
instruction, refer to the “16-bit MCU and DSCProgrammer’s Reference Manual” (DS70157).
The core CPU incorporates hardware support for both
multiplication and division. This includes a dedicated
hardware multiplier and support hardware for 16-bit
divisor division.
3.7.1MULTIPLIER
Using the high-speed, 17-bit x 17-bit multiplier, the ALU
supports unsigned, signed or mixed-sign operation in
several MCU multiplication modes:
• 16-bit x 16-bit signed
• 16-bit x 16-bit unsigned
• 16-bit signed x 5-bit (literal) unsigned
• 16-bit signed x 16-bit unsigned
• 16-bit unsigned x 5-bit (literal) unsigned
• 16-bit unsigned x 16-bit signed
• 8-bit unsigned x 8-bit unsigned
3.8DSP Engine
The DSP engine consists of a high-speed, 17-bit x 17-bit
multiplier, a 40-bit barrel shifter and a 40-bit adder/
subtracter (with two target accumulators, round and
saturation logic).
The DSP engine can also perform inherent accumulatorto-accumulator operations that require no additional
data. These instructions are ADD, SUB and NEG.
The DSP engine has options selected through bits in
the CPU Core Control register (CORCON) as follows:
• Fractional or Integer DSP Multiply (IF)
• Signed, Unsigned or Mixed-Sign DSP Multiply (US)
• Conventional or Convergent Rounding (RND)
• Automatic Saturation On/Off for ACCA (SATA)
• Automatic Saturation On/Off for ACCB (SATB)
• Automatic Saturation On/Off for Writes to Data
Memory (SATDW)
• Accumulator Saturation mode Selection
(ACCSAT)
TABLE 3-2:DSP INSTRUCTIONS
SUMMARY
Instruction
CLRA = 0Yes
EDA = (x – y)
EDACA = A + (x – y)
MACA = A + (x • y)Yes
MACA = A + x
MOVSACNo change in AYes
MPYA = x • yNo
MPYA = x
MPY.NA = – x • yNo
MSCA = A – x • yYe s
Algebraic
Operation
2
2
2
2
ACC Write
Back
No
No
No
No
3.7.2DIVIDER
The divide block supports 32-bit/16-bit and 16-bit/16-bit
signed and unsigned integer divide operations with the
following data sizes:
• 32-bit signed/16-bit signed divide
• 32-bit unsigned/16-bit unsigned divide
• 16-bit signed/16-bit signed divide
• 16-bit unsigned/16-bit unsigned divide
The quotient for all divide instructions ends up in W0
and the remainder in W1. The 16-bit signed and
unsigned DIV instructions can specify any W register
for both the 16-bit divisor (Wn) and any W register
(aligned) pair (W(m + 1):Wm) for the 32-bit dividend.
The divide algorithm takes the single-cycle per bit of
the divisor, so both 32-bit/16-bit and 16-bit/16-bit
instructions take the same number of cycles to
execute.
DS70005144C-page 30 2013-2014 Microchip Technology Inc.
Loading...
+ 414 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.