Escolar Documentos
Profissional Documentos
Cultura Documentos
Data Sheet
High-Performance, 16-Bit
Digital Signal Controllers
• 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 Microchip’s 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 Microchip’s 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.
UART
I2CTM
CAN
SRAM EEPROM Timer Input A/D 10-bit Quad
SPI
Device Pins Mem. Bytes/ Comp/Std Control
Bytes Bytes 16-bit Cap 1 Msps Enc
Instructions PWM PWM
* This table provides a summary of the dsPIC30F2010 peripheral features. Other available devices in the dsPIC30F
Motor Control and Power Conversion Family are shown for feature comparison.
MCLR 1 28 AVDD
EMUD3/AN0/VREF+/CN2/RB0 2 27 AVSS
EMUC3/AN1/VREF-/CN3/RB1 3 26 PWM1L/RE0
AN2/SS1/LVDIN/CN4/RB2 4 25 PWM1H/RE1
dsPIC30F2010
AN3/INDX/CN5/RB3 5 24 PWM2L/RE2
AN4/QEA/IC7/CN6/RB4 6 23 PWM2H/RE3
AN5/QEB/IC8/CN7/RB5 7 22 PWM3L/RE4
VSS 8 21 PWM3H/RE5
OSC1/CLKI 9 20 VDD
OSC2/CLKO/RC15 10 19 VSS
EMUD1/SOSCI/T2CK/U1ATX/CN1//RC13 11 18 PGC/EMUC/U1RX/SDI1/SDA/RF2
EMUC1/SOSCO/T1CK/U1ARX/CN0/RC14 12 17 PGD/EMUD/U1TX/SDO1/SCL/RF3
VDD 13 16 FLTA/INT0/SCK1/OCFA/RE8
EMUD2/OC2/IC2/INT2/RD1 14 15 EMUC2/OC1/IC1/INT1/RD0
28-Pin QFN
EMUC3/AN1/VREF- /CN3/RB1
EMUD3/AN0/VREF+/CN2/RB0
PWM1H/RE1
PWM1L/RE0
MCLR
AVDD
AVSS
22
28
27
26
25
24
23
AN2/SS1/LVDIN/CN4/RB2 1 21 PWM2L/RE2
AN3/INDX/CN5 RB3 2 20 PWM2H/RE3
AN4/QEA/IC7/CN6/RB4 3 19 PWM3L/RE4
AN5/QEB/IC8/CN7/RB5 4 dsPIC30F2010 18 PWM3H/RE5
VSS 5 17 VDD
OSC1/CLKI 6 16 VSS
OSC2/CLKO/RC15 7 15 PGC/EMUC/U1RX/SDI1/SDA/RF2
10
12
13
14
11
8
9
EMUD1/SOSCI/T2CK/U1ATX/CN1/RC13
EMUC1/SOSCO/T1CK/U1ARX/CN0/RC14
EMUD2/OC2/IC2/INT2/RD1
VDD
EMUC2/OC1/IC1/INT1/RD0
FLTA/INT0/SCK1/OCFA/RE8
PGD/EMUD/U1TX/SDO1/SCL/RF3
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)
• The Microchip Corporate Literature Center; U.S. FAX: (480) 792-7277
When contacting a sales office or the literature center, please specify which device, revision of silicon and data sheet (include
literature number) you are using.
Y Data Bus
X Data Bus
16 16 16 16
16
Interrupt Data Latch Data Latch
Controller PSV & Table
Data Access Y Data X Data
24 Control Block 8 16 RAM RAM
(256 bytes) (256 bytes)
Address Address
24 Latch Latch
16 16 16
24 X RAGU
Y AGU
PCU PCH PCL X WAGU EMUD3/AN0/VREF+/CN2/RB0
Program Counter EMUC3/AN1/VREF-/CN3/RB1
Address Latch Stack Loop AN2/SS1/LVDIN/CN4/RB2
Control Control
Logic Logic AN3/INDX/CN5/RB3
Program Memory
(12 Kbytes) AN4/QEA/IC7/CN6/RB4
AN5/QEB/IC8/CN7/RB5
Data EEPROM
(1 Kbyte) Effective Address PORTB
Data Latch 16
ROM Latch 16
24
IR
EMUD1/SOSCI/T2CK/U1ATX/CN1/RC13
16 EMUC1/SOSCO/T1CK/U1ARX/CN0/RC14
16
OSC2/CLKO/RC15
16 x 16
W Reg Array PORTC
Decode
Instruction
Decode & 16 16
Control
Input Output
10-bit ADC Capture Compare I2C™
PWM1L/RE0
Module Module
PWM1H/RE1
PWM2L/RE2
PWM2H/RE3
PWM3L/RE4
PWM3H/RE5
Motor Control FLTA/INT0/SCK1/OCFA/RE8
SPI1 Timers QEI UART1
PWM
PORTE
PGC/EMUC/U1RX/SDI1/SDA/RF2
PGD/EMUD/U1TX/SDO1/SCL/RF3
PORTF
D15 D0
W0/WREG
PUSH.S Shadow
W1
DO Shadow
W2
W3 Legend
W4
DSP Operand W5
Registers
W6
W7
Working Registers
W8
W9
DSP Address
Registers W10
W11
W12/DSP Offset
W13/DSP Write-Back
W14/Frame Pointer
W15/Stack Pointer
PC22 PC0
0 Program Counter
7 0
TABPAG
TBLPAG Data Table Page Address
7 0
PSVPAG Program Space Visibility Page Address
15 0
RCOUNT REPEAT Loop Counter
15 0
DCOUNT DO Loop Counter
22 0
DOSTART DO Loop Start Address
22
DOEND DO Loop End Address
15 0
CORCON Core Configuration Register
SRH SRL
S
a
40 40-bit Accumulator A 40 Round t 16
40-bit Accumulator B u
Logic r
a
Carry/Borrow Out t
Saturate e
Carry/Borrow In Adder
Negate
40
40 40
Barrel
16
Shifter
X Data Bus
40
Sign-Extend
Y Data Bus
32 16
Zero Backfill
32
33
17-bit
Multiplier/Scaler
16 16
To/From W Array
User Memory
PC, table instruction Effective Address (EA), or data 0000FE
Space
000100
space EA, when program space is mapped into data
User Flash
space, as defined by Table 3-1. Note that the program Program Memory
space address is incremented by two between succes- (4K instructions)
sive program words, in order to provide compatibility 001FFE
002000
with data space addressing. Reserved
(Read 0’s)
User program space access is restricted to the lower 7FFBFE
4M instruction word address range (0x000000 to 7FFC00
Data EEPROM
0x7FFFFE), for all accesses other than TBLRD/TBLWT, (1 Kbyte)
which use TBLPAG<7> to determine user or configura- 7FFFFE
8005BE
Space
8005C0
UNITID (32 instr.)
8005FE
800600
Reserved
F7FFFE
Device Configuration F80000
Registers F8000E
F80010
Reserved
FEFFFE
DEVID (2) FF0000
FFFFFE
23 bits
Using
Program 0 Program Counter 0
Counter
Select
1 EA
Using
Program 0 PSVPAG Reg
Space
Visibility 8 bits 15 bits
EA
User/ Byte
Configuration 24-bit EA
Space Select
Select
Note: Program Space Visibility cannot be used to access bits <23:16> of a word in program memory.
PC Address 23 16 8 0
0x000000 00000000
0x000002 00000000
0x000004 00000000
0x000006 00000000
TBLRDL.B (Wn<0> = 0)
TBLRDL.W
Program Memory
‘Phantom’ Byte
TBLRDL.B (Wn<0> = 1)
(Read as ‘0’).
TBLRDH.W
PC Address 23 16 8 0
0x000000 00000000
0x000002 00000000
0x000004 00000000
0x000006 00000000
TBLRDH.B (Wn<0> = 0)
Program Memory
‘Phantom’ Byte
(Read as ‘0’) TBLRDH.B (Wn<0> = 1)
3.1.2 DATA ACCESS FROM PROGRAM Note that by incrementing the PC by 2 for each pro-
MEMORY USING PROGRAM gram memory word, the Least Significant 15 bits of
SPACE VISIBILITY data space addresses directly map to the Least Signif-
icant 15 bits in the corresponding program space
The upper 32 Kbytes of data space may optionally be addresses. The remaining bits are provided by the Pro-
mapped into any 16K word program space page. This gram Space Visibility Page register, PSVPAG<7:0>, as
provides transparent access of stored constant data shown in Figure 3-5.
from X data space, without the need to use special
instructions (i.e., TBLRDL/H, TBLWTL/H instructions). Note: PSV access is temporarily disabled during
table reads/writes.
Program space access through the data space occurs
if the MSb of the data space EA is set and program For instructions that use PSV which are executed
space visibility is enabled, by setting the PSV bit in the outside a REPEAT loop:
Core Control register (CORCON). The functions of • The following instructions will require one instruc-
CORCON are discussed in Section 2.4 “DSP tion cycle in addition to the specified execution
Engine”, DSP Engine. time:
Data accesses to this area add an additional cycle to - MAC class of instructions with data operand
the instruction being executed, since two program prefetch
memory fetches are required. - MOV instructions
Note that the upper half of addressable data space is - MOV.D instructions
always part of the X data space. Therefore, when a • All other instructions will require two instruction
DSP operation uses program space mapping to access cycles in addition to the specified execution time
this memory region, Y data space should typically con- of the instruction.
tain state (variable) data for DSP operations, whereas
X data space should typically contain coefficient For instructions that use PSV which are executed
(constant) data. inside a REPEAT loop:
Although each data space address, 0x8000 and higher, • The following instances will require two instruction
maps directly into a corresponding program memory cycles in addition to the specified execution time
address (see Figure 3-5), only the lower 16-bits of the of the instruction:
24-bit program word are used to contain the data. The - Execution in the first iteration
upper 8 bits should be programmed to force an illegal - Execution in the last iteration
instruction to maintain machine robustness. Refer to - Execution prior to exiting the loop due to an
the “dsPIC30F/33F Programmer’s Reference Manual” interrupt
(DS70157) for details on instruction encoding.
- Execution upon re-entering the loop after an
interrupt is serviced
• Any other iteration of the REPEAT loop will allow
the instruction, accessing data using PSV, to
execute in a single cycle.
15 PSVPAG(1)
EA<15> = 0 0x00
8
Data 16
Space 0x8000
EA 15 23 15 0
Address
EA<15> = 1 0x001200
15 Concatenation 23
Note: 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).
3.2 Data Address Space When executing any instruction other than one of the
MAC class of instructions, the X block consists of the
The core has two data spaces. The data spaces can be 256 byte data address space (including all Y
considered either separate (for some DSP instruc- addresses). When executing one of the MAC class of
tions), or as one unified linear address range (for MCU instructions, the X block consists of the 256 bytes data
instructions). The data spaces are accessed using two address space excluding the Y address block (for data
Address Generation Units (AGUs) and separate data reads only). In other words, all other instructions regard
paths. the entire data memory as one composite address
space. The MAC class instructions extract the Y
3.2.1 DATA SPACE MEMORY MAP address space from data space and address it using
The data space memory is split into two blocks, X and EAs sourced from W10 and W11. The remaining X data
Y data space. A key element of this architecture is that space is addressed using W8 and W9. Both address
Y space is a subset of X space, and is fully contained spaces are concurrently accessed only with the MAC
within X space. In order to provide an apparent linear class instructions.
addressing space, X and Y spaces have contiguous A data space memory map is shown in Figure 3-6.
addresses.
MSB LSB
Address 16 bits Address
MSB LSB
0x0001 0x0000
SFR Space SFR Space
(Note)
0x07FF 0x07FE
0x0801 0x0800
2560 bytes
Near
X Data RAM (X)
256 bytes Data
Space
512 bytes 0x08FF 0x08FE
SRAM Space 0x0901 0x0900
0x09FF 0x0A00
(Note)
0x8001 0x8000
X Data
Unimplemented (X)
Optionally
Mapped
into Program
Memory
0xFFFF 0xFFFE
X SPACE
UNUSED
X SPACE
X SPACE
UNUSED
Indirect EA using any W Indirect EA using W8, W9 Indirect EA using W10, W11
POP: [--W15]
PUSH: [W15++]
DS70118F-page 28
W3 0006 W3 0000 0000 0000 0000
W4 0008 W4 0000 0000 0000 0000
W5 000A W5 0000 0000 0000 0000
W6 000C W6 0000 0000 0000 0000
W7 000E W7 0000 0000 0000 0000
W8 0010 W8 0000 0000 0000 0000
W9 0012 W9 0000 0000 0000 0000
dsPIC30F2010
DS70118F-page 29
dsPIC30F2010
dsPIC30F2010
NOTES:
File Register Direct The address of the file register is specified explicitly.
Register Direct The contents of a register are accessed directly.
Register Indirect The contents of Wn forms the Effective Address (EA).
Register Indirect Post-modified The contents of Wn forms the EA. Wn is post-modified (incremented or
decremented) by a constant value.
Register Indirect Pre-modified Wn is pre-modified (incremented or decremented) by a signed constant value
to form the EA.
Register Indirect with Register Offset The sum of Wn and Wb forms the EA.
Register Indirect with Literal Offset The sum of Wn and a literal forms the EA.
Byte
Address MOV #0x1100,W0
MOV W0, XMODSRT ;set modulo start address
MOV #0x1163,W0
MOV W0,MODEND ;set modulo end address
0x1100 MOV #0x8001,W0
MOV W0,MODCON ;enable W1, X AGU for modulo
MOV #0x0000,W0 ;W0 holds buffer fill value
MOV #0x1110,W1 ;point W1 to buffer
DO AGAIN,#0x31 ;fill the 50 buffer locations
MOV W0, [W1++] ;fill the next location
AGAIN: INC W0,W0 ;increment the fill value
0x1163
Pivot Point
XB = 0x0008 for a 16-word Bit-Reversed Buffer
2. The Stack Pointer is loaded with a value which IVT Reserved Vector
Reserved Vector
is less than 0x0800 (simple stack underflow). Reserved Vector
Interrupt 0 Vector 0x000014
Oscillator Fail Trap: Interrupt 1 Vector
—
—
This trap is initiated if the external oscillator fails and —
operation becomes reliant on an internal RC backup. Interrupt 52 Vector
Interrupt 53 Vector 0x00007E
Reserved 0x000080
Reserved 0x000082
Reserved 0x000084
Oscillator Fail Trap Vector
Stack Error Trap Vector
Address Error Trap Vector
Math Error Trap Vector
AIVT Reserved Vector
Reserved Vector
Reserved Vector
Interrupt 0 Vector 0x000094
Interrupt 1 Vector
—
—
—
Interrupt 52 Vector
Interrupt 53 Vector 0x0000FE
DS70118F-page 42
IFS1 0086 — — — — — — — — INT2IF — — — — IC8IF IC7IF INT1IF 0000 0000 0000 0000
IFS2 0088 — — — — FLTAIF — — QEIIF PWMIF — — — — — — — 0000 0000 0000 0000
IEC0 008C CNIE MI2CIE SI2CIE NVMIE ADIE U1TXIE U1RXIE SPI1IE T3IE T2IE OC2IE IC2IE T1IE OC1IE IC1IE INT0IE 0000 0000 0000 0000
IEC1 008E — — — — — — — — INT2IE — — — — IC8IE IC7IE INT1IE 0000 0000 0000 0000
IEC2 0090 — — — — FLTAIE — — QEIIE PWMIE — — — — — — — 0000 0000 0000 0000
IPC0 0094 — T1IP<2:0> — OC1IP<2:0> — IC1IP<2:0> — INT0IP<2:0> 0100 0100 0100 0100
IPC1 0096 — T31P<2:0> — T2IP<2:0> — OC2IP<2:0> — IC2IP<2:0> 0100 0100 0100 0100
dsPIC30F2010
IPC2 0098 — ADIP<2:0> — U1TXIP<2:0> — U1RXIP<2:0> — SPI1IP<2:0> 0100 0100 0100 0100
IPC3 009A — CNIP<2:0> — MI2CIP<2:0> — SI2CIP<2:0> — NVMIP<2:0> 0100 0100 0100 0100
IPC4 009C — — — — — IC8IP<2:0> — IC7IP<2:0> — INT1IP<2:0> 0100 0100 0100 0100
IPC5 009E — INT2IP<2:0> — — — — — — — — — — — — 0100 0000 0000 0000
IPC6 00A0 — — — — — — — — — — — — — — — — 0000 0000 0000 0000
IPC7 00A2 — — — — — — — — — — — — — — — — 0000 0000 0000 0000
IPC8 00A4 — — — — — — — — — — — — — — — — 0000 0000 0000 0000
IPC9 00A6 — PWMIP<2:0> — — — — — — — — — — — — 0000 0000 0000 0000
IPC10 00A8 — FLTAIP<2:0> — — — — — — — — — QEIIP<2:0> 0100 0000 0000 0100
IPC11 00AA — — — — — — — — — — — — — — — — 0000 0000 0000 0000
Legend: u = uninitialized bit
Note: Refer to “dsPIC30F Family Reference Manual” (DS70046) for descriptions of register bit fields.
The dsPIC30F family of devices contains internal 6.3 Table Instruction Operation Summary
program Flash memory for executing user code. There
are two methods by which the user can program this The TBLRDL and the TBLWTL instructions are used to
memory: read or write to bits<15:0> of program memory.
TBLRDL and TBLWTL can access program memory in
1. In-Circuit Serial Programming (ICSP)
Word or Byte mode.
programming capability
2. Run-Time Self-Programming (RTSP) The TBLRDH and TBLWTH instructions are used to read
or write to bits<23:16> of program memory. TBLRDH
and TBLWTH can access program memory in Word or
6.1 In-Circuit Serial Programming
Byte mode.
(ICSP)
A 24-bit program memory address is formed using
dsPIC30F devices can be serially programmed while in bits<7:0> of the TBLPAG register and the EA from a W
the end application circuit. This is simply done with two register specified in the table instruction, as shown in
lines for Programming Clock and Programming Data Figure 6-1.
(which are named PGC and PGD respectively), and
three other lines for Power (VDD), Ground (VSS) and
Master Clear (MCLR). this allows customers to manu-
facture boards with unprogrammed devices, and then
program the digital signal controller just before shipping
the product. This also allows the most recent firmware
or a custom firmware to be programmed.
24 bits
Using
Program 0 Program Counter 0
Counter
NVMADR Reg EA
Using
NVMADR 1/0 NVMADRU Reg
Addressing
8 bits 16 bits
Working Reg EA
Byte
User/Configuration Select
Space Select 24-bit EA
Note: In Example 6-2, the contents of the upper byte of W3 has no effect.
PIO Module 1
Output Data
0
Read TRIS
I/O Pad
Data Bus D Q
WR TRIS CK
TRIS Latch
D Q
WR LAT +
WR Port CK
Data Latch
Read LAT
Input Data
Read Port
CNPU2 00C6 — — — — — — — — — — CN21PUE CN20PUE CN19PUE CN18PUE CN17PUE CN16PUE 0000 0000 0000 0000
DS70118F-page 55
dsPIC30F2010
dsPIC30F2010
NOTES:
PR1
Equal
Comparator x 16 TSYNC
1 Sync
(3)
TMR1
Reset
0
0
T1IF
Event Flag 1 Q D TGATE
Q CK
TGATE
TGATE
TCS
TCKPS<1:0>
SOSCO/ TON 2
1X
T1CK
SOSCI
TCY 00
C1
SOSCI
C1 = C2 = 18 pF; R = 100K
DS70118F-page 60
Note: Refer to “dsPIC30F Family Reference Manual” (DS70046) for descriptions of register bit fields.
dsPIC30F2010
TMR3HLD
16
16
Write TMR2
Read TMR2
16
Reset
TMR3 TMR2 Sync
MSB LSB
ADC Event Trigger
Comparator x 32
Equal
PR3 PR2
0
T3IF
Event Flag 1 Q D TGATE(T2CON<6>)
Q CK
TGATE
(T2CON<6>)
TGATE
TCS
TCKPS<1:0>
TON 2
T2CK 1X
Prescaler
Gate 1, 8, 64, 256
Sync 01
TCY
00
Note: 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.
PR2
Equal
Comparator x 16
TMR2 Sync
Reset
0
T2IF
Event Flag 1 Q D TGATE
Q CK
TGATE
TGATE
TCS
TCKPS<1:0>
TON 2
T2CK 1X
Gate Prescaler
Sync 01 1, 8, 64, 256
TCY 00
PR3
TMR3
Reset
0
T3IF
Event Flag 1 Q D TGATE
Q CK
TGATE
TGATE
TCS
TCKPS<1:0>
TON 2
Sync 1 X
Prescaler
See 0 1 1, 8, 64, 256
NOTE
TCY 0 0
Note: The dsPIC30F2010 does not have an external pin input to TIMER3. The following modes should not be used:
1. TCS = 1
2. TCS = 0 and TGATE = 1 (gated time accumulation)
DS70118F-page 65
dsPIC30F2010
dsPIC30F2010
NOTES:
16 16
ICx ICTMR
Pin 1 0
Edge FIFO
Prescaler Clock Detection R/W
1, 4, 16 Synchronizer Logic Logic
3 ICM<2:0> ICxBUF
Mode Select
ICBNE, ICOV
ICI<1:0>
Interrupt
ICxCON Logic
Note: Where ‘x’ is shown, reference is made to the registers or bits associated to the respective input
capture channels 1 through N.
IC1CON 0142 — — ICSIDL — — — — — ICTMR ICI<1:0> ICOV ICBNE ICM<2:0> 0000 0000 0000 0000
DS70118F-page 70
IC2CON 0146 — — ICSIDL — — — — — ICTMR ICI<1:0> ICOV ICBNE ICM<2:0> 0000 0000 0000 0000
IC3CON 014A — — ICSIDL — — — — — ICTMR ICI<1:0> ICOV ICBNE ICM<2:0> 0000 0000 0000 0000
IC4CON 014E — — ICSIDL — — — — — ICTMR ICI<1:0> ICOV ICBNE ICM<2:0> 0000 0000 0000 0000
IC5CON 0152 — — ICSIDL — — — — — ICTMR ICI<1:0> ICOV ICBNE ICM<2:0> 0000 0000 0000 0000
IC6CON 0156 — — ICSIDL — — — — — ICTMR ICI<1:0> ICOV ICBNE ICM<2:0> 0000 0000 0000 0000
IC7CON 015A — — ICSIDL — — — — — ICTMR ICI<1:0> ICOV ICBNE ICM<2:0> 0000 0000 0000 0000
IC8CON 015E — — ICSIDL — — — — — ICTMR ICI<1:0> ICOV ICBNE ICM<2:0> 0000 0000 0000 0000
Legend: u = uninitialized bit
Note: Refer to “dsPIC30F Family Reference Manual” (DS70046) for descriptions of register bit fields.
OCxRS
Output S Q
OCxR OCx
Logic R
3 Output Enable
OCM<2:0>
Comparator Mode Select OCFA
(for x = 1 and 2)
OCTSEL
0 1 0 1
Note: Where ‘x’ is shown, reference is made to the registers associated with the respective output compare
channels 1and 2.
12.3 Dual Output Compare Match Mode The user must perform the following steps in order to
configure the output compare module for PWM
When control bits OCM<2:0> (OCxCON<2:0>) = 100 operation:
or 101, the selected output compare channel is config-
1. Set the PWM period by writing to the appropriate
ured for one of two Dual Output Compare modes,
period register.
which are:
2. Set the PWM duty cycle by writing to the OCxRS
• Single Output Pulse mode register.
• Continuous Output Pulse mode 3. Configure the output compare module for PWM
operation.
12.3.1 SINGLE PULSE MODE
4. Set the TMRx prescale value and enable the
For the user to configure the module for the generation Timer, TON (TxCON<15>) = 1.
of a single output pulse, the following steps are
required (assuming timer is off): 12.4.1 INPUT PIN FAULT PROTECTION
• Determine instruction cycle time TCY. FOR PWM
• Calculate desired pulse width value based on TCY. When control bits OCM<2:0> (OCxCON<2:0>) = 111,
• Calculate time to start pulse from timer start value the selected output compare channel is again config-
of 0x0000. ured for the PWM mode of operation, with the
• Write pulse width start and stop times into OCxR additional feature of input fault protection. While in this
and OCxRS compare registers (x denotes mode, if a logic ‘0’ is detected on the OCFA/B pin, the
channel 1, 2). respective PWM output pin is placed in the high-imped-
ance input state. The OCFLT bit (OCxCON<4>)
• Set timer period register to value equal to, or
indicates whether a Fault condition has occurred. This
greater than, value in OCxRS compare register.
state will be maintained until both of the following
• Set OCM<2:0> = 100. events have occurred:
• Enable timer, TON (TxCON<15>) = 1.
• The external Fault condition has been removed.
To initiate another single pulse, issue another write to • The PWM mode has been re-enabled by writing
set OCM<2:0> = 100. to the appropriate control bits.
Duty Cycle
12.7 Output Compare Interrupts For the PWM mode, when an event occurs, the respec-
tive timer interrupt flag (T2IF or T3IF) is asserted and
The output compare channels have the ability to gener- an interrupt will be generated, if enabled. The IF bit is
ate an interrupt on a compare match, for whichever located in the IFS0 status register, and must be cleared
Match mode has been selected. in software. The interrupt is enabled via the respective
For all modes except the PWM mode, when a compare timer interrupt enable bit (T2IE or T3IE), located in the
event occurs, the respective interrupt flag (OCxIF) is IEC0 Control register. The output compare interrupt
asserted and an interrupt will be generated, if enabled. flag is never set during the PWM mode of operation.
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 inter-
rupt enable (OCxIE) bit, located in the corresponding
IEC Control register.
DS70118F-page 74
OC2RS 0186 Output Compare 2 Master Register
OC2R 0188 Output Compare 2 Slave Register 0000 0000 0000 0000
OC2CON 018A — OCFRZ OCSIDL — — — — — — — — OCFLT2 OCTSEL2 OCM<2:0> 0000 0000 0000 0000
Legend: u = uninitialized bit
Note: Refer to “dsPIC30F Family Reference Manual” (DS70046) for descriptions of register bit fields.
dsPIC30F2010
TQCKPS<1:0>
Sleep Input TQCS
2
TCY
0
Synchronize
Prescaler
Det 1 1, 8, 64, 256
1
QEIM<2:0>
0
QEIIF
D Q
TQGATE Event
CK Q Flag
Programmable
QEB
Digital Filter
Programmable
INDX
Digital Filter
PWMCON1
PWM Enable and Mode SFRs
PWMCON2
PWM Manual
OVDCON
Control SFR
PWM Generator #3
PDC3 Buffer
16-bit Data Bus
PDC3
Comparator
PWM Generator
Channel 1 Dead-Time PWM1H
#1 Generator and
PTPER Override Logic PWM1L
FLTA
PTPER Buffer
PTCON
SEVTCMP PTDIR
0 0
Duty Cycle
Period
Period
PWMxH
PWMxL
There is one FLTA pin (FLTA) associated with the PWM The FLTA pin can be controlled manually in software.
module. When asserted, this pin can optionally drive
each of the PWM I/O pins to a defined state. 14.13 PWM Update Lockout
For a complex PWM application, the user may need to
14.12.1 FAULT PIN ENABLE BITS
write up to four duty cycle registers and the time base
The FLTACON SFR has 4 control bits that determine period register, PTPER, at a given time. In some appli-
whether a particular pair of PWM I/O pins is to be con- cations, it is important that all buffer registers be written
trolled by the FLTA input pin. To enable a specific PWM before the new duty cycle and period values are loaded
I/O pin pair for FLTA overrides, the corresponding bit for use by the module.
should be set in the FLTACON register.
The PWM update lockout feature is enabled by setting
If all enable bits are cleared in the FLTACON register, the UDIS control bit in the PWMCON2 SFR. The UDIS
then the FLTA input pin has no effect on the PWM mod- bit affects all duty cycle buffer registers and the PWM
ule and the pin may be used as a general purpose time base period buffer, PTPER. No duty cycle
interrupt or I/O pin. changes or period value changes will have effect while
Note: The FLTA pin logic can operate indepen- UDIS = 1.
dent of the PWM logic. If all the enable bits
in the FLTACON register are cleared, then
the FLTA pin(s) could be used as general
purpose interrupt pin(s). Each FLTA pin
has an interrupt vector, interrupt flag bit
and interrupt priority bits associated with it.
DS70118F-page 90
PWMCON1 01C8 — — — — — PTMOD3 PTMOD2 PTMOD1 — PEN3H PEN2H PEN1H — PEN3L PEN2L PEN1L 0000 0000 0111 0111
PWMCON2 01CA — — — — SEVOPS<3:0> — — — — — — OSYNC UDIS 0000 0000 0000 0000
DTCON1 01CC DTBPS<1:0> DTB<5:0> DTAPS<1:0> Dead Time A Value 0000 0000 0000 0000
FLTACON 01D0 — — FAOV3H FAOV3L FAOV2H FAOV2L FAOV1H FAOV1L FLTAM — — — — FAEN3 FAEN2 FAEN1 0000 0000 0000 0000
OVDCON 01D4 — — POVD3H POVD3L POVD2H POVD2L POVD1H POVD1L — — POUT3H POUT3L POUT2H POUT2L POUT1H POUT1L 0011 1111 0000 0000
PDC1 01D6 PWM Duty Cycle #1 Register 0000 0000 0000 0000
PDC2 01D8 PWM Duty Cycle #2 Register 0000 0000 0000 0000
dsPIC30F2010
PDC3 01DA PWM Duty Cycle #3 Register 0000 0000 0000 0000
Legend: u = uninitialized bit
Note: Refer to “dsPIC30F Family Reference Manual” (DS70046) for descriptions of register bit fields.
A series of eight (8) or sixteen (16) clock pulses shifts A basic difference between 8-bit and 16-bit operation is
out bits from the SPIxSR to SDOx pin and simulta- that the data is transmitted out of bit 7 of the SPIxSR for
neously shifts in data from SDIx pin. An interrupt is 8-bit operation, and data is transmitted out of bit 15 of
generated when the transfer is complete and the cor- the SPIxSR for 16-bit operation. In both modes, data is
responding interrupt flag bit (SPI1IF or SPI2IF) is set. shifted into bit 0 of the SPIxSR.
This interrupt can be disabled through an interrupt
enable bit (SPI1IE or SPI2IE). 15.1.2 SDOx DISABLE
The receive operation is double-buffered. When a A control bit, DISSDO, is provided to the SPIxCON reg-
complete byte is received, it is transferred from ister to allow the SDOx output to be disabled. This will
SPIxSR to SPIxBUF. allow the SPI module to be connected in an input only
configuration. SDO can also be used for general
If the receive buffer is full when new data is being purpose I/O.
transferred from SPIxSR to SPIxBUF, the module will
set the SPIROV bit, indicating an overflow condition.
15.2 Framed SPI Support
The transfer of the data from SPIxSR to SPIxBUF will
not be completed and the new data will be lost. The The module supports a basic framed SPI protocol in
module will not respond to SCL transitions while Master or Slave mode. The control bit FRMEN enables
SPIROV is ‘1’, effectively disabling the module until framed SPI support and causes the SSx pin to perform
SPIxBUF is read by user software. the frame synchronization pulse (FSYNC) function.
Transmit writes are also double-buffered. The user The control bit SPIFSD determines whether the SSx
writes to SPIxBUF. When the master or slave transfer pin is an input or an output (i.e., whether the module
is completed, the contents of the shift register receives or generates the frame synchronization
(SPIxSR) is moved to the receive buffer. If any trans- pulse). The frame pulse is an active-high pulse for a
mit data has been written to the buffer register, the single SPI clock cycle. When frame synchronization is
contents of the transmit buffer are moved to SPIxSR. enabled, the data transmission starts only on the
The received data is thus placed in SPIxBUF and the subsequent transmit edge of the SPI clock.
transmit data in SPIxSR is ready for the next transfer.
Note: Both the transmit buffer (SPIxTXB) and
the receive buffer (SPIxRXB) are mapped
to the same register address, SPIxBUF.
SPIxBUF SPIxBUF
Receive Transmit
SPIxSR
SDIx bit 0
SDOx Shift
clock
SS & FSYNC Clock Edge
Control Select
SSx Control
Secondary Primary
Prescaler Prescaler FCY
1:1-1:8 1:1, 1:4,
SCKx 1:16, 1:64
Note: x = 1 or 2.
SDOx SDIy
Note: x = 1 or 2, y = 1 or 2.
DS70118F-page 94
Legend: u = uninitialized bit
Note: Refer to “dsPIC30F Family Reference Manual” (DS70046) for descriptions of register bit fields.
dsPIC30F2010
I2CRCV (8 bits)
bit 7 bit 0
I2CTRN (8 bits)
bit 7 bit 0
I2CBRG (9 bits)
bit 8 bit 0
I2CCON (16 bits)
bit 15 bit 0
I2CSTAT (16 bits)
bit 15 bit 0
I2CADD (10 bits)
bit 9 bit 0
16.1.3 I2C REGISTERS The I2CADD register holds the slave address. A status
bit, ADD10, indicates 10-bit Address mode. The
I2CCON and I2CSTAT are control and status registers,
I2CBRG acts as the Baud Rate Generator (BRG)
respectively. The I2CCON register is readable and writ-
reload value.
able. The lower 6 bits of I2CSTAT are read-only. The
remaining bits of the I2CSTAT are read/write. In receive operations, I2CRSR and I2CRCV together
form a double-buffered receiver. When I2CRSR
I2CRSR is the shift register used for shifting data,
receives a complete byte, it is transferred to I2CRCV
whereas I2CRCV is the buffer register to which data
and an interrupt pulse is generated. During
bytes are written, or from which data bytes are read.
transmission, the I2CTRN is not double-buffered.
I2CRCV is the receive buffer, as shown in Figure 16-1.
I2CTRN is the transmit register to which bytes are writ- Note: Following a Restart condition in 10-bit
ten during a transmit operation, as shown in Figure 16-2. mode, the user only needs to match the
first 7-bit address.
Internal
Data Bus
I2CRCV
Read
Shift
SCL Clock
I2CRSR
LSB
SDA Addr_Match
Match Detect
Write
I2CADD
Read
Start and
Stop bit Detect
Write
I2CSTAT
Start, Restart,
Stop bit Generate
Read
Control Logic
Collision
Detect
Write
I2CCON
Acknowledge
Read
Generation
Clock
Stretching Write
I2CTRN
Reload
Control Write
If the R_W bit received is a ‘1’, then the serial port will The low byte of the address is then received and com-
go into Transmit mode. It will send ACK on the ninth bit pared with I2CADD<7:0>. If an address match occurs,
and then hold SCL to ‘0’ until the CPU responds by writ- the interrupt pulse is generated and the ADD10 bit is
ing to I2CTRN. SCL is released by setting the SCLREL set, indicating a complete 10-bit address match. If an
bit, and 8 bits of data are shifted out. Data bits are address match did not occur, the ADD10 bit is cleared
shifted out on the falling edge of SCL, such that SDA is and the module returns to the Idle state.
valid during SCL high (see timing diagram). The inter-
rupt pulse is sent on the falling edge of the ninth clock
pulse, regardless of the status of the ACK received
from the master.
DS70118F-page 102
I2CSTAT 0208 ACKSTAT TRSTAT — — — BCL GCSTAT ADD10 IWCOL I2COV D_A P S R_W RBF TBF 0000 0000 0000 0000
I2CADD 020A — — — — — — Address Register 0000 0000 0000 0000
Legend: u = uninitialized bit
Note: Refer to “dsPIC30F Family Reference Manual” (DS70046) for descriptions of register bit fields.
dsPIC30F2010
Write Write
– Control TSR
– Control Buffer
– Generate Flags
– Generate Interrupt
Load TSR
UxTXIF
UTXBRK
Data
Transmit Shift Register (UxTSR)
‘0’ (Start)
UxTX
‘1’ (Stop)
Control
Signals
Note: x = 1 only.
UxMODE UxSTA
LPBACK 8-9
From UxTX
1 Load RSR
to Buffer Control
FERR
PERR
Receive Shift Register Signals
UxRX
0 (UxRSR)
Note: x = 1 only.
AVDD AVSS
VREF+
VREF-
AN0 AN0
AN3 +
S/H CH1 ADC
-
-
16-word, 10-bit
Dual Port
Buffer
Bus Interface
AN2 AN2
AN5 +
S/H CH3
- CH1,CH2,
CH3,CH0 Sample/Sequence
Sample Control
AN0
AN1 Input
AN2 Switches Input MUX
AN3 AN3 Control
AN4 AN4
AN5 AN5 +
S/H CH0
AN1 -
TAD Sampling
A/D Speed RS Max VDD Temperature A/D Channels Configuration
Minimum Time Min
Up to 83.33 ns 12 TAD 500Ω 4.5V to 5.5V -40°C to +85°C VREF- VREF+
1 Msps(1)
CH1, CH2 or CH3
ANx
S/H
ADC
CH0
S/H
CHX
ANx
S/H ADC
ADC
CH0
S/H
ANx CHX
S/H ADC
ANx or VREF-
ANx CHX
S/H ADC
ANx or VREF-
Note 1: External VREF- and VREF+ pins must be used for correct operation. See Figure 18-2 for recommended
circuit.
R2
10
C2 C1 VDD
0.1 μF 0.01 μF
10
R1
VDD
VREF-
VREF+
AVDD
AVSS
C8
1 μF
dsPIC30F2010 VDD
VDD
VSS VSS VDD
VDD
C5
1 μF
VDD
18.7.1 1 Msps CONFIGURATION • Connect external VREF+ and VREF- pins following
GUIDELINE the recommended circuit shown in Figure 18-2
The configuration for 1 Msps operation is dependent on • Set SSRC<2:0> = 111 in the ADCON1 register to
whether a single input pin is to be sampled or whether enable the auto-convert option
multiple pins will be sampled. • Enable automatic sampling by setting the ASAM
control bit in the ADCON1 register
18.7.1.1 Single Analog Input • Enable sequential sampling by clearing the
For conversions at 1 Msps for a single analog input, at SIMSAM bit in the ADCON1 register
least two sample and hold channels must be enabled. • Enable at least two sample and hold channels by
The analog input multiplexer must be configured so writing the CHPS<1:0> control bits in the
that the same input pin is connected to both sample ADCON2 register
and hold channels. The A/D converts the value held on • Write the SMPI<3:0> control bits in the ADCON2
one S/H channel, while the second S/H channel register for the desired number of conversions
acquires a new input sample. between interrupts. At a minimum, set
SMPI<3:0> = 0001 since at least two sample and
18.7.1.2 Multiple Analog Inputs hold channels should be enabled
The A/D converter can also be used to sample multiple • Configure the A/D clock period to be:
analog inputs using multiple sample and hold channels. 1
In this case, the total 1 Msps conversion rate is divided = 83.33 ns
among the different input signals. For example, four 12 x 1,000,000
inputs can be sampled at a rate of 250 ksps for each
signal or two inputs could be sampled at a rate of by writing to the ADCS<5:0> control bits in the
500 ksps for each signal. Sequential sampling must be ADCON3 register
used in this configuration to allow adequate sampling • Configure the sampling time to be 2 TAD by
time on each input. writing: SAMC<4:0> = 00010
• Select at least two channels per analog input pin
18.7.1.3 1 Msps Configuration Items
by writing to the ADCHS register
The following configuration items are required to
achieve a 1 Msps conversion rate.
• Comply with conditions provided in Table 19-2
CHOLD
VA CPIN I leakage = DAC capacitance
VT = 0.6V ± 500 nA = 4.4 pF
VSS
Note: CPIN value depends on device package and is not tested. Effect of CPIN negligible if Rs ≤ 5 kΩ.
RAM Contents: d09 d08 d07 d06 d05 d04 d03 d02 d01 d00
Read to Bus:
Signed Fractional (1.15) d09 d08 d07 d06 d05 d04 d03 d02 d01 d00 0 0 0 0 0 0
Fractional (1.15) d09 d08 d07 d06 d05 d04 d03 d02 d01 d00 0 0 0 0 0 0
Signed Integer d09 d09 d09 d09 d09 d09 d09 d08 d07 d06 d05 d04 d03 d02 d01 d00
Integer 0 0 0 0 0 0 d09 d08 d07 d06 d05 d04 d03 d02 d01 d00
DS70118F-page 120
ADCBUF4 0288 — — — — — — ADC Data Buffer 4 0000 00uu uuuu uuuu
ADCBUF5 028A — — — — — — ADC Data Buffer 5 0000 00uu uuuu uuuu
ADCBUF6 028C — — — — — — ADC Data Buffer 6 0000 00uu uuuu uuuu
ADCBUF7 028E — — — — — — ADC Data Buffer 7 0000 00uu uuuu uuuu
ADCBUF8 0290 — — — — — — ADC Data Buffer 8 0000 00uu uuuu uuuu
ADCBUF9 0292 — — — — — — ADC Data Buffer 9 0000 00uu uuuu uuuu
dsPIC30F2010
Wake-up Request
FPLL
OSC1
Primary PLL
Oscillator x4, x8, x16 PLL
OSC2
Lock COSC<1:0>
Primary Osc
NOSC<1:0>
Primary
Oscillator OSWEN
Stability Detector
Oscillator
POR Done Start-up
Clock
Timer
Switching
Programmable
Secondary Osc and Control Clock Divider System
Block
Clock
SOSCO
Secondary 2
32 kHz LP
Oscillator
SOSCI Oscillator
Stability Detector POST<1:0>
CF
Fail-Safe Clock
FCKSM<1:0> Monitor (FSCM)
2 Oscillator Trap
to Timer1
EC Primary 1 1 1 0 1 1 CLKO
ECIO Primary 1 1 1 1 0 0 I/O
EC w/ PLL 4x Primary 1 1 1 1 0 1 I/O
EC w/ PLL 8x Primary 1 1 1 1 1 0 I/O
EC w/ PLL 16x Primary 1 1 1 1 1 1 I/O
ERC Primary 1 1 1 0 0 1 CLKO
ERCIO Primary 1 1 1 0 0 0 I/O
XT Primary 1 1 0 1 0 0 OSC2
XT w/ PLL 4x Primary 1 1 0 1 0 1 OSC2
XT w/ PLL 8x Primary 1 1 0 1 1 0 OSC2
XT w/ PLL 16x Primary 1 1 0 1 1 1 OSC2
XTL Primary 1 1 0 0 0 X OSC2
HS Primary 1 1 0 0 1 X OSC2
LP Secondary 0 0 — — — — (Notes 1, 2)
FRC Internal FRC 0 1 — — — — (Notes 1, 2)
LPRC Internal LPRC 1 0 — — — — (Notes 1, 2)
Note 1: OSC2 pin function is determined by the Primary Oscillator mode selection (FPR<3:0>).
2: Note that OSC1 pin cannot be used as an I/O pin, even if the secondary oscillator or an internal clock
source is selected at all times.
RESET
Instruction
Digital
Glitch Filter
MCLR
Sleep or Idle
WDT
Module
Illegal Opcode/
Uninitialized W Register
19.3.1 POR: POWER-ON RESET The POR circuit inserts a small delay, TPOR, which is
nominally 10 μs and ensures that the device bias cir-
A power-on event will generate an internal POR pulse
cuits are stable. Furthermore, a user selected power-
when a VDD rise is detected. The Reset pulse will occur
up time-out (TPWRT) is applied. The TPWRT parameter
at the POR circuit threshold voltage (VPOR), which is
is based on device Configuration bits and can be 0 ms
nominally 1.85V. The device supply voltage character-
(no delay), 4 ms, 16 ms or 64 ms. The total delay is at
istics must meet specified starting voltage and rise rate
device power-up TPOR + TPWRT. When these delays
requirements. The POR pulse will Reset a POR timer
have expired, SYSRST will be negated on the next
and place the device in the Reset state. The POR also
leading edge of the Q1 clock, and the PC will jump to
selects the device clock source identified by the
the Reset vector.
oscillator configuration fuses.
The timing for the SYSRST signal is shown in
Figure 19-3 through Figure 19-5.
VDD
MCLR
INTERNAL POR
TOST
OST TIME-OUT
TPWRT
PWRT TIME-OUT
INTERNAL Reset
FIGURE 19-4: TIME-OUT SEQUENCE ON POWER-UP (MCLR NOT TIED TO VDD): CASE 1
VDD
MCLR
INTERNAL POR
TOST
OST TIME-OUT
TPWRT
PWRT TIME-OUT
INTERNAL Reset
FIGURE 19-5: TIME-OUT SEQUENCE ON POWER-UP (MCLR NOT TIED TO VDD): CASE 2
VDD
MCLR
INTERNAL POR
TOST
OST TIME-OUT
TPWRT
PWRT TIME-OUT
INTERNAL Reset
19.3.1.2 Operating without FSCM and PWRT FIGURE 19-6: EXTERNAL POWER-ON
If the FSCM is disabled and the Power-up Timer RESET CIRCUIT (FOR
(PWRT) is also disabled, then the device will exit rap- SLOW VDD POWER-UP)
idly from Reset on power-up. If the clock source is VDD
FRC, LPRC, EXTRC or EC, it will be active
immediately. D R
If the FSCM is disabled and the system clock has not R1
MCLR
started, the device will be in a frozen state at the Reset
vector until the system clock starts. From the user’s C dsPIC30F
perspective, the device will appear to be in Reset until
a system clock is available.
Note 1: External Power-on Reset circuit is
19.3.2 BOR: PROGRAMMABLE required only if the VDD power-up slope
BROWN-OUT RESET is too slow. The diode D helps discharge
The BOR module is based on an internal voltage refer- the capacitor quickly when VDD powers
ence circuit. The main purpose of the BOR module is to down.
generate a device Reset when a brown-out condition 2: R should be suitably chosen so as to
occurs. Brown-out conditions are generally caused by make sure that the voltage drop across
glitches on the AC mains (i.e., missing portions of the R does not violate the device’s electrical
AC cycle waveform due to bad power transmission specification.
lines or voltage sags due to excessive current draw
3: R1 should be suitably chosen so as to
when a large inductive load is turned on).
limit any current flowing into MCLR from
The BOR module allows selection of one of the follow- external capacitor C, in the event of
ing voltage trip points: MCLR/VPP pin breakdown due to Elec-
• 2.6V-2.71V trostatic Discharge (ESD) or Electrical
Overstress (EOS).
• 4.1V-4.4V
• 4.58V-4.73V
Note: Dedicated supervisory devices, such as
Note: The BOR voltage trip points indicated here the MCP1XX and MCP8XX, may also be
are nominal values provided for design used as an external Power-on Reset
guidance only. circuit.
The Watchdog Timer can be “Enabled” or “Disabled” Note: If a POR or BOR occurred, the selection of
only through a Configuration bit (FWDTEN) in the the oscillator is based on the FOS<1:0>
Configuration register FWDT. and FPR<3:0> Configuration bits.
Setting FWDTEN = 1 enables the Watchdog Timer. If the clock source is an oscillator, the clock to the
The enabling is done when programming the device. device will be held off until OST times out (indicating a
By default, after chip-erase, FWDTEN bit = 1. Any stable oscillator). If PLL is used, the system clock is
device programmer capable of programming held off until LOCK = 1 (indicating that the PLL is
dsPIC30F devices allows programming of this and stable). In either case, TPOR, TLOCK and TPWRT delays
other Configuration bits. are applied.
If enabled, the WDT will increment until it overflows or If EC, FRC, LPRC or ERC oscillators are used, then a
“times out”. A WDT time-out will force a device Reset delay of TPOR (~ 10 μs) is applied. This is the smallest
(except during Sleep). To prevent a WDT time-out, the delay possible on wake-up from Sleep.
user must clear the Watchdog Timer using a CLRWDT Moreover, if LP oscillator was active during Sleep, and
instruction. LP is the oscillator used on wake-up, then the start-up
If a WDT times out during Sleep, the device will wake- delay will be equal to TPOR. PWRT delay and OST
up. The WDTO bit in the RCON register will be cleared timer delay are not applied. In order to have the small-
to indicate a wake-up resulting from a WDT time-out. est possible start-up delay when waking up from Sleep,
one of these faster wake-up options should be selected
Setting FWDTEN = 0 allows user software to enable/
before entering Sleep.
disable the Watchdog Timer via the SWDTEN
(RCON<5>) control bit. Any interrupt that is individually enabled (using the cor-
responding IE bit) and meets the prevailing priority
19.5 Power-Saving Modes level will be able to wake-up the processor. The proces-
sor will process the interrupt and branch to the ISR.
There are two power-saving states that can be entered The Sleep status bit in RCON register is set upon
through the execution of a special instruction, PWRSAV. wake-up.
These are: Sleep and Idle.
Note: In spite of various delays applied (TPOR,
The format of the PWRSAV instruction is as follows: TLOCK and TPWRT), the crystal oscillator
PWRSAV <parameter>, where ‘parameter’ defines (and PLL) may not be active at the end of
Idle or Sleep mode. the time-out (e.g., for low-frequency crys-
tals. In such cases), if FSCM is enabled,
19.5.1 SLEEP MODE then the device will detect this as a clock
failure and process the clock failure trap,
In Sleep mode, the clock to the CPU and peripherals is
the FRC oscillator will be enabled, and the
shutdown. If an on-chip oscillator is being used, it is
user will have to re-enable the crystal
shutdown.
oscillator. If FSCM is not enabled, then the
The fail-safe clock monitor is not functional during device will simply suspend execution of
Sleep, since there is no clock to monitor. However, code until the clock is stable, and will
LPRC clock remains active if WDT is operational during remain in Sleep until the oscillator clock
Sleep. has started.
The Brown-out protection circuit and the Low Voltage
Detect circuit, if enabled, will remain functional during
Sleep.
DS70118F-page 135
dsPIC30F2010
dsPIC30F2010
NOTES:
†NOTICE:
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.
22.1 DC Characteristics
VDD
Load Condition 1 - for all pins except OSC2 Load Condition 2 - for OSC2
VDD/2
RL Pin CL
VSS
CL
Pin RL = 464 Ω
CL = 50 pF for all pins except OSC2
VSS 5 pF for OSC2 output
Q4 Q1 Q2 Q3 Q4 Q1
OSC1
OS20
OS30 OS30 OS31 OS31
OS25
CLKO
OS40 OS41
I/O Pin
(Input)
DI35
DI40
VDD SY12
MCLR
Internal SY10
POR
SY11
PWRT
Time-out
SY30
OSC
Time-out
Internal
Reset
Watchdog
Timer
Reset
SY20
SY13
SY13
I/O Pins
SY35
FSCM
Delay
VBGAP
0V
TxCK
Tx10 Tx11
Tx15 Tx20
OS60
TMRX
QEB
TQ10 TQ11
TQ15 TQ20
POSCNT
ICX
IC10 IC11
IC15
OCx
(Output Compare
or PWM Mode) OC11 OC10
OC20
OCFA/OCFB
OC15
OCx
MP30
FLTA/B
MP20
PWMx
MP11 MP10
PWMx
TQ36
QEA
(input)
TQ31 TQ30
TQ35
QEB
(input) TQ41 TQ40
TQ31 TQ30
TQ35
QEB
Internal
QEA
(input)
QEB
(input)
Ungated
Index TQ50
TQ51
Index Internal
TQ55
Position
SCKx
(CKP = 0)
SCKx
(CKP = 1)
SP31 SP30
SP40 SP41
SCKX
(CKP = 1)
SP35
SP20 SP21
SP40 SP30,SP31
SP41
SSX
SP50 SP52
SCKX
(CKP = 0)
SCKX
(CKP = 1)
SP72 SP73
SP35
SP30,SP31 SP51
SP41
SP40
SP50 SP52
SCKX
(CKP = 0)
SCKX
(CKP = 1)
SP35
SP72 SP73
SP52
SP30,SP31 SP51
SDIX
MSb IN BIT14 - - - -1 LSb IN
SP41
SP40
SCL
IM31 IM34
IM30 IM33
SDA
Start Stop
Condition Condition
SDA
Out
SCL
IS31 IS34
IS30 IS33
SDA
Start Stop
Condition Condition
SDA
Out
AD50
ADCLK
Instruction
Execution SET SAMP CLEAR SAMP
SAMP
ch0_dischrg
ch0_samp
ch1_dischrg
ch1_samp
eoc
AD61
AD60
DONE
ADIF
ADRES(0)
ADRES(1)
1 2 3 4 5 6 7 8 5 6 7 8
AD50
ADCLK
Instruction
Execution SET ADON
SAMP
ch0_dischrg
ch0_samp
ch1_dischrg
ch1_samp
eoc
TSAMP TSAMP
AD55 AD55 TCONV
DONE
ADIF
ADRES(0)
ADRES(1)
1 2 3 4 5 6 7 3 4 5 6 8 3 4
2 – Sampling starts after discharge period. 6 – One TAD for end of conversion.
TSAMP is described in the “dsPIC30F
Family Reference Manual” (DS70046), Section 17. 7 – Begin conversion of next channel
XXXXXXXX dsPIC30F2010
XXXXXXXX -30I/MM e3
YYWWNNN 040700U
XXXXXXXXXXXXXXXXX dsPIC30F2010-30I/SP
XXXXXXXXXXXXXXXXX 0348017 e3
YYWWNNN
XXXXXXXXXXXXXXXXXXXX dsPIC30F2010-30I/SO
XXXXXXXXXXXXXXXXXXXX 0348017 e3
XXXXXXXXXXXXXXXXXXXX
YYWWNNN
Note: 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.
EXPOSED E2
E
METAL
PAD
(NOTE 2)
D D2
b
2 2
1 1
K
n
OPTIONAL ALTERNATE
SEE DETAIL L
INDEX INDEX
TOP VIEW AREA INDICATORS BOTTOM VIEW
(NOTE 1)
A1
DETAIL
A
ALTERNATE
PAD OUTLINE
2
n 1 α
E
A2
L
c
β A1 B1
eB B p
E
E1
p
B
2
n 1
h
α
45°
c
A A2
φ
β L A1
From: Name
Company
Address
City / State / ZIP / Country
Telephone: (_______) _________ - _________ FAX: (______) _________ - _________
Application (optional):
Would you like a reply? Y N
Questions:
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?
d s P I C 3 0 F 2 0 1 0 AT - 3 0 E / S O - E S
Custom ID (3 digits) or
Trademark Engineering Sample (ES)
Architecture
Package
Flash SP = SPDIP
SO = SOIC
S = Die (Waffle Pack)
Memory Size in Bytes W = Die (Wafers)
0 = ROMless
1 = 1K to 6K
2 = 7K to 12K
3 = 13K to 24K
4 = 25K to 48K Temperature
5 = 49K to 96K I = Industrial -40°C to +85°C
6 = 97K to 192K E = Extended High Temp -40°C to +125°C
7 = 193K to 384K
8 = 385K to 768K Speed
9 = 769K and Up
20 = 20 MIPS
30 = 30 MIPS
Device ID T = Tape and Reel
Example:
dsPIC30F2010AT-30E/SO = 30 MIPS, Extended temp., SOIC package, Rev. A
08/29/06