Microchip

dsPIC33CH64MP208 - Electronic component Microchip - Free user manual and instructions

Find the device manual for free dsPIC33CH64MP208 Microchip in PDF.

📄 834 pages English EN Download 💬 AI Question
Notice Microchip dsPIC33CH64MP208 - page 23
Pick your language and provide your email: we'll send you a specifically translated version.

User questions about dsPIC33CH64MP208 Microchip

0 question about this device. Answer the ones you know or ask your own.

Ask a new question about this device

The email remains private: it is only used to notify you if someone responds to your question.

No questions yet. Be the first to ask one.

Download the instructions for your Electronic component in PDF format for free! Find your manual dsPIC33CH64MP208 - Microchip and take your electronic device back in hand. On this page are published all the documents necessary for the use of your device. dsPIC33CH64MP208 by Microchip.

USER MANUAL dsPIC33CH64MP208 Microchip

28/36/48/64/80-Pin Dual Core, 16-Bit Digital Signal Controllers with High-Resolution PWM and CAN Flexible Data (CAN FD)

Operating Conditions

• 3V to 3.6V, -40°C to +125°C:

- Main Core: DC to 90 MIPS

- Secondary Core: DC to 100 MIPS

- 3V to 3.6V, -40°C to +150°C:

- Main Core: DC to 60 MIPS

- Secondary Core: DC to 60 MIPS

Core: Dual 16-Bit dsPIC33CH CPU

• Main/Secondary Core Operation
• Independent Peripherals for Main Core and Secondary Core
• Dual Partition for Secondary PRAM LiveUpdate
- Configurable Shared Resources for Main Core and Secondary Core
- Main Core with 64-128 Kbytes of Program Flash with ECC and 16K RAM
• Secondary Core with 24 Kbytes of Program RAM (PRAM) with ECC and 4K Data Memory RAM
- Fast Six-Cycle Divide
- Message Boxes and FIFO to Communicate Between Main and Secondary (MSI)
• Code Efficient (C and Assembly) Architecture
• 40-Bit Wide Accumulators
- Single-Cycle (MAC/MPY) with Dual Data Fetch
- Single-Cycle, Mixed-Sign MUL Plus Hardware Divide
• 32-Bit Multiply Support
- Five Sets of Interrupt Context Selected Registers and Accumulators per Core for Fast Interrupt Response
- Zero Overhead Looping

Clock Management

  • Internal Oscillator
  • Programmable PLLs and Oscillator Clock Sources
  • Main Reference Clock Output
    • Secondary Reference Clock Output
    • Fail-Safe Clock Monitor (FSCM)
  • Fast Wake-up and Start-up
  • Backup Internal Oscillator
  • LPRC Oscillator

Power Management

  • Low-Power Management Modes (Sleep, Idle, Doze)
  • Integrated Power-on Reset and Brown-out Reset

High-Resolution PWM with Fine Edge Placement

- Up to 12 PWM Pairs:

  • Four pairs for Main
  • Eight pairs for Secondary

• 250 ps PWM Resolution

- Applications Include:

  • DC/DC Converters
  • AC/DC power supplies
  • Uninterruptable Power Supply (UPS)
  • Motor Control: BLDC, PMSM, SR, ACIM

Timers/Output Compare/Input Capture

- Two General Purpose 16-Bit Timers:

- One each for Main and Secondary

• Peripheral Trigger Generator (PTG) Module:

  • One module for Main
  • Secondary can interrupt on select PTG sources
  • Useful for automating complex sequences

• 12 SCCP Modules:

  • Eight modules for Main
  • Four modules for Secondary
  • Timer, Capture/Compare and PWM Modes
  • 16 or 32-bit time base
  • 16 or 32-bit capture
  • Four-deep capture buffer
  • Fully Asynchronous Operation, Available in Sleep Modes

Advanced Analog Features

- Four ADC Modules:

  • One module for Main core
  • Three modules for Secondary core
  • 12-bit, 3.5 Msps ADC
  • Up to 18 conversion channels

• Four DAC/Analog Comparator Modules:

  • One module for Main core
  • Three modules for Secondary core
  • 12-bit DACs with hardware slope compensation
  • 15 ns analog comparators

- Three PGA Modules:

  • Three modules for Secondary core
  • Can be read by Host ADC
  • Option to interface with Host ADC

• Shared DAC/Analog Output:

  • DAC/analog comparator outputs
  • PGA outputs

Communication Interfaces

- Three UART Modules:

  • Two modules for Main core
  • One module for Secondary core
  • Support for LIN/J2602 protocols

• Three 4-Wire SPI/I ^2 S Modules:

  • Two modules for Main core
  • One module for Secondary core

• CAN Flexible Data-Rate (FD) Module for the MainCore
- Three I ^2 C Modules:

  • Two modules for Main
  • One module for Secondary
  • Support for SMBus

Other Features

  • PPS to Allow Function Remap
  • Programmable Cyclic Redundancy Check (CRC) for the Main
  • Two SENT Modules for the Main

Direct Memory Access (DMA)

• Eight DMA Channels:

  • Six DMA channels available for the Main core
  • Two DMA channels available for the Secondary core

Debugger Development Support

• In-Circuit and In-Application Programming
- Simultaneous Debugging Support for Main and Secondary Cores
- Main Only Debug and Secondary Only Debug Support
- Main with Three Complex, Five Simple Breakpoints and Secondary with One Complex, Two Simple Breakpoints
- IEEE 1149.2 Compatible (JTAG) Boundary Scan
- Trace Buffer and Run-Time Watch

Safety Features

  • DMT (Deadman Timer)
  • ECC (Error Correcting Code)
    • WDT (Watchdog Timer)
    • CodeGuard™ Security
    • CRC (Cyclic Redundancy Check)
  • Two-Speed Start-up
  • Fail-Safe Clock Monitoring
  • Backup FRC (BFRC)
    • Capless Internal Voltage Regulator
    • Virtual Pins for Redundancy and Monitoring

Functional Safety Readiness – ISO 26262/IEC 61508/IEC 60730

• To learn about the Functional Safety Readiness of this device family and various Functional Safety standards an application can target using this device family, visit www.microchip.com/dsPIC33-Functional-Safety

Qualification and Class B Support

  • AEC-Q100 REVG (Grade 1: -40°C to +125°C) Compliant
    • Class B Safety Library, IEC 60730

TABLE 1: MAIN AND SECONDARY CORE FEATURES

Feature Main Core Secondary Core Shared
Core Frequency 90 MIPS @ 180 MHz100 MIPS @ 200 MHz —
Program Memory 64K-128 Kbytes 24Kbytes (PRAM)(2)
Internal Data RAM16 Kbytes4 Kbytes
16-Bit Timer11
DMA62
SCCP (Capture/Compare/Timer)84
UART21
SPI/I ^2 S21
I ^2 C21
CAN FD1
SENT2
CRC1
QEI11
PTG1
CLC44
16-Bit High-Speed PWM48
ADC 12-Bit13
Digital Comparator44
12-Bit DAC/Analog CMP Module13
Watchdog Timer11
Deadman Timer1
Input/Output696969
Simple Breakpoints52
PGAs ^(1) 33
DAC Output Buffer1
Oscillator111

Note 1: Secondary owns the peripheral/feature, but it is shared with the Main.
2: Dual Partition feature is available on Secondary PRAM.

dsPIC33CH128MP508 PRODUCT FAMILIES

The device names, pin counts, memory sizes and peripheral availability of each device are listed in Table 2. The following pages show their pinout diagrams.

TABLE 2: dsPIC33CHXXXMP50X FAMILY

Product CorePins Flash^(1) Data RAM 12-ADC Modules^(2) ADC ChannelsGPIOPPSTimersSCCPCAN FDSENTUART SPI^2S I^2C QEICLCPTGCRCPWM Pairs (High Resolution)Analog ComparatorsPGACurrent Bias SourceREFO
dsPIC33CH64MP502Main2864K16K1122116181222214114111
Secondary24K4K311211614111148331
dsPIC33CH128MP502Main28128K16K1122116181222214114111
Secondary24K4K311211614111148311
dsPIC33CH64MP503Main3664K16K1152719181222214114111
Secondary24K4K315271914111148331
dsPIC33CH128MP503Main36128K16K1152719181222214114111
Secondary24K4K316271914111148331
dsPIC33CH64MP505Main4864K16K1163530181222214114111
Secondary24K4K316353014111148331
dsPIC33CH128MP505Main48128K16K1163530181222214114111
Secondary24K4K316353014111148311
dsPIC33CH64MP506Main6464K16K1165340181222214114111
Secondary24K4K318534014111148331
dsPIC33CH128MP506Main64128K16K1165340181222214114111
Secondary24K4K318534014111148311
dsPIC33CH64MP508Main8064K16K1166940181222214114111
Secondary24K4K318694014111148331
dsPIC33CH128MP508Main80128K16K1166940181222214114111
Secondary24K4K318694014111148311

Note 1: For the Secondary core, the implemented program memory of 24K is PRAM.
2: Number of ADC modules implemented in the Main and Secondary cores.

TABLE 3: dsPIC33CHXXXMP20X FAMILY WITH NO CAN FD

Product CorePins Flash^(1) Data RAM ADC Modules^(2) ADC ChannelsGPIOPPSTimersSCCPCAN FDSENTUART SPI/2S I^2C QEICLCPTGCRCPWM Pairs (High Resolution)Analog ComparatorsPGACurrent Bias SourceREFO
dsPIC33CH64MP202Main2864K16K112211618222214114111
Secondary24K4K311211614111148331
dsPIC33CH128MP202Main28128K16K112211618222214114111
Secondary24K4K311211614111148311
dsPIC33CH64MP203Main3664K16K115271918222214114111
Secondary24K4K315271914111148331
dsPIC33CH128MP203Main36128K16K115271918222214114111
Secondary24K4K316271914111148331
dsPIC33CH64MP205Main4864K16K116353018222214114111
Secondary24K4K316353014111148331
dsPIC33CH128MP205Main48128K16K116353018222214114111
Secondary24K4K316353014111148311
dsPIC33CH64MP206Main6464K16K116534018222214114111
Secondary24K4K318534014111148331
dsPIC33CH128MP206Main64128K16K116534018222214114111
Secondary24K4K318534014111148311
dsPIC33CH64MP208Main8064K16K116694018222214114111
Secondary24K4K318694014111148331
dsPIC33CH128MP208Main80128K16K116694018222214114111
Secondary24K4K318694014111148311

Note 1: For the Secondary core, the implemented program memory of 24K is PRAM.
2: Number of ADC modules implemented in the Main and Secondary cores.

Pin Diagrams

28-Pin SSOP ^(1)

Microchip dsPIC33CH64MP208 - Pin Diagrams - 1

text_image RA1 1 28 RA0 RA2 2 27 MCLR RA3 3 26 RB15 RA4 4 25 RB14 AVDD 5 24 RB13 AVss 6 23 RB12 VDD 7 22 RB11 Vss 8 21 RB10 RB0 9 20 VDD RB1 10 dsPIC33CHXXXMP502 dsPIC33CHXXXMP202 RB2 11 19 Vss RB3 12 18 RB9 RB4 13 17 RB8 RB5 14 16 RB7 15 RB6

Note 1: Shaded pins are up to 5.5 Vdc tolerant (refer to Table 3-29). For the list of analog ports, refer to Table 3-28 and Table4-25.

TABLE 4: 28-PIN SSOP

Pin # Main Core Secondary Core
1AN1/RA1 S1AN15/S1RA1
2AN2/RA2 S1AN16/S1RA2
3AN3/IBIAS0/RA3 S1AN0/S1CMP1A/S1PGA1P1/S1RA3
4AN4/IBIAS1/RA4 S1MCLR3/S1AN1/S1CMP2A/S1PGA2P1/S1PGA3P2/S1RA4
5AVDDAVDD
6AVssAVss
7VDDVDD
8VssVss
9OSCI/CLKI/AN5/RP32/RB0S1AN5/S1RP32/S1RB0
10OSCO/CLKO/AN6/IBIAS2/RP33/RB1 ^(2) S1AN4/S1RP33/S1RB1 ^(2)
11DACOUT1/AN7/CMP1D/RP34/INT0/RB2S1MCLR2/S1AN3/S1ANC0/S1ANC1/S1CMP1D/S1CMP2D/S1CMP3D/S1RP34/S1INT0/S1RB2
12PGD2/AN8/RP35/RB3S1PGD2/S1AN18/S1CMP3A/S1PGA3P1/S1RP35/S1RB3
13PGC2/RP36/RB4S1PGC2/S1AN9/S1RP36/S1PWM5L/S1RB4
14PGD3/RP37/SDA2/RB5S1PGD3/S1RP37/S1RB5
15PGC3/RP38/SCL2/RB6S1PGC3/S1RP38/S1RB6
16TDO/AN9/RP39/RB7S1MCLR1/S1AN6/S1RP39/S1PWM5H/S1RB7
17PGD1/AN10/RP40/SCL1/RB8S1PGD1/S1AN7/S1RP40/S1SCL1/S1RB8
18PGC1/AN11/RP41/SDA1/RB9S1PGC1/S1RP41/S1SDA1/S1RB9
19VssVss
20VDDVDD
21TMS/RP42/PWM3H/RB10 ^(1) S1RP42/S1PWM3H/S1RB10 ^(1)
22TCK/RP43/PWM3L/RB11S1RP43/S1PWM8H/S1PWM3L/S1RB11
23TDI/RP44/PWM2H/RB12S1RP44/S1PWM2H/S1RB12
24RP45/PWM2L/RB13S1RP45/S1PWM7H/S1PWM2L/S1RB13
25RP46/PWM1H/RB14S1RP46/S1PWM1H/S1RB14
26RP47/PWM1L/RB15S1RP47/S1PWM6H/S1PWM1L/S1RB15
27MCLR
28AN0/CMP1A/RA0S1RA0

Legend: RPn represents remappable peripheral functions.
Note 1: A pull-up resistor is connected to this pin when device is erased (JTAG enabled) and during programming.
2: This pin is toggled during programming.

Pin Diagrams (Continued)

28-Pin UQFN ^(1,2)
Microchip dsPIC33CH64MP208 - Pin Diagrams (Continued) - 1

geo dsPIC33CHXXXMP502 | Category | Position | Value | |---|---|---| | dsPIC33CHXXXMP502 | RB13 | 28 | | dsPIC33CHXXXMP502 | RB12 | 27 | | dsPIC33CHXXXMP502 | RB11 | 26 | | dsPIC33CHXXXMP502 | RB10 | 25 | | dsPIC33CHXXXMP502 | VDD | 24 | | dsPIC33CHXXXMP502 | VSS | 23 | | dsPIC33CHXXXMP502 | RB9 | 22 | | dsPIC33CHXXXMP202 | RB14 | 1 | | dsPIC33CHXXXMP202 | RB15 | 2 | | dsPIC33CHXXXMP202 | MCLR | 3 | | dsPIC33CHXXXMP202 | RA0 | 4 | | dsPIC33CHXXXMP202 | RA1 | 5 | | dsPIC33CHXXXMP202 | RA2 | 6 | | dsPIC33CHXXXMP202 | RA3 | 7 | | dsPIC33CHXXXMP202 | RA4 | 8 | | dsPIC33CHXXXMP202 | AVDD | 9 | | dsPIC33CHXXXMP202 | AVSS | 10 | | dsPIC33CHXXXMP202 | VDD | 11 | | dsPIC33CHXXXMP202 | VSS | 12 | | dsPIC33CHXXXMP202 | RB0 | 13 | | dsPIC33CHXXXMP202 | RB1 | 14 | | dsPIC33CHXXXMP502 | RB8 | 21 | | dsPIC33CHXXXMP502 | RB7 | 20 | | dsPIC33CHXXXMP502 | RB6 | 19 | | dsPIC33CHXXXMP502 | RB5 | 18 | | dsPIC33CHXXXMP502 | RB4 | 17 | | dsPIC33CHXXXMP502 | RB3 | 16 | | dsPIC33CHXXXMP502 | RB2 | 15 | The image displays a schematic representation of the protein or molecular structure of the DS PIC33CHXXXMP502 and its associated molecular fragments. The labels on the diagram indicate specific positions of each segment.

Note 1: Shaded pins are up to 5.5 VDC tolerant (refer to Table 3-29). For the list of analog ports, refer to Table 3-28 and Table 4-25.
2: The large center pad on the bottom of the package may be left floating or connected to Vss. The four-corner anchor pads are internally connected to the large bottom pad, and therefore, must be connected to the same net as the large center pad.

TABLE 5: 28-PIN UQFN

Pin #Main Core Secondary Core
1RP46/PWM1H/RB14 S1RP46/S1PWM1H/S1RB14
2RP47/PWM1L/RB15S1RP47/S1PWM6H/S1PWM1L/S1RB15
3MCLR —
4AN0/CMP1A/RA0 S1RA0
5AN1/RA1 S1AN15/S1RA1
6AN2/RA2 S1AN16/S1RA2
7AN3/IBIAS0/RA3 S1AN0/S1CMP1A/S1PGA1P1/S1RA3
8AN4/IBIAS1/RA4 S1MCLR3/S1AN1/S1CMP2A/S1PGA2P1/S1PGA3P2/S1RA4
9AVDD AVDD
10AVssAVss
11VDDVDD
12VssVss
13OSCI/CLKI/AN5/RP32/RB0S1AN5/S1RP32/S1RB0
14OSCO/CLKO/AN6/IBIAS2/RP33/RB1(2)S1AN4/S1RP33/S1RB1(2)
15DACOUT1/AN7/CMP1D/RP34/INT0/RB2S1MCLR2/S1AN3/S1ANC0/S1ANC1/S1CMP1D/S1CMP2D/S1CMP3D/S1RP34/S1INT0/S1RB2
16PGD2/AN8/RP35/RB3S1PGD2/S1AN18/S1CMP3A/S1PGA3P1/S1RP35/S1RB3
17PGC2/RP36/RB4S1PGC2/S1AN9/S1RP36/S1PWM5L/S1RB4
18PGD3/RP37/SDA2/RB5S1PGD3/S1RP37/S1RB5
19PGC3/RP38/SCL2/RB6S1PGC3/S1RP38/S1RB6
20TDO/AN9/RP39/RB7S1MCLR1/S1AN6/S1RP39/S1PWM5H/S1RB7
21PGD1/AN10/RP40/SCL1/RB8S1PGD1/S1AN7/S1RP40/S1SCL1/S1RB8
22PGC1/AN11/RP41/SDA1/RB9S1PGC1/S1RP41/S1SDA1/S1RB9
23VssVss
24VDDVDD
25TMS/RP42/PWM3H/RB10(1)S1RP42/S1PWM3H/S1RB10(1)
26TCK/RP43/PWM3L/RB11S1RP43/S1PWM8H/S1PWM3L/S1RB11
27TDI/RP44/PWM2H/RB12S1RP44/S1PWM2H/S1RB12
28RP45/PWM2L/RB13S1RP45/S1PWM7H/S1PWM2L/S1RB13

Legend: RPn represents remappable peripheral functions.
Note 1: A pull-up resistor is connected to this pin when device is erased (JTAG enabled) and during programming.
2: This pin is toggled during programming.

Pin Diagrams (Continued)

36-Pin UQFN ^(1,2)

Microchip dsPIC33CH64MP208 - Pin Diagrams (Continued) - 1

other dsPIC33CHXXXMP503 dsPIC33CHXXXMP203 | Pin | Value | |---|---| | RB14 | 1 | | RB15 | 2 | | MCLR | 3 | | RC0 | 4 | | RA0 | 5 | | RA1 | 6 | | RA2 | 7 | | RA3 | 8 | | RA4 | 9 | | AVDD | 10 | | AVss | 11 | | RC1 | 12 | | RC2 | 13 | | VDD | 14 | | Vss | 15 | | RC3 | 16 | | RB0 | 17 | | RB1 | 18 | RVB8: RVB8 RVB7: RVB7 RVB6: RVB6 RVB5: RVB5 RVB4: RVB4 RVB3: RVB3 RVB2: RVB2

Note 1: Shaded pins are up to 5.5 Vdc tolerant (refer to Table 3-29). For the list of analog ports, refer to Table 3-28 and Table 4-25.

2: The large center pad on the bottom of the package may be left floating or connected to Vss. The four-corner anchor pads are internally connected to the large bottom pad, and therefore, must be connected to the same net as the large center pad.

TABLE 6: 36-PIN UQFN

Pin #Main Core Secondary Core
1RP46/PWM1H/RB14 S1RP46/S1PWM1H/S1RB14
2RP47/PWM1L/RB15S1RP47/S1PWM6H/S1PWM1L/S1RB15
3MCLR —
4AN12/IBIAS3/RP48/RC0S1AN10/S1RP48/S1RC0
5AN0/CMP1A/RA0 S1RA0
6AN1/RA1 S1AN15/S1RA1
7AN2/RA2 S1AN16/S1RA2
8AN3/IBIAS0/RA3 S1AN0/S1CMP1A/S1PGA1P1/S1RA3
9AN4/IBIAS1/RA4 S1MCLR3/S1AN1/S1CMP2A/S1PGA2P1/S1PGA3P2/S1RA4
10AVDDAVDD
11AVssAVss
12AN13/ISRC0/RP49/RC1S1ANA1/S1RP49/S1RC1
13AN14/ISRC1/RP50/RC2S1ANA0/S1RP50/S1RC2
14VDDVDD
15VssVss
16CMP1B/RP51/RC3S1AN8/S1CMP3B/S1RP51/S1RC3
17OSCI/CLKI/AN5/RP32/RB0S1AN5/S1RP32/S1RB0
18OSCO/CLKO/AN6/IBIAS2/RP33/RB1(2)S1AN4/S1RP33/S1RB1(2)
19DACOUT1/AN7/CMP1D/RP34/INT0/RB2S1MCLR2/S1AN3/S1ANC0/S1ANC1/S1CMP1D/S1CMP2D/S1CMP3D/S1RP34/S1INT0/S1RB2
20PGD2/AN8/RP35/RB3S1PGD2/S1AN18/S1CMP3A/S1PGA3P1/S1RP35/S1RB3
21PGC2/RP36/RB4S1PGC2/S1AN9/S1RP36/S1PWM5L/S1RB4
22VssVss
23VDDVDD
24PGD3/RP37/SDA2/RB5S1PGD3/S1RP37/S1RB5
25PGC3/RP38/SCL2/RB6S1PGC3/S1RP38/S1RB6
26TDO/AN9/RP39/RB7S1MCLR1/S1AN6/S1RP39/S1PWM5H/S1RB7
27PGD1/AN10/RP40/SCL1/RB8S1PGD1/S1AN7/S1RP40/S1SCL1/S1RB8
28PGC1/AN11/RP41/SDA1/RB9S1PGC1/S1RP41/S1SDA1/S1RB9
29RP52/RC4S1RP52/S1PWM2H/S1RC4
30RP53/RC5S1RP53/S1PWM2L/S1RC5
31VssVss
32VDDVDD
33TMS/RP42/PWM3H/RB10(1)S1RP42/S1PWM3H/S1RB10(1)
34TCK/RP43/PWM3L/RB11S1RP43/S1PWM8H/S1PWM3L/S1RB11
35TDI/RP44/PWM2H/RB12S1RP44/S1PWM7L/S1RB12
36RP45/PWM2L/RB13 S1RP45/S1PWM7H/S1RB13

Legend: RPn represents remappable peripheral functions.
Note 1: A pull-up resistor is connected to this pin when device is erased (JTAG enabled) and during programming.
2: This pin is toggled during programming.

Pin Diagrams (Continued)

48-Pin TQFP/UQFN ^(1,2)

Microchip dsPIC33CH64MP208 - Pin Diagrams (Continued) - 1

heatmap dsPIC33CHXXXMP505 dsPIC33CHXXXMP205 | Category | Value | |---|---| | RB13 | 48 | | RB12 | 47 | | RB11 | 46 | | RB10 | 45 | | RD1 | 44 | | VDD | 43 | | VSS | 42 | | RC11 | 41 | | RC10 | 40 | | RC5 | 39 | | RC4 | 38 | | RB9 | 37 | | RB14 | 1 | | RB15 | 2 | | RC12 | 3 | | RC13 | 4 | | MCLR | 5 | | RD13 | 6 | | RC0 | 7 | | RA0 | 8 | | RA1 | 9 | | RA2 | 10 | | RA3 | 11 | | RA4 | 12 | | AVDD | 13 | | AVss | 14 | | RC1 | 15 | | RC2 | 16 | | RC6 | 17 | | VDD | 18 | | VSS | 19 | | RC3 | 20 | | RB0 | 21 | | RB1 | 22 | | RD10 | 23 | | RC7 | 24 | | RB8 | 36 | | RB7 | 35 | | RB6 | 34 | | RB5 | 33 | | VDD | 32 | | Vss | 31 | | RD8 | 30 | | RC9 | 29 | | RC8 | 28 | | RB4 | 27 | | RB3 | 26 | | RB2 | 25 |

Note 1: Shaded pins are up to 5.5 VDC tolerant (refer to Table 3-29). For the list of analog ports, refer to Table 3-28 and Table4-25.

2: The large center pad on the bottom of the package may be left floating or connected to Vss. The four-corner anchor pads are internally connected to the large bottom pad, and therefore, must be connected to the same net as the large center pad.

TABLE 7: 48-PIN TQFP/UQFN

Pin #Main Core Secondary Core
1RP46/PWM1H/RB14 S1RP46/S1PWM6L/S1RB14
2RP47/PWM1L/RB15 S1RP47/S1PWM6H/S1RB15
3RP60/RC12S1RP60/S1PWM3H/S1RC12
4RP61/RC13S1RP61/S1PWM3L/S1RC13
5MCLR —
6RD13 S1ANN0/S1PGA1N2/S1RD13
7AN12/IBIAS3/RP48/RC0S1AN10/S1RP48/S1RC0
8AN0/CMP1A/RA0S1RA0
9AN1/RA1S1AN15/S1RA1
10AN2/RA2S1AN16/S1RA2
11AN3/IBIAS0/RA3S1AN0/S1CMP1A/S1PGA1P1/S1RA3
12AN4/IBIAS1/RA4STMCLR3/S1AN1/S1CMP2A/S1PGA2P1/S1PGA3P2/S1RA4
13AVDDAVDD
14AVssAVss
15AN13/ISRC0/RP49/RC1S1ANA1/S1RP49/S1RC1
16AN14/ISRC1/RP50/RC2S1ANA0/S1RP50/S1RC2
17RP54/RC6S1AN11/S1CMP1B/S1RP54/S1RC6
18VDDVDD
19VssVss
20CMP1B/RP51/RC3S1AN8/S1CMP3B/S1RP51/S1RC3
21OSCI/CLKI/AN5/RP32/RB0S1AN5/S1RP32/S1RB0
22OSCO/CLKO/AN6/IBIAS2/RP33/RB1(2)S1AN4/S1RP33/S1RB1(2)
23ISRC3/RD10S1AN13/S1CMP2B/S1RD10
24AN15/ISRC2/RP55/RC7S1AN12/S1RP55/S1RC7
25DACOUT1/AN7/CMP1D/RP34/INT0/RB2S1MCLR2/S1AN3/S1ANC0/S1ANC1/S1CMP1D/S1CMP2D/S1CMP3D/S1RP34/S1INT0/S1RB2
26PGD2/AN8/RP35/RB3S1PGD2/S1AN18/S1CMP3A/S1PGA3P1/S1RP35/S1RB3
27PGC2/RP36/RB4S1PGC2/S1AN9/S1RP36/S1PWM5L/S1RB4
28RP56/ASDA1/SCK2/RC8S1RP56/S1ASDA1/S1SCK1/S1RC8
29RP57/ASCL1/SDI2/RC9S1RP57/S1ASCL1/S1SDI1/S1RC9
30SDO2/PCI19/RD8S1SDO1/S1PCI19/S1RD8
31VssVss
32VDDVDD
33PGD3/RP37/SDA2/RB5S1PGD3/S1RP37/S1RB5
34PGC3/RP38/SCL2/RB6S1PGC3/S1RP38/S1RB6
35TDO/AN9/RP39/RB7STMCLR7/S1AN6/S1RP39/S1PWM5H/S1RB7
36PGD1/AN10/RP40/SCL1/RB8S1PGD1/S1AN7/S1RP40/S1SCL1/S1RB8
37PGC1/AN11/RP41/SDA1/RB9S1PGC1/S1RP41/S1SDA1/S1RB9
38RP52/RC4S1RP52/S1PWM2H/S1RC4
39RP53/RC5S1RP53/S1PWM2L/S1RC5
40RP58/RC10 S1RP58/S1PWM1H/S1RC10
41RP59/RC11S1RP59/S1PWM1L/S1RC11
42VssVss
43VDDVDD
44RP65/RD1S1RP65/S1PWM4H/S1RD1
45TMS/RP42/PWM3H/RB10(1)S1RP42/S1PWM8L/S1RB10(1)
46TCK/RP43/PWM3L/RB11S1RP43/S1PWM8H/S1RB11
47TDI/RP44/PWM2H/RB12S1RP44/S1PWM7L/S1RB12
48RP45/PWM2L/RB13 S1RP45/S1PWM7H/S1RB13

Legend: RPn represents remappable peripheral functions.
Note 1: A pull-up resistor is connected to this pin when device is erased (JTAG enabled) and during programming.
2: This pin is toggled during programming.

Pin Diagrams (Continued)

64-Pin TQFP/QFN ^(1,2)

Microchip dsPIC33CH64MP208 - Pin Diagrams (Continued) - 1

other | Pin | Value | |-----|-------| | RB13 | 64 | | RB12 | 63 | | RB11 | 62 | | RB10 | 61 | | RD0 | 60 | | RD1 | 59 | | RD2 | 58 | | VDD | 57 | | VSS | 56 | | RD3 | 55 | | RD4 | 54 | | RC11 | 53 | | RC10 | 52 | | RC5 | 51 | | RC4 | 50 | | RB9 | 49 | | RB8 | 48 | | RB7 | 47 | | RB6 | 46 | | RB5 | 45 | | RD5 | 44 | | RD6 | 43 | | RD7 | 42 | | VDD | 41 | | VSS | 40 | | RD8 | 39 | | RD9 | 38 | | RC9 | 37 | | RC8 | 36 | | RB4 | 35 | | RB3 | 34 | | RB2 | 33 | | RA3 | 17 | | RA4 | 18 | | AVDD | 19 | | AVss | 20 | | RD12 | 21 | | RC1 | 22 | | RC2 | 23 | | RC6 | 24 | | VDD | 25 | | VSS | 26 | | RC3 | 27 | | RB0 | 28 | | RB1 | 29 | | RD11 | 30 | | RD10 | 31 | | RC7 | 32 | MCLR | 7 | | RD15 | 8 | | Vss | 9 | | VDD | 10 | | RD14 | 11 | | RD13 | 12 | | RC0 | 13 | | RA0 | 14 | | RA1 | 15 | | RA2 | 16 | dsPIC33CHXXXMP506 dsPIC33CHXXXMP206

Note 1: Shaded pins are up to 5.5 V DC tolerant (refer to Table 3-29). For the list of analog ports, refer to Table 3-28 and Table 4-25.

2: The large center pad on the bottom of the package may be left floating or connected to Vss. The four-corner anchor pads are internally connected to the large bottom pad, and therefore, must be connected to the same net as the large center pad.

TABLE 8: 64-PIN TQFP/QFN

Pin #Main Core Secondary Core
1RP46/PWM1H/RB14 S1RP46/S1RB14
2RP47/PWM1L/RB15 S1RP47/S1RB15
3RP60/PWM4H/RC12S1RP60/S1RC12
4RP61/PWM4L/RC13 S1RP61/S1RC13
5RP62/RC14 S1RP62/S1PWM7H/S1RC14
6RP63/RC15 S1RP63/S1PWM7L/S1RC15
7MCLR —
8PCI22/RD15S1PCI22/S1RD15
9VssVss
10VDDVDD
11PCI21/RD14S1ANN1/S1PGA2N2/S1PCI21/S1RD14
12RD13S1ANN0/S1PGA1N2/S1RD13
13AN12/IBIAS3/RP48/RC0S1AN10/S1RP48/S1RC0
14AN0/CMP1A/RA0S1RA0
15AN1/RA1S1AN15/S1RA1
16AN2/RA2S1AN16/S1RA2
17AN3/IBIAS0/RA3S1AN0/S1CMP1A/S1PGA1P1/S1RA3
18AN4/IBIAS1/RA4S1MCLR3/S1AN1/S1CMP2A/S1PGA2P1/S1PGA3P2/S1RA4
19AVDDAVDD
20AVssAVss
21RD12S1AN14/S1PGA2P2/S1RD12
22AN13/ISRC0/RP49/RC1S1ANA1/S1RP49/S1RC1
23AN14/ISRC1/RP50/RC2S1ANA0/S1RP50/S1RC2
24RP54/RC6S1AN11/S1CMP1B/S1RP54/S1RC6
25VDDVDD
26VssVss
27CMP1B/RP51/RC3S1AN8/S1CMP3B/S1RP51/S1RC3
28OSCI/CLKI/AN5/RP32/RB0S1AN5/S1RP32/S1RB0
29OSCO/CLKO/AN6/IBIAS2/RP33/RB1(2)S1AN4/S1RP33/S1RB1(2)
30RD11S1AN17/S1PGA1P2/S1RD11
31ISRC3/RD10S1AN13/S1CMP2B/S1RD10
32AN15/ISRC2/RP55/RC7S1AN12/S1RP55/S1RC7
33DACOUT1/AN7/CMP1D/RP34/INT0/RB2S1MCLR2/S1AN3/S1ANC0/S1ANC1/S1CMP1D/S1CMP2D/S1CMP3D/S1RP34/S1INT0/S1RB2
34PGD2/AN8/RP35/RB3S1PGD2/S1AN18/S1CMP3A/S1PGA3P1/S1RP35/S1RB3
35PGC2/RP36/RB4S1PGC2/S1AN9/S1RP36/S1PWM5L/S1RB4
36RP56/ASDA1/SCK2/RC8S1RP56/S1ASDA1/S1SCK1/S1RC8
37RP57/ASCL1/SDI2/RC9S1RP57/S1ASCL1/S1SDI1/S1RC9
38PCI20/RD9S1PCI20/S1RD9
39SDO2/PCI19/RD8S1SDO1/S1PCI19/S1RD8
40VssVss
41VDDVDD
42RP71/RD7S1RP71/S1PWM8H/S1RD7
43RP70/RD6S1RP70/S1PWM6H/S1RD6
44RP69/RD5S1RP69/S1PWM6L/S1RD5
45PGD3/RP37/SDA2/RB5S1PGD3/S1RP37/S1RB5
46PGC3/RP38/SCL2/RB6S1PGC3/S1RP38/S1RB6
47TDO/AN9/RP39/RB7S1MCLR1/S1AN6/S1RP39/S1PWM5H/S1RB7
48PGD1/AN10/RP40/SCL1/RB8S1PGD1/S1AN7/S1RP40/S1SCL1/S1RB8
49PGC1/AN11/RP41/SDA1/RB9S1PGC1/S1RP41/S1SDA1/S1RB9
50RP52/RC4S1RP52/S1PWM2H/S1RC4

Legend: RPn represent remappable peripheral functions.
Note 1: A pull-up resistor is connected to this pin when device is erased (JTAG enabled) and during programming.
2: This pin is toggled during programming.

TABLE 8: 64-PIN TQFP/QFN (CONTINUED)

Pin #Main CoreSecondary Core
51RP53/RC5 S1RP53/S1PWM2L/S1RC5
52RP58/RC10 S1RP58/S1PWM1H/S1RC10
53RP59/RC11 S1RP59/S1PWM1L/S1RC11
54RP68/RD4 S1RP68/S1PWM3H/S1RD4
55RP67/RD3 S1RP67/S1PWM3L/S1RD3
56Vss Vss
57VDD VDD
58RP66/RD2 S1RP66/S1PWM8L/S1RD2
59RP65/RD1 S1RP65/S1PWM4H/S1RD1
60RP64/RD0 S1RP64/S1PWM4L/S1RD0
61TMS/RP42/PWM3H/RB10(1)S1RP42/S1RB10(1)
62TCK/RP43/PWM3L/RB11S1RP43/S1RB11
63TDI/RP44/PWM2H/RB12S1RP44/S1RB12
64RP45/PWM2L/RB13 S1RP45/S1RB13

Legend: RPN represent remappable peripheral functions.
Note 1: A pull-up resistor is connected to this pin when device is erased (JTAG enabled) and during programming.
2: This pin is toggled during programming.

Pin Diagrams (Continued)

80-Pin TQFP ^(1)

Microchip dsPIC33CH64MP208 - Pin Diagrams (Continued) - 1

geo dsPIC33CHXXXMP508 | Chip | Pin Number | Pin Label | | :--- | :--- | :--- | | RB13 | 80 | RB13 | | RB14 | 79 | RB14 | | RB15 | 78 | RB15 | | RB16 | 77 | RB16 | | RB17 | 76 | RB17 | | RB18 | 75 | RB18 | | RB19 | 74 | RB19 | | RB20 | 73 | RB20 | | RB21 | 72 | RB21 | | RB22 | 71 | RB22 | | RB23 | 70 | RB23 | | RB24 | 69 | RB24 | | RB25 | 68 | RB25 | | RB26 | 67 | RB26 | | RB27 | 66 | RB27 | | RB28 | 65 | RB28 | | RB29 | 64 | RB29 | | RB30 | 63 | RB30 | | RB31 | 62 | RB31 | | RB32 | 61 | RB32 | | VDD | 50 | VDD | | VSS | 51 | VSS | | VDD̅ | 50 | VSS̅ | | VSS̅̅ | 49 | VSS̅̅ | | VSS̅ | 48 | VSS̅ | | VSS̅̅̅ | 47 | VSS̅̅̅ | | VSS̅̅̅̅̅ | 46 | VSS̅̅̅ | | VSS̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̆̇ | 45 | VSS̅ | | VSS̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̆ | 44 | VSS | | VSS̅ | 43 | VSS | | VSS̅̅̅ | 42 | VSS | | VSS̅ | 41 | VSS | RA1 | 18 | RA1 | | RA2 | 20 | RA2 | | RA3 | 21 | RA3 | | RA4 | 22 | RA4 | | RA5 | 23 | RA5 | | RA6 | 24 | RA6 | | RA7 | 25 | RA7 | | RA8 | 26 | RA8 | | RA9 | 27 | RA9 | | RD10 | 31 | RD10 | | RD11 | 32 | RD11 | | RD12 | 33 | RD12 | | RD13 | 34 | RD13 | | RD14 | 35 | RD14 | | RD15 | 10 | RD15 | | RD16 | 51 | RD16 | | RD17 | 50 | RD17 | | RD18 | 51 | RD18 | | RD19 | 52 | RD19 | | RD20 | 53 | RD20 | | RD21 | 54 | RD21 | | RD22 | 55 | RD22 | | RD23 | 56 | RD23 | | RD24 | 57 | RD24 | | RD25 | 58 | RD25 | | RD26 | 59 | RD26 | | RD27 | 60 | RD27 | | RD28 | 61 | RD28 | DS PIC33CHXXXMP508 DS PIC33CHXXXMP208

Note 1: Shaded pins are up to 5.5 VDC tolerant (refer to Table 3-29). For the list of analog ports, refer to Table 3-28 and Table 4-25.

TABLE 9: 80-PIN TQFP

Pin #Main Core Secondary Core
1RP46/PWM1H/RB14 S1RP46/S1RB14
2 RE0S1RE0
3RP47/PWM1L/RB15 S1RP47/S1RB15
4RE1 S1RE1
5RP60/PWM4H/RC12S1RP60/S1RC12
6RP61/PWM4L/RC13 S1RP61/S1RC13
7RP62/RC14 S1RP62/S1PWM7H/S1RC14
8RP63/RC15 S1RP63/S1PWM7L/S1RC15
9MCLR —
10PCI22/RD15S1PCI22/S1RD15
11VssVss
12VDDVDD
13PCI21/RD14S1ANN1/S1PGA2N2/S1PCI21/S1RD14
14RD13S1ANN0/S1PGA1N2/S1RD13
15AN12/IBIAS3/RP48/RC0S1AN10/S1RP48/S1RC0
16AN0/CMP1A/RA0S1RA0
17RE2 S1RE2
18AN1/RA1S1AN15/S1RA1
19RE3 S1RE3
20AN2/RA2S1AN16/S1RA2
21AN3/IBIAS0/RA3S1AN0/S1CMP1A/S1PGA1P1/S1RA3
22RE4 S1RE4
23AN4/IBIAS1/RA4S1MCLR3/S1AN1/S1CMP2A/S1PGA2P1/S1PGA3P2/S1RA4
24RE5 S1RE5
25AVDDAVDD
26AVssAVss
27RD12S1AN14/S1PGA2P2/S1RD12
28AN13/ISRC0/RP49/RC1S1ANA1/S1RP49/S1RC1
29AN14/ISRC1/RP50/RC2S1ANA0/S1RP50/S1RC2
30RP54/RC6S1AN11/S1CMP1B/S1RP54/S1RC6
31VDDVDD
32VssVss
33CMP1B/RP51/RC3S1AN8/S1CMP3B/S1RP51/S1RC3
34OSCI/CLKI/AN5/RP32/RB0S1AN5/S1RP32/S1RB0
35OSCO/CLKO/AN6/IBIAS2/RP33/RB1(2)S1AN4/S1RP33/S1RB1(2)
36RD11S1AN17/S1PGA1P2/S1RD11
37RE6 S1PGA3N2/S1RE6
38ISRC3/RD10S1AN13/S1CMP2B/S1RD10
39RE7 S1RE7
40AN15/ISRC2/RP55/RC7S1AN12/S1RP55/S1RC7
41DACOUT1/AN7/CMP1D/RP34/INT0/RB2S1MCLR2/S1AN3/S1ANC0/S1ANC1/S1CMP1D/S1CMP2D/S1CMP3D/S1RP34/S1INT0/S1RB2
42RE8 S1RE8
43PGD2/AN8/RP35/RB3S1PGD2/S1AN18/S1CMP3A/S1PGA3P1/S1RP35/S1RB3
44RE9 S1RE9
45PGC2/RP36/RB4S1PGC2/S1AN9/S1RP36/S1PWM5L/S1RB4
46RP56/ASDA1/SCK2/RC8S1RP56/S1ASDA1/S1SCK1/S1RC8
47RP57/ASCL1/SDI2/RC9S1RP57/S1ASCL1/S1SDI1/S1RC9
48PCI20/RD9S1PCI20/S1RD9

Legend: RPn represent remappable peripheral functions.
Note 1: A pull-up resistor is connected to this pin when device is erased (JTAG enabled) and during programming.
2: This pin is toggled during programming.

TABLE 9: 80-PIN TQFP (CONTINUED)

Pin #Main CoreSecondary Core
49 SDO2/PCI19/RD8 S1SDO1/S1PCI19/S1RD8
50Vss Vss
51 VDD VDD
52RP71/RD7S1RP71/S1PWM8H/S1RD7
53RP70/RD6 S1RP70/S1PWM6H/S1RD6
54RP69/RD5 S1RP69/S1PWM6L/S1RD5
55PGD3/RP37/SDA2/RB5S1PGD3/S1RP37/S1RB5
56PGC3/RP38/SCL2/RB6S1PGC3/S1RP38/S1RB6
57RE10 S1RE10
58TDO/AN9/RP39/RB7 1MCLR1 /S1AN6/S1RP39/S1PWM5H/S1RB7
59RE11 S1RE11
60PGD1/AN10/RP40/SCL1/RB8S1PGD1/S1AN7/S1RP40/S1SCL1/S1RB8
61PGC1/AN11/RP41/SDA1/RB9S1PGC1/S1RP41/S1SDA1/S1RB9
62ASCL2/RE12S1RE12
63RP52/RC4 S1RP52/S1PWM2H/S1RC4
64ASDA2/RE13S1RE13
65RP53/RC5 S1RP53/S1PWM2L/S1RC5
66RP58/RC10S1RP58/S1PWM1H/S1RC10
67RP59/RC11S1RP59/S1PWM1L/S1RC11
68RP68/RD4 S1RP68/S1PWM3H/S1RD4
69RP67/RD3 S1RP67/S1PWM3L/S1RD3
70Vss Vss
71 VDD VDD
72RP66/RD2S1RP66/S1PWM8L/S1RD2
73RP65/RD1 S1RP65/S1PWM4H/S1RD1
74RP64/RD0 S1RP64/S1PWM4L/S1RD0
75TMS/RP42/PWM3H/RB10 ^(1) S1RP42/S1RB10^(1)
76TCK/RP43/PWM3L/RB11S1RP43/S1RB11
77RE14 S1RE14
78TDI/RP44/PWM2H/RB12S1RP44/S1RB12
79RE15 S1RE15
80RP45/PWM2L/RB13S1RP45/S1RB13

Legend: RPn represent remappable peripheral functions.
Note 1: A pull-up resistor is connected to this pin when device is erased (JTAG enabled) and during programming.
2: This pin is toggled during programming.

Table of Contents

dsPIC33CH128MP508 Product Families 4

1.0 Device Overview 23

2.0 Guidelines for Getting Started with 16-Bit Digital Signal Controllers....31

3.0 Main Modules 38

4.0 Secondary Modules 265

5.0 Main Secondary Interface (MSI) 425

6.0 Oscillator with High-Frequency PLL 439

7.0 Power-Saving Features (Main and Secondary) 481

8.0 Direct Memory Access (DMA) Controller 499

9.0 High-Resolution PWM (HSPWM) with Fine Edge Placement 509

10.0 Capture/Compare/PWM/Timer Modules (SCCP) 543

11.0 High-Speed Analog Comparator with Slope Compensation DAC 561

12.0 Quadrature Encoder Interface (QEI) (Main/Secondary) 573

13.0 Universal Asynchronous Receiver Transmitter (UART) 589

14.0 Serial Peripheral Interface (SPI)....611

15.0 Inter-Integrated Circuit (I 2C) 629

16.0 Single-Edge Nibble Transmission (SENT) 639

17.0 Timer1 649

18.0 Configurable Logic Cell (CLC) 653

19.0 32-Bit Programmable Cyclic Redundancy Check (CRC) Generator 665

20.0 Current Bias Generator (CBG) 669

21.0 Special Features 675

22.0 Instruction Set Summary 721

23.0 Development Support....731

24.0 Electrical Characteristics 733

25.0 High-Temperature Electrical Characteristics 777

26.0 Packaging Information....791

Appendix A: Revision History 817

Index 820

The Microchip Website 830

Customer Change Notification Service 830

Customer Support 830

Product Identification System....832

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 Website 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 Website; 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 website at www.microchip.com to receive the most current information on all of our products.

Referenced Sources

This device data sheet is based on the following individual chapters of the "dsPIC33/PIC24 Family Reference Manual". These documents should be considered as the general reference for the operation of a particular module or device feature.

Note 1: To access the documents listed below, browse to the documentation section of the dsPIC33CH128MP508 product page of the Microchip website (www.microchip.com) or select a family reference manual section from the following list.

In addition to parameters, features and other documentation, the resulting page provides links to the related family reference manual sections.

  • “Introduction” (www.microchip.com/DS70000573)
  • “Enhanced CPU” (www.microchip.com/DS70005158)
  • “dsPIC33/PIC24 Program Memory” (www.microchip.com/DS70000613)
    • “Data Memory” (www.microchip.com/DS70000595)
  • “Dual Partition Flash Program Memory” (www.microchip.com/DS70005156)
  • “Flash Programming” (www.microchip.com/DS70000609)
  • “Reset” (www.microchip.com/DS70000602)
  • “Interrupts” (www.microchip.com/DS70000600)
  • "I/O Ports with Edge Detect" (www.microchip.com/DS70005322)
  • “Deadman Timer” (www.microchip.com/DS70005155)
  • “CAN Flexible Data-Rate (FD) Protocol Module” (www.microchip.com/DS70005340)
  • “12-Bit High-Speed, Multiple SARs A/D Converter (ADC)” (www.microchip.com/DS70005213)
  • “Peripheral Trigger Generator (PTG)” (www.microchip.com/DS70000669)
  • “Programmable Gain Amplifier (PGA)” (www.microchip.com/DS70005146)
  • “Main Secondary Interface (MSI) Module” (www.microchip.com/DS70005278)
  • “Watchdog Timer and Power-Saving Modes” (www.microchip.com/DS70000615)
  • “Oscillator Module with High-Speed PLL” (www.microchip.com/DS70005255)
  • “Timer1 Module” (www.microchip.com/DS70005279)
  • “Direct Memory Access Controller (DMA)” (www.microchip.com/DS30009742)
  • “Capture/Compare/PWM/Timer (MCCP and SCCP)” (www.microchip.com/DS30003035)
  • “High-Resolution PWM with Fine Edge Placement” (www.microchip.com/DS70005320)
  • “Serial Peripheral Interface (SPI) with Audio Codec Support” (www.microchip.com/DS70005136)
  • “Inter-Integrated Circuit (I ^2 C)” (www.microchip.com/DS70000195)
  • "Multiprotocol Universal Asynchronous Receiver Transmitter (UART) Module" (www.microchip.com/DS70005288)
  • “Single-Edge Nibble Transmission (SENT) Module” (www.microchip.com/DS70005145)
  • “32-Bit Programmable Cyclic Redundancy Check (CRC)” (www.microchip.com/DS30009729)
  • “Configurable Logic Cell (CLC)” (www.microchip.com/DS70005298)
  • “Quadrature Encoder Interface (QEI)” (www.microchip.com/DS70000601)
  • “High-Speed Analog Comparator Module” (www.microchip.com/DS70005280)
  • “Current Bias Generator (CBG)” (www.microchip.com/DS70005253)
  • “Dual Watchdog Timer” (www.microchip.com/DS70005250)
  • “Programming and Diagnostics” (www.microchip.com/DS70000608)
  • “CodeGuard™ Security” (www.microchip.com/DS70005182)

Terminology Cross Reference

Table 10 provides updated terminology for depreciated naming conventions. Register and bit names remain unchanged, however, descriptions and usage guidance may have been updated.

TABLE 10: TERMINOLOGY CROSS REFERENCES

Use CaseDeprecated TermNew Term
CPU Master Initiator
DMA Master Initiator
I2C Master Host
Slave Client
SPI Master Host
Slave Client
PMP Master Host
Slave Client
UART, LIN mode Master Commander
SlaveResponder
PWMMaster Host
Slave Client

NOTES:

1.0 DEVICE OVERVIEW

Note 1: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive resource. To complement the information in this data sheet, refer to the related section of the "dsPIC33/PIC24 Family Reference Manual", which is available from the Microchip website (www.microchip.com).

2: Some registers and associated bits described in this section may not be available on all devices. Refer to Section 3.2 "Main Memory Organization" and Section 4.2 "Secondary Memory Organization" in this data sheet for device-specific register and bit information.

This document contains device-specific information for the dsPIC33CH128MP508 Digital Signal Controller (DSC) and Microcontroller (MCU) devices.

dsPIC33CH128MP508 devices contain extensive Digital Signal Processor (DSP) functionality with a high-performance, 16-bit MCU architecture.

Figure 1-2 shows a general block diagram of the cores and peripheral modules of the Main and Secondary. Table 1-1 lists the functions of the various pins shown in the pinout diagrams.

The Main core and Secondary core can operate independently and can be programmed and debugged separately during the application development. Both processor (Main and Secondary) subsystems have their own interrupt controllers, clock generators, ICD, port logic, I/O MUXes and PPS. The device is equivalent to having two complete dsPIC® DSCs on a single die.

The Main core will execute the code from Program Flash Memory (PFM) and the Secondary core will operate from Program RAM Memory (PRAM).

Once the code development is complete, the Main Flash will be programmed with the Main code as well as the Secondary code. After a Power-on Reset (POR), the Secondary code from Host Flash will be loaded to the PRAM (program memory of the Secondary) and the Secondary can execute the code independently of the Main. The Main and Secondary can communicate and exchange data with each other using the Main Secondary Interface (MSI) peripheral.

Figure 1-1 shows the block diagram of the device operation during a POR and the process of transferring the Secondary code from the Main to Secondary PRAM.

The I/O ports are shared between the Main and Secondary. Table1 shows the number of peripherals and the shared peripherals that the Main and Secondary own. There are Configuration bits in the Flash memory that specify the ownership (Main or Secondary) of each device pin.

The default (erased) state of the Flash assigns all of the device pins to the Main.

The two cores (Main and Secondary) can both be connected to debug tools, which support independent and simultaneous debugging. When the Secondary core or Main core is debugged (non-Dual Debug mode), the S1MCLRx is not used. MCLR is used for programming and debugging both the Main core and the Secondary core. S1MCLRx is only used when debugging both the cores at the same time.

In normal operation, the "owner" of a device pin is responsible for full control of that pin; this includes both the digital and analog functionality.

The pin owner's GPIO registers control all aspects of the I/O pad, including the ANSELx, CNPUx, CNPDx, ODCx registers and slew rate control.

Note: Both the Main and Secondary cores can monitor a pin as an input, regardless of pin ownership. Pin ownership is valid only for the output functionality of the port.

FIGURE 1-1: SECONDARY CORE CODE TRANSFER BLOCK DIAGRAM
Before a POR:
Microchip dsPIC33CH64MP208 - DEVICE OVERVIEW - 1

flowchart
graph TD
    A["Code to Transfer Secondary Code to Secondary PRAM"] --> B["Main Code"]
    B --> C["Secondary Code"]
    D["Main CPU"] --> E["Main RAM"]
    F["No Code"] --> G["Secondary RAM"]
    H["Secondary CPU"] --> I["Secondary RAM"]

After a POR, it is the Main code's responsibility to load the Secondary PRAM with the Secondary code. Once the Secondary code is loaded to PRAM, the Main can enable the Secondary to start Secondary code execution:

Microchip dsPIC33CH64MP208 - DEVICE OVERVIEW - 2

flowchart
graph LR
    A["Code to Transfer Secondary Code to Secondary PRAM"] --> B["Main CPU"]
    C["Main Code"] --> B
    D["Secondary Code"] --> E["Main RAM"]
    B --> F["Secondary PRAM"]
    E --> F
    F --> G["Secondary CPU"]
    F --> H["Secondary RAM"]

FIGURE 1-2: dsPIC33CH128MP508 FAMILY BLOCK DIAGRAM (1)
Microchip dsPIC33CH64MP208 - DEVICE OVERVIEW - 3

flowchart
graph TD
    A["CLC (4)"] --> B["WDT/DMT"]
    C["QEI (1)"] --> D["CRC (1)"]
    E["SENT (2)"] --> F["PTG (1)"]
    G["CAN FD (1)"] --> H["HS PWM (4)"]
    I["ADC (1)"] --> J["Timer1 (1)"]
    K["DMA (6)"] --> L["DAC/Comparator (1)"]
    M["SCCP (8)"] --> N["SPI/I²S (2)"]
    O["I²C (2)"] --> P["UART (2)"]
    Q["OSCI/CLKI"] --> R["Timing Generation"]
    R --> S["Timing Generation"]
    S --> T["Oscillator Start-up Timer"]
    T --> U["MSI (Main Secondary Interface)"]
    U --> V["Secondary CPU"]
    V --> W["PORTA(2)"]
    V --> X["PORTB(2)"]
    V --> Y["PORTC(2)"]
    V --> Z["PORTD(2)"]
    V --> AA["PORTE(2)"]
    V --> AB["Remappable Pins(3)"]
    V --> AC["I²C (1)"]
    AD["QEI (1)"] --> AE["WDT"]
    AF["PGA (3)"] --> AG["PLC (4)"]
    AH["CLC (4)"] --> AI["ADC (3)"]
    AJ["Timer1 (1)"] --> AK["DMA (2)"]
    AL["DAC/Comparator (3)"] --> AM["SCI/PWM (8)"]
    AN["SPI/I²S (1)"] --> AO["UART (1)"]
    AP["VDD, VSS AVDD, AVss"] --> AQ["MCLR"]
    AR["S1MCLRx"] --> AS["VDD, VSS AVDD, AVss"]
    AT["PTG (1)"] --> AU["Master Timer"]
    AV["HS PWM (4)"] --> AW["Master Timer"]
    AX["Timer1 (1)"] --> AY["Master Timer"]
    AZ["ADC (1)"] --> BA["Master Timer"]
    BB["DAC/Comparator (3)"] --> BC["Master Timer"]
    BD["SCI/PWM (8)"] --> BE["Master Timer"]
    BF["VDD, VSS AVDD, AVss"] --> BG["MCLR"]
    BH["S1MCLRx"] --> BI["MCLR"]
    BJ["VDD, VSS AVDD, AVss"] --> BK["MCLR"]
    BL["Master Timer"] --> BL["Main CPU"]
    BL --> BL

Note 1: The numbers in the parentheses are the number of instantiations of the module indicated.
2: Not all I/O pins or features are implemented on all device pinout configurations. See Table 1-1 for specific implementations by pin count.
3: Some peripheral I/Os are only accessible through remappable pins.

TABLE 1-1: PINOUT I/O DESCRIPTIONS

Pin Name^(1) Pin TypeBuffer TypePPSDescription
AN0-AN18IAnalogNoMain core analog input channels
S1AN0-S1AN18IAnalogNoSecondary core analog input channels
S1ANA0, S1ANA1IAnalogNoSecondary core alternate analog inputs
S1ANC0, S1ANC1IAnalogNoSecondary core dedicated analog input channels
ADCTRG I ST Yes ADC Trigger Input 31
CAN1RXISTYesCAN1 receive input
CAN1OYesCAN1 transmit output
CLKIIST/CMOSNoExternal Clock (EC) source input. Always associated with OSCI pin function.
CLKOONoOscillator crystal output. Connects to crystal or resonator in Crystal Oscillator mode. Optionally functions as CLKO in RC and EC modes. Always associated with OSCO pin function.
OSCIIST/CMOSNoOscillator crystal input. ST buffer when configured in RC mode; CMOS otherwise.
OSCOI/ONoOscillator crystal output. Connects to crystal or resonator in Crystal Oscillator mode. Optionally functions as CLKO in RC and EC modes.
REFOI/S1REFOI I ST Yes Reference clock input
REFCLKO/S1REFCLKO^(3) O —YesReference clock output
INT0/S1INT0^(3) ISTNoExternal Interrupt 0
INT1/S1INT1^(3) ISTYesExternal Interrupt 1
INT2/S1INT2^(3) ISTYesExternal Interrupt 2
INT3/S1INT3^(3) ISTYesExternal Interrupt 3
IOCA[4:0]/S1IOCA[4:0]^(3) ISTNoInterrupt-on-Change input for PORTA
IOCB[15:0]/S1IOCB[15:0]^(3) ISTNoInterrupt-on-Change input for PORTB
IOCC[15:0]/S1IOCC[15:0]^(3) ISTNoInterrupt-on-Change input for PORTC
IOCD[15:0]/S1IOCD[15:0]^(3) ISTNoInterrupt-on-Change input for PORTD
IOCE[15:0]/S1IOCE[15:0]^(3) ISTNoInterrupt-on-Change input for PORTE
QEIA1ISTYesQEI Input A
QEIB1ISTYesQEI Input B
QEINDX1ISTYesQEI Index 1 input
QEIHOM1ISTYesQEI Home 1 input
QEICMPOYesQEI comparator output
RA0-RA4/S1RA0-S1RA4(3)I/OSTNoPORTA is a bidirectional I/O port
RB0-RB15/S1RB0-S1RB15(3)I/OSTNoPORTB is a bidirectional I/O port
RC0-RC15/S1RC0-S1RC15(3)I/OSTNoPORTC is a bidirectional I/O port
RD0-RD15/S1RD0-S1RD15(3)I/OSTNoPORTD is a bidirectional I/O port
RE0-RE15/S1RE0-S1RE15(3)I/OSTNoPORTE is a bidirectional I/O port
T1CK/S1T1CK(3)I STYes Timer1 external clock input

Legend: CMOS = CMOS compatible input or output ST = Schmitt Trigger input with CMOS levels PPS = Peripheral Pin Select

Analog = Analog input O = Output TTL = TTL input buffer

P = Power I = Input
Note 1: Not all pins are available in all package variants. See the "Pin Diagrams" section for pin availability.
2: These pins are remappable as well as dedicated. Some of the pins are associated with the Secondary function and have S1 attached to the beginning of the name. For example, AN0 for the Secondary is S1AN0.
3: S1 attached to the beginning of the name indicates the Secondary feature for that function. For example, AN0 for the Secondary is S1AN0.
4: Only 48, 64 and 80-pin devices have all eight PWM output pairs on dedicated pins. Refer to pinout diagrams for PWM pin availability on other packages.

TABLE 1-1: PINOUT I/O DESCRIPTIONS (CONTINUED)

Pin Name(1)Pin TypeBuffer TypePPSDescription
1CTS/1U1CTS^(3) ISTYesUART1 Clear-to-Send
1RTS/1U1RTS^(3) OYesUART1 Request-to-Send
U1RX/S1U1RX^(3) ISTYesUART1 receive
1TX/1U1TX^(3) OYesUART1 transmit
1DSR/1U1DSR ISTYesUART1 Data-Set-Ready
U1DTR/S1U1DTR OYesUART1 Data-Terminal-Ready
2CTS ISTYesUART2 Clear-to-Send
2RTS OYesUART2 Request-to-Send
U2RX ISTYesUART2 receive
U2TX OYesUART2 transmit
2DSR ISTYesUART2 Data-Set-Ready
U2DTR OYesUART2 Data-Terminal-Ready
SENT1ISTYesSENT1 input
SENT2ISTYesSENT2 input
SENT1OUTOYesSENT1 output
SENT2OUTOYesSENT2 output
PTGTRG24OYesPTG Trigger Output 24
PTGTRG25OYesPTG Trigger Output 25
TCKI1-TCKI8/ S1TCKI1-S1TCKI4^(3) ISTYesSCCP Timer Inputs 1 through 8/1 through 4
ICM1-ICM8/ S1ICM1-S1ICM4^(3) ISTYesSCCP Capture Inputs 1 through 8/1 through 4
OCFA-OCFB/ S1OCFA-S1OCFB^(3) ISTYesSCCP Fault Inputs A through B
OCM1-OCM8/ S1OCM1-S1OCM4^(3) OYesSCCP Compare Outputs 1 through 8/1 through 4
SCK1/S1SCK1(3)I/OSTYesSynchronous serial clock input/output for SPI1
SDI1/S1SDI1(3)ISTYesSPI1 data in
SDO1/S1SDO1^(3) OYesSPI1 data out
1/S1SS1^(3) I/OSTYesSPI1 Secondary synchronization or frame pulse I/O
SCK2I/OSTYesSynchronous serial clock input/output for SPI2
SDI2ISTYesSPI2 data in
SDO2OYesSPI2 data out
2 I/OSTYesSPI2 Secondary synchronization or frame pulse I/O
SCL1/S1SCL1^(3) I/OSTNoSynchronous serial clock input/output for I2C1
SDA1/S1SDA1^(3) I/OSTNoSynchronous serial data input/output for I2C1
ASCL1I/OSTNoAlternate synchronous serial clock input/output for I2C1
ASDA1I/OSTNoAlternate synchronous serial data input/output for I2C1
SCL2I/OSTNoSynchronous serial clock input/output for I2C2
SDA2I/OSTNoSynchronous serial data input/output for I2C2
ASCL2I/OSTNoAlternate synchronous serial clock input/output for I2C2
ASDA2I/OSTNoAlternate synchronous serial data input/output for I2C2

Legend: CMOS = CMOS compatible input or output Analog = Analog input P = Power ST = Schmitt Trigger input with CMOS levels O = Output I = Input PPS = Peripheral Pin Select TTL = TTL input buffer
Note 1: Not all pins are available in all package variants. See the "Pin Diagrams" section for pin availability.
2: These pins are remappable as well as dedicated. Some of the pins are associated with the Secondary function and have S1 attached to the beginning of the name. For example, AN0 for the Secondary is S1AN0.
3: S1 attached to the beginning of the name indicates the Secondary feature for that function. For example, AN0 for the Secondary is S1AN0.
4: Only 48, 64 and 80-pin devices have all eight PWM output pairs on dedicated pins. Refer to pinout diagrams for PWM pin availability on other packages.

TABLE 1-1: PINOUT I/O DESCRIPTIONS (CONTINUED)

Pin Name(1)Pin TypeBuffer TypePPSDescription
TMSISTNoJTAG Test mode select pin
TCKISTNoJTAG test clock input pin
TDIISTNoJTAG test data input pin
TDOONoJTAG test data output pin
PCI8-PCI18/S1PCI8-S1PCI18ISTYesPWM Inputs 8 through 18
PWMEA-PWMED/S1PWMEA-S1PWMEDOYesPWM Event Outputs A through D
PCI19-PCI22/S1PCI19-S1PCI22(3)ISTNoPWM Inputs 19 through 22
PWM1L-PWM4L/S1PWM1L/S1PWM8L(3,4)ONoPWM Low Outputs 1 through 8
PWM1H-PWM4H/S1PWM1H-S1PWM8H(2,3,4)OPWM High Outputs 1 through 8
CLCINA-CLCIND/S1CLCINA-S1CLCIND(3)ISTYesCLC Inputs A through D
CLC1OUT-CLC4OUTOYesCLC Outputs 1 through 4
CMP1OYesComparator 1 output
CMP1A/S1CMP1A-S1CMP3A(3)IAnalogNoComparator Channels 1A through 3A inputs
CMP1B/S1CMP1B-S1CMP3B(3)IAnalogNoComparator Channels 1B through 3B inputs
CMP1D/S1CMP1D-S1CMP3D(3)IAnalogNoComparator Channels 1D through 3D inputs
DACOUT1 O — No DAC output voltage
IBIAS3, IBIAS2, IBIAS1,IBIAS0/ISRC3, ISRC2,ISRC1, ISRC0O Analog No Constant-Current Outputs 0 through 3
S1PGA1P2 I Analog No PGA1Positive Input 2
S1PGA1N2 I Analog No PGA1Negative Input 2
S1PGA2P2 I Analog No PGA2Positive Input 2
S1PGA2N2 I Analog No PGA2Negative Input 2
S1PGA3P1-S1PGA3P2I Analog No PGA3 Positive Inputs 1 through 2
S1PGA3N2 I Analog No PGA3Negative Input 2

Legend: CMOS = CMOS compatible input or output Analog = Analog input P = Power ST = Schmitt Trigger input with CMOS levels O = Output I = Input PPS = Peripheral Pin Select TTL = TTL input buffer
Note 1: Not all pins are available in all package variants. See the "Pin Diagrams" section for pin availability.
2: These pins are remappable as well as dedicated. Some of the pins are associated with the Secondary function and have S1 attached to the beginning of the name. For example, AN0 for the Secondary is S1AN0.
3: S1 attached to the beginning of the name indicates the Secondary feature for that function. For example, AN0 for the Secondary is S1AN0.
4: Only 48, 64 and 80-pin devices have all eight PWM output pairs on dedicated pins. Refer to pinout diagrams for PWM pin availability on other packages.

TABLE 1-1: PINOUT I/O DESCRIPTIONS (CONTINUED)

Pin Name(1)Pin TypeBuffer TypePPSDescription
PGD1/S1PGD1(3)I/OSTNoData I/O pin for Programming/Debugging Communication Channel 1
PGC1/S1PGC1(3)ISTNoClock input pin for Programming/Debugging Communication Channel 1
PGD2/S1PGD2(3)I/OSTNoData I/O pin for Programming/Debugging Communication Channel 2
PGC2/S1PGC2(3)ISTNoClock input pin for Programming/Debugging Communication Channel 2
PGD3/S1PGD3(3)I/OSTNoData I/O pin for Programming/Debugging Communication Channel 3
PGC3/S1PGC3(3)ISTNoClock input pin for Programming/Debugging Communication Channel 3
MCLR/S1MCLR1/S1MCLR2/S1MCLR3I/PST No Master QClear (Reset) input. This pin is an active-low Reset to the device. S1MCLRx is valid only for Secondary debug in Dual Debug mode.
AVDDPPNoPositive supply for analog modules. This pin must be connected at all times.
AVssPPNoGround reference for analog modules. This pin must be connected at all times.
VDD P — No Positive supply for peripheral logic and I/O pins
VssP — No Ground reference for logic and I/O pins

Legend: CMOS = CMOS compatible input or output

ST = Schmitt Trigger input with CMOS levels

PPS = Peripheral Pin Select

Analog = Analog input

O = Output

P = Power

I = Input

TTL = TTL input buffer

Note 1: Not all pins are available in all package variants. See the "Pin Diagrams" section for pin availability.

2: These pins are remappable as well as dedicated. Some of the pins are associated with the Secondary function and have S1 attached to the beginning of the name. For example, AN0 for the Secondary is S1AN0.

3: S1 attached to the beginning of the name indicates the Secondary feature for that function. For example, AN0 for the Secondary is S1AN0.

4: Only 48, 64 and 80-pin devices have all eight PWM output pairs on dedicated pins. Refer to pinout diagrams for PWM pin availability on other packages.

NOTES:

2.0 GUIDELINES FOR GETTING STARTED WITH 16-BIT DIGITAL SIGNAL CONTROLLERS

2.1 Basic Connection Requirements

Getting started with the family devices of the dsPIC33CH128MP508 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:

  • All V DD and Vss pins (see Section 2.2 "Decoupling Capacitors")
  • All AV DD and AVss pins regardless if ADC module is not used (see Section 2.2 "Decoupling Capacitors")
  • MCLR pin (see Section 2.3 "Master Clear (MCLR) Pin")
  • PGCx/PGDx pins used for In-Circuit Serial Programming™ (ICSP™) and debugging purposes (see Section 2.4 "ICSP Pins")
  • OSCI and OSCO pins when an external oscillator source is used (see Section 2.5 "External Oscillator Pins")

2.2 Decoupling Capacitors

The use of decoupling capacitors on every pair of power supply pins, such as VDD, Vss, AVDD and AVss is required.

Consider the following criteria when using decoupling capacitors:

- Value and type of capacitor: Recommendation of 0.1 F (100 nF), 10-20V. This capacitor should be a 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: 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 PCB track inductance.

FIGURE 2-1: RECOMMENDED MINIMUM CONNECTION
Microchip dsPIC33CH64MP208 - Decoupling Capacitors - 1

text_image VDD R R1 C MCLR dsPIC33 0.1 µF Ceramic VDD VSS VDD VSS 0.1 µF Ceramic 0.1 µF Ceramic AVDD AVSS VDD VSS 0.1 µF Ceramic 0.1 µF Ceramic L1(1)

Note 1: As an option, instead of a hard-wired connection, an inductor (L1) can be substituted between VDD and AVDD to improve ADC noise rejection. The inductor impedance should be less than 1 and the inductor capacity greater than 10 mA.

Where:

$$ f \quad \frac {F C N V}{2} = \quad (\text { i.e., ADC Conversion Rate / 2 }) $$

$$ f = \frac {1}{(2 \pi \sqrt {L C})} $$

$$ L = \left(\frac {1}{(2 \pi f \sqrt {C})}\right) ^ {2} $$

2.2.1 BULK CAPACITORS

On boards with power traces running longer than six inches in length, it is suggested to use a bulk capacitor for integrated circuits, including DSCs, to supply a local power source. The value of the bulk 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 bulk capacitor so that it meets the acceptable voltage sag at the device. Typical values range from 4.7 F to 47 F.

2.3 Master 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 pin. Consequently, specific voltage levels (VIH and VIL) and fast signal 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-2, 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.

Note 1: There are the S1MCLR1, S1MCLR2 and S1MCLR3 pins and they are used for Secondary debug during the dual debug process. Those pins do not reset the Secondary core during normal operation.

FIGURE 2-2: EXAMPLE OF MCLR PIN CONNECTIONS
Microchip dsPIC33CH64MP208 - Master Clear (MCLR) Pin - 1

text_image VDD R(1) R1(2) JP C MCLR dsPIC33

Note 1: R ≤ 10 kΩ is recommended. A suggested starting value is 10 kΩ. Ensure that the MCLR pin VIH and VIL specifications are met.
2: R1 ≤ 470Ω will limit any current flowing 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 VIH and VIL specifications are met.

2.4 ICSP Pins

The PGCx and PGDx 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 to exceed 100 Ohms.

Pull-up resistors, series diodes and capacitors on the PGCx and PGDx 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 (VIH) and Voltage Input Low (VIL) requirements.

Ensure that the "Communication Channel Select" (i.e., PGCx/PGDx pins) programmed into the device matches the physical connections for the ICSP to PICkit™ 3, MPLAB® ICD 3 or MPLAB REAL ICE™ emulator.

For more information on MPLAB ICD 2, MPLAB ICD 3 and REAL ICE emulator connection requirements, refer to the following documents that are available on the Microchip website.

  • "Using MPLAB ^ ICD 3 In-Circuit Debugger" (poster) (DS51765)
  • "Development Tools Design Advisory" (DS51764)
  • "MPLAB ^ REAL ICE ^TM In-Circuit Emulator User's Guide" (DS51616)
  • "Using MPLAB ^ REAL ICE ^TM In-Circuit Emulator" (poster) (DS51749)

2.5 External Oscillator Pins

When the Primary Oscillator (POSC) circuit is used to connect a crystal oscillator, special care and consideration is needed to ensure proper operation. The POSC circuit should be tested across the environmental conditions that the end product is intended to be used.

The load capacitors specified in the crystal oscillator data sheet can be used as a starting point, however, the parasitic capacitance from the PCB traces can affect the circuit and the values may need to be altered to ensure proper start-up and operation. Excessive trace length and other physical interaction can lead to poor signal quality. Poorly tuned oscillator circuits can have reduced amplitude, incorrect frequency (runt pulses), distorted waveforms and long start-up times that may result in unpredictable application behavior, such as instruction mis-execution, illegal op code fetch, etc.

Ensure that the crystal oscillator circuit is at full amplitude and correct frequency before the system begins to execute code. In planning the application's routing and I/O assignments, ensure that adjacent port pins, and other signals in close proximity to the oscillator, do not have high frequencies, short rise and fall times and other similar noise. For further information on the Primary Oscillator, see Primary Oscillator (POSC). A suggested layout is shown in Figure 2-3.

2.6 External Oscillator Layout Guidance

Use best practices during PCB layout to ensure robust start-up and operation. 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 it 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. If using a two-sided board, avoid any traces on the other side of the board where the crystal is placed. Suggested layouts are shown in Figure 2-3.

With fine-pitch packages, it is not always possible to completely surround the pins and components. A suitable solution is to tie the broken guard sections to a mirrored ground layer. In all cases, the guard trace(s) must be returned to ground. For additional information and design guidance on oscillator circuits, please refer to these Microchip Application Notes, available at the Microchip website (www.microchip.com):

- AN943, "Practical PICmicro® Oscillator Analysis and Design"

• AN949, "Making Your Oscillator Work"

• AN1798, "Crystal Selection for Low-Power Secondary Oscillator

FIGURE 2-3: SUGGESTED PLACEMENT OF THE OSCILLATOR CIRCUIT
Microchip dsPIC33CH64MP208 - External Oscillator Layout Guidance - 1

text_image Single-Sided and In-Line Layouts: Copper Pour (tied to ground) Primary Oscillator Crystal DEVICE PINS Primary Oscillator C1 C2 OSCI OSCO GND Fine-Pitch (Dual-Sided) Layouts: Top Layer Copper Pour (tied to ground) Bottom Layer Copper Pour (tied to ground) OSCO C2 Oscillator Crystal GND C1 OSCI DEVICE PINS

2.7 Oscillator 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 a certain frequency (see Section 6.0 "Oscillator with High-Frequency PLL") to comply with device PLL start-up conditions. This means 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 that clock switching must be enabled in the device Configuration Word.

2.8 Unused I/Os

Unused I/O pins should be configured as outputs and driven to a logic low state.

Alternatively, connect a 1k to 10k resistor between Vss and unused pins, and drive the output to logic low.

2.9 Targeted Applications

• Power Factor Correction (PFC):
- Interleaved PFC
- Critical Conduction PFC
- Bridgeless PFC
- DC/DC Converters:
- Buck, Boost, Forward, Flyback, Push-Pull
- Half/Full-Bridge
- Phase-Shift Full-Bridge
- Resonant Converters

- DC/AC:

- Half/Full-Bridge Inverter

- Resonant Inverter

- Motor Control

- B L D C

- P M S M

- SR

- A C I M

Examples of typical application connections are shown in Figure 2-4 through Figure 2-6.

FIGURE 2-4: INTERLEAVED PFC
Microchip dsPIC33CH64MP208 - Targeted Applications - 1

flowchart
graph TD
    A["ADC Channel"] --> B["PGA/ADC Channel"]
    B --> C["dsPIC33CH128MP508"]
    D["VAC"] --> E["Inverter"]
    E --> F["Diode 1"]
    F --> G["Resistor 1"]
    G --> H["Capacitor 1"]
    H --> I["Ground"]
    J["VOUT+"] --> K["Resistor 2"]
    K --> L["Capacitor 2"]
    L --> M["Resistor 3"]
    M --> N["Capacitor 3"]
    O["FET Driver"] --> P["PWM ADC Channel"]
    Q["FET Driver"] --> R["PGA ADC Channel"]
    S["FET Driver"] --> T["Ground"]
    U["VOUT-"] --> V["Resistor 4"]
    W["VAC"] --> X["Inverter"]
    Y["VOUT+"] --> Z["Resistor 5"]
    AA["VOUT-"] --> AB["Resistor 6"]

FIGURE 2-5: PHASE-SHIFTED FULL-BRIDGE CONVERTER
Microchip dsPIC33CH64MP208 - Targeted Applications - 2

flowchart
graph TD
    A["Gate 1"] --> B["S1"]
    C["Gate 2"] --> D["VIN-"]
    E["Gate 3"] --> F["S3"]
    G["Gate 4"] --> H["S3"]
    I["Gate 5"] --> J["S3"]
    K["Gate 6"] --> L["S3"]
    M["FET Driver"] --> N["Analog Ground"]
    O["FET Driver"] --> P["PWM PGA/ADC Channel"]
    Q["FET Driver"] --> R["PWM ADC Channel"]
    S["dsPIC33CH128MP508"] --> T["PWM"]
    U["VOUT+"] --> V["Gate 6"]
    W["VOUT-"] --> X["Gate 6"]
    Y["k1"] --> Z["PWM"]
    AA["k2"] --> AB["PWM"]
    AC["Gate 1"] --> AD["S1"]
    AE["Gate 2"] --> AF["S3"]
    AG["Gate 3"] --> AH["S3"]
    AI["Gate 4"] --> AJ["S3"]
    AK["Gate 5"] --> AL["S3"]
    AM["Gate 6"] --> AN["S3"]

FIGURE 2-6: OFF-LINE UPS
Microchip dsPIC33CH64MP208 - Targeted Applications - 3

flowchart
graph TD
    subgraph Push-Pull Converter
        A["VBAT"] --> B["FET Driver"]
        C["GND"] --> D["FET Driver"]
        E["k3"] --> F["PWM PWM/RCM ADC or Analog Comp. dsPIC33CH128MP508"]
    end

    subgraph Full-Bridge Inverter
        G["VDC"] --> H["FET Driver"]
        I["GND"] --> J["FET Driver"]
        K["k4"] --> L["FET Driver"]
        M["k5"] --> N["FET Driver"]
        O["ADC"] --> P["PWM"]
        Q["ADC"] --> R["PWM"]
    end

    subgraph Battery Charger
        S["k6"] --> T["FET Driver"]
        U["+"] --> V["Ground"]
    end

    style Push-Pull Converter fill:#f9f,stroke:#333
    style Full-Bridge Inverter fill:#ccf,stroke:#333
    style Battery Charger fill:#dfd,stroke:#333

3.0 MAIN MODULES

3.1 Main CPU

Note 1: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive reference source. To complement the information in this data sheet, refer to “Enhanced CPU” (www.microchip.com/DS70005158), which is available from the Microchip website (www.microchip.com).

There are two independent CPU cores in the dsPIC33CH128MP508 family. The Main and Secondary cores are similar, except for the fact that the Secondary core can run at a higher speed than the Main core.

The Secondary core fetches instructions from the PRAM and the Main core fetches the code from the Flash. The Main and Secondary cores can run independently asynchronously, at the same speed or at a different speed. This section discusses the Main core.

Note: All of the associated register names are the same on the Main, as well as on the Secondary. The Secondary code will be developed in a separate project in MPLAB X IDE with the device selection, dsPIC33CH128MP508S1, where the S1 indicates the Secondary device.

The dsPIC33CH128MP508 family CPU has a 16-bit (data) modified Harvard architecture with an enhanced instruction set, including significant support for Digital Signal Processing (DSP). 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.1.1 REGISTERS

The dsPIC33CH128MP508 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 16th Working register (W15) operates as a Software Stack Pointer for interrupts and calls.

In addition, the dsPIC33CH128MP508 devices include four Alternate Working register sets, which consist of W0 through W14. The Alternate Working 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 IPL7) 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.1.2 INSTRUCTION SET

The instruction set for dsPIC33CH128MP508 devices 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.1.3 DATA SPACE ADDRESSING

The base Data Space (DS) can be addressed as up to 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. 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 memory map can optionally be mapped into Program Space (PS) at any 16K program word boundary. The program-to-Data Space mapping feature, known as Program Space Visibility (PSV), lets any instruction access Program Space as if it were Data Space. Refer to "Data Memory" (www.microchip.com/DS70000595) for more details on PSV and table accesses.

On dsPIC33CH128MP508 family 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 re-ordering for radix-2 FFT algorithms.

3.1.4 ADDRESSING 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: dsPIC33CH128MP508 FAMILY (MAIN) CPU BLOCK DIAGRAM
Microchip dsPIC33CH64MP208 - ADDRESSING MODES - 1

flowchart
graph TD
    A["X Address Bus"] --> B["Interrupt Controller"]
    A --> C["PSV and Table Data Access Control Block"]
    A --> D["PCU PCH PCL Program Counter"]
    A --> E["Y Data Bus"]
    A --> F["X Data Bus"]
    B --> G["Address Latch"]
    C --> H["Program Memory"]
    C --> I["Data Latch"]
    D --> J["Stack Control Logic"]
    D --> K["Loop Control Logic"]
    E --> L["Y AGU"]
    F --> M["X Data Latch"]
    F --> N["X Data RAM"]
    F --> O["Address Latch"]
    F --> P["X RAGU X WAGU"]
    G --> Q["ROM Latch"]
    H --> Q
    I --> Q
    J --> Q
    K --> Q
    L --> Q
    M --> Q
    N --> Q
    O --> Q
    P --> Q
    Q --> R["RAM"]
    Q --> S["BU"]
    R --> T["16-Bit Working Register Arrays"]
    S --> U["16-Bit ALU"]
    T --> V["DSP Engine"]
    U --> W["Divide Support"]
    V --> X["Power, Reset and Oscillator Modules"]
    W --> Y["Control Signals to Various Blocks"]
    T --> Z["Instruction Decode and Control"]
    T --> AA["Secondary CPU"]
    T --> AB["MSI"]
    T --> AC["Ports"]
    T --> AD["Peripheral Modules"]
    T --> AE["Literal Data"]
    AE --> T
    style A fill:#f9f,stroke:#333
    style B fill:#ccf,stroke:#333
    style C fill:#cfc,stroke:#333
    style D fill:#fcc,stroke:#333
    style E fill:#cff,stroke:#333
    style F fill:#ffc,stroke:#333
    style G fill:#fcc,stroke:#333
    style H fill:#fcc,stroke:#333
    style I fill:#fcc,stroke:#333
    style J fill:#fcc,stroke:#333
    style K fill:#fcc,stroke:#333
    style L fill:#fcc,stroke:#333
    style M fill:#fcc,stroke:#333
    style N fill:#fcc,stroke:#333
    style O fill:#fcc,stroke:#333
    style P fill:#fcc,stroke:#333
    style Q fill:#fcc,stroke:#333
    style R fill:#fcc,stroke:#333
    style S fill:#fcc,stroke:#333
    style T fill:#fcc,stroke:#333
    style U fill:#fcc,stroke:#333
    style V fill:#fcc,stroke:#333
    style W fill:#fcc,stroke:#333
    style X fill:#fcc,stroke:#333
    style Y fill:#fcc,stroke:#333
    style Z fill:#fcc,stroke:#333

3.1.5 PROGRAMMER'S MODEL

The programmer's model for the dsPIC33CH128MP508 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 dsPIC33CH128MP508 devices contain control registers for Modulo Addressing, 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 Figure 3-3 and Figure 3-4.

TABLE 3-1: PROGRAMMER'S MODEL REGISTER DESCRIPTIONS

Register(s) Name Description
W0 through W15(1)Working Register Array
W0 through W14(1)Alternate Working Register Array 1
W0 through W14(1)Alternate Working Register Array 2
W0 through W14(1)Alternate Working Register Array 3
W0 through W14(1)Alternate Working Register Array 4
ACCA, ACCB 40-Bit DSP Accumulators(Additional 4 Alternate Accumulators)
PC 23-Bit Program Counter
SR ALU and DSP Engine STATUS Register
SPLIM Stack Pointer Limit Value Register
TBLPAG Table Memory Page AddressRegister
DSRPAG Extended Data Space (EDS)Read Page Register
RCOUNT REPEAT Loop Counter Register
DCOUNT DO Loop Counter Register
DOSTARTH, DOSTARTL(2)DO Loop Start Address Register (High and Low)
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 represent the value of the register in the currently active CPU context. 2: The DOSTARTH and DOSTARTL registers are read-only.

FIGURE 3-2: PROGRAMMER'S MODEL (INITIATOR)
Microchip dsPIC33CH64MP208 - PROGRAMMER'S MODEL - 1

flowchart
graph TD
    A["Working/Address Registers"] --> B["W0-W3"]
    A --> C["DSP Operand Registers"]
    A --> D["DSP Address Registers"]
    B --> E["W0 (WREG)"]
    C --> F["W1"]
    C --> G["W2"]
    C --> H["W3"]
    C --> I["W4"]
    C --> J["W5"]
    C --> K["W6"]
    C --> L["W7"]
    C --> M["W8"]
    C --> N["W9"]
    C --> O["W10"]
    C --> P["W11"]
    C --> Q["W12"]
    C --> R["W13"]
    D --> S["Frame Pointer/W14"]
    D --> T["Stack Pointer/W15"]
    D --> U["Alternate Working/Address Registers"]

    V["DSP Accumulators(1)"] --> W["ACCA"]
    V --> X["ACCB"]

    Y["Program Counter"] --> Z["Program Counter"]
    Y --> AA["TBLPAG"]
    Y --> AB["X Data Space Read Page Address"]

    AC["DO Loop Counter and Stack"] --> AD["DO Loop Counter and Stack"]

    AE["DO Loop Start Address and Stack"] --> AF["DO Loop Start Address and Stack"]

    AG["CPU Core Control Register"] --> AH["CPU Core Control Register"]

    AI["SPLIM"] --> AJ["Stack Pointer Limit"]

    AK["Stack Pointer"] --> AL["Stack Pointer Limit"]

    AM["Program Counter"] --> AN["Program Counter"]

    AO["Data Table Page Address"] --> AP["Data Table Page Address"]

    AQ["X Data Space Read Page Address"] --> AR["X Data Space Read Page Address"]

    AS["REPEAT Loop Counter"] --> AT["REPEAT Loop Counter"]

    AU["DO Loop Counter and Stack"] --> AV["DO Loop Counter and Stack"]

    AW["DO Loop End Address and Stack"] --> AX["DO Loop End Address and Stack"]

    AY["Stack Pointer Limit"] --> AZ["Stack Pointer Limit"]

    BA["Program Counter"] --> BB["Program Counter"]

    BC["Data Table Page Address"] --> BD["Data Table Page Address"]

    BE["X Data Space Read Page Address"] --> BF["X Data Space Read Page Address"]

    BG["REPEAT Loop Counter"] --> BH["REPEAT Loop Counter"]

    BI["DO Loop Counter and Stack"] --> BJ["DO Loop Counter and Stack"]

    BK["DO Loop Start Address and Stack"] --> BL["DO Loop Start Address and Stack"]

    BM["CSTATUS Register"] --> BN["CSTATUS Register"]

3.1.6 CPU RESOURCES

Many useful resources are provided on the main product page of the Microchip website for the devices listed in this data sheet. This product page contains the latest updates and additional information.

3.1.6.1 Key Resources

  • “Enhanced CPU” (www.microchip.com/DS70005158)
  • Code Samples
  • Application Notes
  • Software Libraries
  • Webinars
  • All related "dsPIC33/PIC24 Family Reference Manual" Sections
  • Development Tools

3.1.7 CPU CONTROL/STATUS REGISTERS

REGISTER 3-1: SR: CPU STATUS REGISTER

R/W-0 R/W-0 R/W-0 R/W-0 R/C-0 R/C-0 R-0 R/W-0
OA OB SA(3)SB(3)OAB SABDA DC
bit 15 bit 8
R/W-0^(2) R/W-0^(2) R/W-0^(2) R-0R/W-0R/W-0R/W-0R/W-0
IPL2^(1) IPL1^(1) IPL0^(1) RANOVZC
bit 7 bit 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 15 OA: Accumulator A Overflow Status bit

1 = Accumulator A has overflowed

0 = Accumulator A has not overflowed

bit 14 OB: Accumulator B Overflow Status bit

1 = Accumulator B has overflowed

0 = Accumulator B has not overflowed

bit 13 SA: Accumulator A Saturation 'Sticky' Status bit ^(3)

1 = Accumulator A is saturated or has been saturated at some time

0 = Accumulator A is not saturated

bit 12 SB: Accumulator B Saturation 'Sticky' Status bit ^(3)

1 = Accumulator B is saturated or has been saturated at some time

0 = Accumulator B is not saturated

bit 11 OAB: OA || OB Combined Accumulator Overflow Status bit

1 = Accumulator A or B has overflowed

0 = Neither Accumulator A or B has overflowed

bit 10 SAB: SA || SB Combined Accumulator 'Sticky' Status bit

1 = Accumulator A or B is saturated or has been saturated at some time

0 = Neither Accumulator A or B is saturated

bit 9 DA: DO Loop Active bit

1 = DO loop is in progress

0 = DO loop is not in progress

bit 8 DC: MCU ALU Half Carry/Borrow bit

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

Note 1: The IPL[2:0] bits are concatenated with the IPL[3] bit (CORCON[3]) to form the CPU Interrupt Priority Level. The value in parentheses indicates the IPL, if IPL[3] = 1. User interrupts are disabled when IPL[3] = 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 bit operations.

REGISTER 3-1: SR: CPU STATUS REGISTER (CONTINUED)

bit 7-5 IPL[2:0]: CPU Interrupt Priority Level Status bits (1,2)

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 4 RA: REPEAT Loop Active bit

1 = REPEAT loop is in progress
0 = REPEAT loop is not in progress 

bit 3 N: MCU ALU Negative bit

1 = Result was negative
0 = Result was non-negative (zero or positive) 

bit 2 OV: MCU ALU Overflow bit

This bit is used for signed arithmetic (two'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 = No overflow occurred 

bit 1 Z: 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 0 C: MCU ALU Carry/Borrow bit

1 = A carry-out from the Most Significant bit of the result occurred
0 = No carry-out from the Most Significant bit of the result occurred 

Note 1: The IPL[2:0] bits are concatenated with the IPL[3] bit (CORCON[3]) to form the CPU Interrupt Priority Level. The value in parentheses indicates the IPL, if IPL[3] = 1. User interrupts are disabled when IPL[3] = 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 bit operations.

REGISTER 3-2: CORCON: CORE CONTROL REGISTER

R/W-0 U-0 R/W-0 R/W-0 R/W-0 R-0 R-0 R-0
VAR— US1 US0 EDT(1)DL2 DL1DL0
bit 15 bit 8
R/W-0R/W-0R/W-1R/W-0R/C-0R-0R/W-0R/W-0
SATASATBSATDWACCSAT IPL3^(2) SFARND IF
bit 7 bit 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 15 VAR: Variable Exception Processing Latency Control bit

1 = Variable exception processing is enabled

0 = Fixed exception processing is enabled

bit 14 Unimplemented: Read as '0'

bit 13-12 US[1:0]: DSP Multiply Unsigned/Signed Control bits

11 = Reserved

10 = DSP engine multiplies are mixed sign

01 = DSP engine multiplies are unsigned

00 = DSP engine multiplies are signed

bit 11 EDT: Early DO Loop Termination Control bit ^(1)

1 = Terminates executing DO loop at the end of the current loop iteration

0 = No effect

bit 10-8 DL[2:0]: DO Loop Nesting Level Status bits

111 = Seven DO loops are active

...

001 = One DO loop is active

000 = Zero DO loops are active

bit 7 SATA: ACCA Saturation Enable bit

1 = Accumulator A saturation is enabled

0 = Accumulator A saturation is disabled

bit 6 SATB: ACCB Saturation Enable bit

1 = Accumulator B saturation is enabled

0 = Accumulator B saturation is disabled

bit 5 SATDW: Data Space Write from DSP Engine Saturation Enable bit

1 = Data Space write saturation is enabled

0 = Data Space write saturation is disabled

bit 4 ACCSAT: Accumulator Saturation Mode Select bit

1 = 9.31 saturation (super saturation)

0 = 1.31 saturation (normal saturation)

bit 3 IPL3: CPU Interrupt Priority Level Status bit 3 (2)

1 = CPU Interrupt Priority Level is greater than 7

0 = CPU Interrupt Priority Level is 7 or less

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.

REGISTER 3-2: CORCON: CORE CONTROL REGISTER (CONTINUED)

bit 2 SFA: Stack Frame Active Status bit

1 = Stack frame is active; W14 and W15 address 0x0000 to 0xFFFF, regardless of DSRPAG
0 = Stack frame is not active; W14 and W15 address the base Data Space

bit 1 RND: Rounding Mode Select bit

1 = Biased (conventional) rounding is enabled
0 = Unbiased (convergent) rounding is enabled

bit 0 IF: 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.

REGISTER 3-3: CTXTSTAT: CPU W REGISTER CONTEXT STATUS REGISTER

U-0 U-0 U-0 U-0 U-0R-0 R-0R-0
CCTXI[2:0]
bit 15bit 8
U-0 U-0 U-0 U-0 U-0R-0 R-0R-0
MCTXI[2:0]
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-11 Unimplemented: Read as '0'

bit 10-8 CCTXI[2:0]: Current (W Register) Context Identifier bits

111 = Reserved


.
100 = Alternate Working Register Set 4 is currently in use
011 = Alternate Working Register Set 3 is currently in use
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-3 Unimplemented: Read as '0'

bit 2-0 MCTXI[2:0]: Manual (W Register) Context Identifier bits

111 = Reserved
.
.
.
100 = Alternate Working Register Set 4 was most recently manually selected
011 = Alternate Working Register Set 3 was most recently manually selected
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

REGISTER 3-4: Y PAGE REGISTER

U-0 U-0 U-0 U-0 U-0 U-0 U-0 U-0
——————
bit 15bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
YPAG[7:0]
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 7-0 YPAG[7:0]: Y Page bits

Note: When implemented, YPAG is a R/W SFR register that resets to 0x0001. When not implemented, YPAG is a read-only SFR register which will always return the fixed Y RAM page value, 0x0001.

REGISTER 3-5: MSTRPR: DATA SPACE BUS MASTER PRIORITY CONTROL REGISTER (MAIN)

U-0 U-0 U-0 U-0 U-0 U-0 U-0 U-0
—————
bit 15bit 8
U-0U-0R/W-0R/W-0U-0U-0U-0R/W-0
DMAPRCANPRNVMPR
bit 7 bit 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-6 Unimplemented: Read as '0'

bit 5 DMAPR: Modify DMA Controller Bus Master Priority Relative to CPU bit

1 = Raises DMA Controller bus Master priority to above that of the CPU

0 = No change to DMA Controller bus Master priority

bit 4 CANPR: Modify CAN1 Bus Master Priority Relative to CPU bit

1 = Raises CAN1 bus Master priority to above that of the CPU

0 = No change to CAN1 bus Master priority

bit 3-1 Unimplemented: Read as '0'

bit 0 NVMPR: Modify NVM Controller Bus Master Priority Relative to CPU bit

1 = Raises NVM Controller bus Master priority to above that of the CPU

0 = No change to NVM Controller bus Master priority

3.1.8 ARITHMETIC LOGIC UNIT (ALU)

The dsPIC33CH128MP508 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 Borrow and Digit Borrow bits, respectively, for subtraction operations.

The ALU can perform 8-bit or 16-bit operations, depending on the mode of the instruction that is used. Data for the ALU operation can come from the W register array or data memory, depending on the addressing mode of the instruction. Likewise, output data from the ALU can be written to the W register array or a data memory location.

Refer to the "16-Bit MCU and DSC Programmer's Reference Manual" (DS70000157) for information on the SR bits affected by each instruction.

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.1.8.1 Multiplier

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.1.8.2 Divider

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 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 one cycle per bit of divisor, so both 32-bit/16-bit and 16-bit/16-bit instructions take the same number of cycles to execute. There are additional instructions: DIV2 and DIVF2. Divide instructions will complete in six cycles.

3.1.9 DSP 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 accumulator-to-accumulator operations that require no additional data. These instructions are, ADD, SUB, NEG, MIN and MAX.

The DSP engine has options selected through bits in the CPU Core Control register (CORCON), as listed below:

• Fractional or integer DSP multiply (IF)
- Signed, unsigned or mixed-sign DSP multiply (USx)
- 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

InstructionAlgebraic OperationACC Write-Back
CLR A = 0 Yes
ED A = (x - y) ^2 No
EDAC A = A + (x - y) ^2 No
MAC A = A + (x · y) Yes
MAC A = A + x ^2 No
MOVSACNo change in AYes
MPY A = x · y No
MPY A = x ^2 No
MPY . N A = -x · y No
MSC A = A - x · y Yes

3.2 Main Memory Organization

Note: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive reference source. To complement the information in this data sheet, refer to "dsPIC33/PIC24 Program Memory" (www.microchip.com/DS70000613), which is available from the Microchip website (www.microchip.com).

The dsPIC33CH128MP508 family architecture features separate program and data memory spaces, and buses. This architecture also allows the direct access of program memory from the Data Space (DS) during code execution.

3.2.1 PROGRAM ADDRESS SPACE

The program address memory space of the dsPIC33CH128MP508 family devices is 4M instructions. The space is addressable by a 24-bit value derived either from the 23-bit PC during program execution, or from table operation or Data Space remapping, as described in Section 3.2.9 "Interfacing Program and Data Memory Spaces".

User application access to the program memory space is restricted to the lower half of the address range (0x000000 to 0x7FFFFFF). The exception is the use of TBLRD operations, which use TBLPAG[7] to permit access to calibration data and Device ID sections of the configuration memory space.

The program memory maps for the Main dsPIC33CHXXXMPX08 device are shown in Figure 3-3 and Figure 3-4.

FIGURE 3-3: PROGRAM MEMORY MAP FOR MAIN dsPIC33CH128MPXXX DEVICES ^(1)
Microchip dsPIC33CH64MP208 - PROGRAM ADDRESS SPACE - 1

text_image GOTO Instruction Reset Address Interrupt Vector Table User Program Flash Memory (44K instructions) Device Configuration Unimplemented (Read '0's) Reserved Calibration Data(2,3) User OTP Memory Reserved Write Latches Reserved DEVID Reserved User Memory Space 0x000000 0x000002 0x000004 0x0001FE 0x000200 0x015EFE 0x015F00 0x015FFE 0x016000 0x7FFFFFE 0x800000 0x800FFE 0x801000 0x8016FC 0x801700 0x8017FE 0x801800 0xF9FFFE 0xFA0000 0xFA0002 0xFA0004 0xFEFFFFE 0xFF0000 0xFF0002 0xFF0004 0xFFFFFE

Note 1: Memory areas are not shown to scale.
2: Calibration data area must be maintained during programming.
3: Calibration data area includes UDID locations.

FIGURE 3-4: PROGRAM MEMORY MAP FOR MAIN dsPIC33CH64MPXXX DEVICES (1)
Microchip dsPIC33CH64MP208 - PROGRAM ADDRESS SPACE - 2

text_image GOTO Instruction Reset Address Interrupt Vector Table User Program Flash Memory (22K instructions) Device Configuration Unimplemented (Read '0's) Reserved Calibration Data(2,3) User OTP Memory Reserved Write Latches Reserved DEVID Reserved 0x000000 0x000002 0x000004 0x0001FE 0x000200 0x00AEFE 0x00AF00 0x00AFFE 0x00B000 0x7FFFFE 0x800000 0x800FFE 0x800100 0x8016FC 0x801700 0x8017FE 0x801800 0xF9FFFE 0xFA0000 0xFA0002 0xFA0004 0xFEFFF 0xFF0000 0xFF0002 0xFF0004 0xFFFFFE

Note 1: Memory areas are not shown to scale.
2: Calibration data area must be maintained during programming.
3: Calibration data area includes UDID locations.

3.2.1.1 Program Memory Organization

The program memory space is organized in word-addressable blocks. Although it is treated as 24 bits wide, it is more appropriate to think of each address of the program memory as a lower and upper word, with the upper byte of the upper word being unimplemented. The lower word always has an even address, while the upper word has an odd address (Figure 3-5).

Program memory addresses are always word-aligned on the lower word, and addresses are incremented or decremented, by two, during code execution. This arrangement provides compatibility with data memory space addressing and makes data in the program memory space accessible.

3.2.1.2 Interrupt and Trap Vectors

All dsPIC33CH128MP508 family devices reserve the addresses between 0x000000 and 0x000200 for hard-coded program execution vectors. A hardware Reset vector is provided to redirect code execution from the default value of the PC on device Reset to the actual start of code. A GOTO instruction is programmed by the user application at address, 0x000000, of Flash memory, with the actual address for the start of code at address, 0x000002, of Flash memory.

A more detailed discussion of the Interrupt Vector Tables (IVTs) is provided in Section 3.5 "Main Interrupt Controller".

FIGURE 3-5: PROGRAM MEMORY ORGANIZATION
Microchip dsPIC33CH64MP208 - Interrupt and Trap Vectors - 1

text_image msw Address most significant word least significant word PC Address (Isw Address) 23 0816 0x000001 0x000003 0x000005 0x000007 Program Memory 'Phantom' Byte (read as '0') Instruction Width 0x000000 0x000002 0x000004 0x000006

3.2.2 UNIQUE DEVICE IDENTIFIER (UDID)

All dsPIC33CH128MP508 family devices are individually encoded during final manufacturing with a Unique Device Identifier or UDID. The UDID cannot be erased by a bulk erase command or any other user-accessible means. This feature allows for manufacturing traceability of Microchip Technology devices in applications where this is a requirement. It may also be used by the application manufacturer for any number of things that may require unique identification, such as:

  • Tracking the device
  • Unique serial number
  • Unique security key

The UDID comprises five 24-bit program words. When taken together, these fields form a unique 120-bit identifier.

The UDID is stored in five read-only locations, located between 0x801200 and 0x801208 in the device configuration space. Table3-3 lists the addresses of the identifier words and shows their contents

TABLE 3-3: UDID ADDRESSES

UDIDAddressDescription
UDID10x801200UDID Word 1
UDID20x801202UDID Word 2
UDID30x801204UDID Word 3
UDID40x801206UDID Word 4
UDID50x801208UDID Word 5

3.2.3 DATA ADDRESS SPACE (MAIN)

The dsPIC33CH128MP508 family CPU has a separate 16-bit wide data memory space. The Data Space is accessed using separate Address Generation Units (AGUs) for read and write operations. The data memory map is shown in Figure 3-6.

All Effective Addresses (EAs) in the data memory space are 16 bits wide and point to bytes within the Data Space. This arrangement gives a base Data Space address range of 64 Kbytes or 32K words.

The lower half of the data memory space (i.e., when EA[15] = 0) is used for implemented memory addresses, while the upper half (EA[15] = 1) is reserved for the Program Space Visibility (PSV).

The dsPIC33CH128MP508 family devices implement up to 16 Kbytes of data memory. If an EA points to a location outside of this area, an all-zero word or byte is returned.

3.2.3.1 Data Space Width

The data memory space is organized in byte-addressable, 16-bit wide blocks. Data are aligned in data memory and registers as 16-bit words, but all Data Space EAs resolve to bytes. The Least Significant Bytes (LSBs) of each word have even addresses, while the Most Significant Bytes (MSBs) have odd addresses.

3.2.3.2 Data Memory Organization and Alignment

To maintain backward compatibility with PIC ^® MCU devices and improve Data Space memory usage efficiency, the dsPIC33CH128MP508 family instruction set supports both word and byte operations. As a consequence of byte accessibility, all Effective Address calculations are internally scaled to step through word-aligned memory. For example, the core recognizes that Post-Modified Register Indirect Addressing mode [Ws++] results in a value of Ws + 1 for byte operations and Ws + 2 for word operations.

A data byte read, reads the complete word that contains the byte, using the LSb of any EA to determine which byte to select. The selected byte is placed onto the LSB of the data path. That is, data memory and registers are organized as two parallel, byte-wide entities with shared (word) address decode, but separate write lines. Data byte writes only write to the corresponding side of the array or register that matches the byte address.

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. If a misaligned read or write is attempted, an address error trap is generated. If the error occurred on a read, the instruction underway is completed. If the error occurred on a write, the instruction is executed but the write does not occur. In either case, a trap is then executed, allowing the system and/or user application to examine the machine state prior to execution of the address Fault.

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 user applications to translate 8-bit signed data to 16-bit signed values. Alternatively, for 16-bit unsigned data, user applications can clear the MSB of any W register by executing a Zero-Extend (ZE) instruction on the appropriate address.

3.2.3.3 SFR Space

The first 4 Kbytes of the Near Data Space, from 0x0000 to 0x0FFF, is primarily occupied by Special Function Registers (SFRs). These are used by the dsPIC33CH128MP508 family core and peripheral modules for controlling the operation of the device.

SFRs are distributed among the modules that they control and are generally grouped together by module. Much of the SFR space contains unused addresses; these are read as '0'.

Note: The actual set of peripheral features and interrupts varies by the device. Refer to the corresponding device tables and pinout diagrams for device-specific information.

3.2.3.4 Near Data Space

The 8-Kbyte area, between 0x0000 and 0x1FFF, is referred to as the Near Data Space. Locations in this space are directly addressable through a 13-bit absolute address field within all memory direct instructions. Additionally, the whole Data Space is addressable using MOV instructions, which support Memory Direct Addressing mode with a 16-bit address field, or by using Indirect Addressing mode using a Working register as an Address Pointer.

FIGURE 3-6: DATA MEMORY MAP FOR dsPIC33CH128MP508 DEVICES
Microchip dsPIC33CH64MP208 - Near Data Space - 1

flowchart
graph TD
    A["4-Kbyte SFR Space"] --> B["0x0001"]
    A --> C["0x0FFF"]
    A --> D["0x1001"]
    E["16-Kbyte SRAM Space"] --> F["0x2FFF"]
    E --> G["0x3001"]
    E --> H["0x4FFF"]
    E --> I["0x5001"]
    J["SFR Space"] --> K["X Data RAM (X) (8K)"]
    K --> L["Y Data RAM (Y) (8K)"]
    M["8-Kbyte Near Data Space"] --> N["0x0000"]
    M --> O["0x0FFE"]
    M --> P["0x2000"]
    Q["X Data Unimplemented (X)"] --> R["0x80000x8001"]
    S["Optionally Mapped into Program Memory"] --> T["0xFFFE"]
    U["LSB Address"] --> V["LSBMSB"]
    W["MSB Address"] --> X["16 Bits"]
    Y["LSB Address"] --> Z["LSBMSB"]

Note: Memory areas are not shown to scale.

3.2.3.5 X and Y Data Spaces

The dsPIC33CH128MP508 family core has two Data Spaces, X and Y. These 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. This feature allows certain instructions to concurrently fetch two words from RAM, thereby enabling efficient execution of DSP algorithms, such as Finite Impulse Response (FIR) filtering and Fast Fourier Transform (FFT).

The X Data Space is used by all instructions and supports all addressing modes. X Data Space has separate read and write data buses. The X read data bus is the read data path for all instructions that view Data Space as combined X and Y address space. It is also the X data prefetch path for the dual operand DSP instructions (MAC class).

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.

Both the X and Y Data Spaces support Modulo Addressing mode for all instructions, subject to addressing mode restrictions. Bit-Reversed Addressing mode is only supported for writes to X Data Space.

All data memory writes, including in DSP instructions, view Data Space as combined X and Y address space. The boundary between the X and Y Data Spaces is device-dependent and is not user-programmable.

3.2.4 MEMORY RESOURCES

Many useful resources are provided on the main product page of the Microchip website for the devices listed in this data sheet. This product page contains the latest updates and additional information.

3.2.4.1 Key Resources

  • "Enhanced CPU" (www.microchip.com/DS70005158)
  • Code Samples
  • Application Notes
  • Software Libraries
  • Webinars
  • All Related "dsPIC33/PIC24 Family Reference Manual" Sections
    • Development Tools

3.2.5 SFR MAPS

The following tables show dsPIC33CH128MP508 family Main SFR names, addresses and Reset values. These tables contain all registers applicable to the

dsPIC33CH128MP508 family. Not all registers are present on all device variants. Refer to Table1 and Table 2 for peripheral availability. Table 4-25 shows port availability for the different package options.

TABLE 3-4: MAIN SFR BLOCK 000h

Register Address AllResets Register AddressAll Resets RegisterAddress All Resets
CoreMODCON04600--000000000000CRC
WREG0000000000000000000XMODSRT048xxxxxxxxxxxxxx0CRCCONL0B00-00000010000--
WREG1002000000000000000XMODEND04Axxxxxxxxxxxxxx1CRCCONH0B2---00000---00000
WREG2004000000000000000YMODSRT04Cxxxxxxxxxxxxxx0CRCXORL0B400000000000000-
WREG3006000000000000000YMODEND04Exxxxxxxxxxxxxx1CRCXORH0B6000000000000000
WREG4008000000000000000XBREV0500xxxxxxxxxxxxxxCRCDATL0B8000000000000000
WREG500A000000000000000DISICNT052xxxxxxxxxxxxxx00CRCDATH0BA000000000000000
WREG600C000000000000000TBLPAG054----00000000CRCWDATL0BC000000000000000
WREG700E000000000000000YPAG056----00000001CRCWDATH0BE000000000000000
WREG8010000000000000000MSTRPR058----00---0CLC
WREG9012000000000000000CTXTSTAT05A000000000000000CLC1CONL0C00-0-0C--000--000
WREG10014000000000000000DMTCON05C000000000000000CLC1CONH0C2----0000
WREG11016000000000000000DMTPRECLR060000000000000000CLC1SEL0C4-000-000-000-000
WREG12018000000000000000DMTCLR064000000000000000CLC1GLSL0C8000000000000000
WREG1301A000000000000000DMTSTAT068000000000000000CLC1GLSH0CA00000000000000
WREG1401C000000000000000DMTCNTL06C000000000000000CLC2CONL0CC0-0-00--000--000
WREG1501E000010000000000DMTCNTH06E000000000000000CLC2CONH0CE----0000
SPLIM020xxxxxxxxxxxxxxDMTHOLDREG07000000000000000CLC2SEL0D0-000-000-000-000
ACCAL022xxxxxxxxxxxxxxDMTPSCNTL07400000000000000CLC2GLSL0D400000000000000
ACCAH024xxxxxxxxxxxxxxDMTPSCNTH0760000000000000CLC2GLSH0D60000000000000
ACCAU026xxxxxxxxxxxxxxDMTPSINTVL0780000000000000CLC3CONL0D80-0-0C--00C--0C
ACCBL028xxxxxxxxxxxxxxDMTPSINTVH07A0000000000000CLC3CONH0DA----000
ACCBH02AxxxxxxxxxxxxxxSENTCLC3SEL0DC-000-000-000-00
ACCBU02CxxxxxxxxxxxxxxSENT1CON10800000000000000CLC3GLSL0E0000000000000
PCL02E0000000000000SENT1CON2084000000000000CLC3GLSH0E200000000000
PCH030----000000SENT1CON308800000000000CLC4CONL0E40-0-0C--0C
DSRPAG032----00CSENT1STAT08C0000000000CLC4CONH0E6----00C
DSWPAG034----00CSENT1SYNC090000000000CLC4SEL0E8-30C-30C-30C-30C
RCOUNT036xxxxxxxxxxSENT1DATL094000000000CLC4GLSL0EC000000000
DCOUNT038xxxxxxxxxxSENT1DATH09600CCLC4GLSHEE00C
DOSTART03A111111111111111SENT2CON109800CECCCONLOF----C
DOSTARTL03A111111111111111SENT2CON209CCECCCONHOF2C
DOSTARTH03CCSENT2CON3OACECCADDRLOF4C
DOENDL03ExxxxxxxxxxSENT2STATOA4CECCADDRHOF6C
DOENDH040----xxxxxSENT2SYNCOA8CECCSTATLOF8C
SR042CSENT2DATLOACCECCSTATHOFA----C
CORCON044x-xxCSENT2DATHOAECC

Legend: x = unknown or indeterminate value; “-” = unimplemented bits. Address and Reset values are in hexadecimal and binary, respectively. Note 1: SFR shown is for the superset 80-pin device.

TABLE 3-5: MAIN SFR BLOCK 100h

Register Address AllResets Register AddressAll ResetsRegister Address All Resets
TimersINT1TMRH15E0000000000000000MSI1MBX3D1E0
T1CON1000-0000000-00-00-INT1HLDL1600000000000000000MSI1MBX4D1E2
TMR11040000000000000000INT1HLDH1620000000000000000MSI1MBX5D1E4
PR11080000000000000000INDX1CNTL1640000000000000000MSI1MBX6D1E6
QEIINDX1CNTH1660000000000000000MSI1MBX7D1E8
QEI1CON1400000000000000000INDX1HLDL1680000000000000000MSI1MBX8D1EA
QEI1IOCL14400000000000xxxxINDX1HLDH16A0000000000000000MSI1MBX9D1EC
QEI1IOCH146----0QEI1GECL16C0000000000000000MSI1MBX10D1EE
QEI1STAT148--00000000000000QEI1GECH16E0000000000000000MSI1MBX11D1F0
POS1CNTL14C0000000000000000QEI1LECL1700000000000000000MSI1MBX12D1F2
POS1CNTH14E0000000000000000QEI1LECH1720000000000000000MSI1MBX13D1F4
POS1HLDL150000000000000000MSI1CON1D20----xx0000000000MSI1MBX14D1F6
POS1HLDH152000000000000000MSI1STAT1D4000000000000000MSI1MBX15D1F8
VEL1CNTL154000000000000000MSI1KEY1D6----0000000MSI1FIFOCS1FA
VEL1CNTH15600000000000000MSI1MBXS1D8----0000000MRSWFDATA1FC
VEL1HLDL158000000000000000MSI1MBX0D1DA000000000000000MWSRFDATA1FE
VEL1HLDH15A00000000000000MSI1MBX1D1DC000000000000000
INT1TMRL15C00000000000000MSI1MBX2D1DE00000000000000

Legend: x = unknown or indeterminate value; "-" = unimplemented bits. Address and Reset values are in hexadecimal and binary, respectively.

TABLE 3-6: MAIN SFR BLOCK 200h

Register Address AllResets Register AddressAll ResetsRegister Address All Resets
I2CU1P224E----00000000SPI1CON1H2AE000000000000000
I2C1CONL2000-0100000000000U1P3250000000000000000SPI1CON2L2B0----0000
I2C1CONH202----0000000U1P3H252----0000000SPI1CON2H2B2----
I2C1STAT204000--0000000000U1TXCHK254----0000000SPI1STATL2B4---00--0001-1-00
I2C1ADD208----000000000U1RXCHK256----0000000SPI1STATH2B6--00000--00000
I2C1MSK20C----000000000U1SCCON258----00000-SPI1BUFL2B8000000000000000
I2C1BRG21000000000000000U1SCINT25A--00-000--00-000SPI1BUFH2BA000000000000000
I2C1TRN214----1111111U1INT25C----00--0--SPI1BRGL2BC----xxxxxxxxxxxxx
I2C1RCV218----0000000U2MODE2600-000-000000000SPI1BRGH2BE----
I2C2CONL21C0-0100000000000U2MODEH26200---000000000SPI1IMSKL2C0---00--0000-0-00
I2C2CONH21E----000000U2STA26400000001000000SPI1IMSKH2C20-000000-00000
I2C2STAT220000--000000000U2STAH266-000-0000101110SPI1URDTL2C400000000000000
I2C2ADD224----00000000U2BRG26800000000000000SPI1URDTH2C60000000000000
I2C2MSK228----00000000U2BRGH26A----0000SPI2CON1L2C80-00000000000
I2C2BRG22C00000000000000U2RXREG26C----xxxxxxxxSPI2CON1H2CA0000000000000
I2C2TRN230----1111111U2TXREG270----xxxxxxxxSPI2CON2L2CC----0000
I2C2RCV234----0000000U2P1274----0000000SPI2CON2H2CE----
UARTU2P2276----0000000SPI2STATL2D0---00--0001-1-00
U1MODE2380-000-00000000U2P327800000000000000SPI2STATH2D2--00000--0000
U1MODEH23A00---00000000U2P3H27A----0000000SPI2BUFL2D4000000000000
U1STA23C0000000100000U2TXCHK27C----0000000SPI2BUFH2D600000000000
U1STAH23E-00C-0000101110U2RXCHK27E----0000000SPI2BRGL2D8----xxxxxxxxxxxxx
U1BRG2400000000000000U2SCCON280----0000-SPI2BRGH2DA----
U1BRGH242----000U2SCINT282--00-00--00-00SPI2IMSKL2DC---00--000-0-00
U1RXREG244----xxxxxxxxU2INT284----00--0--SPI2IMSKH2DE0-00000C-0000
U1TXREG248----xxxxxxxxSPISPI2URDTL2E0000000000000
U1P124C----0000000SPI1CON1L2AC0-00000000000SPI2URDTH2E200000000000

Legend: x = unknown or indeterminate value; “-” = unimplemented bits. Address and Reset values are in hexadecimal and binary, respectively.

TABLE 3-7: MAIN SFR BLOCK 300h-400h

Register Address AllResets Register Addressss All ResetsRegister Address All Resets
High-Speed PWMPG1TRIGB3560000000000000000PG3FFPCIH3AE0000-00000000000
PCLKCON30000----0--00--00PG1TRIGC3580000000000000000PG3SPCIL3B0000000000000000
FSCL3020000000000000000PG1DTL35A--00000000000000PG3SPCIH3B20000-00000000000
FSMINPER3040000000000000000PG1DTH35C--00000000000000PG3LEBL3B4000000000000000
MPHASE3060000000000000000PG1CAP35E000000000000000PG3LEBH3B6----000----0000
MDC3080000000000000000PG2CONL3600-0000000000000PG3PHASE3B8000000000000000
MPER30A0000000000000000PG2CONH362000-00000--0000PG3DC3BA00000000000000
LFSR30C0000000000000000PG2STAT364000000000000000PG3DCA3BC----0000000
CMBTRIGL30E----0000000PG2IOCONL366000000000000000PG3PER3BE00000000000000
CMBTRIGH310----0000000PG2IOCONH368-000---0---0000PG3TRIGA3C000000000000000
LOGCONA31200000000000-000PG2EVTL36A0000000---0000PG3TRIGB3C20000000000000
LOGCONB3140000000000-000PG2EVTH36C0000--00000000PG3TRIGC3C40000000000000
LOGCONC316000000000-000PG2FPCIL36E0000000000000PG3DTL3C6--00000000000
LOGCOND31800000000-000PG2FPCIH3700000-00000000PG3DTH3C8--00000000000
LOGCONE31A00000000-000PG2CLPCIL372000000000000PG3CAP3CA00000000000
LOGCONF31C00000000-000PG2CLPCIH3740000-00000000PG4CONL3CC0-0000000000
PWMEVTA31E0000----000-000PG2FFPCIL376000000000000PG4CONH3CE000-00000--000
PWMEVTB3200000----000-000PG2FFPCIH3780000-00000000PG4STAT3D000000000000
PWMEVTC3220000----000-000PG2SPCIL37A000000000000PG4IOCONL3D20000000000
PWMEVTD3240000----000-000PG2SPCIH37C000-00000000PG4IOCONH3D4-000---0---0
PWMEVTE3260000----000-000PG2LEBL37E00000000000PG4EVTL3D6000000---0
PWMEVTF3280000----000-000PG2LEBH380----00----00PG4EVTH3D80000--0000
PG1CONL32A0-0000000000PG2PHASE3820000000000PG4FPCIL3DA000000000
PG1CONH32C00-0000--00PG2DC384000000000PG4FPCIH3DC000-0000
PG1STAT32E000000000PG2DCA386----00PG4CLPCIL3DE00000000
PG1IOCONL33000000000PG2PER38800000000PG4CLPCIH3E0000-000
PG1IOCONH332-00---0---0PG2TRIGA38A00000000PG4FFPCIL3E20000000
PG1EVTL334000000--PG2TRIGB38C00000000PG4FFPCIH3E4000-000
PG1EVTH336000--000PG2TRIGC38E00000000PG4SPCIL3E6000000
PG1FPCIL3380000000PG2DTL390--00PG4SPCIH3E8000-000
PG1FPCIH33A000-000PG2DTH392--00PG4LEBL3EA00000
PG1CLPCIL33C0000000PG2CAP3940000000PG4LEBH3EC----0C---
PG1CLPCIH33E000-000PG3CONL3960-00PG4PHASE3EE00000
PG1FFPCIL3400000-000PG3CONH39800-00PG4DC3F00000
PG1FFPCIH34200C-0CPG3STAT39A0000000PG4DCA3F2----
PG1SPCIL3440000-0CPG3IOCONL39C0000000PG4PER3F40C
PG1SPCH34600C-0CPG3IOCONH39E-0C--C--CPG4TRIGA3F6C
PG1LEBL348CPG3EVTL3ACPG4TRIGB3F8C
PG1LEBH34A----CPG3EVTH3A2CPG4TRIGC3FAC
PG1PHASE34CCPG3FPCIL3A4CPG4DTL3FC--
PG1DC34ECPG3FPCIH3A6CPG4DTH3FE--
PG1DCA350----CPG3CLPCIL3A8CPG4CAP400C
PG1PER352CPG3CLPCIH3AACC
PG1TRIGA354CPG3FFPCIL3ACCC

Legend: x = unknown or indeterminate value; "-" = unimplemented bits. Address and Reset values are in hexadecimal and binary, respectively.

TABLE 3-8: MAIN SFR BLOCK 500h

Register Address AllResets Register AddressAss All ResetsRegister Address All Resets
CAN FDC1TSCONL5D4----000000000C1RXOVIFH5EA
C1CONL5C00-00011101100000C1TSCONH5D6----000C1TXATIFL5EC
C1CONH5C20000010010011000C1VECL5D8---00000-1000000C1TXATIFH5EE
C1NBTCFGL5C4-0001111-0001111C1VECH5DA-10000---1000000C1TXREQL5F0
C1NBTCFGH5C60000000000111110C1INTL5DC000000----00000C1TXREQH5F2
C1DBTCFGL5C8----0011----0011C1INTH5DE00000000---00000C1TRECL5F4
C1DBTCFGH5CA00000000----01110C1RXIFL5E000000000000000-C1TRECH5F6
C1TDCL5CC-0010000--000000C1RXIFH5E20000000000000000C1BDIAGOL5F8
C1TDCH5CE----00----10C1TXIFL5E40000000000000000C1BDIAGOH5FA
C1TBCL5D00000000000000000C1TXIFH5E60000000000000000C1BDIAG1L5FC
C1TBCH5D20000000000000000C1RXOVIFL5E800000000000000-C1BDIAG1H5FE

Legend: x = unknown or indeterminate value; "-" = unimplemented bits. Address and Reset values are in hexadecimal and binary, respectively.

TABLE 3-9: MAIN SFR BLOCK 600h

Register Address All Resets Register Address All Resets Register Address All Resets
CAN FD (Continued)C1FIFOCON6H65A00000000-1100000C1MASK5L6AC0000000000000000
C1TEFCONL600----100--0-0000C1FIFOSTA665C---0000000000000C1MASK5H6AE0000000000000000
C1TEFCONH602---00000----C1FIFOUA6L660xxxxxxxxxxxxxxxxxxC1FLTOBJ6L6B00000000000000000
C1TEFSTA604----0000C1FIFOUA6H662xxxxxxxxxxxxxxxxxxC1FLTOBJ6H6B20000000000000000
C1TEFUAL608xxxxxxxxxxxxxxxxxxC1FIFOCON7L664----1000000000C1MASK6L6B40000000000000000
C1TEFUAH60AxxxxxxxxxxxxxxxxxxC1FIFOCON7H6660000000-1100000C1MASK6H6B60000000000000000
C1FIFOBAL60C000000000000000C1FIFOSTA7668---0000000000000C1FLTOBJ7L7B80000000000000000
C1FIFOBAH60E000000000000000C1FIFOUA7L66CxxxxxxxxxxxxxxxxxxC1FLTOBJ7H6BA000000000000000
C1TXQCONL610----1001--0-0-0C1FIFOUA7H66ExxxxxxxxxxxxxxxxxxC1MASK7L6BC000000000000000
C1TXQCONH61200000000-1100000C1FLTCON0L6700--00000--00000C1MASK7H6BE000000000000000
C1TXQSTA614---00000000-0-0C1FLTCON0H6720--00000--00000C1FLTOBJ8L6C000000000000000
C1TXQUAL618xxxxxxxxxxxxxxxxxxC1FLTCON1L6740--00000--00000C1FLTOBJ8H6C200000000000000
C1TXQUAH61AxxxxxxxxxxxxxxxxxxC1FLTCON1H6760--00000--00000C1MASK8L6C400000000000000
C1FIFOCON1L61C----1000000000C1FLTCON2L6780--00000--00000C1MASK8H6C60000000000000
C1FIFOCON1H61E00000000-110000C1FLTCON2H67A0--00000--00000C1FLTOBJ9L6C80000000000000
C1FIFOSTA1620---00000000000C1FLTCON3L67C0--00000--0000C1FLTOBJ9H6CA0000000000000
C1FIFOUA1L624xxxxxxxxxxxxxxxxxxC1FLTCON3H67E0--00000--0000C1MASK9L6CC0000000000000
C1FIFOUA1H626xxxxxxxxxxxxxxxxxxC1FLTOBJOL6800000000000000C1MASK9H6CE000000000000
C1FIFOCON2L628----100000000C1FLTOBJOH682000000000000C1FLTOBJ10L6D0000000000000
C1FIFOCON2H62A00000000-110000C1MASKOL684000000000000C1FLTOBJ10H6D200000000000
C1FIFOSTA262C---00000000000C1MASKOH686000000000000C1MASK10L6D400000000000
C1FIFOUA2L630xxxxxxxxxxxxxxxxxxC1FLTOBJ1L688000000000000C1MASK10H6D600000000000
C1FIFOUA2H632xxxxxxxxxxxxxxxxxxC1FLTOBJ1H68A00000000000C1FLTOBJ11L6D800000000000
C1FIFOCON3L634----100000000C1MASK1L68C00000000000C1FLTOBJ11H6DA00000000000
C1FIFOCON3H63600000000-110000C1MASK1H68E00000000000C1MASK11L6DC0000000000
C1FIFOSTA3638---000000000C1FLTOBJ2L6900000000000C1MASK11H6DE0000000000
C1FIFOUA3L63CxxxxxxxxxxxxxxxxxxC1FLTOBJ2H6920000000000C1FLTOBJ12L6E0000000000
C1FIFOUA3H63ExxxxxxxxxxxxxxxxxxC1MASK2L694000000000C1FLTOBJ12H6E2000000000
C1FIFOCON4L640----100000000C1MASK2H696000000000C1MASK12L6E4000000000
C1FIFOCON4H6420000000-110000C1FLTOBJ3L698000000000C1MASK12H6E600000000
C1FIFOSTA4644---00000000C1FLTOBJ3H69A00000000C1FLTOBJ13L6E800000000
C1FIFOUA4L648xxxxxxxxxxxxxxxxxxC1MASK3L69C00000000C1FLTOBJ13H6EA00000000
C1FIFOUA4H64AxxxxxxxxxxxxxxxxxxC1MASK3H69C00000000C1MASK13L6EC0000000
C1FIFOCON5L64C----10000000C1FLTOBJ4L6A000000000C1MASK13H6EE000
C1FIFOCON5H64E0000000-11000C1FLTOBJ4H6A200000000C1FLTOBJ14L6F0000
C1FIFOSTA5650---00000000C1MASK4L6A400000000C1FLTOBJ14H6F2000
C1FIFOUA5L654xxxxxxxxxxxxxxxxxxC1MASK4H6A600000000
C1FIFOUA5H656xxxxxxxxxxxxxxxxxxC1FLTOBJ5L6A800000000
C1FIFOCON6L658----10000000C1FLTOBJ5H6AA00000000

Legend: x = unknown or indeterminate value; "-" = unimplemented bits. Address and Reset values are in hexadecimal and binary, respectively.

TABLE 3-10: MAIN SFR BLOCK 700h

Register Address AllResets Register AddressAss All ResetsRegister Address All Resets
CAN FD (Continued)C1FLTOBJ15L6F80000000000000000C1MASK15H6FE
C1MASK14L6F40000000000000000C1FLTOBJ15H6FA-0000000000000000
C1MASK14H6F6-000000000000000C1MASK15L6FC0000000000000000

Legend: x = unknown or indeterminate value; “-” = unimplemented bits. Address and Reset values are in hexadecimal and binary, respectively.

TABLE 3-11: MAIN SFR BLOCK 800h

RegisterAddressAll ResetsRegisterAddressAll ResetsRegisterAddressAll Resets
InterruptsIPC3846-100-100-100-100IPC33882-100-100-100-100
IFS08000000000000-00000IPC4848-100-100-100-100IPC34884-100-100-100-100
IFS1802000000000000000IPC584A-100-100-100-100IPC35886----100-100
IFS280400000-00-00000--IPC684C-100-100-100-100IPC35886----100-100
IFS3806000----00000IPC784E-100-100-100-100IPC36888----100----
IFS4808--000----0000-00IPC8850-100-100----IPC3788A----100-100----
IFS580A000000000000000-IPC9852----100-100-100IPC3888C----100-100
IFS680C000000000000000IPC10854-100----100-100IPC3988E----100----
IFS780E000000000000---IPC11856-100-100-100-100IPC42894-100-100-100-100
IFS8810--0000000000000-IPC12858-100-100-100-100IPC43896-100-100-100-100
IFS9812--0---00-00--0--IPC1385A----100IPC44898-100-100-100-100
IFS1081400000000----IPC1585E-100-100-100----IPC4589A----100
IFS11816-00----00000IPC16860-100----100-100IPC4789E----100-100----
IEC0820000000000-00000IPC17862----100-100-100INTCON18C000000000000000-
IEC1822000000000000000IPC18864-100----INTCON28C2000----0----0000
IEC282400000-00-0000--IPC19866----100-100INTCON38C4----0----0----0
IEC3826000----00000IPC20868-100-100-100----INTCON48C6----00
IEC4828--000----0000-00IPC2186A-100-100-100-100INTTREG8C8000-00000000000
IEC582A00000000000000-IPC2286C-100-100-100-100Flash
IEC682C00000000000000IPC2386E-100-100-100-100NVMCON8D00000--00----0000
IEC782E000000000000--IPC24870-100-100-100-100NVMADR8D200000000000000
IEC8830--000000000000-IPC25872-100-100-100-100NVMADRU8D4----0000000
IEC8830--000000000000-IPC26874-100-100-100-100NVMKEY8D6----0000000
IEC9832--0---00-00--0--IPC27876-100-100-100-100NVMSRCADRL8D800000000000000
IEC108340000000----00IPC28878-100----NVMSRCADRH8DA----0000000
IEC11836-00----00000IPC2987A-100-100-100-100CBG
IPC0840-100-100-100-100IPC3087C-100-100-100-100BIASCON8F0----0----0000
IPC1842-100-100----100IPC3187E-100-100-100-100IBIASCONL8F4--00000--00000
IPC2844-100-100-100-100IPC32880-100-100-100----IBIASCONH8F6--00000--00000

Legend: x = unknown or indeterminate value; “-” = unimplemented bits. Address and Reset values are in hexadecimal and binary, respectively.

TABLE 3-12: MAIN SFR BLOCK 900h

Register Address AllResets Register AddressAss All ResetsRegister Address All Resets
PTGCCP1CON2L9540C-0----00000000CCP3TMRH9AA
PTGCST9000-00-00000x---00CCP1CON2H9560----100-00000CCP3PRL9AC
PTGCON902----00000000000CCP1CON3H95A0000----0-00--CCP3PRH9AE
PTGBTE904xxxxxxxxxxxxxxxxCCP1STATL95C----0--00xx0000CCP3RAL9B0
PTGBTEH906----CCP1TMRL960000000000000000CCP3RBL9B4
PTGHOLD908000000000000000CCP1TMRH962000000000000000CCP3BUFL9B8
PTGTOLIM90C000000000000000CCP1PRL964111111111111111CCP3BUFH9BA
PTGT1LIM910000000000000000CCP1PRH966111111111111111CCP4CON1L9BC
PTGSDLIM914000000000000000CCP1RAL968000000000000000CCP4CON1H9BE
PTGCOLIM918000000000000000CCP1RBL96C000000000000000CCP4CON2L9C0
PTGC1LIM91C000000000000000CCP1BUFL970000000000000000CCP4CON2H9C2
PTGADJ920000000000000000CCP1BUFH972000000000000000CCP4CON3H9C6
PTGL0924000000000000000CCP2CON1L9740-0000000000000CCP4STATL9C8
PTGQPTR928----00000CCP2CON1H97600--00000000000CCP4TMRL9CC
PTGQUE0930xxxxxxxxxxxxxxxxCCP2CON2L97800-0----00000000CCP4TMRH9CE
PTGQUE1932xxxxxxxxxxxxxxxxCCP2CON2H97A0----100-00000CCP4PRL9D0
PTGQUE2934xxxxxxxxxxxxxxxxCCP2CON3H97E0000----0-00--CCP4PRH9D2
PTGQUE3936xxxxxxxxxxxxxxxxCCP2STATL980----0--00xx0000CCP4RAL9D4
PTGQUE4938xxxxxxxxxxxxxxxxCCP2TMRL984000000000000000CCP4RBL9D8
PTGQUE593AxxxxxxxxxxxxxxxxCCP2TMRH986000000000000000CCP4BUFL9DC
PTGQUE693CxxxxxxxxxxxxxxxxCCP2PRL988111111111111111CCP4BUFH9DE
PTGQUE793ExxxxxxxxxxxxxxxxCCP2PRH98A111111111111111CCP5CON1L9E0
PTGQUE8940xxxxxxxxxxxxxxxxCCP2RAL98C000000000000000CCP5CON1H9E2
PTGQUE9942xxxxxxxxxxxxxxxxCCP2RBL990000000000000000CCP5CON2L9E4
PTGQUE10944xxxxxxxxxxxxxxxxCCP2BUFL994000000000000000CCP5CON2H9E6
PTGQUE11946xxxxxxxxxxxxxxxxCCP2BUFH996000000000000000CCP5CON3H9EA
PTGQUE12948xxxxxxxxxxxxxxxxCCP3CON1L9980-0000000000000CCP5STATL9EC
PTGQUE1394AxxxxxxxxxxxxxxxxCCP3CON1H99A00--00000000000CCP5TMRL9F0
PTGQUE1494CxxxxxxxxxxxxxxxxCCP3CON2L99C00-0----0000000CCP5TMRH9F2
PTGQUE1594ExxxxxxxxxxxxxxxxCCP3CON2H99E0----100-0000CCP5PRL9F4
CCPCCP3CON3H9A20000----0-00--CCP5PRH9F6
CCP1CON1L9500-0000000000000CCP3STATL9A4----0--00xx0000CCP5RAL9F8
CCP1CON1H95200--00000000000CCP3TMRL9A800000000000000CCP5RBL9FC

Legend: x = unknown or indeterminate value; “-” = unimplemented bits. Address and Reset values are in hexadecimal and binary, respectively.

TABLE 3-13: MAIN SFR BLOCK A00h

Register Address AllResets Register AddressPress All ResetsRegister Address All Resets
CCP (Continued)CCP7RALA40000000000000000DMACNT0ACC000000000000001
CCP5BUFLA00000000000000000CCP7RBLA44000000000000000DMACH1ACE---0-0000000000
CCP5BUFHA02000000000000000CCP7BUFLA48000000000000000DMAINT1AD0000000000000--0
CCP6CON1LA040-00000000000000CCP7BUFHA4A000000000000000DMASRC1AD2000000000000000
CCP6CON1HA0600--000000000000CCP8CON1LA4C0-00000000000000DMADST1AD4000000000000000
CCP6CON2LA0800-0----0000000CCP8CON1HA4E00--000000000000DMACNT1AD6000000000000001
CCP6CON2HA0A0----100-00000CCP8CON2LA5000-0----0000000DMACH2AD8---0-0000000000
CCP6CON3HA0E0000----0-00--CCP8CON2HA520----100-0000DMAINT2ADA000000000000--0
CCP6STATLA10----0--00xx0000CCP8STATLA58----0--00xx000DMASRC2ADC00000000000000
CCP6TMRLA1400000000000000CCP8STATHA5A----0000DMADST2ADE00000000000000
CCP6TMRHA1600000000000000CCP8TMRLA5C00000000000000DMACNT2AE000000000000001
CCP6PRLA18111111111111111CCP8TMRHA5E00000000000000DMACH3AE2---0-000000000
CCP6PRHA1A111111111111111CCP8PRLA60111111111111111DMAINT3AE400000000000--0
CCP6RALA1C00000000000000CCP8PRHA62111111111111111DMASRC3AE60000000000000
CCP6RBLA2000000000000000CCP8RALA6400000000000000DMADST3AE80000000000000
CCP6BUFLA2400000000000000CCP8RBLA680000000000000DMACNT3AEA0000000000001
CCP6BUFHA2600000000000000CCP8BUFLA6C0000000000000DMACH4AEC---0-000000000
CCP7CON1LA280-000000000000CCP8BUFHA6E000000000000DMAINT4AEE00000000000--0
CCP7CON1HA2A0--0000000000DMADMASRC4AF0000000000000
CCP7CON2LA2C00-0----000000DMACONABC0----DMADST4AF2000000000000
CCP7CON2HA2E0----100-0000DMABUFABE000000000000DMACNT4AF40000000000001
CCP7CON3HA32C0C-----C-0C--DMALACO000000000000DMACH5AF6---0-00000000
CCP7STATLA34----0--0xx00DMAHAC200100C0CDMAINT5AF80000000000--0
CCP7TMRLA3800C0C0C0C0CDMACHOAC4---0-0CDMASRC5AFA00000000000
CCP7TMRHA3A00C0C0C0CDMAINTOAC600CDMADST5AFC00C
CCP7PRLA3C111111111111111DMASRCOAC80CDMACNT5AFE0C
CCP7PRHA3E111111111111111DMADSTOACACDDD

Legend: x = unknown or indeterminate value; "-" = unimplemented bits. Address and Reset values are in hexadecimal and binary, respectively.

TABLE 3-14: MAIN SFR BLOCK B00h

Register Address AllResets Register AddressRegister Address All Resets
ADCADCMP1ENHB42----00000ADTRIG0HB82
ADCON1LB00000-00000----000ADCMP1LOB44000000000000000ADTRIG1LB84
ADCON1HB02----01----ADCMP1HIB46000000000000000ADTRIG1HB86
ADCON2LB0400-0000000000000ADCMP2ENLB48000000000000000ADTRIG2LB88
ADCON2HB0600-0000000000000ADCMP2ENHB4A----00000ADTRIG2HB8A
ADCON3LB0800000x000000000ADCMP2LOB4C000000000000000ADTRIG3LB8C
ADCON3HB0A00000000----ADCMP2HIB4E000000000000000ADTRIG3HB8E
ADMOD0LB10-0-0-0-0-0-0-0ADCMP3ENLB50000000000000000ADTRIG4LB90
ADMOD0HB12-0-0-0-0-0-0-0ADCMP3ENHB52----00000ADTRIG4HB92
ADMOD1LB14----0-0-0-0ADCMP3LOB54000000000000000ADTRIG5LB94
ADIELB20xxxxxxxxxxxxxxADCMP3HIB56000000000000000ADCMP0CONBA0
ADIEHB22----xxxxxADFL0DATB68000000000000000ADCMP1CONBA4
ADCSS1LB2800000000000000ADFL0CONB6A0xx000000000000ADCMP2CONBA8
ADSTATLB3000000000000000ADFL1DATB6C00000000000000ADCMP3CONBAC
ADSTATHB32----0000ADFL1CONB6E0xx000000000000ADLVLTRGLBD0
ADCMP0ENLB3800000000000000ADFL2DATB7000000000000000ADLVLTRGHBD2
ADCMP0ENHB3A----0000ADFL2CONB720xx000000000000ADEIELBF0
ADCMP0LOB3C00000000000000ADFL3DATB7400000000000000ADEIEHBF2
ADCMP0HIB3E0000000000000ADFL3CONB760xx000000000000ADEISTATLBF8
ADCMP1ENLB400000000000000ADTRIGOLB8000000000000000ADEISTATHBFA

Legend: x = unknown or indeterminate value; “-” = unimplemented bits. Address and Reset values are in hexadecimal and binary, respectively.

TABLE 3-15: MAIN SFR BLOCK C00h

Register Address AllResets Register AddressAddress All ResetsRegister Address All Resets
ADC (Continued)ADCBUF9C1E0000000000000000DAC
ADCON5LC000----0----ADCBUF10C200000000000000000DACCTRL1LC80
ADCON5HC020----xxxx0----ADCBUF11C220000000000000000DACCTRL2LC84
ADCAL1HC0A00000-00-000----ADCBUF12C240000000000000000DACCTRL2HC86
ADCBUF0C0C0000000000000000ADCBUF13C260000000000000000DAC1CONLC88
ADCBUF1C0E0000000000000000ADCBUF14C280000000000000000DAC1CONHC8A
ADCBUF2C100000000000000000ADCBUF15C2A0000000000000000DAC1DATLC8C
ADCBUF3C120000000000000000ADCBUF16C2C0000000000000000DAC1DATHC8E
ADCBUF4C140000000000000000ADCBUF17C2E0000000000000000SLP1CONLC90
ADCBUF5C160000000000000000ADCBUF18C300000000000000000SLP1CONHC92
ADCBUF6C180000000000000000ADCBUF19C320000000000000000SLP1DATC94
ADCBUF7C1A0000000000000000ADCBUF20C340000000000000000VREGCONCFC
ADCBUF8C1C0000000000000000

Legend: x = unknown or indeterminate value; “-” = unimplemented bits. Address and Reset values are in hexadecimal and binary, respectively.

TABLE 3-16: MAIN SFR BLOCK D00h

Register Address AllResets Register Address All ResetsRegister Address All Resets
I/O PortsRPINR19D2A1111111111111111RPOR4D88--000000--000000
RPCOND00----0----RPINR20D2C1111111111111111RPOR5D8A--000000--000000
RPINR0D0411111111----RPINR21D2E1111111111111111RPOR6D8C--000000--000000
RPINR1D061111111111111111RPINR22D301111111111111111RPOR7D8E--000000--000000
RPINR2D0811111111----RPINR23D32111111111111111RPOR8D90--000000--000000
RPINR3D0A1111111111111111RPINR26D38----1111111RPOR9D92--000000--000000
RPINR4D0C1111111111111111RPINR30D4011111111----RPOR10D94--000000--000000
RPINR5D0E1111111111111111RPINR37D4E11111111----RPOR11D96--000000--000000
RPINR6D101111111111111111RPINR38D50----1111111RPOR12D98--000000--000000
RPINR7D121111111111111111RPINR42D581111111111111111RPOR13D9A--000000--000000
RPINR8D141111111111111111RPINR43D5A1111111111111111RPOR14D9C--000000--000000
RPINR9D161111111111111111RPINR44D5C1111111111111111RPOR15D9E--000000--000000
RPINR10D181111111111111111RPINR45D5E1111111111111111RPOR16DA0--000000--000000
RPINR11D1A1111111111111111RPINR46D601111111111111111RPOR17DA2--000000--000000
RPINR12D1C1111111111111111RPINR47D621111111111111111RPOR18DA4--000000--000000
RPINR13D1E1111111111111111RPOR0D80--000000--000000RPOR19DA6--000000--000000
RPINR14D201111111111111111RPOR1D82--000000--000000RPOR20DA8--000000--000000
RPINR15D221111111111111111RPOR2D84--000000--000000RPOR21DAA--000000--000000
RPINR18D281111111111111111RPOR3D86--000000--000000RPOR22DAC--000000--000000

Legend: x = unknown or indeterminate value; "-" = unimplemented bits. Address and Reset values are in hexadecimal and binary, respectively.

TABLE 3-17: MAIN SFR BLOCK E00h

Register Address AllResets Register Addressless All ResetsRegister Address All Resets
I/O Ports (Continued)CNCONBE2A0----0----LATDE5A
ANSELAE00----11111CNEN0BE2C0000000000000000ODCDE5C
TRISAE02----11111CNSTATBE2E0000000000000000CNPUDE5E
PORTAE04----xxxxxCNEN1BE300000000000000000CNPDDE60
LATAE06----xxxxxCNFBE320000000000000000CNCONDE62
ODCAE08----00000ANSELCE38----1----1111CNEN0DE64
CNPUAE0A----00000TRISCE3A1111111111111111CNSTATDE66
CNPDAE0C----00000PORTCE3CxxxxxxxxxxxxxxxxxxCNEN1DE68
CNCONAE0E0----0----LATCE3ExxxxxxxxxxxxxxxxxxCNFDE6A
CNEN0AE10----00000ODCCE400000000000000000TRISEE72
CNSTATAE12----00000CNPUCE420000000000000000PORTEE74
CNEN1AE14----00000CNPDCE440000000000000000LATEE76
CNFAE16----00000CNCONCE460----0----ODCEE78
ANSELBE1C----111---1111CNEN0CE480000000000000000CNPUEE7A
TRISBE1E1111111111111111CNSTATCE4A0000000000000000CNPDEE7C
PORTBE20xxxxxxxxxxxxxxxxxCNEN1CE4C0000000000000000CNCONEE7E
LATBE22xxxxxxxxxxxxxxxxxCNFCE4E0000000000000000CNEN0EE80
ODCBE240000000000000000ANSELDE54----1----CNSTATEE82
CNPUBE260000000000000000TRISDE561111111111111111CNEN1EE84
CNPDBE280000000000000000PORTDE58xxxxxxxxxxxxxxxxxCNFEE86

Legend: x = unknown or indeterminate value; "-" = unimplemented bits. Address and Reset values are in hexadecimal and binary, respectively.

TABLE 3-18: MAIN SFR BLOCK F00h

Register Address AllResets Register Address All ResetsRegister Address All Resets
ResetPMD2FA6----00000000PCTRAPHFC2----00000000
RCONF8000--x-0000000011PMD3FA8----0----0-FEXLFC4xxxxxxxxxxxxxx
OscillatorPMD4FAA----0---FEXHFC6----xxxxxxxxxx
OSCCONF84-000-yyy0-0-0--0PMD6FAE--000000----DPCLFCExxxxxxxxxxxxxxxxxx
CLKDIVF8600110000--000001PMD7FB0----x----0---DPCHFD0----xxxxxxxxxx
PLLFBDF88----000010010110PMD8FB2----00--0--xx000-APPOFD2xxxxxxxxxxxxxxxxxx
PLLDIVF8A----00-011-001WDTAPPIFD4xxxxxxxxxxxxxxxxxx
OSCTUNF8C----000000WDTCONLFB40--0000000000000APPSFD6----xxxxxx
ACLKCON1F8E00----0--000001WDTCONHFB6000000000000000STROUTLFD8xxxxxxxxxxxxxxxxxx
APLLFBD1F90----000010010110REFOCONLFB80-000-00----0000STROUTHFDAxxxxxxxxxxxxxxxxxx
APLLDIV1F92----00-011-001REFOCONHFBA-000000000000000STROVCNTFDCxxxxxxxxxxxxxxxxxx
CANCLKCONF9A----xxxx-xxxxxxxxREFOTRIMHFBE000000000----JDATAHFFAxxxxxxxxxxxxxxxxxx
PMDPCTRAPLFC0000000000000000JDATALFFCxxxxxxxxxxxxxxxxxx
PMD1FA4----000-00000-00

Legend: x = unknown or indeterminate value; "-" = unimplemented bits; y = value set by Configuration bits. Address and Reset values are in hexadecimal and binary, respectively.

3.2.5.1 Paged Memory Scheme

The dsPIC33CH128MP508 architecture extends the available Data Space through a paging scheme, which allows the available Data Space to be accessed using MOV instructions in a linear fashion for pre- and post-modified Effective Addresses (EAs). The upper half of the base Data Space address is used in conjunction with the Data Space Read Page (DSRPAG) register to form the Program Space Visibility (PSV) address.

The Data Space Read Page (DSRPAG) register is located in the SFR space. Construction of the PSV address is shown in Figure 3-7. When DSRPAG[9] = 1 and the base address bit, EA[15] = 1, the DSRPAG[8:0] bits are concatenated onto EA[14:0] to form the 24-bit PSV read address.

The paged memory scheme provides access to multiple 32-Kbyte windows in the PSV memory. The Data Space Read Page (DSRPAG) register, in combination with the upper half of the Data Space address, can provide up to 8 Mbytes of PSV address space. The paged data memory space is shown in Figure 3-8.

The Program Space (PS) can be accessed with a DSRPAG of 0x200 or greater. Only reads from PS are supported using the DSRPAG.

FIGURE 3-7: PROGRAM SPACE VISIBILITY (PSV) READ ADDRESS GENERATION
Microchip dsPIC33CH64MP208 - Paged Memory Scheme - 1

flowchart
graph TD
    A["Select DSRPAG"] --> B{DSRPAG["9"] = 1}
    B -->|No EDS Access| C["0"]
    B -->|Select DSRPAG| D["1"]
    C --> E["EA"]
    D --> F["EA"]
    G["Generate PSV Address"] --> H["1"]
    I["Byte Select16-Bit DS EA"] --> J["0"]
    K["Byte24-Bit PSV EA Select"] --> L["15 Bits"]
    M["DAIR Data"] --> N["0 (DSRPAG = don't care)"]
    O["Data"] --> P["0 (DSRPAG = don't care)"]
    Q["Data"] --> R["0 (DSRPAG = don't care)"]
    S["Data"] --> T["0 (DSRPAG = don't care)"]
    U["Data"] --> V["0 (DSRPAG = don't care)"]
    W["Data"] --> X["0 (DSRPAG = don't care)"]
    Y["Data"] --> Z["0 (DSRPAG = don't care)"]

Note: DS read access when DSRPAG = 0x000 will force an address error trap.

FIGURE 3-8: PAGED DATA MEMORY SPACE
Microchip dsPIC33CH64MP208 - Paged Memory Scheme - 2

flowchart
graph TD
    A["Local Data Space"] --> B["DS_Addr[14:0"]]
    B --> C["(DSRPAG = 0x200) No Writes Allowed"]
    C --> D["(DSRPAG = 0x2FF) No Writes Allowed"]
    D --> E["(DSRPAG = 0x300) No Writes Allowed"]
    E --> F["(DSRPAG = 0x3FF) No Writes Allowed"]
    F --> G["(DSRPAG = 0x3FF) No Writes Allowed"]
    G --> H["(DSRPAG = 0x300) No Writes Allowed"]
    H --> I["(DSRPAG = 0x3FF) No Writes Allowed"]
    I --> J["(DSRPAG = 0x300) No Writes Allowed"]
    J --> K["(DSRPAG = 0x300) No Writes Allowed"]
    K --> L["(DSRPAG = 0x300) No Writes Allowed"]
    L --> M["(DSRPAG = 0x300) No Writes Allowed"]
    M --> N["(DSRPAG = 0x300) No Writes Allowed"]
    N --> O["(DSRPAG = 0x300) No Writes Allowed"]
    O --> P["(DSRPAG = 0x300) No Writes Allowed"]
    P --> Q["(DSRPAG = 0x300) No Writes Allowed"]
    Q --> R["(DSRPAG = 0x300) No Writes Allowed"]
    R --> S["(DSRPAG = 0x300) No Writes Allowed"]
    S --> T["(DSRPAG = 0x300) No Writes Allowed"]
    T --> U["(DSRPAG = 0x300) No Writes Allowed"]
    U --> V["(DSRPAG = 0x300) No Writes Allowed"]
    V --> W["(DSRPAG = 0x300) No Writes Allowed"]
    W --> X["(DSRPAG = 0x300) No Writes Allowed"]
    X --> Y["(DSRPAG = 0x300) No Writes Allowed"]
    Y --> Z["(DSRPAG = 0x300) No Writes Allowed"]
    Z --> AA["(DSRPAG = 0x300) No Writes Allowed"]
    AA --> AB["(DSRPAG = 0x300) No Writes Allowed"]
    AB --> AC["(DSRPAG = 0x300) No Writes Allowed"]
    AC --> AD["(DSRPAG = 0x300) No Writes Allowed"]
    AD --> AE["(DSRPAG = 0x300) No Writes Allowed"]
    AE --> AF["(DSRPAG = 0x300) No Writes Allowed"]
    AF --> AG["(DSRPAG = 0x300) No Writes Allowed"]
    AG --> AH["(DSRPAG = 0x300) No Writes Allowed"]
    AH --> AI["(DSRPAG = 0x300) No Writes Allowed"]
    AI --> AJ["(DSRPAG = 0x300) No Writes Allowed"]
    AJ --> AK["(DSRPAG = 0x300) No Writes Allowed"]
    AK --> AL["(DSRPAG = 0x300) No Writes Allowed"]
    AL --> AM["(DSRPAG = 0x300) No Writes Allowed"]
    AM --> AN["(DSRPAG = 0x300) No Writes Allowed"]
    AN --> AO["(DSRPAG = 0x300) No Writes Allowed"]
    AO --> AP["(DSRPAG = 0x300) No Writes Allowed"]
    AP --> AQ["(DSRPAG = 0x300) No Writes Allowed"]
    AQ --> AR["(DSRPAG = 0x300) No Writes Allowed"]
    AR --> AS["(DSRPAG = 0x300) No Writes Allowed"]
    AS --> AT["(DSRPAG = 0x3FF) No Writes Allowed"]
    AT --> AU["(DSRPAG = 0x3FF) No Writes Allowed"]
    AU --> AV["(DSRPAG = 0x3FF) No Writes Allowed"]
    AV --> AW["(DSRPAG = 0x3FF) No Writes Allowed"]
    AW --> AX["(DSRPAG = 0x3FF) No Writes Allowed"]
    AX --> AY["(DSRPAG = 0x3FF) No Writes Allowed"]
    AY --> AZ["(DSRPAG = 0x3FF) No Writes Allowed"]
    AZ --> BA["(DSRPAG = 0x3FF) No Writes Allowed"]
    BA --> BB["(DSRPAG = 0x3FF) No Writes Allowed"]
    BB --> BC["(DSRPAG = 0x3FF) No Writes Allowed"]
    BC --> BD["(DSRPAG = 0x3FF) No Writes Allowed"]
    BD --> BE["(DSRPAG = 0x3FF) No Writes Allowed"]
    BE --> BF["(DSRPAG = 0x3FF) No Writes Allowed"]
    BF --> BG["(DSRPAG = 0x3FF) No Writes Allowed"]
    BG --> BH["(DSRPAG = 0x3FF) No Writes Allowed"]
    BH --> BI["(DSRPAG = 0x3FF) No Writes Allowed"]
    AE --> BJ["(DSRPAG = 15:1.1)"]
    BJ --> BK["(TBLPAG = 15:1.1)"]
    BK --> BL["TBLPAG = 15:1.1)"]
    BL --> BM["TBLPAG = 15:1.1)"]
    BM --> BN["TBLPAG = 15:1.1)"]
    BN --> BO["TBLPAG = 15:1.1)"]
    BO --> BP["TBLPAG = 15:1.1)"]
    AP --> BQ["TBLPAG = 15:1.1)"]
    AP --> BR["TBLPAG = 15:1.1"]
    BR --> BS["TBLPAG = 15:1.1"]
    CA["Table Address Space (TBLPAG[7:1.1"])] --> CB["DS_Addr[15:1.1"]]
    CB --> CC["TSW - [15:1.1"]]
    CC --> DD["TSW - [15:1.1"]]
    DD --> DE["TSW - [15:1.1"]]
    DE --> DF["TSW - [15:1.1"]]
    DF --> DG["TSW - [15:1.1"]]
    DG --> DH["TSW - [15:1.1"]]

When a PSV page overflow or underflow occurs, EA[15] is cleared as a result of the register indirect EA calculation. An overflow or underflow of the EA in the PSV pages can occur at the page boundaries when:

  • The initial address, prior to modification, addresses the PSV page
  • The EA calculation uses Pre- or Post-Modified Register Indirect Addressing; however, this does not include Register Offset Addressing

In general, when an overflow is detected, the DSRPAG register is incremented and the EA[15] bit is set to keep the base address within the PSV window. When an underflow is detected, the DSRPAG register is decremented and the EA[15] bit is set to keep the base address within the PSV window. This creates a linear PSV address space, but only when using Register Indirect Addressing modes.

Exceptions to the operation described above arise when entering and exiting the boundaries of Page 0 and PSV spaces. Table 3-19 lists the effects of overflow and underflow scenarios at different boundaries.

In the following cases, when overflow or underflow occurs, the EA[15] bit is set and the DSRPAG is not modified; therefore, the EA will wrap to the beginning of the current page:

  • Register Indirect with Register Offset Addressing
  • Modulo Addressing
  • Bit-Reversed Addressing

TABLE 3-19: OVERFLOW AND UNDERFLOW SCENARIOS AT PAGE 0 AND PSV SPACE BOUNDARIES ^(2,3,4)

O/U,R/WOperationBefore After
DSRPAGDSEA[15]PageDescriptionDSRPAGDSEA[15]PageDescription
O,Read[++Wn]or[Wn++]DSRPAG = 0x2FF 1PSV: Last lswpageDSRPAG = 0x300 1PSV: First MSBpage
O,ReadDSRPAG = 0x3FF 1PSV: Last MSBpageDSRPAG = 0x3FF0See Note 1
U,Read[--Wn]or[Wn--]DSRPAG = 0x0011PSV pageDSRPAG = 0x0010See Note 1
U,ReadDSRPAG = 0x200 1PSV: First lswpageDSRPAG = 0x2000See Note 1
U,ReadDSRPAG = 0x300 1PSV: First MSBpageDSRPAG = 0x2FF 1PSV: Last lswpage

Legend: O = Overflow, U = Underflow, R = Read, W = Write
Note 1: The Register Indirect Addressing now addresses a location in the base Data Space (0x0000-0x8000).
2: An EDS access, with DSRPAG = 0x000, will generate an address error trap.
3: Only reads from PS are supported using DSRPAG.
4: Pseudolinear Addressing is not supported for large offsets.

3.2.5.2 Extended X Data Space

The lower portion of the base address space range, between 0x0000 and 0x7FFF, is always accessible, regardless of the contents of the Data Space Read Page register. It is indirectly addressable through the register indirect instructions. It can be regarded as being located in the default EDS Page 0 (i.e., EDS address range of 0x000000 to 0x007FFF with the base address bit, EA[15] = 0, for this address range). However, Page 0 cannot be accessed through the upper 32 Kbytes, 0x8000 to 0xFFFF, of base Data Space in combination with DSRPAG = 0x00. Consequently, DSRPAG is initialized to 0x001 at Reset.

Note 1: DSRPAG should not be used to access Page 0. An EDS access with DSRPAG set to 0x000 will generate an address error trap.

2: Clearing the DSRPAG in software has no effect.

The remaining PSV pages are only accessible using the DSRPAG register in combination with the upper 32 Kbytes, 0x8000 to 0xFFFF, of the base address, where the base address bit, EA[15] = 1.

3.2.5.3 Software Stack

The W15 register serves as a dedicated Software Stack Pointer (SSP), and is automatically modified by exception processing, subroutine calls and returns; however, W15 can be referenced by any instruction in the same manner as all other W registers. This simplifies reading, writing and manipulating the Stack Pointer (for example, creating stack frames).

Note: To protect against misaligned stack accesses, W15[0] is fixed to '0' by the hardware.

W15 is initialized to 0x1000 during all Resets. This address ensures that the SSP points to valid RAM in all dsPIC33CH128MP508 devices and permits stack availability for non-maskable trap exceptions. These can occur before the SSP is initialized by the user software. You can reprogram the SSP during initialization to any location within Data Space.

The Software Stack Pointer always points to the first available free word and fills the software stack, working from lower toward higher addresses. Figure 3-9 illustrates how it pre-decrements for a stack pop (read) and post-increments for a stack push (writes).

When the PC is pushed onto the stack, PC[15:0] are pushed onto the first available stack word, then PC[22:16] are pushed into the second available stack location. For a PC push during any CALL instruction, the MSB of the PC is zero-extended before the push, as shown in Figure 3-9. During exception processing, the MSB of the PC is concatenated with the lower eight bits of the CPU STATUS Register, SR. This allows the contents of SRL to be preserved automatically during interrupt processing.

Note 1: To maintain system Stack Pointer (W15) coherency, W15 is never subject to (EDS) paging, and is therefore, restricted to an address range of 0x0000 to 0xFFFF. The same applies to the W14 when used as a Stack Frame Pointer (SFA = 1).

2: As the stack can be placed in, and can access X and Y spaces, care must be taken regarding its use, particularly with regard to local automatic variables in a C development environment

FIGURE 3-9: CALL STACK FRAME
Microchip dsPIC33CH64MP208 - Software Stack - 1

text_image 0x0000 Stack Grows Toward Higher Address 015 CALL SUBR PC[15:1] b'000000003' PC[22:16] [Free Word] W15 (before CALL) W15 (after CALL)

3.2.6 INSTRUCTION ADDRESSING MODES

The addressing modes shown in Table 3-20 form the basis of the addressing modes optimized to support the specific features of individual instructions. The addressing modes provided in the MAC class of instructions differ from those in the other instruction types.

3.2.6.1 File Register Instructions

Most file register instructions use a 13-bit address field (f) to directly address data present in the first 8192 bytes of data memory (Near Data Space). Most file register instructions employ a Working register, W0, which is denoted as WREG in these instructions. The destination is typically either the same file register or WREG (with the exception of the MUL instruction), which writes the result to a register or register pair. The MOV instruction allows additional flexibility and can access the entire Data Space.

3.2.6.2 MCU Instructions

The three-operand MCU instructions are of the form:

Operand 3 = Operand 1 Operand 2

where Operand 1 is always a Working register (that is, the addressing mode can only be Register Direct), which is referred to as Wb. Operand 2 can be a W register fetched from data memory or a 5-bit literal. The result location can either be a W register or a data memory location. The following addressing modes are supported by MCU instructions:

  • Register Direct
  • Register Indirect
  • Register Indirect Post-Modified
  • Register Indirect Pre-Modified
  • 5-Bit or 10-Bit Literal

Note: Not all instructions support all the addressing modes given above. Individual instructions can support different subsets of these addressing modes.

TABLE 3-20: FUNDAMENTAL ADDRESSING MODES SUPPORTED

Addressing Mode Description
File Register DirectThe address of the file register is specified explicitly.
Register DirectThe contents of a register are accessed directly.
Register IndirectThe contents of Wn form the Effective Address (EA).
Register Indirect Post-ModifiedThe contents of Wn form the EA. Wn is post-modified (incremented or decremented) by a constant value.
Register Indirect Pre-ModifiedWn is pre-modified (incremented or decremented) by a signed constant value to form the EA.
Register Indirect with Register Offset (Register Indexed)The sum of Wn and Wb forms the EA.
Register Indirect with Literal OffsetThe sum of Wn and a literal forms the EA.

3.2.6.3 Move and Accumulator Instructions

Move instructions, and the DSP accumulator class of instructions, provide a greater degree of addressing flexibility than other instructions. In addition to the addressing modes supported by most MCU instructions, move and accumulator instructions also support Register Indirect with Register Offset Addressing mode, also referred to as Register Indexed mode.

Note: For the MOV instructions, the addressing mode specified in the instruction can differ for the source and destination EA. However, the 4-bit Wb (Register Offset) field is shared by both source and destination (but typically only used by one).

In summary, the following addressing modes are supported by move and accumulator instructions:

  • 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: Not all instructions support all the addressing modes given above. Individual instructions may support different subsets of these addressing modes.

3.2.6.4 MAC Instructions

The dual source operand DSP instructions (CLR, ED, EDAC, MAC, MPY, MPY.N, MOVSAC and MSC), also referred to as MAC instructions, use a simplified set of addressing modes to allow the user application to effectively manipulate the Data Pointers through register indirect tables.

The two-source operand prefetch registers must be members of the set {W8, W9, W10, W11}. For data reads, W8 and W9 are always directed to the X RAGU, and W10 and W11 are always directed to the Y AGU. The Effective Addresses generated (before and after modification) must therefore, be valid addresses within X Data Space for W8 and W9, and Y Data Space for W10 and W11.

Note: Register Indirect with Register Offset Addressing mode is available only for W9 (in X space) and W11 (in Y space).

In summary, the following addressing modes are supported by the MAC class of instructions:

  • 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)

3.2.6.5 Other Instructions

Besides the addressing modes outlined previously, some instructions use literal constants of various sizes. For example, BRA (branch) instructions use 16-bit signed literals to specify the branch destination directly, whereas the DISI instruction uses a 14-bit unsigned literal field. In some instructions, such as ULNK, the source of an operand or result is implied by the opcode itself. Certain operations, such as a NOP, do not have any operands.

3.2.7 MODULO ADDRESSING

Modulo Addressing mode 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.

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 be configured to operate in only 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 that have a power-of-two length. As these buffers satisfy the start and end address criteria, they can operate in a Bidirectional mode (that is, address boundary checks are performed on both the lower and upper address boundaries).

3.2.7.1 Start and End Address

The Modulo Addressing scheme requires that a starting and ending address be specified and loaded into the 16-bit Modulo Buffer Address registers: XMODSRT, XMODEND, YMODSRT and YMODEND (see Table 3-4).

Note: Y space Modulo Addressing EA calculations assume word-sized data (LSb of every EA is always clear).

The length of a circular buffer is not directly specified. It is determined by the difference between the corresponding start and end addresses. The maximum possible length of the circular buffer is 32K words (64 Kbytes).

3.2.7.2 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 the registers that operate with Modulo Addressing:

  • If XWM = 1111, X RAGU and X WAGU Modulo Addressing is disabled
  • I f Y W M = 1111, Y AGU Modulo Addressing is disabled

The X Address Space Pointer W (XWM) register, to which Modulo Addressing is to be applied, is stored in MODCON[3:0] (see Table 3.2.1). Modulo Addressing is enabled for X Data Space when XWM is set to any value other than '1111' and the XMODEN bit is set (MODCON[15]).

The Y Address Space Pointer W (YWM) register, 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 '1111' and the YMODEN bit (MODCON[14]) is set.

FIGURE 3-10: MODULO ADDRESSING OPERATION EXAMPLE
Microchip dsPIC33CH64MP208 - W Address Register Selection - 1

text_image Byte Address 0x1100 0x1163 Start Addr = 0x1100 End Addr = 0x1163 Length = 0x0032 words MOV #0x1100, W0 MOV W0, XMODSRT ;set modulo start address MOV #0x1163, W0 MOV W0, MODEND ;set modulo end address 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

3.2.7.3 Modulo Addressing Applicability

Modulo Addressing can be applied to the Effective Address (EA) calculation associated with any W register. Address boundaries check for addresses equal to:

  • The upper boundary addresses for incrementing buffers
  • The lower boundary addresses for decrementing buffers

It is important to realize that the address boundaries check for addresses less than, or greater than, the upper (for incrementing buffers) and lower (for decrementing buffers) boundary addresses (not just equal to). Address changes can, therefore, jump beyond boundaries and still be adjusted correctly.

Note: The modulo corrected Effective Address is written back to the register only when Pre-Modify or Post-Modify Addressing mode is used to compute the Effective Address. When an address offset (such as [W7 + W2] ) is used, Modulo Addressing correction is performed, but the contents of the register remain unchanged.

3.2.8 BIT-REVERSED ADDRESSING

Bit-Reversed Addressing mode is intended to simplify data reordering for radix-2 FFT algorithms. It is supported by the X AGU for data writes only.

The modifier, which can be a constant value or register contents, is regarded as having its bit order reversed. The address source and destination are kept in normal order. Thus, the only operand requiring reversal is the modifier.

3.2.8.1 Bit-Reversed Addressing Implementation

Bit-Reversed Addressing mode is enabled in any of these situations:

  • BWMx bits (W register selection) in the MODCON register are any value other than '1111' (the stack cannot be accessed using Bit-Reversed Addressing)
    • The BREN bit is set in the XBREV register
  • The addressing mode used is Register Indirect with Pre-Increment or Post-Increment

If the length of a bit-reversed buffer is M = 2^N bytes, the last 'N' bits of the data buffer start address must be zeros.

XB[14:0] is the Bit-Reversed Addressing modifier, or 'pivot point', which is typically a constant. In the case of an FFT computation, its value is equal to half of the FFT data buffer size.

Note: All bit-reversed EA calculations assume word-sized data (LSb of every EA is always clear). The XB value is scaled accordingly to generate compatible (byte) addresses.

When enabled, Bit-Reversed Addressing is executed only for Register Indirect with Pre-Increment or Post-Increment Addressing and word-sized data writes. It does not function for any other addressing mode or for byte-sized data and normal addresses are generated instead. When Bit-Reversed Addressing is active, the W Address Pointer is always added to the address modifier (XB) and the offset associated with the Register Indirect Addressing mode is ignored. In addition, as word-sized data are a requirement, the LSb of the EA is ignored (and always clear).

Note: Modulo Addressing and Bit-Reversed Addressing can be enabled simultaneously using the same W register, but Bit-Reversed Addressing operation will always take precedence for data writes when enabled.

If Bit-Reversed Addressing has already been enabled by setting the BREN (XBREV[15]) bit, a write to the XBREV register should not be immediately followed by an indirect read operation using the W register that has been designated as the Bit-Reversed Pointer.

FIGURE 3-11: BIT-REVERSED ADDRESSING EXAMPLE
Microchip dsPIC33CH64MP208 - Bit-Reversed Addressing Implementation - 1

flowchart
graph TD
    A["Sequential Address"] --> B["b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 0"]
    B --> C["b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b1 b2 b3 b4 0"]
    C --> D["Pivot Point"]
    E["Bit Locations Swapped Left-to-Right Around Center of Binary Value"] --> F["Bit-Reversed Address"]
    F --> G["XB = 0x0008 for a 16-Word Bit-Reversed Buffer"]
    style A fill:#f9f,stroke:#333
    style E fill:#f9f,stroke:#333
    style F fill:#ccf,stroke:#333
    style G fill:#cfc,stroke:#333

TABLE 3-21: BIT-REVERSED ADDRESSING SEQUENCE (16-ENTRY)

Normal Address Bit-Reversed Address
A3 A2A1 A0DecimalA3 A2 A1A0 Decimal
00000 00000
00011 10008
00102 01004
00113 110012
01004 00102
01015 101010
01106 01106
01117 111014
10008 00011
10019 10019
10101001015
101111110113
11001200113
110113101111
11101401117
111115111115

3.2.9 INTERFACING PROGRAM AND DATA MEMORY SPACES

The dsPIC33CH128MP508 family architecture uses a 24-bit wide Program Space (PS) and a 16-bit wide Data Space (DS). The architecture is also a modified Harvard scheme, meaning that data can also be present in the Program Space. To use these data successfully, they must be accessed in a way that preserves the alignment of information in both spaces.

Aside from normal execution, the architecture of the dsPIC33CH128MP508 family devices provides two methods by which Program Space can be accessed during operation:

  • Using table instructions to access individual bytes or words anywhere in the Program Space
  • Remapping a portion of the Program Space into the Data Space (Program Space Visibility)

Table instructions allow an application to read or write to small areas of the program memory. This capability makes the method ideal for accessing data tables that need to be updated periodically. It also allows access to all bytes of the program word. The remapping method allows an application to access a large block of data on a read-only basis, which is ideal for look-ups from a large table of static data. The application can only access the least significant word of the program word.

TABLE 3-22: PROGRAM SPACE ADDRESS CONSTRUCTION

Access TypeAccess SpaceProgram Space Address
[23] [22:16] [15] [14:1] [0]
Instruction Access (Code Execution)User 0 PC[22:1] 0
0xxx xxxx xxxx xxxx xxxx xxxx
TBLRD/TBLWT (Byte/Word Read/Write)UserTBLPAG[7:0]Data EA[15:0]
0xxx xxxxxxxx xxxx xxxx xxxx
ConfigurationTBLPAG[7:0]Data EA[15:0]
1xxx xxxxxxxx xxxx xxxx xxxx

FIGURE 3-12: DATA ACCESS FROM PROGRAM SPACE ADDRESS GENERATION

Microchip dsPIC33CH64MP208 - INTERFACING PROGRAM AND DATA MEMORY SPACES - 1

text_image Program Counter(1) 0 Program Counter 0 23 Bits EA 1/0 Table Operations(2) 1/0 TBLPAG 8 Bits 16 Bits 24 Bits User/Configuration Space Select Byte Select

Note 1: The Least Significant bit (LSb) of Program Space addresses is always fixed as '0' to maintain word alignment of data in the Program and Data Spaces.

2: Table operations are not required to be word-aligned. Table Read operations are permitted in the configuration memory space.

3.2.9.1 Data Access from Program Memory Using Table Instructions

The TBLRDL and TBLWTL instructions offer a direct method of reading or writing the lower word of any address within the Program Space without going through Data Space. The TBLRDH and TBLWTH instructions are the only method to read or write the upper eight bits of a Program Space word as data.

The PC is incremented by two for each successive 24-bit program word. This allows program memory addresses to directly map to Data Space addresses. Program memory can thus be regarded as two 16-bit wide word address spaces, residing side by side, each with the same address range. TBLRDL and TBLWTL access the space that contains the least significant data word. TBLRDH and TBLWTH access the space that contains the upper data byte.

Two table instructions are provided to move byte or word-sized (16-bit) data to and from Program Space. Both function as either byte or word operations.

• TBLRDL (Table Read Low):

- In Word mode, this instruction maps the lower word of the Program Space location (P[15:0]) to a data address (D[15:0])

- In Byte mode, either the upper or lower byte of the lower program word is mapped to the lower byte of a data address. The upper byte is selected when Byte Select is '1'; the lower byte is selected when it is '0'.

• TBLRDH (Table Read High):

- In Word mode, this instruction maps the entire upper word of a program address (P[23:16]) to a data address. The 'phantom' byte (D[15:8]) is always '0'.

- In Byte mode, this instruction maps the upper or lower byte of the program word to D[7:0] of the data address in the TBLRDL instruction. The data are always '0' when the upper 'phantom' byte is selected (Byte Select = 1).

In a similar fashion, two table instructions, TBLWTH and TBLWTL, are used to write individual bytes or words to a Program Space address. The details of their operation are explained in Section 3.3 "Main Flash Program Memory".

For all table operations, the area of program memory space to be accessed is determined by the Table Page register (TBLPAG). TBLPAG covers the entire program memory space of the device, including user application and configuration spaces. When TBLPAG[7] = 0, the table page is located in the user memory space. When TBLPAG[7] = 1, the page is located in configuration space.

FIGURE 3-13: ACCESSING PROGRAM MEMORY WITH TABLE INSTRUCTIONS
Microchip dsPIC33CH64MP208 - Data Access from Program Memory Using Table Instructions - 1

flowchart
graph TD
    A["TBLPAG 02"] --> B["23 15"]
    B --> C["0x000000"]
    C --> D["0x020000"]
    D --> E["0x030000"]
    E --> F["0x800000"]
    F --> G["0x800000"]
    G --> H["0x800000"]
    H --> I["0x800000"]
    I --> J["0x800000"]
    J --> K["0x800000"]
    K --> L["0x800000"]
    L --> M["0x800000"]
    M --> N["0x800000"]
    N --> O["0x800000"]
    O --> P["0x800000"]
    P --> Q["0x800000"]
    Q --> R["0x800000"]
    R --> S["0x800000"]
    S --> T["0x800000"]
    T --> U["0x800000"]
    U --> V["0x800000"]
    V --> W["0x800000"]
    W --> X["0x800000"]
    X --> Y["0x800000"]
    Y --> Z["0x800000"]
    Z --> AA["0x800000"]
    AA --> AB["0x800000"]
    AB --> AC["0x800000"]
    AC --> AD["0x800000"]
    AD --> AE["0x800000"]
    AE --> AF["0x800000"]
    AF --> AG["0x800000"]
    AG --> AH["0x800000"]
    AH --> AI["0x800000"]
    AI --> AJ["0x800000"]
    AJ --> AK["0x800000"]
    AK --> AL["0x800000"]
    AL --> AM["0x800000"]
    AM --> AN["O81623"]
    AN --> AO["'Phantom' Byte"]
    AO --> AP["TBLRDH.B (Wn[O"] = 1)]
    AO --> AQ["TBLRDL.B (Wn[O"] = 1)]
    AO --> AR["TBLRDL.W (Wn[O"] = 1)]
    AO --> AS["TBLRDH.B (Wn[O"] = 1)]
    AO --> AT["TBLRDL.B (Wn[O"] = 1)]
    AO --> AU["TBLRDL.W (Wn[O"] = 1)]

3.3 Main Flash Program Memory

Note 1: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive reference source. To complement the information in this data sheet, refer to “Flash Programming” (www.microchip.com/DS70000609), which is available from the Microchip website (www.microchip.com).

2: This section refers to the “Dual Partition Flash Program Memory” (www.microchip.com/DS70005156), but the Dual Partition is not implemented in the Main Flash.

The dsPIC33CH128MP508 family devices contain internal Flash program memory for storing and executing application code. The memory is readable, writable and erasable during normal operation over the entire VDD range.

Flash memory can be programmed in three ways:

• In-Circuit Serial Programming (ICSP) programming capability
• Enhanced In-Circuit Serial Programming (Enhanced ICSP)
• Run-Time Self-Programming (RTSP)

ICSP allows for a dsPIC33CH128MP508 family device to be serially programmed while in the end application circuit. This is done with a Programming Clock and Programming Data (PGCx/PGDx) line, and three other lines for power (VDD), ground (Vss) and Master Clear (MCLR). This allows customers to manufacture boards with unprogrammed devices and then program the device just before shipping the product. This also allows the most recent firmware or a custom firmware to be programmed.

Enhanced In-Circuit Serial Programming uses an on-board bootloader, known as the Program Executive, to manage the programming process. Using an SPI data frame format, the Program Executive can erase, program and verify program memory. For more information on Enhanced ICSP, see the device programming specification.

RTSP allows the Main Flash user application code to update itself during run time. The feature is capable of writing a single program memory word (two instructions) or an entire row as needed.

3.3.1 FLASH PROGRAMMING OPERATIONS

For ICSP and RTSP programming of the Main Flash, TBLWTL and TBLWTH instructions are used to write to the NVM write latches. An NVM write operation then writes the contents of both latches to the Flash, starting at the address defined by the contents of TBLPAG, and the NVMADR and NVMADRU registers.

Programmers can program two adjacent words (24 bits x 2) of Program Flash Memory at a time on every other word address boundary (0x000002, 0x000006, 0x00000A, etc.). To do this, it is necessary to erase the page that contains the desired address of the location the user wants to change. For protection against accidental operations, the write initiate sequence for NVMKEY must be used to allow any erase or program operation to proceed. After the programming command has been executed, the user application must wait for the programming time until programming is complete.

Regardless of the method used to program the Flash, a few basic requirements should be met:

- A full 48-bit double instruction word should always be programmed to a Flash location. Either instruction may simply be a NOP to fulfill this requirement. This ensures a valid ECC value is generated for each pair of instructions written.

• Assuming the above step is followed, the last 24-bit location in implemented program space should never be executed. The penultimate instruction must contain a program flow change instruction, such as a RETURN or BRA instruction.

FIGURE 3-14: ADDRESSING FOR TABLE REGISTERS
Microchip dsPIC33CH64MP208 - FLASH PROGRAMMING OPERATIONS - 1

text_image Using Program Counter 24 Bits 0 Program Counter 0 Working Reg EA Using Table Instruction 1/0 TBLPAG Reg 8 Bits 16 Bits User/Configuration Space Select 24-Bit EA Byte Select

RTSP allows the user application to program one double instruction word or one row at a time. The double instruction word write blocks and single row write blocks are edge-aligned, from the beginning of program memory, on boundaries of one double instruction word and 64 double instruction words, respectively.

The basic sequence for RTSP programming is to first load two 24-bit instructions into the NVM write latches found in configuration memory space. Refer to Figure 3-3

through Figure 3-4 for write latch addresses. Then, the WR bit in the NVMCON register is set to initiate the write process. The processor stalls (waits) until the programming operation is finished. The WR bit is automatically cleared when the operation is finished.

Double instruction word writes are performed by manually loading both write latches, using TBLWTL and TBLWTH instructions, and then initiating the NVM write while the NVMOPx bits are set to '0x1'. The program space destination address is defined by the NVMADR/U registers.

EXAMPLE 3-1: FLASH WRITE/READ

/////Flash write///////
//Sample code for writing 0x123456 to address locations 0x10000 / 10002
NVMCON = 0x4001;
TBLPAG = 0xFA; // write latch upper address
NVMADR = 0x0000; // set target write address of general segment
NVMADRU = 0x0001;
__builtin_tblwt1(0, 0x3456); // load write latches
__builtin_tblwth (0, 0x12);

__builtin_tblwt1(2, 0x3456); // load write latches
__builtin_tblwth (2, 0x12);

asm volatile ("disi #5");
__builtin_write_NVM();
while(_WR == 1);

/////Flash Read///////
//Sample code to read the Flash content of address 0x10000
// readDataL/ readDataH variables need to defined
TBLPAG = 0x0001;
readDataL = __builtin_tblrdl(0x0000);
readDataH = __builtin_tblrdh(0x0000); 

Row programming is performed by first loading 128 instructions into data RAM and then loading the address of the first instruction in that row into the NVMSRCADRL/H registers. Once the write has been initiated, the device will automatically load two instructions into the write latches and write them to the program space destination address defined by the NVMADR/U registers.

The operation will increment the NVMSRCADRL/H and the NVMADR/U registers until all double instruction words have been programmed.

The RPDF bit (NVMCON[9]) selects the format of the stored data in RAM to be either compressed or uncompressed. See Figure 3-15 for data formatting. Compressed data help to reduce the amount of required RAM by using the upper byte of the second word for the MSB of the second instruction.

All erase and program operations may optionally use the NVM interrupt to signal the successful completion of the operation.

FIGURE 3-15: UNCOMPRESSED/ COMPRESSED FORMAT
Microchip dsPIC33CH64MP208 - FLASH PROGRAMMING OPERATIONS - 2

text_image 715 0 LSW1 Even Byte Address MSB10x00 LSW2 MSB20x00 UNCOMPRESSED FORMAT (RPDF = 0) 715 0 LSW1 Even Byte Address MSB1MSB2 LSW2 COMPRESSED FORMAT (RPDF = 1)

3.3.3 ERROR CORRECTING CODE (ECC)

In order to improve program memory performance and durability, the devices include Error Correcting Code functionality (ECC) as an integral part of the Flash memory controller. ECC can determine the presence of single bit errors in program data, including which bit is in error, and correct the data automatically without user intervention. ECC cannot be disabled.

When data are written to program memory, ECC generates a 7-bit Hamming code parity value for every two (24-bit) instruction words. The data are stored in blocks of 48 data bits and seven parity bits; parity data are not memory-mapped and are inaccessible. When the data are read back, the ECC calculates the parity on it and compares it to the previously stored parity value. If a parity mismatch occurs, there are two possible outcomes:

  • Single bit error has occurred and has been automatically corrected on readback.
  • Double-bit error has occurred and the read data are not changed.

Single bit error occurrence can be identified by the state of the ECCSBEIF (IFS0[13]) bit. An interrupt can be generated when the corresponding interrupt enable bit is set, ECCSBEIE (IEC0[13]). The ECCSTATL register contains the parity information for single bit errors. The SECOUT[7:0] bit field contains the expected calculated SEC parity and SECIN[7:0] bits contain the actual value from a Flash read operation. The SECSYNDx bits (ECCSTATH[7:0]) indicate the bit position of the single bit error within the 48-bit pair of instruction words. When no error is present, SECINx equals SECOUTx and SECSYNDx is zero.

Double-bit errors result in a generic hard trap. The ECCDBE bit (INTCON4[1]) will be set to identify the source of the hard trap. If no Interrupt Service Routine is implemented for the hard trap, a device Reset will also occur. The ECCSTATH register contains double-bit error status information. The DEDOUT bit is the expected calculated DED parity and DEDIN is the actual value from a Flash read operation. When no error is present, DEDIN equals DEDOUT.

3.3.3.1 ECC Fault Injection

To test Fault handling, an EEC error can be generated. Both single and double-bit errors can be generated in both the read and write data paths. Read path Fault injection first reads the Flash data and then modifies them prior to entering the ECC logic. Write path Fault injection modifies the actual data prior to them being written into the target Flash and will cause an EEC error on subsequent Flash read. The following procedure is used to inject a Fault:

  1. Load Flash target address into the ECCADDR register.
  2. Select 1st Fault bit determined by FLT1PTRx (ECCCONH[7:0]). The target bit is inverted to create the Fault.
  3. If a double Fault is desired, select the 2nd Fault bit determined by FLT2PTRx (ECCCONH[15:8]), otherwise set to all '1's.
  4. Write the NVMKEY unlock sequence.
  5. Enable the ECC Fault injection logic by setting the FLTINJ bit (ECCCONL[0])
  6. Perform a read or write to the Flash target address.

3.3.4 CONTROL REGISTERS

Five SFRs are used to write and erase the Program Flash Memory: NVMCON, NVMKEY, NVMADR, NVMADRU and NVMSRCADRL/H.

The NVMCON register (Register 3-6) selects the operation to be performed (page erase, word/row program, Inactive Partition erase) and initiates the program or erase cycle.

NVMKEY (Register 3-9) is a write-only register that is used for write protection. To start a programming or erase sequence, the user application must consecutively write 0x55 and 0xAA to the NVMKEY register.

There are two NVM Address registers: NVMADR and NVMADRU. These two registers, when concatenated, form the 24-bit Effective Address (EA) of the selected word/row for programming operations, or the selected page for erase operations. The NVMADRU register is used to hold the upper eight bits of the EA, while the NVMADR register is used to hold the lower 16 bits of the EA.

For row programming operation, data to be written to Program Flash Memory are written into data memory space (RAM) at an address defined by the NVMSRCADRL/H register (location of first element in row programming data).

3.3.5 NVM CONTROL REGISTERS

REGISTER 3-6: NVMCON: NONVOLATILE MEMORY (NVM) CONTROL REGISTER

R/SO-0^(1) R/W-0^(1) R/W-0^(1) R/W-0 U-0U-0R/W-0R/C-0
WR WRENWRERR NVMSIDL(2)— —RPDF URERR
bit 15 bit 8
U-0 U-0U-0U-0R/W-0(1) R/W-0^(1) R/W-0^(1) R/W-0^(1)
NVMOP[3:0] ^(3,4)
bit 7 bit 0
Legend:C = Clearable bitSO = Settable Only 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 15 WR: Write Control bit ^(1)

1 = Initiates a Flash memory program or erase operation; the operation is self-timed and the bit is cleared by hardware once the operation is complete
0 = Program or erase operation is complete and inactive

bit 14 WREN: Write Enable bit ^(1)

1 = Enables Flash program/erase operations
0 = Inhibits Flash program/erase operations

bit 13 WRERR: Write Sequence Error Flag bit ^(1)

1 = An improper program or erase sequence attempt, or termination has occurred (bit is set automatically on any set attempt of the WR bit)
0 = The program or erase operation completed normally

bit 12 NVMSIDL: NVM Stop in Idle Control bit ^(2)

1 = Flash voltage regulator goes into Standby mode during Idle mode
0 = Flash voltage regulator is active during Idle mode

bit 11-10 Unimplemented: Read as '0'

bit 9 RPDF: Row Programming Data Format bit

1 = Row data to be stored in RAM are in compressed format
0 = Row data to be stored in RAM are in uncompressed format

bit 8 URERR: Row Programming Data Underrun Error bit

1 = Indicates row programming operation has been terminated
0 = No data underrun error is detected

bit 7-4 Unimplemented: Read as '0'

Note 1: These bits can only be reset on a POR.

2: If this bit is set, there will be minimal power savings (IIDLE), and upon exiting Idle mode, there is a delay (TVREG) before Flash memory becomes operational.
3: All other combinations of NVMOP[3:0] are unimplemented.
4: Execution of the PWRSAV instruction is ignored while any of the NVM operations are in progress.
5: Two adjacent words on a 4-word boundary are programmed during execution of this operation.

REGISTER 3-6: NVMCON: NONVOLATILE MEMORY (NVM) CONTROL REGISTER (CONTINUED)

bit 3-0 NVMOP[3:0]: NVM Operation Select bits (1,3,4)

1111 = Reserved 1110 = User memory bulk erase operation 1101 = Reserved 1100 = Reserved 1011 = Reserved 1010 = Reserved 1001 = Reserved 1000 = Reserved 0111 = Reserved 0101 = Reserved 0100 = Reserved 0011 = Memory page erase operation 0010 = Memory row program operation 0001 = Memory double-word operation ^(5) 0000 = Reserved

Note 1: These bits can only be reset on a POR.

2: If this bit is set, there will be minimal power savings (1 IDLE), and upon exiting Idle mode, there is a delay (TVREG) before Flash memory becomes operational.
3: All other combinations of NVMOP[3:0] are unimplemented.
4: Execution of the PWRSAV instruction is ignored while any of the NVM operations are in progress.
5: Two adjacent words on a 4-word boundary are programmed during execution of this operation.

REGISTER 3-7: NVMADR: NONVOLATILE MEMORY LOWER ADDRESS REGISTER

R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x
NVMADR[15:8]
bit 15 bit 8
R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x
NVMADR[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 NVMADR[15:0]: Nonvolatile Memory Lower Write Address bits

Selects the lower 16 bits of the location to program or erase in Program Flash Memory. This register may be read or written to by the user application.

REGISTER 3-8: NVMADRU: NONVOLATILE MEMORY UPPER ADDRESS REGISTER

R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x
NVMADRU[23:16]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-8 Unimplemented: Read as '0'

bit 7-0 NVMADRU[23:16]: Nonvolatile Memory Upper Write Address bits

Selects the upper eight bits of the location to program or erase in Program Flash Memory. This register may be read or written to by the user application.

REGISTER 3-9: NVMKEY: NONVOLATILE MEMORY KEY REGISTER

U-0 U-0 U-0 U-0 U-0 U-0 U-0 U-0
— — — +++ —
bit 15bit 8
W-0W-0W-0W-0W-0W-0W-0W-0
NVMKEY[7:0]
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 cleared x = Bit is unknown

bit 15-8 Unimplemented: Read as '0'

bit 7-0 NVMKEY[7:0]: NVM Key Register bits (write-only)

REGISTER 3-10: NVMSRCADRL: NVM SOURCE DATA ADDRESS REGISTER LOW

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
NVMSRCADR[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
NVMSRCADR[7:0]
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown

bit 15-0 NVMSRCADR[15:0]: NVM Source Data Address bits

The RAM address of the data to be programmed into Flash when the NVMOP[3:0] bits are set to row programming.

REGISTER 3-11: NVMSRCADRH: NVM SOURCE DATA ADDRESS REGISTER HIGH

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
NVMSRCADR[23:16]
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown

bit 15-8 Unimplemented: Read as '0'

bit 7-0 NVMSRCADR[23:16]: NVM Source Data Address bits

The RAM address of the data to be programmed into Flash when the NVMOP[3:0] bits are set to row programming.

3.3.6 ECC CONTROL REGISTERS

REGISTER 3-12: ECCCONL: ECC FAULT INJECTION CONFIGURATION REGISTER LOW

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-1 Unimplemented: Read as '0'

bit 0 FLTINJ: Fault Injection Sequence Enable bit

1 = Enabled

0 = Disabled

REGISTER 3-13: ECCCONH: ECC FAULT INJECTION CONFIGURATION REGISTER HIGH

R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
FLT2PTR[7:0]
bit 15bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
FLT1PTR[7:0]
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 cleared x = Bit is unknown

bit 15-8 FLT2PTR[7:0]: ECC Fault Injection Bit Pointer 2

11111111-00111000 = No Fault injection occurs

00110111 = Fault injection (bit inversion) occurs on bit 55 of ECC bit order

...

00000001 = Fault injection (bit inversion) occurs on bit 1 of ECC bit order

00000000 = Fault injection (bit inversion) occurs on bit 0 of ECC bit order

bit 7-0 FLT1PTR[7:0]: ECC Fault Injection Bit Pointer 1

11111111-00111000 = No Fault injection occurs

00110111 = Fault injection occurs on bit 55 of ECC bit order

...

00000001 = Fault injection occurs on bit 1 of ECC bit order

00000000 = Fault injection occurs on bit 0 of ECC bit order

REGISTER 3-14: ECCADDRL: ECC FAULT INJECT ADDRESS COMPARE REGISTER LOW

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
ECCADDR[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
ECCADDR[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-0 ECCADDR[15:0]: ECC Fault Injection NVM Address Match Compare bits

REGISTER 3-15: ECCADDRH: ECC FAULT INJECT ADDRESS COMPARE REGISTER HIGH

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
ECCADDR[31:24]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
ECCADDR[23:16]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-0 ECCADDR[31:16]: ECC Fault Injection NVM Address Match Compare bits

REGISTER 3-16: ECCSTATL: ECC SYSTEM STATUS DISPLAY REGISTER LOW

R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
SECOUT[7:0]
bit 15 bit 8
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
SECIN[7:0
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-8 SECOUT[7:0]: Calculated Single Error Correction Parity Value bits

bit 7-0 SECIN[7:0]: Read Single Error Correction Parity Value bits

Bits are the actual parity value of a Flash read operation.

REGISTER 3-17: ECCSTATH: ECC SYSTEM STATUS DISPLAY REGISTER HIGH

U-0 U-0 U-0 U-0 U-0 R-0 R-0
DEDOUTDEDIN
bit 15 bit 8
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
SECSYND[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 15-10 Unimplemented: Read as '0'

bit 9 DEDOUT: Calculated Dual Bit Error Detection Parity bit

bit 8 DEDIN: Read Dual Bit Error Detection Parity bit

bit 7-0 SECSYND[7:0]: Calculated ECC Syndrome Value bits

Indicates the bit location that contains the error.

3.4 Master Resets

Note 1: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive reference source. To complement the information in this data sheet, refer to “Reset” (www.microchip.com/DS70000602), which is available from the Microchip website (www.microchip.com).

The Reset module combines all Reset sources and controls the device Master Reset Signal, SYSRST. The following is a list of device Reset sources:

  • POR: Power-on Reset
    • BOR: Brown-out Reset
    • M C LMBster Clear Pin Reset
  • S W R : RESET Instruction
  • WDTO: Watchdog Timer Time-out Reset
    • CM: Configuration Mismatch Reset
    • TRAPR: Trap Conflict Reset
    • IOPUWR: Illegal Condition Device Reset
  • Illegal Opcode Reset
  • Uninitialized W Register Reset
  • Security Reset

A simplified block diagram of the Reset module is shown in Figure 3-16.

Any active source of Reset will make the SYSRST signal active. On system Reset, some of the registers associated with the CPU and peripherals are forced to a known Reset state, and some are unaffected.

Note: Refer to the specific peripheral section or Section 3.2 "Main Memory Organization" of this data sheet for register Reset states.

All types of device Reset set a corresponding status bit in the RCON register to indicate the type of Reset (see Register 3-18).

A POR clears all the bits, except for the BOR and POR bits (RCON[1:0]) that are set. The user application can set or clear any bit, at any time, during code execution. The RCON bits only serve as status bits. Setting a particular Reset status bit in software does not cause a device Reset to occur.

The RCON register also has other bits associated with the Watchdog Timer and device power-saving states. The function of these bits is discussed in other sections of this data sheet.

Note: The status bits in the RCON register should be cleared after they are read so that the next RCON register value after a device Reset is meaningful.

For all Resets, the default clock source is determined by the FNOSC[2:0] bits in the FOSCSEL Configuration register. The value of the FNOSCx bits is loaded into the NOSC[2:0] (OSCCON[10:8]) bits on Reset, which in turn, initializes the system clock.

FIGURE 3-16: MASTER RESET SYSTEM BLOCK DIAGRAM
Microchip dsPIC33CH64MP208 - Master Resets - 1

flowchart
graph TD
    A["MCLR"] --> B["Reset Instruction"]
    B --> C["Glitch Filter"]
    C --> D["AND"]
    E["WDT Module\nSleep or Idle"] --> D
    F["VDD"] --> G["Internal Regulator"]
    G --> H["BOR"]
    H --> I["AND"]
    I --> J["SYSRST"]
    K["VDD Rise Detect"] --> L["POR"]
    L --> I
    M["Trap Conflict"] --> I
    N["Illegal Opcode"] --> I
    O["Uninitialized W Register"] --> I
    P["Security Reset"] --> I
    Q["Configuration Mismatch"] --> I

3.4.1 RESET RESOURCES

Many useful resources are provided on the main product page of the Microchip website for the devices listed in this data sheet. This product page contains the latest updates and additional information.

  • “Reset” (www.microchip.com/DS70000602)
  • Code Samples
  • Application Notes
  • Software Libraries
  • Webinars
  • All Related "dsPIC33/PIC24 Family Reference Manual" Sections
  • Development Tools

3.4.2 RESET CONTROL REGISTER

REGISTER 3-18: RCON: RESET CONTROL REGISTER (1)

R/W-0 R/W-0 U-0 U-0 U-0 R/W-0 R/W-0
TRAPRIOPUWRCMVREGS
bit 15 bit 8
R/W-0R/W-0U-0R/W-0R/W-0R/W-0R/W-1R/W-1
EXTR SWRWDTOSLEEPIDLEBORPOR
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15 TRAPR: Trap Reset Flag bit

1 = A Trap Conflict Reset has occurred

0 = A Trap Conflict Reset has not occurred

bit 14 IOPUWR: Illegal Opcode or Uninitialized W Register Access Reset Flag bit

1 = An illegal opcode detection, an illegal address mode or Uninitialized W register used as an Address Pointer caused a Reset 0 = An illegal opcode or Uninitialized W Register Reset has not occurred

bit 13-10 Unimplemented: Read as '0'

bit 9 CM: Configuration Mismatch Flag bit

1 = A Configuration Mismatch Reset has occurred.

0 = A Configuration Mismatch Reset has not occurred

bit 8 VREGS: Voltage Regulator Standby During Sleep bit

1 = Voltage regulator is active during Sleep

0 = Voltage regulator goes into Standby mode during Sleep

bit 7 EXTR: External Reset (MCLR) Pin bit

1 = A Master Clear (pin) Reset has occurred

0 = A Master Clear (pin) Reset has not occurred

bit 6 SWR: Software RESET (Instruction) Flag bit

1 = A RESET instruction has been executed

0 = A RESET instruction has not been executed

bit 5 Unimplemented: Read as '0'

bit 4 WDTO: Watchdog Timer Time-out Flag bit

1 = WDT time-out has occurred

0 = WDT time-out has not occurred

bit 3 SLEEP: Wake-up from Sleep Flag bit

1 = Device has been in Sleep mode

0 = Device has not been in Sleep mode

bit 2 IDLE: Wake-up from Idle Flag bit

1 = Device has been in Idle mode

0 = Device has not been in Idle mode

bit 1 BOR: Brown-out Reset Flag bit

1 = A Brown-out Reset has occurred

0 = A Brown-out Reset has not occurred

Note 1: All of the Reset status bits can be set or cleared in software. Setting one of these bits in software does not cause a device Reset.

REGISTER 3-18: RCON: RESET CONTROL REGISTER (1) (CONTINUED)

bit 0 POR: Power-on Reset Flag bit

1 = A Power-on Reset has occurred
0 = A Power-on Reset has not occurred

Note 1: All of the Reset status bits can be set or cleared in software. Setting one of these bits in software does not cause a device Reset.

3.5 Main Interrupt Controller

Note 1: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive reference source. To complement the information in this data sheet, refer to “Interrupts” (www.microchip.com/DS70000600), which is available from the Microchip website (www.microchip.com).

The dsPIC33CH128MP508 family interrupt controller reduces the numerous peripheral interrupt request signals to a single interrupt request signal to the dsPIC33CH128MP508 family CPU.

The interrupt controller has the following features:

  • Six Processor Exceptions and Software Traps
  • Seven User-Selectable Priority Levels
  • Interrupt Vector Table (IVT) with a Unique Vector for each Interrupt or Exception Source
  • Fixed Priority within a Specified User Priority Level
    • Fixed Interrupt Entry and Return Latencies
  • Alternate Interrupt Vector Table (AIVT) for Debug Support

3.5.1 INTERRUPT VECTOR TABLE

The dsPIC33CH128MP508 family Interrupt Vector Table (IVT), shown in Figure 3-17, resides in program memory, starting at location, 000004h. The IVT contains six non-maskable trap vectors and up to 246 sources of interrupts. In general, each interrupt source has its own vector. Each interrupt vector contains a 24-bit wide address. The value programmed into each interrupt vector location is the starting address of the associated Interrupt Service Routine (ISR).

Interrupt vectors are prioritized in terms of their natural priority. This priority is linked to their position in the vector table. Lower addresses generally have a higher natural priority. For example, the interrupt associated with Vector 0 takes priority over interrupts at any other vector address.

3.5.1.1 Alternate Interrupt Vector Table

The Alternate Interrupt Vector Table (AIVT), shown in Figure 3-18, is available only when the Boot Segment (BS) is defined and the AIVT has been enabled. To enable the Alternate Interrupt Vector Table, the Configuration bit, AIVTDIS in the FSEC register, must be programmed and the AIVTEN bit must be set (INTCON2[8] = 1). When the AIVT is enabled, all interrupt and exception processes use the alternate vectors instead of the default vectors. The AIVT begins at the start of the last page of the Boot Segment, defined by BSLIM[12:0]. The second half of the page is no longer usable space. The Boot Segment must be at least two pages to enable the AIVT.

Note: Although the Boot Segment must be enabled in order to enable the AIVT, application code does not need to be present inside of the Boot Segment. The AIVT (and IVT) will inherit the Boot Segment code protection.

The AIVT supports debugging by providing a means to switch between an application and a support environment without requiring the interrupt vectors to be reprogrammed. This feature also enables switching between applications for evaluation of different software algorithms at run time.

3.5.2 RESET SEQUENCE

A device Reset is not a true exception because the interrupt controller is not involved in the Reset process. The dsPIC33CH128MP508 family devices clear their registers in response to a Reset, which forces the PC to zero. The device then begins program execution at location, 0x000000. A GOTO instruction at the Reset address can redirect program execution to the appropriate start-up routine.

Note: Any unimplemented or unused vector locations in the IVT should be programmed with the address of a default interrupt handler routine that contains a RESET instruction.

FIGURE 3-17: dsPIC33CH128MP508 FAMILY MAIN INTERRUPT VECTOR TABLE
Microchip dsPIC33CH64MP208 - RESET SEQUENCE - 1

text_image Reset - GOTO Instruction 0x000000 Reset - GOTO Address 0x000002 Oscillator Fail Trap Vector 0x000004 Address Error Trap Vector 0x000006 Generic Hard Trap Vector 0x000008 Stack Error Trap Vector 0x00000A Math Error Trap Vector 0x00000C Reserved 0x00000E Generic Soft Trap Vector 0x000010 Reserved 0x000012 Interrupt Vector 0 0x000014 Interrupt Vector 1 0x000016 : : : : : : Interrupt Vector 52 0x00007C Interrupt Vector 53 0x00007E Interrupt Vector 54 0x000080 : : : : : : Interrupt Vector 116 0x0000FC Interrupt Vector 117 0x0000FE Interrupt Vector 118 0x000100 Interrupt Vector 119 0x000102 Interrupt Vector 120 0x000104 : : : : : : Interrupt Vector 244 0x0001FC Interrupt Vector 245 0x0001FE START OF CODE 0x000200 IVT See Table 3-19 for Interrupt Vector Details

FIGURE 3-18: dsPIC33CH128MP508 ALTERNATE MAIN INTERRUPT VECTOR TABLE
Microchip dsPIC33CH64MP208 - RESET SEQUENCE - 2

bar_stacked | Interrupt Vector | BSLIM[12:0] | BSLIM[12:0] + 0x000000 | | :--- | :--- | :--- | | Interrupt Vector 0 | (1) + 0x000014 | (1) + 0x000016 | | Interrupt Vector 1 | (1) + 0x000016 | (1) + 0x000016 | | :--- | :--- | :--- | | Interrupt Vector 52 | (1) + 0x00007C | (1) + 0x00007C | | Interrupt Vector 53 | (1) + 0x00007E | (1) + 0x00007E | | Interrupt Vector 54 | (1) + 0x00008O | (1) + 0x00008O | | :--- | :--- | :--- | | Interrupt Vector 116 | (1) + 0x0000FC | (1) + 0x0000FC | | Interrupt Vector 117 | (1) + 0x000FE | (1) + 0x000FE | | Interrupt Vector 118 | (1) + 0x00010O | (1) + 0x00010O | | Interrupt Vector 119 | (1) + 0x000102 | (1) + 0x000102 | | Interrupt Vector 120 | (1) + 0x000104 | (1) + 0x000104 | | :--- | :--- | :--- | | Interrupt Vector 244 | (1) + 0x0001FC | (1) + 0x0001FC | | Interrupt Vector 245 | (1) + 0x0001FE | (1) + 0x0001FE | The image displays a vertical arrow labeled 'Decreasing Natural Order Priority' pointing to the left side of the chart. The text 'See Table 3-19 for Interrupt Vector Details' is displayed on the right side.

Note 1: The address depends on the size of the Boot Segment defined by BSLIM[12:0]: [(][12:0]-1)×0×800] + Offset.

TABLE 3-23: TRAP TABLE

Trap DescriptionMPLAB®XC16 Trap ISR NameVector #IVT AddressTrap Bit Location
Generic FlagSource FlagEnablePriority Level
Oscillator Failure Trap _OscillatorFail 0 0x0000004 INTCON1[1]— —15
Address Error Trap _AddressError1 0x00000006 INTCCON1[3]— —14
Generic Hard Trap – ECCDBE_HardTrapError20x000008INTCON4[1]1
Generic Hard Trap – SGHT _HardTrapError2 0x000000008INTCON4[0]INTCON2[13]13
Stack Error Trap_StackError30x00000AINTCON1[2]— —12
Math Error Trap – OVAERR_MathError40x00000CINTCON1[4]INTCON1[14]INTCON1[10]11
Math Error Trap – OVBERR_MathError40x00000CINTCON1[4]INTCON1[13]INTCON1[9]11
Math Error Trap – COVAERR_MathError40x00000CINTCON1[4]INTCON1[12]INTCON1[8]11
Math Error Trap – COVBERR_MathError40x00000CINTCON1[4]INTCON1[11]INTCON1[8]11
Math Error Trap – SFTACERR_MathError40x00000CINTCON1[4]INTCON1[7]INTCON1[8]11
Math Error Trap – DIV0ERR_MathError40x00000CINTCON1[4]INTCON1[6]INTCON1[8]11
ReservedReserved50x00000E
Generic Soft Trap – CAN_SoftTrapError6 0x000010INTCON3[9]9
Generic Soft Trap – NAE_SoftTrapError6 0x000010INTCON3[8]9
Generic Soft Trap – CAN2_SoftTrapError6 0x000010INTCON3[6]9
Generic Soft Trap – DAE_SoftTrapError6 0x000010INTCON3[5]9
Generic Soft Trap – DOOVR_SoftTrapError6 0x000010INTCON3[4]9
Generic Soft Trap – APLL Lock_SoftTrapError60x000010INTCON3[0]9
ReservedReserved70x000012

TABLE 3-24: MAIN INTERRUPT VECTOR DETAILS (1)

Interrupt DescriptionMPLAB® XC16ISR NameVector #IRQ #IVT AddressInterrupt Bit Location
Flag Enable Priority
External Interrupt 0_INT0Interrupt800x000014IFS0[0]IEC0[0]IPC0[2:0]
Timer1_T1Interrupt910x000016IFS0[1]IEC0[1]IPC0[6:4]
Change Notice Interrupt A_CNAInterrupt1020x000018IFS0[2]IEC0[2]IPC0[10:8]
Change Notice Interrupt B_CNBInterrupt1130x00001AIFS0[3]IEC0[3]IPC0[14:12]
DMA Channel 0_DMA0Interrupt1240x00001CIFS0[4]IEC0[4]IPC1[2:0]
ReservedReserved1350x00001E
Input Capture/Output Compare 1_CCP1Interrupt1460x000020IFS0[6]IEC0[6]IPC1[10:8]
CCP1 Timer_CCT1Interrupt1570x000022IFS0[7]IEC0[7]IPC1[14:12]
DMA Channel 1_DMA1Interrupt1680x000024IFS0[8]IEC0[8]IPC2[2:0]
SPI1 Receiver_SPI1RXInterrupt1790x000026IFS0[9]IEC0[9]IPC2[6:4]
SPI1 Transmitter_SPI1TXInterrupt18100x000028IFS0[10]IEC0[10]IPC2[10:8]
UART1 Receiver_U1RXInterrupt19110x00002AIFS0[11]IEC0[11]IPC2[14:12]
UART1 Transmitter_U1TXInterrupt20120x00002CIFS0[12]IEC0[12]IPC3[2:0]
ECC Single Bit Error_ECCSBEInterrupt21130x00002EIFS0[13]IEC0[13]IPC3[6:4]
NVM Write Complete_NVMInterrupt22140x000030IFS0[14]IEC0[14]IPC3[10:8]
External Interrupt 1_INT1Interrupt23150x000032IFS0[15]IEC0[15]IPC3[14:12]
I2C1 Client Event_SI2C1Interrupt24160x000034IFS1[0]IEC1[0]IPC4[2:0]
I2C1 Host Event_MI2C1Interrupt25170x000036IFS1[1]IEC1[1]IPC4[6:4]
DMA Channel 2_DMA2Interrupt26180x000038IFS1[2]IEC1[2]IPC4[10:8]
Change Notice Interrupt C_CNCInterrupt27190x00003AIFS1[3]IEC1[3]IPC4[14:12]
External Interrupt 2_INT2Interrupt28200x00003CIFS1[4]IEC1[4]IPC5[2:0]
DMA Channel 3_DMA3Interrupt29210x00003EIFS1[5]IEC1[5]IPC5[6:4]
DMA Channel 4_DMA4Interrupt30220x000040IFS1[6]IEC1[6]IPC5[10:8]
Input Capture/Output Compare 2_CCP2Interrupt31230x000042IFS1[7]IEC1[7]IPC5[14:12]
CCP2 Timer_CCT2Interrupt32240x000044IFS1[8]IEC1[8]IPC6[2:0]
CAN1 Combined Error_CAN1Interrupt33250x000046IFS1[9]IEC1[9]IPC6[6:4]
External Interrupt 3_INT3Interrupt34260x000048IFS1[10]IEC1[10]IPC6[10:8]
UART2 Receiver_U2RXInterrupt35270x00004AIFS1[11]IEC1[11]IPC6[14:12]
UART2 Transmitter_U2TXInterrupt36280x00004CIFS1[12]IEC1[12]IPC7[2:0]
SPI2 Receiver_SPI2RXInterrupt37290x00004EIFS1[13]IEC1[13]IPC7[6:4]
SPI2 Transmitter_SPI2TXInterrupt38300x000050IFS1[14]IEC1[14]IPC7[10:8]
CAN1 RX Data Ready_C1RXInterrupt39310x000052IFS1[15]IEC1[15]IPC7[14:12]
ReservedReserved40-4132-330x000054-0x000056
DMA Channel 5_DMA5Interrupt42340x000058IFS2[2]IEC2[2]IPC8[10:8]
Input Capture/Output Compare 3_CCP3Interrupt43350x00005AIFS2[3]IEC2[3]IPC8[14:12]
CCP3 Timer_CCT3Interrupt44360x00005CIFS2[4]IEC2[4]IPC9[2:0]
I2C2 Client Event_SI2C2Interrupt45370x00005EIFS2[5]IEC2[5]IPC9[6:4]
I2C2 Host Event_MI2C2Interrupt46380x000060IFS2[6]IEC2[6]IPC9[10:8]
ReservedReserved47390x000062
Input Capture/Output Compare 4_CCP4Interrupt48400x000064IFS2[8]IEC2[8]IPC10[2:0]
CCP4 Timer_CCT4Interrupt49410x000066IFS2[9]IEC2[9]IPC10[6:4]
ReservedReserved50420x000068
Input Capture/Output Compare 5_CCP5Interrupt51430x00006AIFS2[11]IEC2[11]IPC10[14:12]
CCP5 Timer_CCT5Interrupt52440x00006CIFS2[12]IEC2[12]IPC11[2:0]
Deadman Timer_DMTInterrupt53450x00006EIFS2[13]IEC2[13]IPC11[6:4]
Interrupt DescriptionMPLAB ^ XC16ISR NameVector #IRQ #IVT AddressInterrupt Bit Location
Flag EnablePriority
Input Capture/Output Compare 6_CCP6Interrupt54460x000070IFS2[14]IEC2[14]IPC11[10:8]
CCP6 Timer _CCT6Interrupt 55 470x000072 IFS2[15]IEC2[15]IPC11[14:12]
QEI Position Counter Compare_QEI1Interrupt56480x000074IFS3[0]IEC3[0]IPC12[2:0]
UART1 Error_U1EInterrupt57490x000076IFS3[1]IEC3[1]IPC12[6:4]
UART2 Error_U2EInterrupt58500x000078IFS3[2]IEC3[2]IPC12[10:8]
CRC Generator_CRCInterrupt59510x00007AIFS3[3]IEC3[3]IPC12[14:12]
CAN1 TX Data Request_C1TXInterrupt60520x00007CIFS3[4]IEC3[4]IPC13[2:0]
ReservedReserved61-6853-600x00007E-0x00008C
In-Circuit Debugger_ICDInterrupt69610x00008EIFS3[13]IEC3[13]IPC15[6:4]
JTAG Programming_JTAGInterrupt70620x000090IFS3[14]IEC3[14]IPC15[10:8]
PTG Step_PTGSTEPInterrupt71630x000092IFS3[15]IEC3[15]IPC15[14:12]
I2C1 Bus Collision_I2C1BCInterrupt72640x000094IFS4[0]IEC4[0]IPC16[2:0]
I2C2 Bus Collision_I2C2BCInterrupt73650x000096IFS4[1]IEC4[1]IPC16[6:4]
ReservedReserved74660x000098
PWM Generator 1_PWM1Interrupt75670x00009AIFS4[3]IEC4[3]IPC16[14:12]
PWM Generator 2_PWM2Interrupt76680x00009CIFS4[4]IEC4[4]IPC17[2:0]
PWM Generator 3_PWM3Interrupt77690x00009EIFS4[5]IEC4[5]IPC17[6:4]
PWM Generator 4_PWM4Interrupt78700x0000A0IFS4[6]IEC4[6]IPC17[10:8]
ReservedReserved79-8271-740x0000A2-0x0000A8
Change Notice D_CNDInterrupt83750x0000AAIFS4[11]IEC4[11]IPC18[14:12]
Change Notice E_CNEInterrupt84760x0000ACIFS4[12]IEC4[12]IPC19[2:0]
Comparator 1_CMP1Interrupt85770x0000AEIFS4[13]IEC4[13]IPC19[6:4]
ReservedReserved86-8878-800x0000B0-0x0000B4
PTG Watchdog Timer Time-out_PTGWDTInterrupt89810x0000B6IFS5[1]IEC5[1]IPC20[6:4]
PTG Trigger 0_PTG0Interrupt90820x0000B8IFS5[2]IEC5[2]IPC20[10:8]
PTG Trigger 1_PTG1Interrupt91830x0000BAIFS5[3]IEC5[3]IPC20[14:12]
PTG Trigger 2_PTG2Interrupt92840x0000BCIFS5[4]IEC5[4]IPC21[2:0]
PTG Trigger 3_PTG3Interrupt93850x0000BEIFS5[5]IEC5[6]IPC21[6:4]
SENT1 TX/RX_SENT1Interrupt94860x0000C0IFS5[6]IEC5[6]IPC21[10:8]
SENT1 Error_SENT1EInterrupt95870x0000C2IFS5[7]IEC5[7]IPC21[14:12]
SENT2 TX/RX_SENT2Interrupt96880x0000C4IFS5[8]IEC5[8]IPC22[2:0]
SENT2 Error_SENT2EInterrupt97890x0000C6IFS5[9]IEC5[9]IPC22[6:4]
ADC Global Interrupt_ADCInterrupt98900x0000C8IFS5[10]IEC5[10]IPC22[10:8]
ADC AN0 Interrupt_ADCAN0Interrupt99910x0000CAIFS5[11]IEC5[11]IPC22[14:12]
ADC AN1 Interrupt_ADCAN1Interrupt100920x0000CCIFS5[12]IEC5[12]IPC23[2:0]
ADC AN2 Interrupt_ADCAN2Interrupt101930x0000CEIFS5[13]IEC5[13]IPC23[6:4]
ADC AN3 Interrupt_ADCAN3Interrupt102940x0000D0IFS5[14]IEC5[14]IPC23[10:8]
ADC AN4 Interrupt_ADCAN4Interrupt103950x0000D2IFS5[15]IEC5[15]IPC23[14:12]
ADC AN5 Interrupt_ADCAN5Interrupt104960x0000D4IFS6[0]IEC6[0]IPC24[2:0]
ADC AN6 Interrupt_ADCAN6Interrupt105970x0000D6IFS6[1]IEC6[1]IPC24[6:4]
ADC AN7 Interrupt_ADCAN7Interrupt106980x0000D8IFS6[2]IEC6[2]IPC24[10:8]
ADC AN8 Interrupt_ADCAN8Interrupt107990x0000DAIFS6[3]IEC6[3]IPC24[14:12]
ADC AN9 Interrupt_ADCAN9Interrupt1081000x0000DCIFS6[4]IEC6[4]IPC25[2:0]
ADC AN10 Interrupt_ADCAN10Interrupt1091010x0000DEIFS6[5]IEC6[5]IPC25[6:4]
ADC AN11 Interrupt_ADCAN11Interrupt1101020x0000E0IFS6[6]IEC6[6]IPC25[10:8]
Interrupt DescriptionMPLAB® XC16ISR NameVector #IRQ #IVT AddressInterrupt Bit Location
FlagEnablePriority
ADC AN12 Interrupt _ADCAN12Intinterrupt 111 103 0x0000E2 IFS6[7] IEC6[7] IPC25[14:12]
ADC AN13 Interrupt _ADCAN13Intinterrupt 112 104 0x0000E4 IFS6[8] IEC6[8] IPC26[2:0]
ADC AN14 Interrupt _ADCAN14Intinterrupt 113 105 0x0000E6 IFS6[9] IEC6[9] IPC26[6:4]
ADC AN15 Interrupt_ADCAN15Interrupt1141060x0000E8IFS6[10]IEC6[10]IPC26[10:8]
ADC AN16 Interrupt_ADCAN16Interrupt1151070x0000EAIFS6[11]IEC6[11]IPC26[14:12]
ADC AN17 Interrupt_ADCAN17Interrupt1161080x0000ECIFS6[12]IEC6[12]IPC27[2:0]
ADC AN18 Interrupt_ADCAN18Interrupt1171090x0000EEIFS6[13]IEC6[13]IPC27[6:4]
ADC AN19 Interrupt_ADCAN19Interrupt1181100x0000F0IFS6[14]IEC6[14]IPC27[10:8]
ADC AN20 Interrupt_ADCAN20Interrupt1191110x0000F2IFS6[15]IEC6[15]IPC27[14:12]
ReservedReserved120-122112-1140x0000F4-0x0000F8
ADC Fault_ADFLTInterrupt1231150x0000FAIFS7[3]IEC7[3]IPC28[14:12]
ADC Digital Comparator 0_ADCMP0Interrupt1241160x0000FCIFS7[4]IEC7[4]IPC29[2:0]
ADC Digital Comparator 1_ADCMP1Interrupt1251170x0000FEIFS7[5]IEC7[5]IPC29[6:4]
ADC Digital Comparator 2_ADCMP2Interrupt1261180x000100IFS7[6]IEC7[6]IPC29[10:8]
ADC Digital Comparator 3_ADCMP3Interrupt1271190x000102IFS7[7]IEC7[7]IPC29[14:12]
ADC Oversample Filter 0_ADFLTR0Interrupt1281200x000104IFS7[8]IEC7[8]IPC30[2:0]
ADC Oversample Filter 1_ADFLTR1Interrupt1291210x000106IFS7[9]IEC7[9]IPC30[6:4]
ADC Oversample Filter 2_ADFLTR2Interrupt1301220x000108IFS7[10]IEC7[10]IPC30[10:8]
ADC Oversample Filter 3_ADFLTR3Interrupt1311230x00010AIFS7[11]IEC7[11]IPC30[14:12]
CLC1 Positive Edge_CLC1PInterrupt1321240x00010CIFS7[12]IEC7[12]IPC31[2:0]
CLC2 Positive Edge_CLC2PInterrupt1331250x00010EIFS7[13]IEC7[13]IPC31[6:4]
SPI1 Error_SPI1GInterrupt1341260x000110IFS7[14]IEC7[14]IPC31[10:8]
SPI2 Error_SPI2GInterrupt1351270x000112IFS7[15]IEC7[15]IPC31[14:12]
ReservedReserved1361280x000114
MSI Client Initiated Interrupt_MSIS1Interrupt1371290x000116IFS8[1]IEC8[1]IPC32[6:4]
MSI Protocol A_MSIAInterrupt1381300x000118IFS8[2]IEC8[2]IPC32[10:8]
MSI Protocol B_MSIBInterrupt1391310x00011AIFS8[3]IEC8[3]IPC32[14:12]
MSI Protocol C_MSICInterrupt1401320x00011CIFS8[4]IEC8[4]IPC33[2:0]
MSI Protocol D_MSIDInterrupt1411330x00011EIFS8[5]IEC8[5]IPC33[6:4]
MSI Protocol E_MSIEInterrupt1421340x000120IFS8[6]IEC8[6]IPC33[10:8]
MSI Protocol F_MSIFInterrupt1431350x000122IFS8[7]IEC8[7]IPC33[14:12]
MSI Protocol G_MSIGInterrupt1441360x000124IFS8[8]IEC8[8]IPC34[2:0]
MSI Protocol H_MSIHInterrupt1451370x000126IFS8[9]IEC8[9]IPC34[6:4]
Host Read FIFO Data Ready_MSIDInterrupt1461380x000128IFS8[10]IEC8[10]IPC34[10:8]
Host Write FIFO Empty_MSIWFEInterrupt1471390x00012AIFS8[11]IEC8[11]IPC34[14:12]
Read or Write FIFO Fault(Over/Underflow)_MSIFLTInterrupt1481400x00012CIFS8[12]IEC8[12]IPC35[2:0]
MSI Client Reset_S1RSTInterrupt1491410x00012EIFS8[13]IEC8[13]IPC35[6:4]
ReservedReserved150-153142-1450x000130-0x000136
Secondary Break_S1BRKInterrupt1541460x000138IFS9[2]IEC9[2]IPC36[10:8]
ReservedReserved155-156147-1480x00013A-0x00013C
Input Capture/Output Compare 7_CCP7Interrupt1571490x00013EIFS9[5]IEC9[5]IPC37[6:4]
CCP7 Timer_CCT7Interrupt1581500x000140IFS9[6]IEC9[6]IPC37[10:8]
ReservedInput Capture/Output Compare 8Reserved_CCP8Interrupt1591601511520x0001420x000144—IFS9[8]—IEC9[8]—IPC38[2:0]
CCP8 Timer _CCT8Interrupt 161153 0x000146 IFS9[9]IEC9[9]IPC38[6:4]
ReservedReserved162-164154-1560x000148-0x00014C
Client Clock Fail_S1CLKFInterrupt1651570x00014EIFS9[13]IEC9[13]IPC39[6:4]
ReservedReserved166-175158-1670x000150-0x000162
ADC FIFO Ready_ADFIFOInterrupt1761680x000164IFS10[8]IEC10[8]IPC42[2:0]
PWM Event A_PEVTAInterrupt1771690x000166IFS10[9]IEC10[9]IPC42[6:4]
PWM Event B_PEVTBInterrupt1781700x000168IFS10[10]IEC10[10]IPC42[10:8]
PWM Event C_PEVTCInterrupt1791710x00016AIFS10[11]IEC10[11]IPC42[14:12]
PWM Event D_PEVTDInterrupt1801720x00016CIFS10[12]IEC10[12]IPC43[2:0]
PWM Event E_PEVTEInterrupt1811730x00016EIFS10[13]IEC10[13]IPC43[6:4]
PWM Event F_PEVTFInterrupt1821740x000170IFS10[14]IEC10[14]IPC43[10:8]
CLC3 Positive Edge_CLC3PInterrupt1831750x000172IFS10[15]IEC10[15]IPC43[14:12]
CLC4 Positive Edge_CLC4PInterrupt1841760x000174IFS11[0]IEC11[0]IPC44[2:0]
CLC1 Negative Edge_CLC1NInterrupt1851770x000176IFS11[1]IEC11[1]IPC44[6:4]
CLC2 Negative Edge_CLC2NInterrupt1861780x000178IFS11[2]IEC11[2]IPC44[10:8]
CLC3 Negative Edge_CLC3NInterrupt1871790x00017AIFS11[3]IEC11[3]IPC44[14:12]
CLC4 Negative Edge_CLC4NInterrupt1881800x00017CIFS11[4]IEC11[4]IPC45[2:0]
ReservedReserved189-196181-1880x0017E-0x0018C
UART1 Event_U1EVTInterrupt1971890x00018EIFS11[13]IF2C11[13]IPC47[6:4]
UART2 Event_U2EVTInterrupt1981900x000190IFS11[14]IF2C11[14]IPC47[12:8]

Note 1: Not all interrupts are available on all packages. Make sure the selected device variant has the interrupt available on the device.

TABLE 3-25: MAIN INTERRUPT FLAG REGISTERS

RegisterAddress Bit15 Bit14 Bit13 Bit 12 Bit11 Bit 10 Bit 9Bit 8 Bit 7 Bit6 Bit 5 Bit 4Bit 3 Bit 2 Bit 1Bit 0
IFS0800hINT1IFNVMIIFECCSBEIFU1TXIFU1RXIFSPI1TXIFSPI1RXIFDMA1IFCCT1IFCCP1IFDMA0IFCNBIFCNAIFT1IFINT0IF
IFS1802hC1RXIFSPI2TXIFSPI2RXIFU2TXIFU2RXIFINT3IFC1IFCCT2IFCCP2IFDMA4IFDMA3IFINT2IFCNCIFDMA2IFMI2C1IFSI2C1IF
IFS2804hCCT6IFCCP6IFDMTIFCCT5IFCCP5IFCCT4IFCCP4IFMI2C2IFSI2C2IFCCT3IFCCP3IFDMA5IF
IFS3 806hPTGSTTEPIFJTAGIFICDIFC1TXIFCRCIFU2EIFU1EIFQE11IF
IFS4 808hCMP1IFCNEIFCNDIFPWM4IFPWM3IFPWM2IFPWM1IFI2C29CIFI2C1BCIF
IFS580AhADCAN4IFADCAN3IFADCAN2IFADCAN1IFADCAN0IFADCIFSENT2EIFSENT2IFSENT1EIFSENT1IFPTG3IFPTG2IFPTG1IFPTG0IFPTGWDTIF
IFS680ChADCAN20IFADCAN19IFADCAN18IFADCAN17IFADCAN16IFADCAN15IFADCAN14IFADCAN13IFADCAN12IFADCAN11IFADCAN10IFADCAN9IFADCAN8IFADCAN7IFADCAN6IFADCAN5IF
IFS780EhSPI2GIFSPI1GIFCLC2PIFCLC1PIFADFLTR3IFADFLTR2IFADFLTR1IFADFLTR0IFADCM3IFADCM2IFADCMPIIFADCMPOIFADFLTIF
IFS8 810hS1SRSTIFMSIFLTIFMSWFEIFMSIDTIFMSIHIFMSIGIFMSIFIFMSIEIFMSIDIFMSICIFMSIBIFMSIAIFMSIS1IF
IFS9 812hS1CLKIFCCT8IFCCP8IFCCT7IFCCP7IFS1BRKIF
IFS10814hCLC3PIFPEVTFIFPEVTEIFPEVTDIFPEVTCIFPEVTBIFPEVTAIFADFIFOIF
IFS11816hU2EVTIFU1EVTIFCLC4NIFCLC3NIFCLC2NIFCLC1NIFCLC4PIF

Legend: — = Unimplemented.

TABLE 3-26: MAIN INTERRUPT ENABLE REGISTERS

RegisterAddressBit 15Bit14Bit 13Bit 12Bit 11Bit 10Bit 9Bit 8Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
IEC0820hINT1IENVMIIEECCSBEIEU1TXIEU1RXIESPI1TXIESPI1RXIEDMA1IECCT1IECCP1IEDMA0IECNBIECNAIET1IEINT0IE
IEC1822hC1RXIESPI2TXIESPI2RXIEU2TXIEU2RXIEINT3IEC1IECCT2IECCP2IEDMA4IEDMA3IEINT2IECNCIEDMA2IEMI2C1IESI2C1IE
IEC2824hCCT6IECCP8IEDMTIECCT5IECCP5IECCT4IECCP4IEMI2C2IESI2C2IECCT3IECCP3IEDMA5IE
IEC3826hPTGSTEPIEJTAGIEICDIEC1TXIECRCIEU2EIEU1EIEQE11IE
IEC4828hCMP1IECNEIECNDIEPWM4IEPWM3IEPWM2IEPWM1IEI2C2BCIEI2C1BCIE
IEC582AhADCAN4IEADCAN3IEADCAN2IEADCAN1IEADCAN0IEADCIESENT2EIESENT2IESENT1EIESENT1IEPTG3IEPTG2IEPTG1IEPTG0IEPTGWDTIE
IEC682ChADCAN20IEADCAN19IEADCAN18IEADCAN17IEADCAN16IEADCAN15IEADCAN14IEADCAN13IEADCAN12IEADCAN11IEADCAN10IEADCAN9IEADCAN8IEADCAN7IEADCAN6IEADCAN5IE
IEC782EhSPI2GIESPI1GIECLC2PIECLC1PIEADFLTR3IEADFLTR2IEADFLTR1IEADFLTR0IEADCMP3IEADCMP2IEADCMP1IEADCMP0IEADFLTIE
IEC8830hS1SRSTIEMSIFLTIEMSIWFEIEMSIDTIEMSIHIEMSIGIEMSIFIEMSIEIEMSIDIEMSICIEMSIBIEMSIAIEMSIS1IE
IEC9832hS1CLKFIECCT8IECCP8IECCT7IECCP7IES1BRKIE
IEC10834hCLC3PIEPEVTFIEPEVTEIEPEVTDIEPEVTCIEPEVTBIEPEVTAIEADFIFOIE
IEC11 836hU2EVTIEU1EVTIECLC4NIECLC3NIECLC2NIECLC1NIECLC4PIE

Legend: — = Unimplemented.

TABLE 3-27: MAIN INTERRUPT PRIORITY REGISTERS

RegisterAddressBit 15Bit14Bit 13Bit 12Bit 11Bit 10Bit 9Bit 8Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
IPC0840hCNBIP2CNBIP1CNBIP0CNAIP2CNAIP1CNAIP0T1IP2T1IP1T1IP0INT0IP2INT0IP1INT0IP0
IPC1842hCCT1IP2CCT1IP1CCT1IP0CCP1IP2CCP1IP1CCP1IP0DMA0IP2DMA0IP1DMA0IP0
IPC2844hU1RXIP2U1RXIP1U1RXIP0SPI1TXIP2SPI1TXIP1SPI1TXIP0SPI1RXIP2SPI1RXIP1SPI1RXIP0DMA1IP2DMA1IP1DMA1IP0
IPC3846hINT1IP2INT1IP1INT1IP0NVMIIP2NVMIIP1NVMIIP0ECCSBEIP2ECCSBEIP1ECCSBEIP0U1TXIP2U1TXIP1U1TXIP0
IPC4848hCNCIP2CNCIP1CNCIP0DMA2IP2DMA2IP1DMA2IP0MI2C1IP2MI2C1IP1MI2C1IP0SI2C1IP2SI2C1IP1SI2C1IP0
IPC584AhCCP2IP2CCP2IP1CCP2IP0DMA4IP2DMA4IP1DMA4IP0DMA3IP2DMA3IP1DMA3IP20INT2IP2INT2IP1INT2IP0
IPC684ChU2RXIP2U2RXIP1U2RXIP0INT3IP2INT3IP1INT3IP0CAN1IP2CAN1IP1CAN1IP0CCT2IP2CCT2IP1CCT2IP0
IPC784EhC1RXIP2C1RXIP1C1RXIP0SPI2TXIP2SPI2TXIP1SPI2TXIP0SPI2RXIP2SPI2RXIP1SPI2RXIP0U2TXIP2U2TXIP1U2TXIP0
IPC8850hCCP3IP2CCP3IP1CCP3IP0DMA5IP2DMA5IP1DMA5IP0
IPC9852hMI2C2IP2MI2C2IP1MI2C2IP0SI2C2IP2SI2C2IP1SI2C2IP0CCT3IP2CCT3IP1CCT3IP0
IPC10 854hCCP5IP2CCP5IP1CCP5IP0CCT4IP2CCT4IP1CCT4IP0CCP4IP2CCP4IP1CCP4IP0
IPC11856hCCT6IP2CCT6IP1CCT6IP0CCP6IP2CCP6IP1CCP6IP0DMTP2DMTP1DMTP0CCT5IP2CCT5IP1CCT5IP0
IPC12 858hCRCIP2CRCIP1CRCIP0U2EIP2U2EIP1U2EIP0U1EIP2U1EIP1U1EIP0QE1IP2QE1IP1QE1IP0
IPC1385AhC1TXIP2C1TXIP1C1TXIP0
IPC1485Ch
IPC1585EhPTGSTEPIP2PTGSTEPIP1PTGSTEPIP0JTAGIP2JTAGIP1JTAGIP0ICDIP2ICDIP1ICDIP0
IPC16 860hPWM1IP2PWM1IP1PWM1IP0I2C2BCIP2I2C2BCIP1I2C2BCIP0I2C1BCIP2I2C19CIP1I2C1BCIP0
IPC17 862hPWM4IP2PWM4IP1PWM4IP0PWM3IP2PWM3IP1PWM3IP0PWM2IP2PWM2IP1PWM2IP0
IPC18 864hCNDIP2CNDIP1CNDIP0
IPC19 866hCMP1IP2CMP1IP1CMP1IP0CNEIP2CNEIP1CNEIP0
IPC20 868hPTG1IP2PTG1IP1PTG1IP0PTG0IP2PTG0IP1PTG0IP0PTGWDTIP2PTGWDTIP1PTGWDTIP0
IPC2186AhSENT1EIP2SENT1EIP1SENT1EIP0SENT1IP2SENT1IP1SENT1IP0PTG3IP2PTG3IP1PTG3IP0PTG2IP2PTG2IP1PTG2IP0
IPC2286ChADCAN0IP2ADCAN0IP1ADCAN0IP0ADCIP2ADCIP1ADCIP0SENT2EIP2SENT2EIP1SENT2EIP0SENT2IP2SENT2IP1SENT2IP0
IPC2386EhADCAN4IP2ADCAN4IP1ADCAN4IP0ADCAN3IP2ADCAN3IP1ADCAN3IP0ADCAN2IP2ADCAN2IP1ADCAN2IP0ADCAN1IP2ADCAN1IP1ADCAN1IP0
IPC24 870hADCAN8IP2ADCAN8IP1ADCAN8IP0ADCAN7IP2ADCAN7IP1ADCAN7IP0ADCAN6IP2ADCAN6IP1ADCAN6IP0ADCAN5IP2ADCAN5IP1ADCAN5IP0
IPC25 872hADCAN12IP2ADCAN12IP1ADCAN12IP0ADCAN11IP2ADCAN11IP1ADCAN11IP0ADCAN10IP2ADCAN10IP1ADCAN10IP0ADCAN8IP2ADCAN9IP1ADCAN9IP0
IPC26 874hADCAN16IP2ADCAN16IP2ADCAN16IP2ADCAN15IP2ADCAN15IP1ADCAN15IP0ADCAN14IP2ADCAN14IP1ADCAN14IP0ADCAN13IP2ADCAN13IP1ADCAN13IP0
IPC27 876hADCAN20IP2ADCAN20IP1ADCAN20IP0ADCAN19IP2ADCAN19IP1ADCAN19IP0ADCAN18IP2ADCAN18IP1ADCAN18IP0ADCAN17IP2ADCAN17IP1ADCAN17IP0
IPC28 878hADFLTIP2ADFLTIP1ADFLTIP0
IPC2987AhADCMP3IP2ADCMP3IP1ADCMP3IP0ADCMP2IP2ADCMP2IP1ADCMP2IP0ADCMP1IP2ADCMP1IP1ADCMP1IP0ADCMP0IP2ADCMP0IP1ADCMP0IP0
IPC3087ChADFLTR3IP2ADFLTR3IP1ADFLTR3IP0ADFLTR2IP2ADFLTR2IP1ADFLTR2IP0ADFLTR1IP2ADFLTR1IP1ADFLTR1IP0ADFLTR0IP2ADFLTR0IP1ADFLTR0IP0
IPC3187EhSPI2GIP0SPI2GIP1SPI2GIP0SPI1GIP2SPI1GIP1SPI1GIP0CLC2PIP2CLC2PIP1CLC2PIP0CLC1PIP2CLC1PIP1CLC1PIP0
IPC32 880hMSIBIP2MSIBIP1MSIBIP0MSIAIP2MSIAIP1MSIAIP0MSIS1IP2MSIS1IP1MSIS1IP0
IPC33 882hMSIFIP2MSIFIP1MSIFIP0MSIEIP2MSIEIP1MSIEIP0MSIDIP2MSIDIP1MSIDIP0MSICIP2MSICIP1MSICIP0
IPC34 884hMSIWFEIP2MSIWFEIP1MSIWFEIP0MSIDITIP2MSIDITIP1MSIDITIP0MSIHIP2MSIHIP1MSIHIP0MSIGIP2MSIGIP1MSIGIP0
IPC35586hS1SRSTIP2S1SRSTIP1S1SRSTIP0MSIFLTIP2MSIFLTIP1MSIFLTIP0
IPC36 888hS1BRKIP2S1BRKIP1S1BRKIP0
IPC3788AhCCT7IP2CCT7IP1CCT7IP0CCPTIP2CCPTIP1CCPTIP0
IPC3888ChCCT8IP2CCT8IP1CCT8IP0CCP8IP2CCP8IP1CCP8IP0
IPC3988EhS1CLKFIP2S1CLKFIP1S1CLKFIP0
IPC40890h
IPC41592h
IPC42 894hPEVTCIP2PEVTCIP1PEVTCIP0PEVTBIP2PEVTBIP1PEVTBIP0PEVTAIP2PEVTAIP1PEVTAIP0ADFIFOIP2ADFIFOIP1ADFIFOIP0
IPC43 896hCLC3PIP2CLC3PIP1CLC3PIP0PEVTFIP2PEVTFIP1PEVTFIP0PEVTEIP2PEVTEIP1PEVTEIP0PEVTDIP2PEVTDIP1PEVTDIP0
IPC44 898hCLC3NIP2CLC3NIP1CLC3NIP0CLC2NIP2CLC2NIP1CLC2NIP0CLC1NIP2CLC1NIP1CLC1NIP0CLC4IPIP2CLC4IPIP1CLC4IPIP0
IPC4589AhCLC4NIP2CLC4NIP1CLC4NIP0
IPC4689Ch
IPC4789EhU2EVTP2U2EVTP1U2EVTP0U1EVTP2U1EVTP1U1EVTP0

Legend: — = Unimplemented.

3.5.3 INTERRUPT RESOURCES

Many useful resources are provided on the main product page of the Microchip website for the devices listed in this data sheet. This product page contains the latest updates and additional information.

3.5.3.1 Key Resources

  • "Interrupts" (www.microchip.com/DS70000600)
  • Code Samples
  • Application Notes
  • Software Libraries
  • Webinars
  • All Related "dsPIC33/PIC24 Family Reference Manual" Sections
  • Development Tools

3.5.4 INTERRUPT CONTROL AND STATUS REGISTERS

The dsPIC33CH128MP508 family devices implement the following registers for the interrupt controller:

  • INTCON1
  • INTCON2
  • INTCON3
  • INTCON4
    • I N T T R E G

3.5.4.1 INTCON1 through INTCON4

Global interrupt control functions are controlled from INTCON1, INTCON2, INTCON3 and INTCON4.

INTCON1 contains the Interrupt Nesting Disable bit (NSTDIS), as well as the control and status flags for the processor trap sources.

The INTCON2 register controls external interrupt request signal behavior, contains the Global Interrupt Enable bit (GIE) and the Alternate Interrupt Vector Table Enable bit (AIVTEN).

INTCON3 contains the status flags for the Auxiliary PLL and DO stack overflow status trap sources.

The INTCON4 register contains the Software Generated Hard Trap Status bit (SGHT).

3.5.4.2 IFSx

The IFSx registers maintain all of the interrupt request flags. Each source of interrupt has a status bit, which is set by the respective peripherals or external signal and is cleared via software.

3.5.4.3 IECx

The IECx registers maintain all of the interrupt enable bits. These control bits are used to individually enable interrupts from the peripherals or external signals.

3.5.4.4 IPCx

The IPCx registers are used to set the Interrupt Priority Level (IPL) for each source of interrupt. Each user interrupt source can be assigned to one of seven priority levels.

3.5.4.5 INTTREG

The INTTREG register contains the associated interrupt vector number and the new CPU Interrupt Priority Level, which are latched into the Vector Number (VECNUM[7:0]) and Interrupt Level bits (ILR[3:0]) fields in the INTTREG register. The new Interrupt Priority Level is the priority of the pending interrupt.

The interrupt sources are assigned to the IFSx, IECx and IPCx registers in the same sequence as they are listed in Table3-24. For example, INT0 (External Interrupt 0) is shown as having Vector Number 8 and a natural order priority of 0. Thus, the INT0IF bit is found in IFS0[0], the INT0IE bit in IEC0[0] and the INT0IP[2:0] bits in the first position of IPC0 (IPC0[2:0]).

3.5.4.6 Status/Control Registers

Although these registers are not specifically part of the interrupt control hardware, two of the CPU Control registers contain bits that control interrupt functionality. For more information on these registers, refer to "Enhanced CPU" (www.microchip.com/DS70005158).

- The CPU STATUS Register, SR, contains the IPL[2:0] bits (SR[7:5]). These bits indicate the current CPU Interrupt Priority Level. The user software can change the current CPU Interrupt Priority Level by writing to the IPLx bits.

- The CORCON register contains the IPL3 bit, which together with IPL[2:0], also indicates the current CPU priority level. IPL3 is a read-only bit so that trap events cannot be masked by the user software.

All Interrupt registers are described in Register 3-21 through Register 3-25 in the following pages.

3.5.4.7 Cross Core Interrupts

There are three interrupts that can occur in the Main core based on the Secondary events:

- S1RSTIF is a Client Reset interrupt which gets set in the Main if the Secondary gets a Reset. This interrupt is enabled only when the SRTSIE bit (MSI1CON[7]) is set.

- S1CLKIF is a Main interrupt which gets set if the Secondary core loses its system clock.

- S1BRKIF is the Client Break interrupt. This interrupt gets set in the Main if the Secondary stops at a breakpoint (valid only when the Secondary is being debugged).

Cross core breakpoints are also available to assist in dual-core debugging scenarios. Please reference AN2721, Getting Started with Dual Core for instructions on how to configure a cross-core breakpoint.

3.5.5 INTERRUPT STATUS/CONTROL REGISTERS

REGISTER 3-19: SR: CPU STATUS REGISTER (1)

R/W-0 R/W-0 R/W-0 R/W-0 R/C-0 R/C-0 R-0 R/W-0
OAOBSASBOABSABDADC
bit 15 bit 8
R/W-0^(3) R/W-0^(3) R/W-0^(3) R-0 R/W-0R/W-0 R/W-0 R/W-0
IPL2^(2) IPL1^(2) IPL0^(2) RANOVZC
bit 7 bit 0

Legend: C = Clearable bit

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 7-5 IPL[2:0]: CPU Interrupt Priority Level Status bits ^(2,3)

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)

Note 1: For complete register details, see Register 3-1.

2: The IPL[2:0] bits are concatenated with the IPL[3] bit (CORCON[3]) to form the CPU Interrupt Priority Level. The value in parentheses indicates the IPL, if IPL[3] = 1. User interrupts are disabled when IPL[3] = 1.

3: The IPL[2:0] Status bits are read-only when the NSTDIS bit (INTCON1[15]) = 1.

REGISTER 3-20: CORCON: CORE CONTROL REGISTER (1)

R/W-0 U-0 R/W-0 R/W-0 R/W-0 R-0 R-0 R-0
VARUS1US0EDTDL2DL1DL0
bit 15 bit 8
R/W-0R/W-0R/W-1R/W-0R/C-0R-0R/W-0R/W-0
SATASATBSATDWACCSAT IPL3^(2) SFARNDIF
bit 7 bit 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 15 VAR: Variable Exception Processing Latency Control bit

1 = Variable exception processing is enabled
0 = Fixed exception processing is enabled

bit 3 IPL3: CPU Interrupt Priority Level Status bit 3 (2)

1 = CPU Interrupt Priority Level is greater than 7
0 = CPU Interrupt Priority Level is 7 or less

Note 1: For complete register details, see Register 3-2.

2: The IPL3 bit is concatenated with the IPL[2:0] bits (SR[7:5]) to form the CPU Interrupt Priority Level.

REGISTER 3-21: INTCON1: INTERRUPT CONTROL REGISTER 1

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
NSTDIS OVAERR OVBERR COVAERR COVBERROVATE OVBTE COVTE
bit 15 bit 8
R/W-0R/W-0U-0R/W-0R/W-0R/W-0R/W-0U-0
SFTACERRDIV0ERRMATHERRADDRERRSTKERROSCFAIL
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15 NSTDIS: Interrupt Nesting Disable bit

1 = Interrupt nesting is disabled
0 = Interrupt nesting is enabled

bit 14 OVAERR: Accumulator A Overflow Trap Flag bit

1 = Trap was caused by an overflow of Accumulator A
0 = Trap was not caused by an overflow of Accumulator A

bit 13 OVBERR: Accumulator B Overflow Trap Flag bit

1 = Trap was caused by an overflow of Accumulator B
0 = Trap was not caused by an overflow of Accumulator B

bit 12 COVAERR: Accumulator A Catastrophic Overflow Trap Flag bit

1 = Trap was caused by a catastrophic overflow of Accumulator A
0 = Trap was not caused by a catastrophic overflow of Accumulator A

bit 11 COVBERR: Accumulator B Catastrophic Overflow Trap Flag bit

1 = Trap was caused by a catastrophic overflow of Accumulator B
0 = Trap was not caused by a catastrophic overflow of Accumulator B

bit 10 OVATE: Accumulator A Overflow Trap Enable bit

1 = Trap overflow of Accumulator A
0 = Trap is disabled

bit 9 OVBTE: Accumulator B Overflow Trap Enable bit

1 = Trap overflow of Accumulator B
0 = Trap is disabled

bit 8 COVTE: Catastrophic Overflow Trap Enable bit

1 = Trap catastrophic overflow of Accumulator A or B is enabled
0 = Trap is disabled

bit 7 SFTACERR: Shift Accumulator Error Status bit

1 = Math error trap was caused by an invalid accumulator shift
0 = Math error trap was not caused by an invalid accumulator shift

bit 6 DIV0ERR: Divide-by-Zero Error Status bit

1 = Math error trap was caused by a divide-by-zero
0 = Math error trap was not caused by a divide-by-zero

bit 5 Unimplemented: Read as '0'

bit 4 MATHERR: Math Error Status bit

1 = Math error trap has occurred
0 = Math error trap has not occurred

bit 3 ADDRERR: Address Error Trap Status bit

1 = Address error trap has occurred
0 = Address error trap has not occurred

REGISTER 3-21: INTCON1: INTERRUPT CONTROL REGISTER 1 (CONTINUED)

bit 2 STKERR: Stack Error Trap Status bit

1 = Stack error trap has occurred
0 = Stack error trap has not occurred

bit 1 OSCFAIL: Oscillator Failure Trap Status bit

1 = Oscillator failure trap has occurred
0 = Oscillator failure trap has not occurred

bit 0 Unimplemented: Read as '0'

REGISTER 3-22: INTCON2: INTERRUPT CONTROL REGISTER 2

R/W-1 R/W-0 R/W-0 U-0 U-0 U-0 U-0 R/W-0
GIE DISI $WTRAPAIVTEN
bit 15 bit 8
U-0U-0U-0U-0R/W-0R/W-0R/W-0R/W-0
INT3EPINT2EPINT1EPINT0EP
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15 GIE: Global Interrupt Enable bit

1 = Interrupts and associated IE bits are enabled 0 = Interrupts are disabled, but traps are still enabled

bit 14 DISI: DISI Instruction Status bit

1 = DISI instruction is active 0 = DISI instruction is not active

bit 13 SWTRAP: Software Trap Status bit

1 = Software trap is enabled 0 = Software trap is disabled

bit 12-9 Unimplemented: Read as '0'

bit 8 AIVTEN: Alternate Interrupt Vector Table Enable bit 1 = Uses Alternate Interrupt Vector Table 0 = Uses standard Interrupt Vector Table

bit 7-4 Unimplemented: Read as '0'

bit 3 INT3EP: External Interrupt 3 Edge Detect Polarity Select bit 1 = Interrupt on negative edge 0 = Interrupt on positive edge

bit 2 INT2EP: External Interrupt 2 Edge Detect Polarity Select bit 1 = Interrupt on negative edge 0 = Interrupt on positive edge

bit 1 INT1EP: External Interrupt 1 Edge Detect Polarity Select bit 1 = Interrupt on negative edge 0 = Interrupt on positive edge

bit 0 INT0EP: External Interrupt 0 Edge Detect Polarity Select bit 1 = Interrupt on negative edge 0 = Interrupt on positive edge

REGISTER 3-23: INTCON3: INTERRUPT CONTROL REGISTER 3

U-0 U-0 U-0 U-0 U-0 R/W-0 R/W-0
CANNAE
bit 15 bit 8
U-0U-0R/W-0R/W-0U-0U-0U-0R/W-0
DAEDOOVRAPLL
bit 7 bit 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-10 Unimplemented: Read as '0'

bit 9 CAN: CAN Address Error Soft Trap Status bit

1 = CAN address error soft trap has occurred

0 = CAN address error soft trap has not occurred

bit 8 NAE: NVM Address Error Soft Trap Status bit

1 = NVM address error soft trap has occurred

0 = NVM address error soft trap has not occurred

bit 7-6 Unimplemented: Read as '0'

bit 5 DAE: DMA Address Error (Soft) Trap Status bit

1 = DMA address error trap has occurred

0 = DMA address error trap has not occurred

bit 4 DOOVR: DO Stack Overflow Soft Trap Status bit

1 = DO stack overflow soft trap has occurred

0 = DO stack overflow soft trap has not occurred

bit 3-1 Unimplemented: Read as '0'

bit 0 APLL: Auxiliary PLL Loss of Lock Soft Trap Status bit

1 = APLL lock soft trap has occurred

0 = APLL lock soft trap has not occurred

REGISTER 3-24: INTCON4: INTERRUPT CONTROL REGISTER 4

R = Readable bitW = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 15-2 Unimplemented: Read as '0'

bit 1 ECCDBE: ECC Double-Bit Error Trap bit

1 = ECC double-bit error trap has occurred
0 = ECC double-bit error trap has not occurred

bit 0 SGHT: Software Generated Hard Trap Status bit

1 = Software generated hard trap has occurred
0 = Software generated hard trap has not occurred

REGISTER 3-25: INTTREG: INTERRUPT CONTROL AND STATUS REGISTER

U-0 U-0 R/W-0 U-0 R-0 R-0 R-0 R-0
VHOLDILR3ILR2ILR1ILR0
bit 15 bit 8
R-0 R-0R-0R-0 R-0 R-0 R-0 R-0
VECNUM[7:0]
bit 7

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-14 Unimplemented: Read as '0'

bit 13 VHOLD: Vector Number Capture Enable bit

1 = VECNUM[7:0] bits read current value of vector number encoding tree (i.e., highest priority pending interrupt)
0 = Vector number latched into VECNUM[7:0] at Interrupt Acknowledge and retained until next IACK 

bit 12 Unimplemented: Read as '0'

bit 11-8 ILR[3:0]: New CPU Interrupt Priority Level bits

1111 = CPU Interrupt Priority Level is 15 
... 
0001 = CPU Interrupt Priority Level is 1 
0000 = CPU Interrupt Priority Level is 0 

bit 7-0 VECNUM[7:0]: Vector Number of Pending Interrupt bits

11111111 = 255, Reserved; do not use 
... 
00001001 = 9, IC1 - Input Capture 1 
00001000 = 8, INT0 - External Interrupt 0 
00000111 = 7, Reserved; do not use 
00000110 = 6, Generic soft error trap 
00000101 = 5, Reserved; do not use 
00000100 = 4, Math error trap 
00000011 = 3, Stack error trap 
00000010 = 2, Generic hard trap 
00000001 = 1, Address error trap 
00000000 = 0, Oscillator fail trap 

3.6 Main I/O Ports

Note 1: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive reference source. To complement the information in this data sheet, refer to "I/O Ports with Edge Detect" (www.microchip.com/DS70005322), which is available from the Microchip website (www.microchip.com).

2: The I/O ports are shared by the Main core and Secondary core. All input goes to both the Main and Secondary. The I/O ownership is defined by the Configuration bits.

3: The TMS pin function may be active multiple times during ICSP device erase, programming and debugging. When the TMS function is active, the integrated pull-up resistor will pull the pin to VDD. Proper care should be taken if there are sensitive circuits connected on the TMS pin during programming/erase and debugging.

Many of the device pins are shared among the peripherals and the Parallel I/O ports. All I/O input ports feature Schmitt Trigger inputs for improved noise immunity. The Main and Secondary have the same number of I/O ports and are shared. The Main PORT registers are located in the Main SFR and the Secondary PORT registers are located in the Secondary SFR, respectively.

Some of the key features of the I/O ports are:

  • Individual Output Pin Open-Drain Enable/Disable
  • Individual Input Pin Weak Pull-up and Pull-Down
  • Monitor Selective Inputs and Generate Interrupt when Change in Pin State is Detected
    • Operation during Sleep and Idle modes

Note: The output functionality of the ports is defined by the Configuration registers, FCFGPRA0 to FCFGPRE0. When these Configuration bits are maintained as '1', the Main owns the pin (only the output function); when the bits are '0', the ownership of that specific pin belongs to the Secondary. The input function of the I/O is valid for both Main and Secondary. The Configuration registers, FCFGPRA0 to FCFGPRE0, do not have any control over the input function.

3.6.1 PARALLEL I/O (PIO) PORTS

All port pins have 12 registers directly associated with their operation as digital I/Os. The Data Direction register (TRISx) determines whether the pin is an input or an output. If the data direction bit is a '1', then the pin is an input.

All port pins are defined as inputs after a Reset. Reads from the latch (LATx), read the latch. Writes to the latch, write the latch. Reads from the port (PORTx), read the port pins, while writes to the port pins, write the latch. Any bit and its associated data and control registers that are not valid for a particular device are disabled. This means the corresponding LATx and TRISx registers, and the port pin are read as zeros.

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. Table 3-28 shows the pin availability. Table 3-29 shows the 5V input tolerant pins across this device.

TABLE 3-28: PIN AND ANSELx AVAILABILITY

Device Rx15 Rx14 Rx13 Rx12Rx11Rx10Rx9 Rx8Rx7Rx6 Rx5Rx4 Rx3Rx2 Rx1 Rx0
PORTA
dsPIC33XXXMP508/208XXXXX
dsPIC33XXXMP506/206XXXXX
dsPIC33XXXMP505/205XXXXX
dsPIC33XXXMP503/203XXXXX
dsPIC33XXXMP502/202XXXXX
ANSELAXXXXX
PORTB
dsPIC33XXXMP508/208XXXXXXXXXXXXXXX
dsPIC33XXXMP506/206XXXXXXXXXXXXXXX
dsPIC33XXXMP505/205XXXXXXXXXXXXXXX
dsPIC33XXXMP503/203XXXXXXXXXXXXXXX
dsPIC33XXXMP502/202XXXXXXXXXXXXXXX
ANSELBXXXXXX
PORTC
dsPIC33XXXMP508/208XXXXXXXXXXXXXXX
dsPIC33XXXMP506/206XXXXXXXXXXXXXX
dsPIC33XXXMP505/205XXXXXXXXXXXXX
dsPIC33XXXMP503/203XXXXX
dsPIC33XXXMP502/202
ANSELCXXXX
PORTD
dsPIC33XXXMP508/208XXXXXXXXXXXXXXX
dsPIC33XXXMP506/206XXXXXXXXXXX-XXX
dsPIC33XXXMP505/205XXXX
dsPIC33XXXMP503/203
dsPIC33XXXMP502/202
ANSELDX
PORTE
dsPIC33XXXMP508/208XXXXXXXXXXXXXXX
dsPIC33XXXMP506/206
dsPIC33XXXMP505/205
dsPIC33XXXMP503/203
dsPIC33XXXMP502/202

TABLE 3-29: 5V INPUT TOLERANT PORTS

PORTARA4RA3RA2RA1RA0
PORTBRB15RB14RB13RB12RB11RB10RB9RB8RB7RB6RB5RB4RB3RB2RB1RB0
PORTCRC15RC14RC13RC12RC11RC10RC9RC8RC7RC6RC5RC4RC3RC2RC1RC0
PORTDRD15RD14RD13RD12RD11RD10RD9RD8RD7RD6RD5RD4RD3RD2RD1RD0
PORTERE15RE14RE13RE12RE11RE10RE9RE8RE7RE6RE5RE4RE3RE2RE1RE0

Legend: Shaded pins are up to 5.5 VDC input tolerant.

FIGURE 3-19: BLOCK DIAGRAM OF A TYPICAL SHARED PORT STRUCTURE
Microchip dsPIC33CH64MP208 - PARALLEL I/O (PIO) PORTS - 1

flowchart
graph TD
    subgraph Peripheral Module
        A["Peripheral Input Data"] --> B["Peripheral Module Enable"]
        B --> C["Peripheral Output Enable"]
        C --> D["Peripheral Output Data"]
    end

    subgraph Output Multiplexers
        E["1"] --> F["0"]
        G["1"] --> H["0"]
        I["0"] --> J["Output Enable"]
        K["1"] --> L["0"]
        M["I/O Pin"] --> N["I/O Pin"]
    end

    subgraph PIO Module
        O["TRISx Latch"] --> P["D Q"]
        P --> Q["Data Latch"]
        Q --> R["WR LATx + WR PORTx"]
        S["Data Bus"] --> T["TRISx"]
        U["WR TRISx"] --> V["CK"]
        W["Read TRISx"] --> X["Data Bus"]
        Y["Read LATx"] --> Z["Data Bus"]
        AA["Read PORTx"] --> AB["Data Bus"]
    end

    F --> J
    H --> L
    N --> M
    O --> P
    Q --> R
    R --> AA
    style Peripheral Module fill:#f9f,stroke:#333
    style Output Multiplexers fill:#ccf,stroke:#333

3.6.1.1 Open-Drain Configuration

In addition to the PORTx, LATx and TRISx registers for data control, port pins can also be individually configured for either digital or open-drain output. This is controlled by the Open-Drain Enable for PORTx register, ODCx, associated with each port. Setting any of the bits configures the corresponding pin to act as an open-drain output.

The open-drain feature allows the generation of outputs, other than VDD, by using external pull-up resistors. The maximum open-drain voltage allowed on any pin is the same as the maximum VIH specification for that particular pin.

3.6.2 CONFIGURING ANALOG AND DIGITAL PORT PINS

The ANSELx registers control the operation of the analog port pins. The port pins that are to function as analog inputs or outputs must have their corresponding ANSELx and TRISx bits set. In order to use port pins for I/O functionality with digital modules, such as timers, UARTs, etc., the corresponding ANSELx bit must be cleared.

The ANSELx registers have a default value of 0xFFFF; therefore, all pins that share analog functions are analog (not digital) by default.

Pins with analog functions affected by the ANSELx registers are listed with a buffer type of analog in the Pinout I/O Descriptions (see Table 1-1).

If the TRISx bit is cleared (output) while the ANSELx bit is set, the digital output level (VOH or VOL) is converted by an analog peripheral, such as the ADC module or comparator module.

When the PORTx register is read, all pins configured as analog input channels are read as cleared (a low level).

Pins configured as digital inputs do not convert an analog input. Analog levels on any pin, defined as a digital input (including the ANx pins), can cause the input buffer to consume current that exceeds the device specifications.

3.6.2.1 I/O Port Write/Read Timing

One instruction cycle is required between a port direction change or port write operation and a read operation of the same port. Typically, this instruction would be a NOP.

The following registers are in the PORT module:

  • Register 3-26: ANSELx (one per port)
  • Register 3-27: TRISx (one per port)
  • Register 3-28: PORTx (one per port)
  • Register 3-29: LATx (one per port)
  • Register 3-30: ODCx (one per port)
  • Register 3-31: CNPUx (one per port)
  • Register 3-32: CNPDx (one per port)
  • Register 3-33: CNCONx (one per port – optional)
  • Register 3-34: CNEN0x (one per port)
  • Register 3-35: CNSTATx (one per port – optional)
  • Register 3-36: CNEN1x (one per port)
  • Register 3-37: CNFx (one per port)

3.6.3 MAIN PORT CONTROL REGISTERS

REGISTER 3-26: ANSELx: ANALOG SELECT FOR PORTx REGISTER

R/W-1 R/W-1 R/W-1 R/W-1 R/W-1 R/W-1 R/W-1 R/W-1
ANSELx[15:8]
bit 15 bit 8
R/W-1 R/W-1 R/W-1 R/W-1 R/W-1 R/W-1 R/W-1 R/W-1
ANSELx[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR

'1' = Bit is set

'0' = Bit is cleared

x = Bit is unknown

bit 15-0 ANSELx[15:0]: Analog Select for PORTx bits

1 = Analog input is enabled and digital input is disabled on the PORTx[n] pin
0 = Analog input is disabled and digital input is enabled on the PORTx[n] pin

REGISTER 3-27: TRISx: OUTPUT ENABLE FOR PORTx REGISTER

R/W-1 R/W-1 R/W-1 R/W-1 R/W-1 R/W-1 R/W-1 R/W-1
TRISx[15:8]
bit 15 bit 8
R/W-1 R/W-1 R/W-1 R/W-1 R/W-1 R/W-1 R/W-1 R/W-1
TRISx[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-0 TRISx[15:0]: Output Enable for PORTx bits

1 = LATx[n] is not driven on the PORTx[n] pin
0 = LATx[n] is driven on the PORTx[n] pin

REGISTER 3-28: PORTx: INPUT DATA FOR PORTx REGISTER

R/W-1R/W-1R/W-1R/W-1R/W-1R/W-1R/W-1R/W-1
PORTx[15:8]
bit 15 bit 8
R/W-1R/W-1R/W-1R/W-1R/W-1R/W-1R/W-1R/W-1
PORTx[7:0]
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-0 PORTx[15:0]: PORTx Data Input Value bits

REGISTER 3-29: LATx: OUTPUT DATA FOR PORTx REGISTER

R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x
LATx[15:8]
bit 15 bit 8
R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x
LATx[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 15-0 LATx[15:0]: PORTx Data Output Value bits

REGISTER 3-30: ODCx: OPEN-DRAIN ENABLE FOR PORTx REGISTER

R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
ODCx[15:8]
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
ODCx[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 15-0

ODCx[15:0]: PORTx Open-Drain Enable bits

1 = Open-drain is enabled on the PORTx pin

0 = Open-drain is disabled on the PORTx pin

REGISTER 3-31: CNPUx: CHANGE NOTIFICATION PULL-UP ENABLE FOR PORTx REGISTER

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CNPUx[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CNPUx[7:0]
bit 7bit0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-0 CNPUx[15:0]: Change Notification Pull-up Enable for PORTx bits

1 = The pull-up for PORTx[n] is enabled – takes precedence over the pull-down selection
0 = The pull-up for PORTx[n] is disabled

REGISTER 3-32: CNPDx: CHANGE NOTIFICATION PULL-DOWN ENABLE FOR PORTx REGISTER

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CNPDx[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CNPDx[7:0]
bit 7bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-0 CNPDx[15:0]: Change Notification Pull-Down Enable for PORTx bits

1 = The pull-down for PORTx[n] is enabled (if the pull-up for PORTx[n] is not enabled)
0 = The pull-down for PORTx[n] is disabled

REGISTER 3-33: CNCONx: CHANGE NOTIFICATION CONTROL FOR PORTx REGISTER

R/W-0 U-0 U-0 U-0 R/W-0 U-0 U-0 U-0
ONCNSTYLE
bit 15 bit 8
R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15 ON: Change Notification (CN) Control for PORTx On bit

1 = CN is enabled
0 = CN is disabled

bit 14-12 Unimplemented: Read as '0'

bit 11 CNSTYLE: Change Notification Style Selection bit

1 = Edge style (detects edge transitions, CNFx[15:0] bits are used for a Change Notification event)
0 = Mismatch style (detects change from last port read, CNSTATx[15:0] bits are used for a Change Notification event)

bit 10-0 Unimplemented: Read as '0'

REGISTER 3-34: CNEN0x: INTERRUPT CHANGE NOTIFICATION ENABLE FOR PORTx REGISTER

R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
CNEN0x[15:8]
bit 15bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
CNEN0x[7:0]
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 cleared x = Bit is unknown

bit 15-0 CNEN0x[15:0]: Interrupt Change Notification Enable for PORTx bits

1 = Interrupt-on-change (from the last read value) is enabled for PORTx[n]
0 = Interrupt-on-change is disabled for PORTx[n]

REGISTER 3-35: CNSTATx: INTERRUPT CHANGE NOTIFICATION STATUS FOR PORTx REGISTER

R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
CNSTATx[15:8]
bit 15 bit 8
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
CNSTATx[7:0]
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-0 CNSTATx[15:0]: Interrupt Change Notification Status for PORTx bits

When CNSTYLE (CNCONx[11]) = 0:

1 = Change occurred on PORTx[n] since last read of PORTx[n]
0 = Change did not occur on PORTx[n] since last read of PORTx[n]

REGISTER 3-36: CNEN1x: INTERRUPT CHANGE NOTIFICATION EDGE SELECT FOR PORTx REGISTER

R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
CNEN1x[15:8]
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
CNEN1x[7:0]
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-0 CNEN1x[15:0]: Interrupt Change Notification Edge Select for PORTx bits

REGISTER 3-37: CNFx: INTERRUPT CHANGE NOTIFICATION FLAG FOR PORTx REGISTER

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CNFx[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CNFx[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR

'1' = Bit is set

'0' = Bit is cleared

x = Bit is unknown

bit 15-CNFX[15:0]: Interrupt Change Notification Flag for PORTx bits

When CNSTYLE (CNCONx[11]) = 1:

1 = An enabled edge event occurred on the PORTx[n] pin

0 = An enabled edge event did not occur on the PORTx[n] pin

3.6.4 INPUT CHANGE NOTIFICATION (ICN)

The Input Change Notification function of the I/O ports allows the dsPIC33CH128MP508 family devices to generate interrupt requests to the processor in response to a Change-of-State (COS) on selected input pins. This feature can detect input Change-of-States, even in Sleep mode, when the clocks are disabled. Every I/O port pin can be selected (enabled) for generating an interrupt request on a Change-of-State. Five control registers are associated with the Change Notification (CN) functionality of each I/O port. To enable the Change Notification feature for the port, the ON bit (CNCONx[15]) must be set.

The CNEN0x and CNEN1x registers contain the CN interrupt enable control bits for each of the input pins. The setting of these bits enables a CN interrupt for the corresponding pins. Also, these bits, in combination with the CNSTYLE bit (CNCONx[11]), define a type of transition when the interrupt is generated. Possible CN event options are listed in Table 3-30.

TABLE 3-30: CHANGE NOTIFICATION EVENT OPTIONS

CNSTYLE Bit (CNCONx[11])CNEN1x BitCNEN0x BitChange Notification Event Description
0 Does not matter0 Disabled
0 Does not matter1 Detects a mismatch between the last read state and the current state of the pin
100Disabled
101Detects a positive transition only (from ‘0’ to ‘1’)
110Detects a negative transition only (from ‘1’ to ‘0’)
111Detects both positive and negative transitions

The CNSTATx register indicates whether a change occurred on the corresponding pin since the last read of the PORTx bit. In addition to the CNSTATx register, the CNFx register is implemented for each port. This register contains flags for Change Notification events. These flags are set if the valid transition edge, selected in the CNEN0x and CNEN1x registers, is detected. CNFx stores the occurrence of the event. CNFx bits must be cleared in software to get the next Change Notification interrupt. The CN interrupt is generated only for the I/Os configured as inputs (corresponding TRISx bits must be set).

Note: Pull-ups and pull-downs on Input Change Notification pins should always be disabled when the port pin is configured as a digital output.

3.6.5 PERIPHERAL PIN SELECT (PPS)

A major challenge in general purpose devices is providing the largest possible set of peripheral features, while minimizing the conflict of features on I/O pins. The challenge is even greater on low pin count devices. In an application where more than one peripheral needs to be assigned to a single pin, inconvenient work arounds in application code, or a complete redesign, may be the only option.

Peripheral Pin Select configuration provides an alternative to these choices by enabling peripheral set selection and placement on a wide range of I/O pins. By increasing the pinout options available on a particular device, users can better tailor the device to their entire application, rather than trimming the application to fit the device.

The Peripheral Pin Select configuration feature operates over a fixed subset of digital I/O pins. Users may independently map the input and/or output of most digital peripherals to any one of these I/O pins. Hardware safeguards are included that prevent accidental or spurious changes to the peripheral mapping once it has been established.

3.6.6 AVAILABLE PINS

The number of available pins is dependent on the particular device and its pin count. Pins that support the Peripheral Pin Select feature include the label, "RPn", in their full pin designation, where "n" is the remappable pin number. "RP" is used to designate pins that support both remappable input and output functions.

3.6.7 AVAILABLE PERIPHERALS

The peripherals managed by the Peripheral Pin Select are all digital only peripherals. These include general serial communications (UART and SPI), general purpose timer clock inputs, timer-related peripherals (input capture and output compare) and interrupt-on-change inputs.

In comparison, some digital only peripheral modules are never included in the Peripheral Pin Select feature. This is because the peripheral's function requires special I/O circuitry on a specific port and cannot be easily connected to multiple pins. One example includes I^2C modules. A similar requirement excludes all modules with analog inputs, such as the A/D Converter (ADC)

A key difference between remappable and non-remappable peripherals is that remappable peripherals are not associated with a default I/O pin. The peripheral must always be assigned to a specific I/O pin before it can be used. In contrast, non-remappable peripherals are always available on a default pin, assuming that the peripheral is active and not conflicting with another peripheral.

When a remappable peripheral is active on a given I/O pin, it takes priority over all other digital I/Os and digital communication peripherals associated with the pin. Priority is given regardless of the type of peripheral that is mapped. Remappable peripherals never take priority over any analog functions associated with the pin.

3.6.8 CONTROLLING CONFIGURATION CHANGES

Because peripheral mapping can be changed during run time, some restrictions on peripheral remapping are needed to prevent accidental configuration changes. The dsPIC33CH128MP508 devices have implemented the control register lock sequence.

3.6.8.1 CONTROL REGISTER LOCK

Under normal operation, writes to the RPINRx and RPORx registers are not allowed. Attempted writes will appear to execute normally, but the contents of the registers will remain unchanged. To change these registers, they must be unlocked in hardware. The register lock is controlled by the IOLOCK bit (RPCON[11]). Setting IOLOCK prevents writes to the control registers; clearing IOLOCK allows writes.

To set or clear IOLOCK, the NVMKEY unlock sequence must be executed:

  1. Write 0x55 to NVMKEY.
  2. Write 0xAA to NVMKEY.
  3. Clear (or set) IOLOCK as a single operation.

IOLOCK remains in one state until changed. This allows all of the Peripheral Pin Selects to be configured with a single unlock sequence, followed by an update to all of the control registers. Then, IOLOCK can be set with a second lock sequence.

Note: MPLAB XC16 provides a built-in C language function for unlocking and modifying the RPCON register:
    _builtin_write_RPCON(value);
For more information, see the MPLAB XC16 Help files. 

3.6.9 CONSIDERATIONS FOR PERIPHERAL PIN SELECTION

The ability to control Peripheral Pin Selection introduces several considerations into application design that most users would never think of otherwise. This is particularly true for several common peripherals, which are only available as remappable peripherals.

The main consideration is that the Peripheral Pin Selects are not available on default pins in the device's default (Reset) state. More specifically, because all RPINRx registers reset to '1's and RPORx registers reset to '0's, this means all PPS inputs are tied to Vss, while all PPS outputs are disconnected. This means that before any other application code is executed, the user must initialize the device with the proper peripheral configuration. Because the IOLOCK bit resets in the unlocked state, it is not necessary to execute the unlock sequence after the device has come out of Reset. For application safety, however, it is always better to set IOLOCK and lock the configuration after writing to the control registers.

The NVMKEY unlock sequence must be executed as an Assembly language routine. If the bulk of the application is written in C, or another high-level language, the unlock sequence should be performed by writing in-line assembly or by using the ____builtin_write_RPCON(value) function provided by the compiler.

Choosing the configuration requires a review of all Peripheral Pin Selects and their pin assignments, particularly those that will not be used in the application. In all cases, unused pin-selectable peripherals should be disabled completely. Unused peripherals should have their inputs assigned to an unused RPn pin function. I/O pins with unused RPn functions should be configured with the null peripheral output.

3.6.10 INPUT MAPPING

The inputs of the Peripheral Pin Select options are mapped on the basis of the peripheral. That is, a control register associated with a peripheral dictates the pin it will be mapped to. The RPINRx registers are used to configure peripheral input mapping. Each register contains sets of 8-bit fields, with each set associated with one of the remappable peripherals. Programming a given peripheral's bit field with an appropriate 8-bit index value maps the RPn pin with the corresponding value, or internal signal, to that peripheral. See Table 3-31 for a list of available inputs.

For example, Figure 3-20 illustrates remappable pin selection for the U1RX input.

FIGURE 3-20: REMAPPABLE INPUT FOR U1RX
Microchip dsPIC33CH64MP208 - INPUT MAPPING - 1

flowchart
graph LR
    A["Vss"] --> B["U1RXR[7:0"]]
    C["CMP1"] --> B
    D["RP32"] --> B
    E["..."] --> B
    F["RP181"] --> B
    B --> G["U1RX Input to Peripheral"]
    B --> H["n"]
    B --> I["0"]
    B --> J["1"]
    B --> K["32"]

Note: For input only, Peripheral Pin Select functionality does not have priority over TRISx settings. Therefore, when configuring an RPn pin for input, the corresponding bit in the TRISx register must also be configured for input (set to '1'). Physical connection to a pin can be made through RP32 through RP71. There are internal signals and virtual pins that can be connected to an input. Table 3-31 shows the details of the input assignment.

EXAMPLE 3-2: CONFIGURING UART1 INPUT AND OUTPUT FUNCTIONS

//
**************************
// Unlock Registers
**************************
__builtin_write_RPCON(0x0000);
//**************************
// Configure Input Functions (See Table 3-32)
// Assign U1Rx To Pin RP35
//**************************
U1RXR = 35;
// Assign ULCTS To Pin RP36
//**************************
U1CTSR = 36;
//**************************
// Configure Output Functions (See Table 3-34)
//**************************
// Assign ULTx To Pin RP37
//**************************
RP37 = 1;
//**************************
// Assign ULRTS To Pin RP38
//**************************
RP38 = 2;
//**************************
// Lock Registers
//**************************
__builtin_write_RPCON(0x0800);

Example 3-2 provides a configuration for bidirectional communication with flow control using UART1. The following input and output functions are used:

  • Input Functions: U1RX, U1CTS
    • Output Functions: U1TX, U1RTS

TABLE 3-31: MAIN CORE REMAPPABLE PIN INPUTS

RPINRx[15:8] or RPINRx[7:0]Function Available on Ports
0Vss Internal
1 Host Comparator 1 Internal
2 Client Comparator 1 Internal
3 Client Comparator 2 Internal
4 Client Comparator 3 Internal
5 Client REFCLKO Internal
6 Host PTG Trigger 26 Internal
7 Host PTG Trigger 27 Internal
8Client PWM Event Output CInternal
9Client PWM Event Output DInternal
10Client PWM Event Output EInternal
11Host PWM Event Output CInternal
12Host PWM Event Output DInternal
13Host PWM Event Output EInternal
14-31RP14-RP31Reserved
32RP32Port Pin RB0
33RP33Port Pin RB1
34RP34Port Pin RB2
35RP35Port Pin RB3
36RP36Port Pin RB4
37RP37Port Pin RB5
38RP38Port Pin RB6
39RP39Port Pin RB7
40RP40Port Pin RB8
41RP41Port Pin RB9
42RP42Port Pin RB10
43RP43Port Pin RB11
44RP44Port Pin RB12
45RP45Port Pin RB13
46RP46Port Pin RB14
47RP47Port Pin RB15
48RP48Port Pin RC0
49RP49Port Pin RC1
50RP50Port Pin RC2
51RP51Port Pin RC3
52RP52Port Pin RC4
53RP53Port Pin RC5
54RP54Port Pin RC6
55RP55Port Pin RC7
56RP56Port Pin RC8
57RP57Port Pin RC9
58RP58Port Pin RC10
59RP59Port Pin RC11
RPINRx[15:8] or RPINRx[7:0]FunctionAvailable on Ports
60 RP60 Port Pin RC12
61 RP61 Port Pin RC13
62 RP62 Port Pin RC14
63 RP63 Port Pin RC15
64 RP64 Port Pin RD0
65 RP65 Port Pin RD1
66 RP66 Port Pin RD2
67 RP67 Port Pin RD3
68 RP68 Port Pin RD4
69 RP69 Port Pin RD5
70 RP70 Port Pin RD6
71 RP71 Port Pin RD7
72-167 Reserved Reserved
168 DAC1 pwm_req_on Internal
169 DAC1 pwm_req_off Internal
170 RP170 Secondary Virtual S1RPV0
171 RP171 Secondary Virtual S1RPV1
172 RP172 Secondary Virtual S1RPV2
173 RP173 Secondary Virtual S1RPV3
174 RP174 Secondary Virtual S1RPV4
175 RP175 Secondary Virtual S1RPV5
176 RP176 Main Virtual RPV0
177 RP177 Main Virtual RPV1
178 RP178 Main Virtual RPV2
179 RP179 Main Virtual RPV3
180 RP180 Main Virtual RPV4
181 RP181 Main Virtual RPV5

3.6.11 VIRTUAL CONNECTIONS

The dsPIC33CH128MP508 devices support six Host virtual RPn pins (RP176-RP181) that are identical in functionality to all other RPn pins, with the exception of pinouts. These six pins are internal to the devices and are not connected to a physical device pin.

These pins provide a simple way for inter-peripheral connection without utilizing a physical pin. For example, the output of the analog comparator can be connected to RP176 and the PWM Fault input can be configured for RP176 as well. This configuration allows the analog comparator to trigger PWM Faults without the use of an actual physical pin on the device.

3.6.12 SECONDARY PPS INPUTS TO MAIN CORE PPS

The dsPIC33CH128MP508 Secondary core subsystem PPS has connections to the Main core subsystem virtual PPS (RPV5-RPV0) output blocks. These inputs are mapped as S1RP175, S1RP174, S1RP173, S1RP172, S1RP171 and S1RP170.

The RPn inputs, RP1-RP13, are connected to internal signals from both the Main and Secondary core sub-systems. Additionally, the Main core virtual output PPS blocks (RPV5-RPV0) are connected to the Secondary core PPS circuitry.

There are virtual pins in PPS to share between Main and Secondary:

• RP181 is for Host input (RPV5)
• RP180 is for Host input (RPV4)
• RP179 is for Host input (RPV3)
• RP178 is for Host input (RPV2)
• RP177 is for Host input (RPV1)
• RP176 is for Host input (RPV0)
• RP175 is for Client input (S1RPV5)
- RP174 is for Client input (S1RPV4)
• RP173 is for Client input (S1RPV3)
• RP172 is for Client input (S1RPV2)
• RP171 is for Client input (S1RPV1)
- RP170 is for Client input (S1RPV0)

The idea of the RPVn (Remappable Pin Virtual) is to interconnect between the Main and Secondary without an I/O pin. For example, the Main UART receiver can be connected to the Secondary UART transmit using RPVn, and data communication can happen from Secondary to Main without using any physical pin.

3.7 Cross-Core Signal Mapping

The list of input signals in Table 3-31 cannot be easily used by the Secondary core. The concept of a virtual pin is an output direction pin. Even though the signals in Table 3-31 are outputs, they can only be assigned to inputs, and therefore NOT the virtual output pins that allow cross-core signaling. In order to use these outputs, another resource like the CLC must be used to connect them.

The following method can be used for cross-core signal mapping:

  1. Map DAC 'pwm_req' signal to Client PWM.
  2. Map Host CLC output to virtual output.
  3. Map Host virtual output to Client PWM PCI.

Only the list of outputs in Table 3-34 and Table 4-31 can be assigned to any RP out. Register bit width is six bits resulting in a max count of 64. Signals in Table 3-31 and Table 4-27 cannot be written to RPORx registers, only RPINx.

EXAMPLE 3-3: CONFIGURING CLC AS A BUFFER

CLC1GLSLbits.GID1T = 1; // Connect GID1
CLC1CONHbits.G2POL = 1; // Invert to get a
// logic '1' on gate 2
CLC1CONHbits.G3POL = 1; // Invert to get a logic
'1' on gate 3
CLC1CONHbits.G4POL = 1; // Invert to get a logic
// '1' on gate 4
CLC1CONLbits.MODE = 2; // 4 in AND
CLC1CONLbits.LCEN = 1; 

An unselected gate input is a logic '0'. Inverting this yields a logic '1', which allows AND to pass the other gate signals.

TABLE 3-32: SELECTABLE INPUT SOURCES (MAPS INPUT TO FUNCTION)

Input Name^(1) Function Name RegisterRegister Bits
External Interrupt 1 INT1 RPINR0 INT1R[7:0]
External Interrupt 2 INT2 RPINR1 INT2R[7:0]
External Interrupt 3 INT3 RPINR1 INT3R[7:0]
Timer1 External Clock T1CK RPINR2 T1CK[7:0]
SCCP Timer1TCKI1RPINR3TCKI1R[7:0]
SCCP Capture 1ICM1RPINR3ICM1R[7:0]
SCCP Timer2TCKI2RPINR4TCKI2R[7:0]
SCCP Capture 2ICM2RPINR4ICM2R[7:0]
SCCP Timer3TCKI3RPINR5TCKI3R[7:0]
SCCP Capture 3ICM3RPINR5ICM3R[7:0]
SCCP Timer4TCKI4RPINR6TCKI4R[7:0]
SCCP Capture 4ICM4RPINR6ICM4R[7:0]
SCCP Timer5TCKI5RPINR7TCKI5R[7:0]
SCCP Capture 5ICM5RPINR7ICM5R[7:0]
SCCP Timer6TCKI6RPINR8TCKI6R[7:0]
SCCP Capture 6ICM6RPINR8ICM6R[7:0]
SCCP Timer7TCKI7RPINR9TCKI7R[7:0]
SCCP Capture 7ICM7RPINR9ICM7R[7:0]
SCCP Timer8TCKI8RPINR10TCKI8R[7:0]
SCCP Capture 8ICM8RPINR10ICM8R[7:0]
SCCP Fault AOCFARPINR11OCFAR[7:0]
SCCP Fault BOCFBRPINR11OCFBR[7:0]
PWM PCI Input 8PCI8RPINR12PCI8R[7:0]
PWM PCI Input 9PCI9RPINR12PCI9R[7:0]
PWM PCI Input 10PCI10RPINR13PCI10R[7:0]
PWM PCI Input 11PCI11RPINR13PCI11R[7:0]
QEI Input AQEIA1RPINR14QEIA1R[7:0]
QEI Input BQEIB1RPINR14QEIB1R[7:0]
QEI Index 1 InputQEINDX1RPINR15QEINDX1R[7:0]
QEI Home 1 InputQEIHOM1RPINR15QEIHOM1R[7:0]
UART1 ReceiveU1RXRPINR18U1RXR[7:0]
UART1 Data-Set-Ready 1DSR RPINR18U1DSRR[7:0]
UART2 ReceiveU2RXRPINR19U2RXR[7:0]
UART2 Data-Set-Ready 2DSR RPINR19U2DSRR[7:0]
SPI1 Data InputSDI1RPINR20SDI1R[7:0]
SPI1 Clock InputSCK1INRPINR20SCK1R[7:0]
SPI1 Client Select 1 RPINR21SS1R[7:0]
Reference Clock InputREFOIRPINR21REFOIR[7:0]
SPI2 Data InputSDI2RPINR22SDI2R[7:0]
SPI2 Clock InputSCK2INRPINR22SCK2R[7:0]
SPI2 Client Select 2 RPINR23SS2R[7:0]
UART1 Clear-to-Send 1CTS RPINR23 U1CTSR[7:0]
Input Name^(1) Function NameRegister Register Bits
CAN1 Input CAN1RX RPINR26 CAN1RXR[7:0]
UART2 Clear-to-Send U2CTS RPINR30U2CTSR[7:0]
PWM PCI Input 17 PCI17 RPINR37 PCI17R[7:0]
PWM PCI Input 18 PCI18 RPINR38 PCI18R[7:0]
PWM PCI Input 12 PCI12 RPINR42 PCI12R[7:0]
PWM PCI Input 13 PCI13 RPINR42 PCI13R[7:0]
PWM PCI Input 14 PCI14 RPINR43 PCI14R[7:0]
PWM PCI Input 15 PCI15 RPINR43 PCI15R[7:0]
PWM PCI Input 16 PCI16 RPINR44 PCI16R[7:0]
SENT1 Input SENT1 RPINR44 SENT1R[7:0]
SENT2 Input SENT2 RPINR45 SENT2R[7:0]
CLC Input ACLCINARPINR45CLCINAR[7:0]
CLC Input BCLCINBRPINR46CLCINBR[7:0]
CLC Input C CLCINCRPINR46CLCINCR[7:0]
CLC Input D CLCINDRPINR47CLCINDR[7:0]
ADC Trigger Input (ADTRIG31)ADCTRGRPINR47ADCTRGR[7:0]

Note 1: Unless otherwise noted, all inputs use the Schmitt Trigger input buffers.

3.7.1 OUTPUT MAPPING

In contrast to inputs, the outputs of the Peripheral Pin Select options are mapped on the basis of the pin. In this case, a control register associated with a particular pin dictates the peripheral output to be mapped. The RPORx registers are used to control output mapping. Each register contains sets of 6-bit fields, with each set associated with one RPn pin (see Register 3-71 through Register 3-93). The value of the bit field corresponds to one of the peripherals and that peripheral's output is mapped to the pin (see Table 3-34 and Figure 3-21).

A null output is associated with the output register Reset value of '0'. This is done to ensure that remappable outputs remain disconnected from all output pins by default.

FIGURE 3-21: MULTIPLEXING REMAPPABLE OUTPUTS FOR RPn
Microchip dsPIC33CH64MP208 - OUTPUT MAPPING - 1

text_image RPnR[5:0] Default U1TX Output U1RTS Output 0 1 2 Output Data RP32-RP71 (Physical Pins) U1DTR Output U2DTR Output 52 53 RP170-RP181 (Internal Virtual Output Ports)

Note 1: There are six virtual output ports which are not connected to any I/O ports (RP176-RP181). These virtual ports can be accessed by RPOR20, RPOR21 and RPOR22.

3.7.2 MAPPING LIMITATIONS

The control schema of the peripheral select pins is not limited to a small range of fixed peripheral configurations. There are no mutual or hardware-enforced lockouts between any of the peripheral mapping SFRs. Literally, any combination of peripheral mappings, across any or all of the RPn pins, is possible. This includes both many-to-one and one-to-many mappings of peripheral inputs, and outputs to pins. While such mappings may be technically possible from a configuration point of view, they may not be supportable from an electrical point of view (see Table 3-33).

TABLE 3-33: MAIN REMAPPABLE OUTPUT PIN REGISTERS (1)

Register RP Pin I/O Port
RPOR0[5:0] RP32 Port Pin RB0
RPOR0[13:8] RP33 Port Pin RB1
RPOR1[5:0] RP34 Port Pin RB2
RPOR1[13:8] RP35 Port Pin RB3
RPOR2[5:0] RP36 Port Pin RB4
RPOR2[13:8] RP37 Port Pin RB5
RPOR3[5:0] RP38 Port Pin RB6
RPOR3[13:8] RP39 Port Pin RB7
RPOR4[5:0] RP40 Port Pin RB8
RPOR4[13:8] RP41 Port Pin RB9
RPOR5[5:0] RP42 Port Pin RB10
RPOR5[13:8] RP43 Port Pin RB11
RPOR6[5:0] RP44 Port Pin RB12
RPOR6[13:8] RP45 Port Pin RB13
RPOR7[5:0] RP46 Port Pin RB14
RPOR7[13:8] RP47 Port Pin RB15
RPOR8[5:0] RP48 Port Pin RC0
RPOR8[13:8] RP49 Port Pin RC1
RPOR9[5:0] RP50 Port Pin RC2
RPOR9[13:8] RP51 Port Pin RC3
RPOR10[5:0] RP52 Port Pin RC4
RPOR10[13:8] RP53 Port Pin RC5
RPOR11[5:0] RP54 Port Pin RC6
RPOR11[13:8]RP55 Port Pin RC7
RPOR12[5:0] RP56 Port Pin RC8
RPOR12[13:8] RP57 Port Pin RC9
RPOR13[5:0] RP58 Port Pin RC10
RPOR13[13:8] RP59 Port Pin RC11
RPOR14[5:0] RP60 Port Pin RC12
RPOR14[13:8] RP61 Port Pin RC13
RPOR15[5:0] RP62 Port Pin RC14
RPOR15[13:8] RP63 Port Pin RC15
RPOR16[5:0] RP64 Port Pin RD0
RPOR16[13:8] RP65 Port Pin RD1
RPOR17[5:0] RP66 Port Pin RD2
RPOR17[13:8] RP67 Port Pin RD3
RPOR18[5:0] RP68 Port Pin RD4
RPOR18[13:8] RP69 Port Pin RD5
RPOR19[5:0] RP70 Port Pin RD6
RPOR19[13:8] RP71 Port Pin RD7
RPOR20[5:0]RP176Virtual Pin RPV0
RPOR20[13:8]RP177Virtual Pin RPV1
RPOR21[5:0]RP178Virtual Pin RPV2
RPOR21[13:8]RP179Virtual Pin RPV3
RPOR22[5:0]RP180Virtual Pin RPV4
RPOR22[13:8]RP181Virtual Pin RPV5

Note 1: Not all RP pins are available on all packages. Make sure the selected device variant has the feature available on the device.

TABLE 3-34: OUTPUT SELECTION FOR REMAPPABLE PINS (RPn) ^(1)

Function RPnR[5:0] Output Name
Default PORT 0 RPn tied to Default Pin
U1TX 1 RPn tied to UART1 Transmit
1RTS 2 RPn tied to UART1 Request-to-Send
U2TX 3 RPn tied to UART2 Transmit
2RTS 4 RPn tied to UART2 Request-to-Send
SDO1 5 RPn tied to SPI1Data Output
SCK1 6 RPn tied to SPI1Clock Output
1 7 RPn tied to SPI1 Client Select
SDO2 8 RPn tied to SPI2Data Output
SCK2 9 RPn tied to SPI2Clock Output
2 10 RPn tied to SPI2 Client Select
REFCLKO14 RPn tied to Reference Clock Output
OCM115 RPn tied to SCCP1 Output
OCM216 RPn tied to SCCP2 Output
OCM317 RPn tied to SCCP3 Output
OCM418 RPn tied to SCCP4 Output
OCM519 RPn tied to SCCP5 Output
OCM620 RPn tied to SCCP6 Output
CAN121 RPn tied to CAN1 Output
CMP123 RPn tied to Comparator 1 Output
PWM4H34 RPn tied to PWM4H Output
PWM4L35 RPn tied to PWM4L Output
PWMEA36 RPn tied to PWM Event A Output
PWMEB37 RPn tied to PWM Event B Output
QEICMP38 RPn tied to QEI Comparator Output
CLC1OUT40 RPn tied to CLC1 Output
CLC2OUT41 RPn tied to CLC2 Output
OCM742 RPn tied to SCCP7 Output
OCM843 RPn tied to SCCP8 Output
PWMEC44 RPn tied to PWM Event C Output
PWMED45 RPn tied to PWM Event D Output
PTGTRG2446 PTG Trigger Output 24
PTGTRG2547 PTG Trigger Output 25
SENT1OUT48 RPn tied to SENT1 Output
SENT2OUT49 RPn tied to SENT2 Output
CLC3OUT50 RPn tied to CLC3 Output
CLC4OUT51 RPn tied to CLC4 Output
U1DTR52 Data Terminal Ready Output 1
U2DTR53 Data Terminal Ready Output 2

Note 1: Not all RP are available on all packages. Make sure the selected device variant has the feature available on the device.

3.7.3 I/O HELPFUL TIPS

  1. In some cases, certain pins, as defined in Table 24-19 under "Injection Current", have internal protection diodes to VDD and Vss. The term, "Injection Current", is also referred to as "Clamp Current". On designated pins, with sufficient external current-limiting precautions by the user, I/O pin input voltages are allowed to be greater or lesser than the data sheet absolute maximum ratings, with respect to the Vss and VDD supplies. Note that when the user application forward biases either of the high or low-side internal input clamp diodes, that the resulting current being injected into the device that is clamped internally by the VDD and Vss power rails, may affect the ADC accuracy by four to six counts.
  2. I/O pins that are shared with any analog input pin (i.e., ANx) are always analog pins, by default, after any Reset. Consequently, configuring a pin as an analog input pin automatically disables the digital input pin buffer and any attempt to read the digital input level by reading PORTx or LATx will always return a '0', regardless of the digital logic level on the pin. To use a pin as a digital I/O pin on a shared ANx pin, the user application needs to configure the Analog Select for PORTx registers in the I/O ports module (i.e., ANSELx) by setting the appropriate bit that corresponds to that I/O port pin to a '0'.

Note: Although it is not possible to use a digital input pin when its analog function is enabled, it is possible to use the digital I/O output function, TRISx = 0x0, while the analog function is also enabled. However, this is not recommended, particularly if the analog input is connected to an external analog voltage source, which would create signal contention between the analog signal and the output pin driver.

  1. Most I/O pins have multiple functions. Referring to the device pin diagrams in this data sheet, the priorities of the functions allocated to any pins are indicated by reading the pin name, from left-to-right. The left most function name takes precedence over any function to its right in the naming convention. For example: AN14/ISRC1/RP50/RC2; this indicates that AN14 is the highest priority in this example and will supersede all other functions to its right in the list. Those other functions to its right, even if enabled, would not work as long as any other function to its left was enabled. This rule applies to all of the functions listed for a given pin.
  2. Each pin has an internal weak pull-up resistor and pull-down resistor that can be configured using the CNPUx and CNPDx registers, respectively. These resistors eliminate the need for external resistors in certain applications. The internal pull-up is up to \~(VDD - 0.8), not VDD. This value is still above the minimum VIH of CMOS and TTL devices.
  3. When driving LEDs directly, the I/O pin can source or sink more current than what is specified in the VOH/LOH and VOL/LOL DC characteristics specification. The respective LOH and IOL current rating only applies to maintaining the corresponding output at or above the VOH, and at or below the VOL levels. However, for LEDs, unlike digital inputs of an externally connected device, they are not governed by the same minimum VIH/VIIL levels. An I/O pin output can safely sink or source any current less than that listed in the Absolute Maximum Ratings in Section 24.0, Electrical Characteristics of this data sheet. For example:

$$ \mathrm{VOH} = 2. 4 \mathrm{v} @ \mathrm{IOH} = - 8 \mathrm{mA} \text { and } \mathrm{VDD} = 3. 3 \mathrm{V} $$

The maximum output current sourced by any 8 mA I/O pin = 12 mA.

LED source current < 12 mA is technically permitted. Refer to the VOH/LOH graphs in Section 24.1 "DC Characteristics" for additional information.

  1. The Peripheral Pin Select (PPS) pin mapping rules are as follows:

a) Only one "output" function can be active on a given pin at any time, regardless if it is a dedicated or remappable function (one pin, one output).
b) It is possible to assign a "remappable output" function to multiple pins and externally short or tie them together for increased current drive.
c) If any "dedicated output" function is enabled on a pin, it will take precedence over any remappable "output" function.
d) If any "dedicated digital" (input or output) function is enabled on a pin, any number of "input" remappable functions can be mapped to the same pin.
e) If any "dedicated analog" function(s) are enabled on a given pin, "digital input(s)" of any kind will all be disabled, although a single "digital output", at the user's cautionary discretion, can be enabled and active as long as there is no signal contention with an external analog input signal. For example, it is possible for the ADC to convert the digital output logic level, or to toggle a digital output on a comparator or ADC input, provided there is no external analog input, such as for a built-in self-test.
f) Any number of "input" remappable functions can be mapped to the same pin(s) at the same time, including to any pin with a single output from either a dedicated or remappable "output".
g) The TRISx registers control only the digital I/O output buffer. Any other dedicated or remappable active "output" will automatically override the TRISx setting. The TRISx register does not control the digital logic "input" buffer. Remappable digital "inputs" do not automatically override TRISx settings, which means that the TRISx bit must be set to input for pins with only remappable input function(s) assigned.
h) All analog pins are enabled by default after any Reset and the corresponding digital input buffer on the pin has been disabled. Only the Analog Select for PORTx (ANSELx) registers control the digital input buffer, not the TRISx register. The user must disable the analog function on a pin using the Analog Select for PORTx registers in order to use any "digital input(s)" on a corresponding pin, no exceptions.

3.7.4 I/O PORTS RESOURCES

Many useful resources are provided on the main product page of the Microchip website for the devices listed in this data sheet. This product page contains the latest updates and additional information.

3.7.4.1 Key Resources

  • "I/O Ports with Edge Detect" (www.microchip.com/DS70005322)
  • Code Samples
  • Application Notes
  • Software Libraries
  • Webinars
  • All Related "dsPIC33/PIC24 Family Reference Manual" Sections
  • Development Tools

TABLE 3-35: PORTA REGISTER SUMMARY

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-12 Unimplemented: Read as '0'

bit 11 IOLOCK: Peripheral Remapping Register Lock bit

1 = All Peripheral Remapping registers are locked and cannot be written
0 = All Peripheral Remapping registers are unlocked and can be written

bit 10-0 Unimplemented: Read as '0'

Note 1: Writing to this register needs an unlock sequence.

REGISTER 3-39: RPINR0: PERIPHERAL PIN SELECT INPUT REGISTER

R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
INT1R7INT1R6INT1R5INT1R4INT1R3INT1R2INT1R1INT1R0
bit 15 bit 8
R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-8 INT1R[7:0]: Assign External Interrupt 1 (INT1) to the Corresponding RPn Pin bits See Table 3-31.

bit 7-0 Unimplemented: Read as '0'

REGISTER 3-40: RPINR1: PERIPHERAL PIN SELECT INPUT REGISTER 1

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
INT3R7INT3R6INT3R5INT3R4INT3R3INT3R2INT3R1INT3R0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
INT2R7INT2R6INT2R5INT2R4INT2R3INT2R2INT2R1INT2R0
bit 7 bit 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-8 INT3R[7:0]: Assign External Interrupt 3 (INT3) to the Corresponding RPn Pin bits See Table 3-31.

bit 7-0 INT2R[7:0]: Assign External Interrupt 2 (INT2) to the Corresponding RPn Pin bits See Table 3-31.

REGISTER 3-41: RPINR2: PERIPHERAL PIN SELECT INPUT REGISTER 2

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
T1CKR7T1CKR6T1CKR5T1CKR4T1CKR3T1CKR2T1CKR1T1CKR0
bit 15 bit 8
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-8 T1CKR[7:0]: Assign Timer1 External Clock (T1CK) to the Corresponding RPn Pin bits See Table 3-31.

bit 7-0 Unimplemented: Read as '0'

REGISTER 3-42: RPINR3: PERIPHERAL PIN SELECT INPUT REGISTER 3

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
ICM1R7ICM1R6ICM1R5ICM1R4ICM1R3ICM1R2ICM1R1ICM1R0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
TCKI1R7TCKI1R6TCKI1R5TCKI1R4TCKI1R3TCKI1R2TCKI1R1TCKI1R0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-8 ICM1R[7:0]: Assign SCCP Capture 1 (ICM1) Input to the Corresponding RPn Pin bits See Table 3-31.

bit 7-0 TCKI1[7:0]: Assign SCCP Timer1 (TCKI1) Input to the Corresponding RPn Pin bits See Table 3-31.

REGISTER 3-43: RPINR4: PERIPHERAL PIN SELECT INPUT REGISTER 4

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
ICM2R7ICM2R6ICM2R5ICM2R4ICM2R3ICM2R2ICM2R1ICM2R0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
TCKI2R7TCKI2R6TCKI2R5TCKI2R4TCKI2R3TCKI2R2TCKI2R1TCKI2R0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-8 ICM2R[7:0]: Assign SCCP Capture 2 (ICM2) Input to the Corresponding RPn Pin bits See Table 3-31.

bit 7-0 TCKI2R[7:0]: Assign SCCP Timer2 (TCKI2) Input to the Corresponding RPn Pin bits See Table 3-31.

REGISTER 3-44: RPINR5: PERIPHERAL PIN SELECT INPUT REGISTER 5

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
ICM3R7 ICM3R6 ICM3R5ICM3R4 ICM3R3 ICM3R2ICM3R1ICM3R0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
TCKI3R7TCKI3R6TCKI3R5TCKI3R4TCKI3R3TCKI3R2TCKI3R1TCKI3R0
bit 7 bit 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-8 ICM3R[7:0]: Assign SCCP Capture 3 (ICM3) Input to the Corresponding RPn Pin bits See Table 3-31.

bit 7-0 TCKI3R[7:0]: Assign SCCP Timer3 (TCKI3) Input to the Corresponding RPn Pin bits See Table 3-31.

REGISTER 3-45: RPINR6: PERIPHERAL PIN SELECT INPUT REGISTER 6

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
ICM4R7 ICM4R6 ICM4R5ICM4R4 ICM4R3 ICM4R2ICM4R1ICM4R0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
TCKI4R7TCKI4R6TCKI4R5TCKI4R4TCKI4R3TCKI4R2TCKI4R1TCKI4R0
bit 7 bit 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-8 ICM4R[7:0]: Assign SCCP Capture 4 (ICM4) Input to the Corresponding RPn Pin bits See Table 3-31.

bit 7-0 TCKI4R[7:0]: Assign SCCP Timer4 (TCKI4) Input to the Corresponding RPn Pin bits See Table 3-31.

REGISTER 3-46: RPINR7: PERIPHERAL PIN SELECT INPUT REGISTER 7

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
ICM5R7ICM5R6ICM5R5ICM5R4ICM5R3ICM5R2ICM5R1ICM5R0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
TCKI5R7TCKI5R6TCKI5R5TCKI5R4TCKI5R3TCKI5R2TCKI5R1TCKI5R0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-8 ICM5R[7:0]: Assign SCCP Capture 5 (ICM5) Input to the Corresponding RPn Pin bits See Table 3-31.

bit 7-0 TCKI5R[7:0]: Assign SCCP Timer5 (TCKI5) Input to the Corresponding RPn Pin bits See Table 3-31.

REGISTER 3-47: RPINR8: PERIPHERAL PIN SELECT INPUT REGISTER 8

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
ICM6R7ICM6R6ICM6R5ICM6R4ICM6R3ICM6R2ICM6R1ICM6R0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
TCKI6R7TCKI6R6TCKI6R5TCKI6R4TCKI6R3TCKI6R2TCKI6R1TCKI6R0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-8 ICM6R[7:0]: Assign SCCP Capture 6 (ICM6) Input to the Corresponding RPn Pin bits See Table 3-31.

bit 7-0 TCKI6R[7:0]: Assign SCCP Timer6 (TCKI6) Input to the Corresponding RPn Pin bits See Table 3-31.

REGISTER 3-48: RPINR9: PERIPHERAL PIN SELECT INPUT REGISTER 9

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
ICM7R7 ICM7R6 ICM7R5ICM7R4 ICM7R3 ICM7R2ICM7R1ICM7R0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
TCKI7R7TCKI7R6TCKI7R5TCKI7R4TCKI7R3TCKI7R2TCKI7R1TCKI7R0
bit 7 bit 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-8 ICM7R[7:0]: Assign SCCP Capture 7 (ICM7) Input to the Corresponding RPn Pin bits See Table 3-31.

bit 7-0 TCKI7R[7:0]: Assign SCCP Timer7 (TCKI7) Input to the Corresponding RPn Pin bits See Table 3-31.

REGISTER 3-49: RPINR10: PERIPHERAL PIN SELECT INPUT REGISTER 10

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
ICM8R7 ICM8R6 ICM8R5ICM8R4 ICM8R3 ICM8R2ICM8R1ICM8R0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
TCKI8R7TCKI8R6TCKI8R5TCKI8R4TCKI8R3TCKI8R2TCKI8R1TCKI8R0
bit 7 bit 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-8 ICM8R[7:0]: Assign SCCP Capture 8 (ICM8) Input to the Corresponding RPn Pin bits See Table 3-31.

bit 7-0 TCKI8R[7:0]: Assign SCCP Timer8 (TCKI8) Input to the Corresponding RPn Pin bits See Table 3-31.

REGISTER 3-50: RPINR11: PERIPHERAL PIN SELECT INPUT REGISTER 11

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
OCFBR7 OCFBR6 OCFBR5 OCFBR4 OCFBR3 OCFBR2 OCFBR1OCFBR0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
OCFAR7OCFAR6OCFAR5OCFAR4OCFAR3OCFAR2OCFAR1OCFAR0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-8 OCFBR[7:0]: Assign SCCP Fault B (OCFB) Input to the Corresponding RPn Pin bits See Table 3-31.

bit 7-0 OCFAR[7:0]: Assign SCCP Fault A (OCFA) Input to the Corresponding RPn Pin bits See Table 3-31.

REGISTER 3-51: RPINR12: PERIPHERAL PIN SELECT INPUT REGISTER 12

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PCI9R7PCI9R6PCI9R5PCI9R4PCI9R3PCI9R2PCI9R1PCI9R0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PCI8R7PCI8R6PCI8R5PCI8R4PCI8R3PCI8R2PCI8R1PCI8R0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-8 PCI9R[7:0]: Assign PWM Input 9 (PCI9) to the Corresponding RPn Pin bits See Table 3-31.

bit 7-0 PCI8R[7:0]: Assign PWM Input 8 (PCI8) to the Corresponding RPn Pin bits See Table 3-31.

REGISTER 3-52: RPINR13: PERIPHERAL PIN SELECT INPUT REGISTER 13

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PCI11R7 PCI11R6 PCI11R5 PCI11R4 PCI11R3PCI11R2 PCI11R1PCI11R0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PCI10R7PCI10R6PCI10R5PCI10R4PCI10R3PCI10R2PCI10R1PCI10R0
bit 7 bit 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-8 PCI11R[7:0]: Assign PWM Input 11 (PCI11) to the Corresponding RPn Pin bits See Table 3-31.

bit 7-0 PCI10R[7:0]: Assign PWM Input 10 (PCI10) to the Corresponding RPn Pin bits See Table 3-31.

REGISTER 3-53: RPINR14: PERIPHERAL PIN SELECT INPUT REGISTER 14

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
QEIB1R7QEIB1R6QEIB1R5QEIB1R4QEIB1R3QEIB1R2QEIB1R1QEIB1R0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
QEIA1R7QEIA1R6QEIA1R5QEIA1R4QEIA1R3QEIA1R2QEIA1R1QEIA1R0
bit 7 bit 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-8 QEIB1R[7:0]: Assign QEI Input B (QEIB1) to the Corresponding RPn Pin bits See Table 3-31.

bit 7-0 QEIA1R[7:0]: Assign QEI Input A (QEIA1) to the Corresponding RPn Pin bits See Table 3-31.

REGISTER 3-54: RPINR15: PERIPHERAL PIN SELECT INPUT REGISTER 15

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
QEIHOM1R7QEIHOM1R6QEIHOM1R5QEIHOM1R4QEIHOM1R3QEIHOM1R2QEIHOM1R1QEIHOM1R0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
QEINDX1R7QEINDX1R6QEINDX1R5QEINDX1R4QEINDX1R3QEINDX1R2QEINDX1R1QEINDX1R0
bit 7 bit 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-8 QEIHOM1R[7:0]: Assign QEI Home 1 Input (QEIHOM1) to the Corresponding RPn Pin bits See Table 3-31.

bit 7-0 QEINDX1R[7:0]: Assign QEI Index 1 Input (QEINDX1) to the Corresponding RPn Pin bits See Table 3-31.

REGISTER 3-55: RPINR18: PERIPHERAL PIN SELECT INPUT REGISTER 18

R/W-0 R/W-0 R/W-0R/W-0R/W-0 R/W-0 R/W-0 R/W-0
U1DSRR7U1DSRR6U1DSRR5U1DSRR4U1DSRR3U1DSRR2U1DSRR1U1DSRR0
bit 15 bit 8
R/W-0 R/W-0 R/W-0R/W-0R/W-0 R/W-0 R/W-0 R/W-0
U1RXR7U1RXR6U1RXR5U1RXR4U1RXR3U1RXR2U1RXR1U1RXR0
bit 7 bit 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-8 U1DSRR[7:0]: Assign UART1 Data-Set-Ready (U1 DSR) to the Corresponding RPn Pin bits See Table 3-31.

bit 7-0 U1RXR[7:0]: Assign UART1 Receive (U1RX) to the Corresponding RPn Pin bits See Table 3-31.

REGISTER 3-56: RPINR19: PERIPHERAL PIN SELECT INPUT REGISTER 19

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
U2DSRR7 U2DSRR6 U2DSRR5 U2DSRR4 U2DSRR3 U2DSRR2 U2DSRR1 U2DSRR0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
U2RXR7U2RXR6U2RXR5U2RXR4U2RXR3U2RXR2U2RXR1U2RXR0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-8 U2DSRR[7:0]: Assign UART2 Data-Set-Ready (U2 DSR) to the Corresponding RPn Pin bits See Table 3-31.

bit 7-0 U2RXR[7:0]: Assign UART2 Receive (U2RX) to the Corresponding RPn Pin bits See Table 3-31.

REGISTER 3-57: RPINR20: PERIPHERAL PIN SELECT INPUT REGISTER 20

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
SCK1R7SCK1R6SCK1R5SCK1R4SCK1R3SCK1R2SCK1R1SCK1R0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
SDI1R7SDI1R6SDI1R5SDI1R4SDI1R3SDI1R2SDI1R1SDI1R0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-8 SCK1R[7:0]: Assign SPI1 Clock Input (SCK1IN) to the Corresponding RPn Pin bits See Table 3-31.

bit 7-0 SDI1R[7:0]: Assign SPI1 Data Input (SDI1) to the Corresponding RPn Pin bits See Table 3-31.

REGISTER 3-58: RPINR21: PERIPHERAL PIN SELECT INPUT REGISTER 21

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
REFOIR7 REFOIR6 REFOR5 REFOIR4REFOIR3REFOIR2 REFOIR1REFOIR0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
SS1R7SS1R6SS1R5SS1R4SS1R3SS1R2SS1R1SS1R0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-8 REFOIR[7:0]: Assign Reference Clock Input (REFOI) to the Corresponding RPn Pin bits See Table 3-31.

bit 7-0 SS1R[7:0]: Assign SPI1 Client Select (SS1) to the Corresponding RPn Pin bits See Table 3-31.

REGISTER 3-59: RPINR22: PERIPHERAL PIN SELECT INPUT REGISTER 22

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
SCK2R7SCK2R6SCK2R5SCK2R4SCK2R3SCK2R2SCK2R1SCK2R0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
SDI2R7SDI2R6SDI2R5SDI2R4SDI2R3SDI2R2SDI2R1SDI2R0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-8 SCK2R[7:0]: Assign SPI2 Clock Input (SCK2IN) to the Corresponding RPn Pin bits See Table 3-31.

bit 7-0 SDI2R[7:0]: Assign SPI2 Data Input (SDI2) to the Corresponding RPn Pin bits See Table 3-31.

REGISTER 3-60: RPINR23: PERIPHERAL PIN SELECT INPUT REGISTER 23

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
U1CTSR7 U1CTSR6 U1CTSR5 U1CTSR4 U1CTSR3 U1CTSR2 U1CTSR1U1CTSR0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
SS2R7SS2R6SS2R5SS2R4SS2R3SS2R2SS2R1SS2R0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-8 U1CTSR[7:0]: Assign UART1 Clear-to-Send (U1CTS) to the Corresponding RPn Pin bits See Table 3-31.

bit 7-0 SS2R[7:0]: Assign SPI2 Client Select (SS2) to the Corresponding RPn Pin bits See Table 3-31.

REGISTER 3-61: RPINR26: PERIPHERAL PIN SELECT INPUT REGISTER 26

R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-8 Unimplemented: Read as '0'

bit 7-0 CAN1RXR[7:0]: Assign CAN1 Input (CAN1RX) to the Corresponding RPn Pin bits See Table 3-31.

REGISTER 3-62: RPINR30: PERIPHERAL PIN SELECT INPUT REGISTER 30

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
U2CTSR7 U2CTSR6 U2CTSR5 U2CTSR4 U2CTSR3U2CTSR2 U2CTSR1 U2CTSR0
bit 15 bit 8
R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-8 U2CTSR[7:0]: Assign UART2 Clear-to-Send (U2 CTS) to the Corresponding RPn Pin bits See Table 3-31.

bit 7-0 Unimplemented: Read as '0'

REGISTER 3-63: RPINR37: PERIPHERAL PIN SELECT INPUT REGISTER 37

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PCI17R7PCI17R6PCI17R5PCI17R4PCI17R3PCI17R2PCI17R1PCI17R0
bit 15 bit 8
R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-8 PCI17R[7:0]: Assign PWM Input 17 (PCI17) to the Corresponding RPn Pin bits See Table 3-31.

bit 7-0 Unimplemented: Read as '0'

REGISTER 3-64: RPINR38: PERIPHERAL PIN SELECT INPUT REGISTER 38

U-0 U-0 U-0 U-0 U-0 U-0 U-0
————
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
PCI18R7PCI18R6PCI18R5PCI18R4PCI18R3PCI18R2PCI18R1PCI18R0
bit 7 bit 0
Legend:
R = Readable bitW = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown

bit 15-8 Unimplemented: Read as '0'

bit 7-0 PCI18R[7:0]: Assign PWM Input 18 (PCI18) to the Corresponding RPn Pin bits See Table 3-31.

REGISTER 3-65: RPINR42: PERIPHERAL PIN SELECT INPUT REGISTER 42

R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
PCI13R7PCI13R6PCI13R5PCI13R4PCI13R3PCI13R2PCI13R1PCI13R0
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
PCI12R7PCI12R6PCI12R5PCI12R4PCI12R3PCI12R2PCI12R1PCI12R0
bit 7 bit 0
Legend:
R = Readable bitW = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown

bit 15-8 PCI13R[7:0]: Assign PWM Input 13 (PCI13) to the Corresponding RPn Pin bits See Table 3-31.

bit 7-0 PCI12R[7:0]: Assign PWM Input 12 (PCI12) to the Corresponding RPn Pin bits See Table 3-31.

REGISTER 3-66: RPINR43: PERIPHERAL PIN SELECT INPUT REGISTER 43

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PCI15R7PCI15R6PCI15R5PCI15R4PCI15R3PCI15R2PCI15R1PCI15R0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PCI14R7PCI14R6PCI14R5PCI14R4PCI14R3PCI14R2PCI14R1PCI14R0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-8 PCI15R[7:0]: Assign PWM Input 15 (PCI15) to the Corresponding RPn Pin bits See Table 3-31.

bit 7-0 PCI14R[7:0]: Assign PWM Input 14 (PCI14) to the Corresponding RPn Pin bits See Table 3-31.

REGISTER 3-67: RPINR44: PERIPHERAL PIN SELECT INPUT REGISTER 44

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
SENT1R7SENT1R6SENT1R5SENT1R4SENT1R3SENT1R2SENT1R1SENT1R0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PCI16R7PCI16R6PCI16R5PCI16R4PCI16R3PCI16R2PCI16R1PCI16R0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-8 SENT1R[7:0]: Assign SENT1 Input (SENT1) to the Corresponding RPn Pin bits See Table 3-31.

bit 7-0 PCI16[7:0]: Assign PWM Input 16 (PCI16) to the Corresponding RPn Pin bits See Table 3-31.

REGISTER 3-68: RPINR45: PERIPHERAL PIN SELECT INPUT REGISTER 45

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CLCINAR7 CLCINAR6 CLCINAR5 CLCINAR4 CLCINAR3 CLCINAR2CLCINAR1CLCINAR0
bit 15bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
SENT2R7SENT2R6SENT2R5SENT2R4SENT2R3SENT2R2SENT2R1SENT2R0
bit 7 bit 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-8 CLCINAR[7:0]: Assign CLC Input A (CLCINA) to the Corresponding RPn Pin bits See Table 3-31.

bit 7-0 SENT2R[7:0]: Assign SENT2 Input (SENT2) to the Corresponding RPn Pin bits See Table 3-31.

REGISTER 3-69: RPINR46: PERIPHERAL PIN SELECT INPUT REGISTER 46

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CLCINCR7CLCINCR6CLCINCR5CLCINCR4CLCINCR3CLCINCR2CLCINCR1CLCINCR0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CLCINBR7CLCINBR6CLCNBR5CLCINBR4CLCINBR3CLCINBR2CLCINBR1CLCINBR0
bit 7 bit 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-8 CLCINCR[7:0]: Assign CLC Input C (CLCINC) to the Corresponding RPn Pin bits See Table 3-31.

bit 7-0 CLCINBR[7:0]: Assign CLC Input B (CLCINB) to the Corresponding RPn Pin bits See Table 3-31.

REGISTER 3-70: RPINR47: PERIPHERAL PIN SELECT INPUT REGISTER 47

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
ADCTRGR7ADCTRGR6ADCTRGR5ADCTRGR4ADCTRGR3ADCTRGR2ADCTRGR1ADCTRGR0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CLCINDR7CLCINDR6CLCINDR5CLCINDR4CLCINDR3CLCINDR2CLCINDR1CLCINDR0
bit 7 bit 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-8 ADCTRGR[7:0]: Assign ADC Trigger Input (ADCTRG) to the Corresponding RPn Pin bits See Table 3-31.

bit 7-0 CLCINDR[7:0]: Assign CLC Input D (CLCIND) to the Corresponding RPn Pin bits See Table 3-31.

REGISTER 3-71: RPOR0: PERIPHERAL PIN SELECT OUTPUT REGISTER 0

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP33R5RP33R4RP33R3RP33R2RP33R1RP33R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP32R5RP32R4RP32R3RP32R2RP32R1RP32R0
bit 7 bit 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-14 Unimplemented: Read as '0'

bit 13-8 RP33R[5:0]: Peripheral Output Function is Assigned to RP33 Output Pin bits (see Table 3-34 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP32R[5:0]: Peripheral Output Function is Assigned to RP32 Output Pin bits (see Table 3-34 for peripheral function numbers)

REGISTER 3-72: RPOR1: PERIPHERAL PIN SELECT OUTPUT REGISTER 1

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP35R5RP35R4RP35R3RP35R2RP35R1RP35R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP34R5RP34R4RP34R3RP34R2RP34R1RP34R0
bit 7 bit 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-14 Unimplemented: Read as '0'

bit 13-8 RP35R[5:0]: Peripheral Output Function is Assigned to RP35 Output Pin bits (see Table 3-34 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP34R[5:0]: Peripheral Output Function is Assigned to RP34 Output Pin bits (see Table 3-34 for peripheral function numbers)

REGISTER 3-73: RPOR2: PERIPHERAL PIN SELECT OUTPUT REGISTER 2

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP37R5RP37R4RP37R3RP37R2RP37R1RP37R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP36R5RP36R4RP36R3RP36R2RP36R1RP36R0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-14 Unimplemented: Read as '0'

bit 13-8 RP37R[5:0]: Peripheral Output Function is Assigned to RP37 Output Pin bits (see Table 3-34 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP36R[5:0]: Peripheral Output Function is Assigned to RP36 Output Pin bits (see Table 3-34 for peripheral function numbers)

REGISTER 3-74: RPOR3: PERIPHERAL PIN SELECT OUTPUT REGISTER 3

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP39R5RP39R4RP39R3RP39R2RP39R1RP39R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP38R5RP38R5RP38R5RP38R5RP38R5RP38R5
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-14 Unimplemented: Read as '0'

bit 13-8 RP39R[5:0]: Peripheral Output Function is Assigned to RP39 Output Pin bits (see Table 3-34 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP38R[5:0]: Peripheral Output Function is Assigned to RP38 Output Pin bits (see Table 3-34 for peripheral function numbers)

REGISTER 3-75: RPOR4: PERIPHERAL PIN SELECT OUTPUT REGISTER 4

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP41R5RP41R4RP41R3RP41R2RP41R1RP41R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP40R5RP40R4RP40R3RP40R2RP40R1RP40R0
bit 7 bit 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-14 Unimplemented: Read as '0'

bit 13-8 RP41R[5:0]: Peripheral Output Function is Assigned to RP41 Output Pin bits (see Table 3-34 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP40R[5:0]: Peripheral Output Function is Assigned to RP40 Output Pin bits (see Table 3-34 for peripheral function numbers)

REGISTER 3-76: RPOR5: PERIPHERAL PIN SELECT OUTPUT REGISTER 5

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP43R5RP43R4RP43R3RP43R2RP43R1RP43R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP42R5RP42R4RP42R3RP42R2RP42R1RP42R0
bit 7 bit 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-14 Unimplemented: Read as '0'

bit 13-8 RP43R[5:0]: Peripheral Output Function is Assigned to RP43 Output Pin bits (see Table 3-34 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP42R[5:0]: Peripheral Output Function is Assigned to RP42 Output Pin bits (see Table 3-34 for peripheral function numbers)

REGISTER 3-77: RPOR6: PERIPHERAL PIN SELECT OUTPUT REGISTER 6

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP45R5RP45R4RP45R3RP45R2RP45R1RP45R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP44R5RP44R4RP44R3RP44R2RP44R1RP44R0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-14 Unimplemented: Read as '0'

bit 13-8 RP45R[5:0]: Peripheral Output Function is Assigned to RP45 Output Pin bits (see Table 3-34 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP44R[5:0]: Peripheral Output Function is Assigned to RP44 Output Pin bits (see Table 3-34 for peripheral function numbers)

REGISTER 3-78: RPOR7: PERIPHERAL PIN SELECT OUTPUT REGISTER 7

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP47R5RP47R4RP47R3RP47R2RP47R1RP47R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP46R5RP46R4RP46R3RP46R2RP46R1RP46R0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-14 Unimplemented: Read as '0'

bit 13-8 RP47R[5:0]: Peripheral Output Function is Assigned to RP47 Output Pin bits (see Table 3-34 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP46R[5:0]: Peripheral Output Function is Assigned to RP46 Output Pin bits (see Table 3-34 for peripheral function numbers)

REGISTER 3-79: RPOR8: PERIPHERAL PIN SELECT OUTPUT REGISTER 8

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP49R5RP49R4RP49R3RP49R2RP49R1RP49R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP48R5RP48R4RP48R3RP48R2RP48R1RP48R0
bit 7 bit 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-14 Unimplemented: Read as '0'

bit 13-8 RP49R[5:0]: Peripheral Output Function is Assigned to RP49 Output Pin bits (see Table 3-34 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP48R[5:0]: Peripheral Output Function is Assigned to RP48 Output Pin bits (see Table 3-34 for peripheral function numbers)

REGISTER 3-80: RPOR9: PERIPHERAL PIN SELECT OUTPUT REGISTER 9

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP51R5RP51R4RP51R3RP51R2RP51R1RP51R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP50R5RP50R4RP50R3RP50R2RP50R1RP50R0
bit 7 bit 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-14 Unimplemented: Read as '0'

bit 13-8 RP51R[5:0]: Peripheral Output Function is Assigned to RP51 Output Pin bits (see Table 3-34 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP50R[5:0]: Peripheral Output Function is Assigned to RP50 Output Pin bits (see Table 3-34 for peripheral function numbers)

REGISTER 3-81: RPOR10: PERIPHERAL PIN SELECT OUTPUT REGISTER 10

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP53R5RP53R4RP53R3RP53R2RP53R1RP53R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP52R5RP52R4RP52R3RP52R2RP52R1RP52R0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-14 Unimplemented: Read as '0'

bit 13-8 RP53[5:0]: Peripheral Output Function is Assigned to RP53 Output Pin bits (see Table 3-34 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP52R[5:0]: Peripheral Output Function is Assigned to RP52 Output Pin bits (see Table 3-34 for peripheral function numbers)

REGISTER 3-82: RPOR11: PERIPHERAL PIN SELECT OUTPUT REGISTER 11

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP55R5RP55R4RP55R3RP55R2RP55R1RP55R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP54R5RP54R4RP54R3RP54R2RP54R1RP54R0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-14 Unimplemented: Read as '0'

bit 13-8 RP55R[5:0]: Peripheral Output Function is Assigned to RP55 Output Pin bits (see Table 3-34 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP54R[5:0]: Peripheral Output Function is Assigned to RP54 Output Pin bits (see Table 3-34 for peripheral function numbers)

REGISTER 3-83: RPOR12: PERIPHERAL PIN SELECT OUTPUT REGISTER 12

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP57R5RP57R4RP57R3RP57R2RP57R1RP57R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP56R5RP56R4RP56R3RP56R2RP56R1RP56R0
bit 7 bit 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-14 Unimplemented: Read as '0'

bit 13-8 RP57R[5:0]: Peripheral Output Function is Assigned to RP57 Output Pin bits (see Table 3-34 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP56R[5:0]: Peripheral Output Function is Assigned to RP56 Output Pin bits (see Table 3-34 for peripheral function numbers)

REGISTER 3-84: RPOR13: PERIPHERAL PIN SELECT OUTPUT REGISTER 13

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP59R5RP59R4RP59R3RP59R2RP59R1RP59R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP58R5RP58R4RP58R3RP58R2RP58R1RP58R0
bit 7 bit 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-14 Unimplemented: Read as '0'

bit 13-8 RP59R[5:0]: Peripheral Output Function is Assigned to RP59 Output Pin bits (see Table 3-34 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP58R[5:0]: Peripheral Output Function is Assigned to RP58 Output Pin bits (see Table 3-34 for peripheral function numbers)

REGISTER 3-85: RPOR14: PERIPHERAL PIN SELECT OUTPUT REGISTER 14

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP61R5RP61R4RP61R3RP61R2RP61R1RP61R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP60R5RP60R4RP60R3RP60R2RP60R1RP60R0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-14 Unimplemented: Read as '0'

bit 13-8 RP61R[5:0]: Peripheral Output Function is Assigned to RP61 Output Pin bits (see Table 3-34 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP60R[5:0]: Peripheral Output Function is Assigned to RP60 Output Pin bits (see Table 3-34 for peripheral function numbers)

REGISTER 3-86: RPOR15: PERIPHERAL PIN SELECT OUTPUT REGISTER 15

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP63R5RP63R4RP63R3RP63R2RP63R1RP63R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP62R5RP62R4RP62R3RP62R2RP62R1RP62R0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-14 Unimplemented: Read as '0'

bit 13-8 RP63R[5:0]: Peripheral Output Function is Assigned to RP63 Output Pin bits (see Table 3-34 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP62R[5:0]: Peripheral Output Function is Assigned to RP62 Output Pin bits (see Table 3-34 for peripheral function numbers)

REGISTER 3-87: RPOR16: PERIPHERAL PIN SELECT OUTPUT REGISTER 16

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP65R5RP65R4RP65R3RP65R2RP65R1RP65R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP64R5RP64R4RP64R3RP64R2RP64R1RP64R0
bit 7 bit 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-14 Unimplemented: Read as '0'

bit 13-8 RP65R[5:0]: Peripheral Output Function is Assigned to RP65 Output Pin bits (see Table 3-34 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP64R[5:0]: Peripheral Output Function is Assigned to RP64 Output Pin bits (see Table 3-34 for peripheral function numbers)

REGISTER 3-88: RPOR17: PERIPHERAL PIN SELECT OUTPUT REGISTER 17

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP67R5RP67R4RP67R3RP67R2RP67R1RP67R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP66R5RP66R4RP66R3RP66R2RP66R1RP66R0
bit 7 bit 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-14 Unimplemented: Read as '0'

bit 13-8 RP67R[5:0]: Peripheral Output Function is Assigned to RP67 Output Pin bits (see Table 3-34 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP66R[5:0]: Peripheral Output Function is Assigned to RP66 Output Pin bits (see Table 3-34 for peripheral function numbers)

REGISTER 3-89: RPOR18: PERIPHERAL PIN SELECT OUTPUT REGISTER 18

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP69R5RP69R4RP69R3RP69R2RP69R1RP69R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP68R5RP68R4RP68R3RP68R2RP68R1RP68R0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-14 Unimplemented: Read as '0'

bit 13-8 RP69R[5:0]: Peripheral Output Function is Assigned to RP69 Output Pin bits (see Table 3-34 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP68R[5:0]: Peripheral Output Function is Assigned to RP68 Output Pin bits (see Table 3-34 for peripheral function numbers)

REGISTER 3-90: RPOR19: PERIPHERAL PIN SELECT OUTPUT REGISTER 19

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP71R5RP71R4RP71R3RP71R2RP71R1RP71R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP70R5RP70R4RP70R3RP70R2RP70R1RP70R0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-14 Unimplemented: Read as '0'

bit 13-8 RP71R[5:0]: Peripheral Output Function is Assigned to RP71 Output Pin bits (see Table 3-34 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP70R[5:0]: Peripheral Output Function is Assigned to RP70 Output Pin bits (see Table 3-34 for peripheral function numbers)

REGISTER 3-91: RPOR20: PERIPHERAL PIN SELECT OUTPUT REGISTER 20

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
— —RP1(1)RP177R4(1)RP1R7R3(1)5 RP177R2(1)RP177R1(1)RP177R0(1)
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
— —RP1(1)RP176R4(1)RP1R6R3(1)5 RP176R2(1)RP176R1(1)RP176R0(1)
bit 7 bit 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-14 Unimplemented: Read as '0'

bit 13-8 RP177R[5:0]: Peripheral Output Function is Assigned to RP177 Output Pin bits ^(1) (see Table 3-34 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP176R[5:0]: Peripheral Output Function is Assigned to RP176 Output Pin bits ^(1) (see Table 3-34 for peripheral function numbers)

Note 1: These are virtual output ports.

REGISTER 3-92: RPOR21: PERIPHERAL PIN SELECT OUTPUT REGISTER 21

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
— —RP1(1)RP179R4(1)RP1R9R3(1)5 RP179R2(1)RP179R1(1)RP179R0(1)
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
——RP1(1)RP178R4(1)RP1R8R3(1)5 RP178R2(1)RP178R1(1)RP178R0(1)
bit 7 bit 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-14 Unimplemented: Read as '0'

bit 13-8 RP179R[5:0]: Peripheral Output Function is Assigned to RP179 Output Pin bits ^(1) (see Table 3-34 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP178R[5:0]: Peripheral Output Function is Assigned to RP178 Output Pin bits ^(1) (see Table 3-34 for peripheral function numbers)

Note 1: These are virtual output ports.

REGISTER 3-93: RPOR22: PERIPHERAL PIN SELECT OUTPUT REGISTER 22

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
— —RP1(1)RP181R4(1)RP181R3(1)5RP181R2(1)RP181R1(1)RP181R0(1)
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
— —RP1(1)RP180R4(1)RP180R3(1)5 RP180R2(1)RP180R1(1)
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-14 Unimplemented: Read as '0'

bit 13-8 RP181R[5:0]: Peripheral Output Function is Assigned to RP181 Output Pin bits (see Table 3-34 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP180R[5:0]: Peripheral Output Function is Assigned to RP180 Output Pin bits (see Table 3-34 for peripheral function numbers)

Note 1: These are virtual output ports.

TABLE 3-40: MAIN PPS INPUT CONTROL REGISTERS

RegisterBit 15 Bit 14 Bit13 Bit 12 Bit11 Bit 10 Bit 9Bit 8 Bit 7 Bit6 Bit 5 Bit 4Bit 3 Bit 2 Bit 1Bit 0
RPCONIOLOCK
RPINR0INT1R7INT1R6INT1R5INT1R4INT1R3INT1R2INT1R1INT1R0
RPINR1INT3R7INT3R6INT3R5INT3R4INT3R3INT3R2INT3R1INT3R0INT2R7INT2R5INT2R5INT2R4INT2R3INT2R2INT2R1INT2R0
RPINR2T1CKR7T1CKR6T1CKR5T1CKR4T1CKR3T1CKR2T1CKR1T1CKR0
RPINR3ICM1R7ICM1R6ICM1R5ICM1R4ICM1R3ICM1R2ICM1R1ICM1R0TCKI1R7TCKI1R6TCKI1R5TCKI1R4TCKI1R3TCKI1R2TCKI1R1TCKI1R0
RPINR4ICM2R7ICM2R6ICM2R5ICM2R4ICM2R3ICM2R2ICM2R1ICM2R0TCKI2R7TCKI2R6TCKI2R5TCKI2R4TCKI2R3TCKI2R2TCKI2R1TCKI2R0
RPINR5ICM3R7ICM3R6ICM3R5ICM3R4ICM3R3ICM3R2ICM3R1ICM3R0TCKI3R7TCKI3R6TCKI3R5TCKI3R4TCKI3R3TCKI3R2TCKI3R1TCKI3R0
RPINR6ICM4R7ICM4R6ICM4R5ICM4R4ICM4R3ICM4R2ICM4R1ICM4R0TCKI4R7TCKI4R6TCKI4R5TCKI4R4TCKI4R3TCKI4R2TCKI4R1TCKI4R0
RPINR7ICM5R7ICM5R6ICM5R5ICM5R4ICM5R3ICM5R2ICM5R1ICM5R0TCKI5R7TCKI5R6TCKI5R5TCKI5R4TCKI5R3TCKI5R2TCKI5R1TCKI5R0
RPINR8ICM6R7ICM6R6ICM6R5ICM6R4ICM6R3ICM6R2ICM6R1ICM6R0TCKI6R7TCKI6R6TCKI6R5TCKI6R4TCKI6R3TCKI6R2TCKI6R1TCKI6R0
RPINR9ICM7R7ICM7R6ICM7R5ICM7R4ICM7R3ICM7R2ICM7R1ICM7R0TCKI7R7TCKI7R6TCKI7R5TCKI7R4TCKI7R3TCKI7R2TCKI7R1TCKI7R0
RPINR10ICM8R7ICM8R6ICM8R5ICM8R4ICM8R3ICM8R2ICM8R1ICM8R0TCKI8R7TCKI8R6TCKI8R5TCKI8R4TCKI8R3TCKI8R2TCKI8R1TCKI8R0
RPINR11OCFBR7OCFBR6OCFBR5OCFBR4OCFBR3OCFBR2OCFBR1OCFBR0OCFAR7OCFAR6OCFAR5OCFAR4OCFAR3OCFAR2OCFAR1OCFAR0
RPINR12PCI9R7PCI9R6PCI9R5PCI9R4PCI9R3PCI9R2PCI9R1PCI9R0PCI8R7PCI8R6PCI8R5PCI8R4PCI8R3PCI8R2PCI8R1PCI8R0
RPINR13PCI11R7PCI11R6PCI11R5PCI11R4PCI11R3PCI11R2PCI11R1PCI11R0PCI10R6PCI10R5PCI10R4PCI10R3PCI10R2PCI10R1PCI10R0PCI10R0
RPINR14QEIB1R7QEIB1R6QEIB1R5QEIB1R4QEIB1R3QEIB1R2QEIB1R1QEIB1R0QEIA1R7QEIA1R6QEIA1R5QEIA1R4QEIA1R3QEIA1R2QEIA1R1QEIA1R0
RPINR15QEIHOM1R7QEIHOM1R6QEIHOM1R5QEIHOM1R4QEIHOM1R3QEIHOM1R2QEIHOM1R1QEIHOM1R0QEINDX1R7QEINDX1R5QEINDX1R5QEINDX1R4QEINDX1R3QEINDX1R2QEINDX1R1QEINDX1R0
RPINR18U1DSRR7U1DSRR6U1DSRR5U1DSRR4U1DSRR3U1DSRR2U1DSRR1U1DSRR0U1RXR7U1RXR6U1RXR5U1RXR4U1RXR3U1RXR2U1RXR1U1RXR0
RPINR19U2DSRR7U2DSRR6U2DSRR5U2DSRR4U2DSRR3U2DSRR2U2DSRR1U2DSRR0U2RXR7U2RXR6U2RXR5U2RXR4U2RXR3U2RXR2U2RXR1U2RXR0
RPINR20SCK1R7SCK1R6SCK1R5SCK1R4SCK1R3SCK1R2SCK1R1SCK1R0SDI1R7SDI1R6SDI1R5SDI1R4SDI1R3SDI1R2SDI1R1SDI1R0
RPINR21REFOIR7REFOIR6REFOIR5REFOIR4REFOIR3REFOIR2REFOIR1REFOIR0SS1R7SS1R5SS1R5SS1R4SS1R3SS1R2SS1R1SS1R0
RPINR22SCK2R7SCK2R6SCK2R5SCK2R4SCK2R3SCK2R2SCK2R1SCK2R0SDI2R7SDI2R6SDI2R5SDI2R4SDI2R3SDI2R2SDI2R1SDI2R0
RPINR23U1CTSR7U1CTSR6U1CTSR5U1CTSR4U1CTSR3U1CTSR2U1CTSR1U1CTSR0SS2R7SS2R6SS2R5SS2R4SS2R3SS2R2SS2R1SS2R0
RPINR26CAN1RXR7CAN1RXR6CAN1RXR5CAN1RXR4CAN1RXR3CAN1RXR2CAN1RXR1CAN1RXR0
RPINR30U2CTSR7U2CTSR6U2CTSR5U2CTSR4U2CTSR3U2CTSR2U2CTSR1U2CTSR0
RPINR37PCI17R7PCI17R6PCI17R5PCI17R4PCI17R3PCI17R2PCI17R1PCI17R0
RPINR38PCI18R7PCI18R6PCI18R5PCI18R4PCI18R3PCI18R2PCI18R1PCI18R0
RPINR42PCI13R7PCI13R6PCI13R5PCI13R4PCI13R3PCI13R2PCI13R1PCI13R0PCI12R7PCI12R6PCI12R5PCI12R4PCI12R3PCI12R2PCI12R1PCI12R0
RPINR43PCI15R7PCI15R6PCI15R5PCI15R4PCI15R3PCI15R2PCI15R1PCI15R0PCI14R7PCI14R6PCI14R5PCI14R4PCI14R3PCI14R2PCI14R1PCI14R0
RPINR44SENT1R7SENT1R6SENT1R5SENT1R4SENT1R3SENT1R2SENT1R1SENT1R0PCI16R7PCI16R6PCI16R5PCI16R4PCI16R3PCI16R2PCI16R1PCI16R0
RPINR45CLCINAR7CLCINAR6CLCINAR5CLCINAR4CLCINAR3CLCINAR2CLCINAR1CLCINAR0SENT2R7SENT2R6SENT2R5SENT2R4SENT2R3SENT2R2SENT2R1SENT2R0
RPINR46CLCINCR7CLCINCR6CLCINCR5CLCINCR4CLCINCR3CLCINCR2CLCINCR1CLCINCR0CLCINBR7CLCINBR6CLCINBR5CLCINBR4CLCINBR3CLCINBR2CLCINBR1CLCINBR0
RPINR47ADCTRGR7ADCTRGR6ADCTRGR5ADCTRGR4ADCTRGR3ADCTRGR2ADCTRGR1ADCTRGR0CLCINDR7CLCINDR6CLCINDR5CLCINDR4CLCINDR3CLCINDR2CLCINDR1CLCINDR0

TABLE 3-41: MAIN PPS OUTPUT CONTROL REGISTERS (1)

Register Bit15 Bit 14Bit 13Bit 12Bit 11Bit 10Bit 9Bit 8Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
RPOR0RP33R5RP33R4RP33R3RP33R2RP33R1RP33R0RP32R5RP32R4RP32R3RP32R2RP32R1RP32R0
RPOR1RP35R5RP35R4RP35R3RP35R2RP35R1RP35R0RP34R5RP34R4RP34R3RP34R2RP34R1RP34R0
RPOR2RP37R5RP37R4RP37R3RP37R2RP37R1RP37R0RP36R5RP36R4RP36R3RP36R2RP36R1RP36R0
RPOR3RP39R5RP39R4RP39R3RP39R2RP39R1RP39R0RP38R5RP38R4RP38R3RP38R2RP38R1RP38R0
RPOR4RP41R5RP41R4RP41R3RP41R2RP41R1RP41R0RP40R5RP40R4RP40R3RP40R2RP40R1RP40R0
RPOR5RP43R5RP43R4RP43R3RP43R2RP43R1RP43R0RP42R5RP42R4RP42R3RP42R2RP42R1RP42R0
RPOR6RP45R5RP45R4RP45R3RP45R2RP45R1RP45R0RP44R5RP44R4RP44R3RP44R2RP44R1RP44R0
RPOR7RP47R5RP47R4RP47R3RP47R2RP47R1RP47R0RP46R5RP46R4RP46R3RP46R2RP46R1RP46R0
RPOR8RP49R5RP49R4RP49R3RP49R2RP49R1RP49R0RP48R5RP48R4RP48R3RP48R2RP48R1RP48R0
RPOR9RP51R5RP51R4RP51R3RP51R2RP51R1RP51R0RP50R5RP50R4RP50R3RP50R2RP50R1RP50R0
RPOR10RP53R5RP53R4RP53R3RP53R2RP53R1RP53R0RP52R5RP52R4RP52R3RP52R2RP52R1RP52R0
RPOR11RP55R5RP55R4RP55R3RP55R2RP55R1RP55R0RP54R5RP54R4RP54R3RP54R2RP54R1RP54R0
RPOR12RP57R5RP57R4RP57R3RP57R2RP57R1RP57R0RP56R5RP56R4RP56R3RP56R2RP56R1RP56R0
RPOR13RP59R5RP59R4RP59R3RP59R2RP59R1RP59R0RP58R5RP58R4RP58R3RP58R2RP58R1RP58R0
RPOR14RP61R5RP61R4RP61R3RP61R2RP61R1RP61R0RP60R5RP60R4RP60R3RP60R2RP60R1RP60R0
RPOR15RP63R5RP63R4RP63R3RP63R2RP63R1RP63R0RP62R5RP62R4RP62R3RP62R2RP62R1RP62R0
RPOR16RP65R5RP65R4RP65R3RP65R2RP65R1RP65R0RP64R5RP64R4RP64R3RP64R2RP64R1RP64R0
RPOR17RP67R5RP67R4RP67R3RP67R2RP67R1RP67R0RP66R5RP66R4RP66R3RP66R2RP66R1RP66R0
RPOR18RP69R5RP69R4RP69R3RP69R2RP69R1RP69R0RP68R5RP68R4RP68R3RP68R2RP68R1RP68R0
RPOR19RP71R5RP71R4RP71R3RP71R2RP71R1RP71R0RP70R5RP70R4RP70R3RP70R2RP70R1RP70R0
RPOR20RP177R5RP177R4RP177R3RP177R2RP177R1RP177R0RP176R5RP176R4RP176R3RP176R2RP176R1RP176R0
RPOR21RP179R5RP179R4RP179R3RP179R2RP179R1RP179R0RP178R5RP178R4RP178R3RP178R2RP178R1RP178R0
RPOR22RP181R5RP181R4RP181R3RP181R2RP181R1RP181R0RP180R5RP180R4RP180R3RP180R2RP180R1RP180R0

Note 1: Not all RP pins are available on all packages. Make sure the selected device variant has the feature available on the device.

3.8 Deadman Timer (DMT) (Main Only)

Note 1: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive reference source. To complement the information in this data sheet, refer to “Deadman Timer (DMT)” (www.microchip.com/DS70005155), which is available from the Microchip website (www.microchip.com).

2: The Secondary core does not have any DMT module; only the Main has the DMT.

The primary function of the Deadman Timer (DMT) is to interrupt the processor in the event of a software malfunction. The DMT, which works on the system clock, is a free-running instruction fetch timer, which is clocked whenever an instruction fetch occurs, until a count match occurs. Instructions are not fetched when the processor is in Sleep mode.

DMT can be enabled in the Configuration fuse or by software in the DMTCON register by setting the ON bit. The DMT consists of a 32-bit counter with a time-out count match value, as specified by the two 16-bit Configuration Fuse registers: FDMTCNTL and FDMTCNTH.

A DMT is typically used in mission-critical and safety-critical applications, where any single failure of the software functionality and sequencing must be detected. Table 3-42 shows an overview of the DMT module.

TABLE 3-42: DMT MODULE OVERVIEW

No. of DMT ModulesIdentical (Modules)
Main Core 1 No
Secondary Core NoneNA

Figure 3-22 shows a block diagram of the Deadman Timer module.

flowchart
graph LR
    A["Instruction Fetched Strobe(2)"] --> B["DMT Enable"]
    C["System Clock"] --> B
    B --> D["32-Bit Counter"]
    D --> E["(Counter) = DMT Max Count(1)"]
    E --> F["Improper Sequence Flag"]
    F --> G["DMT Event"]
    H["BAD1"] --> F
    I["BAD2"] --> F

Note 1: DMT Max Count is controlled by the initial value of the FDMTCNTL and FDMTCNTH Configuration registers.
2: DMT window interval is controlled by the value of the FDMTIVTL and FDMTIVTH Configuration registers.

3.8.1 DEADMAN TIMER CONTROL/STATUS REGISTERS

REGISTER 3-94: DMTCON: DEADMAN TIMER CONTROL REGISTER

R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15 ON: DMT Module Enable bit (1)

1 = Deadman Timer module is enabled
0 = Deadman Timer module is not enabled

bit 14-0 Unimplemented: Read as '0'

Note 1: This bit has control only when DMTDIS = 0 in the FDMT register.

REGISTER 3-95: DMTPRECLR: DEADMAN TIMER PRECLEAR REGISTER

R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
STEP1[7:0]
bit 15bit 8
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-8 STEP1[7:0]: DMT Preclear Enable bits

01000000 = Enables the Deadman Timer preclear (Step 1)

All Other

Write Patterns = Sets the BAD1 flag; these bits are cleared when a DMT Reset event occurs. STEP1[7:0] bits are also cleared if the STEP2[7:0] bits are loaded with the correct value in the correct sequence.

bit 7-0 Unimplemented: Read as '0'

REGISTER 3-96: DMTCLR: DEADMAN TIMER CLEAR REGISTER

U-0 U-0 U-0 U-0 U-0 U-0 U-0
————
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
STEP2[7:0]
bit 7 bit 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-8 Unimplemented: Read as '0'

bit 7-0 STEP2[7:0]: DMT Clear Timer bits

00001000 = Clears STEP1[7:0], STEP2[7:0] and the Deadman Timer if preceded by the correct loading of the STEP1[7:0] bits in the correct sequence. The write to these bits may be verified by reading the DMTCNTL/H register and observing the counter being reset.

All Other

Write Patterns = Sets the BAD2 bit; the value of STEP1[7:0] will remain unchanged and the new value being written to STEP2[7:0] will be captured. These bits are cleared when a DMT Reset event occurs.

REGISTER 3-97: DMTSTAT: DEADMAN TIMER STATUS REGISTER

Legend:HC = Hardware 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 15-8 Unimplemented: Read as '0'

bit 7 BAD1: Deadman Timer Bad STEP1[7:0] Value Detect bit

1 = Incorrect STEP1[7:0] value was detected

0 = Incorrect STEP1[7:0] value was not detected

bit 6 BAD2: Deadman Timer Bad STEP2[7:0] Value Detect bit

1 = Incorrect STEP2[7:0] value was detected

0 = Incorrect STEP2[7:0] value was not detected

bit 5 DMTEVENT: Deadman Timer Event bit

1 = Deadman Timer event was detected (counter expired, or bad STEP1[7:0] or STEP2[7:0] value was entered prior to counter increment)

0 = Deadman Timer event was not detected

bit 4-1 Unimplemented: Read as '0'

bit 0 WINOPN: Deadman Timer Clear Window bit

1 = Deadman Timer clear window is open

0 = Deadman Timer clear window is not open

REGISTER 3-98: DMTCNTL: DEADMAN TIMER COUNT REGISTER LOW

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
COUNTER[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
COUNTER[7:0]
bit 7 bit 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-0 COUNTER[15:0]: Read Current Contents of Lower DMT Counter bits

REGISTER 3-99: DMTCNTH: DEADMAN TIMER COUNT REGISTER HIGH

R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
COUNTER[31:24]
bit 15bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
COUNTER[23:16]
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-0 COUNTER[31:16]: Read Current Contents of Higher DMT Counter bits

REGISTER 3-100: DMTPSCNTL: DMT POST-CONFIGURE COUNT STATUS REGISTER LOW

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PSCNT[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PSCNT[7:0]
bit 7 bit 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-0

PSCNT[15:0]: Lower DMT Instruction Count Value Configuration Status bits

This is always the value of the FDMTCNTL Configuration register.

REGISTER 3-101: DMTPSCNTH: DMT POST-CONFIGURE COUNT STATUS REGISTER HIGH

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PSCNT[31:24]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PSCNT[23:16]
bit 7 bit 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-0

PSCNT[31:16]: Higher DMT Instruction Count Value Configuration Status bits

This is always the value of the FDMTCNTH Configuration register.

REGISTER 3-102: DMTPSINTVL: DMT POST-CONFIGURE INTERVAL STATUS REGISTER LOW

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PSINTV[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PSINTV[7:0]
bit 7 bit 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-0 PSINTV[15:0]: Lower DMT Window Interval Configuration Status bits

This is always the value of the FDMTIVTL Configuration register.

REGISTER 3-103: DMTPSINTVH: DMT POST-CONFIGURE INTERVAL STATUS REGISTER HIGH

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PSINTV[31:24]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PSINTV[23:16]
bit 7 bit 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-0 PSINTV[31:16]: Higher DMT Window Interval Configuration Status bits

This is always the value of the FDMTIVTH Configuration register.

REGISTER 3-104: DMTHOLDREG: DMT HOLD REGISTER (1)

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
UPRCNT[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
UPRCNT[7:0]
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-0 UPRCNT[15:0]: DMTCNTH Register Value when DMTCNTL and DMTCNTH were Last Read bits

Note 1: The DMTHOLDREG register is initialized to '0' on Reset, and is only loaded when the DMTCNTL and DMTCNTH registers are read.

3.9 Controller Area Network (CAN FD) Module (Host Only)

Note 1: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive reference source. To complement the information in this data sheet, refer to “CAN Flexible Data-Rate (FD) Protocol Module” (www.microchip.com/DS70005340), which is available from the Microchip website (www.microchip.com).

2: Only the Main core has a CAN FD module.

Table 3-43 shows an overview of the CAN FD module.
TABLE 3-43: CAN FD MODULE OVERVIEW

Number of CAN ModulesIdentical (Modules)
Main Core 1 NA
Secondary CoreNone NA

3.9.1 FEATURES

The CAN FD module has the following features:

General

• Nominal (Arbitration) Bit Rate up to 1 Mbps
• Data Bit Rate up to 8 Mbps
• CAN FD Controller modes:
- Mixed CAN 2.0B and CAN FD mode
- CAN 2.0B mode
• Conforms to ISO11898-1:2015

Message FIFOs

  • Seven FIFOs, Configurable as Transmit or Receive FIFOs
    • One Transmit Queue (TXQ)
    • Transmit Event FIFO (TEF) with 32-Bit Timestamp

Message Transmission

  • Message Transmission Prioritization:
  • Based on priority bit field, and/or
  • Message with lowest ID gets transmitted first using the TXQ
  • Programmable Automatic Retransmission Attempts: Unlimited, Three Attempts or Disabled

Message Reception

• 16 Flexible Filter and Mask Objects.
• Each Object can be Configured to Filter either:
- Standard ID + first 18 data bits or
- Extended ID

- 32-Bit Timestamp.

- The CAN FD Bit Stream Processor (BSP) Implements the Medium Access Control of the CAN FD Protocol Described in ISO11898-1:2015. It serializes and deserializes the bit stream, encodes and decodes the CAN FD frames, manages the medium access, Acknowledges frames, and detects and signals errors.

- The TX Handler Prioritizes the Messages that are Requested for Transmission by the Transmit FIFOs. It uses the RAM interface to fetch the transmit data from RAM and provides them to the BSP for transmission.

- The BSP provides Received Messages to the RX Handler. The RX handler uses acceptance filters to filter out messages that shall be stored in the Receive FIFOs. It uses the RAM interface to store received data into RAM.

• Each FIFO can be Configured either as a Transmit or Receive FIFO. The FIFO control keeps track of the FIFO head and tail, and calculates the user address. In a TX FIFO, the user address points to the address in RAM where the data for the next transmit message shall be stored. In an RX FIFO, the user address points to the address in RAM where the data of the next receive message shall be read. The user notifies the FIFO that a message was written to or read from RAM by incrementing the head/tail of the FIFO.

- The Transmit Queue (TXQ) is a Special Transmit FIFO that Transmits the Messages based on the ID of the Messages Stored in the Queue.

- The Transmit Event FIFO (TEF) Stores the Message IDs of the Transmitted Messages.

- A Free-Running Time Base Counter is used to Timestamp Received Messages. Messages in the TEF can also be timestamped.

- The CAN FD Controller module Generates Interrupts when New Messages are Received or when Messages were Transmitted Successfully.

Figure 3-23 shows the CAN FD system block diagram.

Note:CAN is available only on the dsPIC33CHXXXMP50X devices.

FIGURE 3-23: CAN FD MODULE BLOCK DIAGRAM
Microchip dsPIC33CH64MP208 - Message Reception - 1

flowchart
graph TD
    subgraph Device RAM
        A["TEF"] --> B["Message Object 0"]
        A --> C["TXQ"]
        A --> D["FIFO 1"]
        A --> E["FIFO 7"]
        B --> F["Message Object 31"]
        C --> G["Message Object 31"]
        D --> H["Message Object 31"]
        E --> I["Message Object 31"]
    end

    subgraph C1TX
        J["TX Handler"]
        K["TX Prioritization"]
    end

    subgraph C1RX
        L["RX Handler"]
        M["Filter and Masks"]
    end

    subgraph Device RAM
        N["Timestamping"]
        O["Interrupt Control"]
        P["Error Handling Diagnostics"]
    end

    A --> Q["Device RAM"]
    B --> Q
    C --> Q
    D --> Q
    E --> Q
    Q --> R["TFE"]
    Q --> S["TXQ"]
    Q --> T["FIFO 1"]
    Q --> U["FIFO 7"]

3.9.2 CAN CONTROL/STATUS REGISTERS

REGISTER 3-105: C1CONH: CAN CONTROL REGISTER HIGH (2)

R/W-0 R/W-0 R/W-0 R/W-0 S/HC-0 R/W-1 R/W-0 R/W-0
TXBWS3TXBWS2TXBWS1TXBWS0ABATREQOP2REQOP1REQOP0
bit 15 bit 8
R-1R-0R-0R/W-1R/W-1R/W-0R/W-0R/W-0
OPMOD2OPMOD1OPMOD0TXQEN(1) STEF^(1) SERRLOM^(1) ESIGM^(1) RTXAT^(1)
bit 7 bit 0
Legend:S = Settable bitHC = Hardware Clearable bit
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-12 TXBWS[3:0]: Transmit Bandwidth Sharing bits

1111-1100 = 4096

1011 = 2048

1010 = 1024

1001 = 512

1000 = 256

0111 = 128

0110 = 64

0101 = 32

0100 = 16

0011 = 8

0010 = 4

0001 = 2

0000 = No delay

bit 11 ABAT: Abort All Pending Transmissions bit

1 = Signals all transmit buffers to abort transmission

0 = Module will clear this bit when all transmissions are aborted

bit 10-8 REQOP[2:0]: Request Operation Mode bits

111 = Sets Restricted Operation mode

110 = Sets Normal CAN 2.0 mode; error frames on CAN FD frames

101 = Sets External Loopback mode

100 = Sets Configuration mode

011 = Sets Listen Only mode

010 = Sets Internal Loopback mode

001 = Sets Disable mode

000 = Sets Normal CAN FD mode; supports mixing of full CAN FD and classic CAN 2.0 frames

bit 7-5 OPMOD[2:0]: Operation Mode Status bits

111 = Module is in Restricted Operation mode

110 = Module is in Normal CAN 2.0 mode; error frames on CAN FD frames

101 = Module is in External Loopback mode

100 = Module is in Configuration mode

011 = Module is in Listen Only mode

010 = Module is in Internal Loopback mode

001 = Module is in Disable mode

000 = Module is in Normal CAN FD mode; supports mixing of full CAN FD and classic CAN 2.0 frames

Note 1: These bits can only be modified in Configuration mode (OPMOD[2:0] = 100).

2: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-105: C1CONH: CAN CONTROL REGISTER HIGH (2) (CONTINUED)

bit 4 TXQEN: Enable Transmit Queue bit (1)

1 = Enables Transmit Message Queue (TXQ) and reserves space in RAM
0 = Does not reserve space in RAM for TXQ

bit 3 STEF: Store in Transmit Event FIFO bit

(1)

1 = Saves transmitted messages in TEF
0 = Does not save transmitted messages in TEF

bit 2 SERRLOM: Transition to Listen Only Mode on System Error bit ^(1)

1 = Transitions to Listen Only mode
0 = Transitions to Restricted Operation mode

bit 1 ESIGM: Transmit ESI in Gateway Mode bit

(1)

1 = ESI is transmitted as recessive when ESI of the message is high or CAN controller is error passive
0 = ESI reflects error status of CAN controller

bit 0 RTXAT: Restrict Retransmission Attempts bit

(1)

1 = Restricted retransmission attempts, uses TXAT[1:0] bits (C1TXQCONH[6:5])
0 = Unlimited number of retransmission attempts, TXAT[1:0] bits will be ignored

Note 1: These bits can only be modified in Configuration mode (OPMOD[2:0] = 100).

2: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-106: C1CONL: CAN CONTROL REGISTER LOW (2)

R/W-0 U-0 R/W-0 R/W-0 R/W-0 R/W-1 R/W-1 R/W-1
CON — SIDL BRSDIS BUSY WFT1 WFT0 WAKFIL(1)
bit 15 bit 8
R/W-0R/W-1R/W-1R/W-0R/W-0R/W-0R/W-0R/W-0
CLKSEL(1)PXEDIS(1)ISOCRCEN(1)DNCNT4DNCNT3DNCNT2DNCNT1DNCNT0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15 CON: CAN Enable bit

1 = CAN module is enabled

0 = CAN module is disabled

bit 14 Unimplemented: Read as '0'

bit 13 SIDL: CAN Stop in Idle Control bit

1 = Stops module operation in Idle mode

0 = Does not stop module operation in Idle mode

bit 12 BRSDIS: Bit Rate Switching (BRS) Disable bit

1 = Bit Rate Switching is disabled, regardless of BRS in the transmit message object

0 = Bit Rate Switching depends on BRS in the transmit message object

bit 11 BUSY: CAN Module is Busy bit

1 = The CAN module is active

0 = The CAN module is inactive

bit 10-9 WFT[1:0]: Selectable Wake-up Filter Time bits

11 = T11FILTER

10 = T10FILTER

01 = T01FILTER

00 = T00FILTER

bit 8 WAKFIL: Enable CAN Bus Line Wake-up Filter bit ^(1)

1 = Uses CAN bus line filter for wake-up

0 = CAN bus line filter is not used for wake-up

bit 7 CLKSEL: Module Clock Source Select bit (1)

1 = AFPLLO is selected as the source

0 = FCAN is selected as the source

bit 6 PXEDIS: Protocol Exception Event Detection Disabled bit ^(1)

A recessive "reserved bit" following a recessive FDF bit is called a Protocol Exception.

1 = Protocol Exception is treated as a form error

0 = If a Protocol Exception is detected, CAN will enter the bus integrating state

bit 5 ISOCRCEN: Enable ISO CRC in CAN FD Frames bit ^(1)

1 = Includes stuff bit count in CRC field and uses non-zero CRC initialization vector

0 = Does not include stuff bit count in CRC field and uses CRC initialization vector with all zeros

bit 4-0 DNCNT[4:0]: DeviceNet™ Filter Bit Number bits

10011-11111 = Invalid selection (compares up to 18 bits of data with EID)

10010 = Compares up to Data Byte 2, bit 6 with EID17

...

00001 = Compares up to Data Byte 0, bit 7 with EID0

00000 = Does not compare data bytes

Note 1: These bits can only be modified in Configuration mode (OPMOD[2:0] = 100).

2: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-107: C1NBTCFGH: CAN NOMINAL BIT TIME CONFIGURATION REGISTER HIGH (1,2)

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
BRP[7:0]
bit 15 bit 8
R/W-0 R/W-0 R/W-1 R/W-1 R/W-1 R/W-1 R/W-0 R/W-0
TSEG1[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 15-8 BRP[7:0]: Baud Rate Prescaler bits

$$ 1 1 1 1 \quad 1 1 1 1 = T Q = 2 5 6 / F s y s $$

$$ 0 0 0 0 \quad 0 0 0 0 = T _ {Q} = 1 / F s y s $$

bit 7-0 TSEG1[7:0]: Time Segment 1 bits (Propagation Segment + Phase Segment 1)

$$ 1 1 1 1 \quad 1 1 1 1 = \text { Length is } 2 5 6 \times T _ {Q} $$

$$ \dots \quad 0 0 0 0 \quad 0 0 0 0 = \text { Length is } 1 \times T _ {Q} $$

Note 1: These bits can only be modified in Configuration mode (OPMOD[2:0] = 100).

2: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-108: C1NBTCFGL: CAN NOMINAL BIT TIME CONFIGURATION REGISTER LOW ^(1,2)

U-0R/W-0 R/W-0 R/W-0 R/W-1 R/W-1 R/W-1 R/W-1
TSEG2[6:0]
bit 15 bit 8
U-0R/W-0 R/W-0 R/W-0 R/W-1 R/W-1 R/W-1 R/W-1
SJW[6:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 15 Unimplemented: Read as '0'

bit 14-8 TSEG2[6:0]: Time Segment 2 bits (Phase Segment 2)

$$ 1 1 1 \quad 1 1 1 1 = \text { Length is } 1 2 8 \times T _ {Q} $$

$$ 0 0 0 0 0 0 0 0 = \text { Length is } 1 \times T _ {Q} $$

bit 7 Unimplemented: Read as '0'

bit 6-0 SJW[6:0]: Synchronization Jump Width bits

$$ 1 1 1 \quad 1 1 1 1 = \text { Length is } 1 2 8 \times T _ {Q} $$

$$ \dots \quad 0 0 0 \quad 0 0 0 0 = \text { Length is } 1 \times T _ {Q} $$

Note 1: These bits can only be modified in Configuration mode (OPMOD[2:0] = 100).

2: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-109: C1DBTCFGH: CAN DATA BIT TIME CONFIGURATION REGISTER HIGH (1,2)

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
BRP[7:0]
bit 15 bit 8
U-0 U-0 U-0 R/W-0 R/W-1 R/W-1 R/W-1 R/W-0
TSEG1[4:0]
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 cleared x = Bit is unknown

bit 15-8 BRP[7:0]: Baud Rate Prescaler bits

1111 1111 = TQ = 256/Fsys

...

0000 0000 = TQ = 1/Fsys

bit 7-5 Unimplemented: Read as '0'

bit 4-0 TSEG1[4:0]: Time Segment 1 bits (Propagation Segment + Phase Segment 1)

1 1111 = Length is 32 x Tq

...

0 0000 = Length is 1 x TQ

Note 1: This register can only be modified in Configuration mode (OPMOD[2:0] = 100).

2: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-110: C1DBTCFGL: CAN DATA BIT TIME CONFIGURATION REGISTER LOW ^(1,2)

U-0 U-0 U-0U-0 R/W-0 R/W-0 R/W-1R/W-1
TSEG2[3:0]
bit 15 bit 8
U-0 U-0 U-0U-0 R/W-0 R/W-0 R/W-1R/W-1
SJW[3:0]
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-12 Unimplemented: Read as '0'

bit 11-8 TSEG2[3:0]: Time Segment 2 bits (Phase Segment 2)

1111 = Length is 16 x TQ

...

0000 = Length is 1 x TQ

bit 7-4 Unimplemented: Read as '0'

Note 1: This register can only be modified in Configuration mode (OPMOD[2:0] = 100).

2: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-110: C1DBTCFGL: CAN DATA BIT TIME CONFIGURATION REGISTER LOW ^(1,2)

bit 3-0 SJW[3:0]: Synchronization Jump Width bits

1111 = Length is 16 x TQ

+ + *

0000 = Length is 1 x TQ

Note 1: This register can only be modified in Configuration mode (OPMOD[2:0] = 100).

2: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-111: C1TDCH: CAN TRANSMITTER DELAY COMPENSATION REGISTER HIGH (1,2)

U-0 U-0 U-0 U-0 U-0 R/W-0 R/W-0
EDGFLTENSID11EN
bit 15 bit 8
U-0 U-0 U-0 U-0 U-0 R/W-1 R/W-0
TDCMOD1TDCMOD0
bit 7 bit 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-10 Unimplemented: Read as '0'

bit 9 EDGFLTEN: Enable Edge Filtering During Bus Integration State bit

1 = Edge filtering is enabled according to ISO11898-1:2015

0 = Edge filtering is disabled

bit 8 SID11EN: Enable 12-Bit SID in CAN FD Base Format Messages bit

1 = RRS is used as SID11 in CAN FD base format messages: SID[11:0] = {SID[10:0], SID11}

0 = Does not use RRS; SID[10:0]

bit 7-2 Unimplemented: Read as '0'

bit 1-0 TDCMOD[1:0]: Transmitter Delay Compensation Mode bits (Secondary Sample Point (SSP))

10-11 = Auto: Measures delay and adds TDCO[6:0]

01 = Manual: Does not measure, uses TDCV[5:0] + TDCO[6:0] from register

00 = Disable

Note 1: This register can only be modified in Configuration mode (OPMOD[2:0] = 100).

2: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-112: C1TDCL: CAN TRANSMITTER DELAY COMPENSATION REGISTER LOW (1,2,3)

U-0 R/W-0 R/W-0 R/W-1 R/W-0 R/W-0 R/W-0 R/W-0
— TDCO[6:0]
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
TDCV[5:0]
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15 Unimplemented: Read as '0'

bit 14-8 TDCO[6:0]: Transmitter Delay Compensation Offset bits (Secondary Sample Point (SSP))

111 1111 = -64 x TCAN
...
011 1111 = 63 x TCAN
...
000 0000 = 0 x TCAN 

bit 7-6 Unimplemented: Read as '0'

bit 5-0 TDCV[5:0]: Transmitter Delay Compensation Value bits (Secondary Sample Point (SSP))

11 1111 = 63 x TSYSCLK
...
00 0000 = 0 x TSYSCLK 

Note 1: This register can only be modified in Configuration mode (OPMOD[2:0] = 100).

2: CAN is available only on the dsPIC33CHXXXMP50X devices.

3: TCAN = 1/FCAN. FCAN is the clock which comes out of CAN clock generator.

REGISTER 3-113: C1TBCH: CAN TIME BASE COUNTER REGISTER HIGH (1,2,3)

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
TBC[31:24]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
TBC[23:16]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared

bit 15-0 TBC[31:16]: CAN Time Base Counter bits

This is a free-running timer that increments every TBCPREx clock when TBCEN is set.

Note 1: The Time Base Counter (TBC) will be stopped and reset when TBCEN = 0 to save power.

2: The TBC prescaler count will be reset on any write to C1TBCH/L (TBCPREx will be unaffected).
3: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-114: C1TBCL: CAN TIME BASE COUNTER REGISTER LOW (1,2,3)

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
TBC[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
TBC[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-0 TBC[15:0]: CAN Time Base Counter bits

This is a free-running timer that increments every TBCPREx clock when TBCEN is set.

Note 1: The TBC will be stopped and reset when TBCEN = 0 to save power.

2: The TBC prescaler count will be reset on any write to C1TBCH/L (TBCPREx will be unaffected).
3: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-115: C1TSCONH: CAN TIMESTAMP CONTROL REGISTER HIGH (1)

U-0 U-0 U-0 U-0 U-0 U-0 U-0
————
bit 15bit 8
U-0 U-0 U-0 U-0 U-0R/W-0R/W-0R/W-0
TSRESTSEOFTBCEN
bit 7 bit 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-3 Unimplemented: Read as '0'

bit 2 TSRES: Timestamp Reset bit (CAN FD frames only)

1 = At sample point of the bit following the FDF bit

0 = At sample point of Start-of-Frame (SOF)

bit 1 TSEOF: Timestamp End-of-Frame (EOF) bit

1 = Timestamp when frame is taken valid (11898-1 10.7):

- RX no error until last, but one bit of EOF

- TX no error until the end of EOF

0 = Timestamp at "beginning" of frame:

- Classical Frame: At sample point of SOF

- FD Frame: See TSRES bit

bit 0 TBCEN: Time Base Counter Enable bit

1 = Enables TBC

0 = Stops and resets TBC

Note 1: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-116: C1TSCONL: CAN TIMESTAMP CONTROL REGISTER LOW ^(1)

U-0 U-0 U-0 U-0 U-0 U-0R/W-0R/W-0
————TBCPRE[9:8]
bit 15bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
TBCPRE[7:0]
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-10 Unimplemented: Read as '0'

bit 9-0 TBCPRE[9:0]: CAN Time Base Counter Prescaler bits

1023 = TBC increments every 1024 clocks

...

0 = TBC increments every 1 clock

Note 1: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-117: C1VECH: CAN INTERRUPT CODE REGISTER HIGH (1)

U-0 R-1 R-0 R-0 R-0 R-0 R-0 R-0
— RXCODE[6:0]
bit 15 bit 8
U-0 R-1 R-0 R-0 R-0 R-0 R-0 R-0
— TXCODE[6:0]
bit 7 bit 0 

Legend:

R = Readable bit W = Writable bit    U = Unimplemented bit, read as '0'
-n = Value at POR    '1' = Bit is set    '0' = Bit is cleared    x = Bit is unknown 

bit 15 Unimplemented: Read as '0'

bit 14-8 RXCODE[6:0]: Receive Interrupt Flag Code bits
1000001-1111111 = Reserved
1000000 = No interrupt
0001000-0111111 = Reserved
0000111 = FIFO 7 interrupt (RFIF7 is set)
...
0000010 = FIFO 2 interrupt (RFIF2 is set)
0000001 = FIFO 1 interrupt (RFIF1 is set)
0000000 = Reserved; FIFO 0 cannot receive 

bit 7 Unimplemented: Read as '0'

bit 6-0
TXCODE[6:0]: Transmit Interrupt Flag Code bits
1000001-1111111 = Reserved
1000000 = No interrupt
0001000-0111111 = Reserved
0000111 = FIFO 7 interrupt (TFIF7 is set)
...
0000001 = FIFO 1 interrupt (TFIF1 is set)
0000000 = FIFO 0 interrupt (TFIF0 is set) 

Note 1: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-118: C1VECL: CAN INTERRUPT CODE REGISTER LOW (1)

U-0 U-0 U-0 R-0 R-0 R-0 R-0 R-0
— — —FILHIT[4:0]
bit 15 bit 8
U-0 R-1 R-0 R-0 R-0 R-0 R-0 R-0
ICODE[6:0]
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-13 Unimplemented: Read as '0'

bit 12-8 FILHIT[4:0]: Filter Hit Number bits

01111 = Filter 15

01110 = Filter 14

...

00001 = Filter 1

00000 = Filter 0

bit 7 Unimplemented: Read as '0'

bit 6-0 ICODE[6:0]: Interrupt Flag Code bits

1001011-1111111 = Reserved

1001010 = Transmit attempt interrupt (any bit in C1TXATIF is set)

1001001 = Transmit event FIFO interrupt (any bit in C1TEFSTA is set)

1001000 = Invalid message occurred (IVMIF/IE)

1000111 = CAN module mode change occurred (MODIF/IE)

1000110 = CAN timer overflow (TBCIF/IE)

1000101 = RX/TX MAB overflow/underflow (RX: Message received before previous message was saved to memory; TX: Can't feed TX MAB fast enough to transmit consistent data)

1000100 = Address error interrupt (illegal FIFO address presented to system)

1000011 = Receive FIFO overflow interrupt (any bit in C1RXOVIF is set)

1000010 = Wake-up interrupt (WAKIF/WAKIE)

1000001 = Error interrupt (CERRIF/IE)

1000000 = No interrupt

0001000-0111111 = Reserved

0000111 = FIFO 7 interrupt (TFIF7 or RFIF7 is set)

* * *

0000001 = FIFO 1 interrupt (TFIF1 or RFIF1 is set)

0000000 = FIFO 0 interrupt (TFIF0 is set)

Note 1: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-119: C1INTH: CAN INTERRUPT REGISTER HIGH (1)

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 U-0 U-0
IVMIE WAKIE CERRIE SERRIE RXOVIETXATIE
bit 15 bit 8
U-0U-0U-0R/W-0R/W-0R/W-0R/W-0R/W-0
TEFIEMODIETBCIERXIETXIE
bit 7 bit 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 15IVMIE: Invalid Message Interrupt Enable bit1 = Invalid message interrupt is enabled0 = Invalid message interrupt is disabled
bit 14WAKIE: Bus Wake-up Activity Interrupt Enable bit1 = Wake-up activity interrupt is enabled0 = Wake-up Activity Interrupt is disabled
bit 13CERRIE: CAN Bus Error Interrupt Enable bit1 = CAN bus error interrupt is enabled0 = CAN bus error interrupt is disabled
bit 12SERRIE: System Error Interrupt Enable bit1 = System error interrupt is enabled0 = System error interrupt is disabled
bit 11RXOVIE: Receive Buffer Overflow Interrupt Enable bit1 = Receive buffer overflow interrupt is enabled0 = Receive buffer overflow interrupt is disabled
bit 10TXATIE: Transmit Attempt Interrupt Enable bit1 = Transmit attempt interrupt is enabled0 = Transmit attempt interrupt is disabled
bit 9-5Unimplemented: Read as '0'
bit 4TEFIE: Transmit Event FIFO Interrupt Enable bit1 = Transmit event FIFO interrupt is enabled0 = Transmit event FIFO interrupt is disabled
bit 3MODIE: Mode Change Interrupt Enable bit1 = Mode change interrupt is enabled0 = Mode change interrupt is disabled
bit 2TBCIE: CAN Timer Interrupt Enable bit1 = CAN timer interrupt is enabled0 = CAN timer interrupt is disabled
bit 1RXIE: Receive Object Interrupt Enable bit1 = Receive object interrupt is enabled0 = Receive object interrupt is disabled
bit 0TXIE: Transmit Object Interrupt Enable bit1 = Transmit object interrupt is enabled0 = Transmit object interrupt is disabled

Note 1: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-120: C1INTL: CAN INTERRUPT REGISTER LOW (2)

HS/C-0 HS/C-0 HS/C-0 HS/C-0 R-0 R-0 U-0 U-0
IVMIF(1)WAKIF(1)CERRIF(1)SERRIF(1)RXOVIF TXATIF
bit 15 bit 8
U-0U-0U-0R-0HS/C-0HS/C-0R-0R-0
TEFIF MODIF^(1) TBCIF^(1) RXIFTXIF
bit 7 bit 0
Legend:C = Clearable bitHS = Hardware Settable bit
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15 IVMIF: Invalid Message Interrupt Flag bit ^(1)

1 = Invalid message interrupt occurred
0 = No invalid message interrupt

bit 14 WAKIF: Bus Wake-up Activity Interrupt Flag bit ^(1)

1 = Wake-up activity interrupt occurred
0 = No wake-up activity interrupt

bit 13 CERRIF: CAN Bus Error Interrupt Flag bit ^(1)

1 = CAN bus error interrupt occurred
0 = No CAN bus error interrupt

bit 12 SERRIF: System Error Interrupt Flag bit ^(1)

1 = System error interrupt occurred
0 = No system error interrupt

bit 11 RXOVIF: Receive Buffer Overflow Interrupt Flag bit

1 = Receive buffer overflow interrupt occurred
0 = No receive buffer overflow interrupt

bit 10 TXATIF: Transmit Attempt Interrupt Flag bit

1 = Transmit attempt interrupt occurred
0 = No Transmit Attempt Interrupt

bit 9-5 Unimplemented: Read as '0'

bit 4 TEFIF: Transmit Event FIFO Interrupt Flag bit

1 = Transmit event FIFO interrupt occurred
0 = No transmit event FIFO interrupt

bit 3 MODIF: CAN Mode Change Interrupt Flag bit (1)

1 = CAN module mode change occurred (OPMOD[2:0] have changed to reflect REQOP[2:0])
0 = No mode change occurred

bit 2 TBCIF: CAN Timer Overflow Interrupt Flag bit (1)

1 = TBC has overflowed
0 = TBC has not overflowed

bit 1 RXIF: Receive Object Interrupt Flag bit

1 = Receive object interrupt is pending
0 = No receive object interrupts are pending

bit 0 TXIF: Transmit Object Interrupt Flag bit

1 = Transmit object interrupt is pending
0 = No transmit object interrupts are pending

Note 1: C1INTL: Flags are set by hardware and cleared by application.

2: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-121: C1RXIFH: CAN RECEIVE INTERRUPT STATUS REGISTER HIGH (1,2)

R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
RFIF[31:24]
bit 15 bit 8
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
RFIF[23:16]
bit 7 bit 0
Legend:
R = Readable bit W = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown

bit 15-0 RFIF[31:16]: Unimplemented

Note 1: C1RXIFH: FIFO: RFIFx = 'or' of enabled RX FIFO flags (flags need to be cleared in the FIFO register).

2: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-122: C1RXIFL: CAN RECEIVE INTERRUPT STATUS REGISTER LOW ^(1,2)

R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
RFIF[15:8]
bit 15 bit 8
R-0 R-0 R-0 R-0 R-0 R-0 R-0 U-0
RFIF[7:1]
bit 7 bit 0
Legend:
R = Readable bit W = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown

bit 15-8 RFIF[15:8]: Unimplemented

bit 7-1 RFIF[7:1]: Receive FIFO Interrupt Pending bits

1 = One or more enabled receive FIFO interrupts are pending

0 = No enabled receive FIFO interrupts are pending

bit 0 Unimplemented: Read as '0'

Note 1: C1RXIFL: FIFO: RFIFx = 'or' of enabled RX FIFO flags (flags need to be cleared in the FIFO register).

2: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-123: C1RXOVIFH: CAN RECEIVE OVERFLOW INTERRUPT STATUS REGISTER HIGH (1,2)

R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
RFOVIF[31:24]
bit 15 bit 8
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
RFOVIF[23:16]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 15-0 RFOVIF[31:16]: Unimplemented

Note 1: C1RXOVIFH: FIFO: RFOVIFx (flag needs to be cleared in the FIFO register).

2: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-124: C1RXOVIFL: CAN RECEIVE OVERFLOW INTERRUPT STATUS REGISTER LOW ^(1,2)

R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
RFOVIF[15:8]
bit 15 bit 8
R-0 R-0 R-0 R-0 R-0 R-0 R-0 U-0
RFOVIF[7:1]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 15-8 RFOVIF[15:8]: Unimplemented

bit 7-1 RFOVIF[7:1]: Receive FIFO Overflow Interrupt Pending bits

1 = Interrupt is pending

0 = Interrupt is not pending

bit 0 Unimplemented: Read as '0'

Note 1: C1RXOVIFL: FIFO: RFOVIFx (flag needs to be cleared in the FIFO register).

2: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-125: C1TXIFH: CAN TRANSMIT INTERRUPT STATUS REGISTER HIGH (1,2)

R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
TFIF[31:24]
bit 15 bit 8
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
TFIF[23:16]
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown

bit 15-0 TFIF[31:16]: Unimplemented

Note 1: C1TXIFH: FIFO: TFIFx = 'or' of the enabled TX FIFO flags (flags need to be cleared in the FIFO register).

2: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-126: C1TXIFL: CAN TRANSMIT INTERRUPT STATUS REGISTER LOW (1,3)

R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
TFIF[15:8]
bit 15 bit 8
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
TFIF[7:0](2)
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown

bit 15-8 TFIF[15:8]: Unimplemented

bit 7-0 TFIF[7:0]: Transmit FIFO/TXQ Interrupt Pending bits ^(2)

1 = One or more enabled transmit FIFO/TXQ interrupts are pending
0 = No enabled transmit FIFO/TXQ interrupts are pending

Note 1: C1TXIFL: FIFO: TFIFx = 'or' of the enabled TX FIFO flags (flags need to be cleared in the FIFO register).

2: TFIF0 is for the transmit queue.
3: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-127: C1TXATIFH: CAN TRANSMIT ATTEMPT INTERRUPT STATUS REGISTER HIGH ^(1,2)

R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
TFATIF[31:24]
bit 15 bit 8
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
TFATIF[23:16]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 15-0 TFATIF[31:16]: Unimplemented

Note 1: C1TXATIFH: FIFO: TFATIFx (flag needs to be cleared in the FIFO register).

2: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-128: C1TXATIFL: CAN TRANSMIT ATTEMPT INTERRUPT STATUS REGISTER LOW ^(1,3)

R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
TFATIF[15:8]
bit 15 bit 8
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
TFATIF[7:0](2)
bit 7 bit 0

Legend:

R = Readable bit W = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 15-8 TFATIF[15:8]: Unimplemented

bit 7-0 TFATIF[7:0]: Transmit FIFO/TXQ Attempt Interrupt Pending bits ^(2)

1 = Interrupt is pending
0 = Interrupt is not pending

Note 1: C1TXATIFL: FIFO: TFATIFx (flag needs to be cleared in the FIFO register).

2: TFATIF0 is for the transmit queue.
3: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-129: C1TXREQH: CAN TRANSMIT REQUEST REGISTER HIGH (1)

S/HC-0 S/HC-0 S/HC-0 S/HC-0 S/HC-0 S/HC-0 S/HC-0 S/HC-0
TXREQ[31:24]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 S/HC-0
TXREQ[23:16]
bit 7bit 0
Legend:S = Settable bitHC = Hardware Clearable bit
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-0 TXREQ[31:16]: Unimplemented

Note 1: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-130: C1TXREQL: CAN TRANSMIT REQUEST REGISTER LOW (1)

S/HC-0 S/HC-0 S/HC-0 S/HC-0 S/HC-0 S/HC-0 S/HC-0 S/HC-0
TXREQ[15:8]
bit 15 bit 8
S/HC-0 S/HC-0 S/HC-0 S/HC-0 S/HC-0 S/HC-0 S/HC-0 S/HC-0s
TXREQ[7:1]TXREQ0
bit 7bit 0
Legend:S = Settable bitHC = Hardware Clearable bit
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-8 TXREQ[15:8]: Unimplemented

bit 7-1 TXREQ[7:1]: Message Send Request bits

TXEN = 1 (object configured as a transmit object):

Setting this bit to '1' requests sending a message. The bit will automatically clear when the message(s) queued in the object is (are) successfully sent. This bit can NOT be used for aborting a transmission.

TXEN = 0 (object configured as a receive object):

This bit has no effect.

bit 0 TXREQ0: Transmit Queue Message Send Request bit

Setting this bit to '1' requests sending a message. The bit will automatically clear when the message(s) queued in the object is (are) successfully sent. This bit can NOT be used for aborting a transmission.

Note 1: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-131: C1FIFOBAH: CAN MESSAGE MEMORY BASE ADDRESS REGISTER HIGH (1)

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
FIFOBA[31:24]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
FIFOBA[23:16]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared

bit 15-0 FIFOBA[31:16]: Message Memory Base Address bits

Defines the base address for the transmit event FIFO followed by the message objects.

Note 1: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-132: C1FIFOBAL: CAN MESSAGE MEMORY BASE ADDRESS REGISTER LOW (1)

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
FIFOBA[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0R-0R-0
FIFOBA[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-0 FIFOBA[15:0]: Message Memory Base Address bits

Defines the base address for the transmit event FIFO followed by the message objects.

Note 1: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-133: C1TXQCONH: CAN TRANSMIT QUEUE CONTROL REGISTER HIGH (2)

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PLSIZE2(1)PLSIZE1(1)PLSIZE0(1)FSIZE4(1)FSIZE3(1)FSIZE2(1)FSIZE1(1)FSIZE0(1)
bit 15 bit 8
U-0 R/W-1 R/W-1 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
TXAT1TXAT0TXPRI4TXPRI3TXPRI2TXPRI1TXPRI0
bit 7 bit 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-13 PLSIZE[2:0]: Payload Size bits ^(1)

111 = 64 data bytes

110 = 48 data bytes

101 = 32 data bytes

100 = 24 data bytes

011 = 20 data bytes

010 = 16 data bytes

001 = 12 data bytes

000 = 8 data bytes

bit 12-8 FSIZE[4:0]: FIFO Size bits ^(1)

11111 = FIFO is 32 messages deep

...

00010 = FIFO is 3 messages deep

00001 = FIFO is 2 messages deep

00000 = FIFO is 1 message deep

bit 7 Unimplemented: Read as '0'

bit 6-5 TXAT[1:0]: Retransmission Attempts bits

This feature is enabled when RTXAT (C1CONH[0]) is set.

11 = Unlimited number of retransmission attempts

10 = Unlimited number of retransmission attempts

01 = Three retransmission attempts

00 = Disables retransmission attempts

bit 4-0 TXPRI[4:0]: Message Transmit Priority bits

11111 = Highest message priority

• • •

00000 = Lowest message priority

Note 1: These bits can only be modified in Configuration mode (OPMOD[2:0] = 100).

2: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-134: C1TXQCONL: CAN TRANSMIT QUEUE CONTROL REGISTER LOW (1)

U-0 U-0 U-0 U-0 U-0 R/W-0 R/W-0 R/W-0
————FRESETTXREQUINC
bit 15bit 8
R-0U-0U-0HS/C-0U-0R/W-0U-0R/W-0
TXENTXATIETXQEIETXQNIE
bit 7 bit 0
Legend:HS = Hardware Settable bitC = 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 15-11 Unimplemented: Read as '0'

bit 10 FRESET: FIFO Reset bit

1 = FIFO will be reset when bit is set, cleared by hardware when FIFO is reset; user should poll whether this bit is clear before taking any action 0 = No effect

bit 9 TXREQ: Message Send Request bit

1 = Requests sending a message; the bit will automatically clear when all the messages queued in the TXQ are successfully sent 0 = Clearing the bit to '0' while set ('1') will request a message abort

bit 8 UINC: Increment Head/Tail bit

When this bit is set, the FIFO head will increment by a single message.

bit 7 TXEN: TX Enable bit

bit 6-5 Unimplemented: Read as '0'

bit 4 TXATIE: Transmit Attempts Exhausted Interrupt Enable bit

1 = Enables interrupt 0 = Disables interrupt

bit 3 Unimplemented: Read as '0'

bit 2 TXQEIE: Transmit Queue Empty Interrupt Enable bit

1 = Interrupt is enabled for TXQ empty 0 = Interrupt is disabled for TXQ empty

bit 1 Unimplemented: Read as '0'

bit 0 TXQNIE: Transmit Queue Not Full Interrupt Enable bit

1 = Interrupt is enabled for TXQ not full 0 = Interrupt is disabled for TXQ not full

Note 1: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-135: C1TXQSTA: CAN TRANSMIT QUEUE STATUS REGISTER (3)

U-0 U-0 U-0 R-0 R-0 R-0 R-0 R-0
———TXQ C^(1) TXQCI3 ^(1) 4TXQCI2 ^(1) TXQCI1 ^(1)
bit 15 bit 8
R-0 R-0 R-0 HS/C-0 U-0 R-1 U-0 R-1
TXABT(2)TXLARBTXERRTXATIFTXQEIFTXQNIF
bit 7 bit 0
Legend:HS = Hardware Settable bitC = 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 15-13 Unimplemented: Read as '0'

bit 12-8 TXQCI[4:0]: Transmit Message Queue Index bits ^(1)

A read of this register will return an index to the message that the FIFO will next attempt to transmit.

bit 7 TXABT: Message Aborted Status bit ^(2)

1 = Message was aborted

0 = Message completed successfully

bit 6 TXLARB: Message Lost Arbitration Status bit

1 = Message lost arbitration while being sent

0 = Message did not lose arbitration while being sent

bit 5 TXERR: Error Detected During Transmission bit

1 = A bus error occurred while the message was being sent

0 = A bus error did not occur while the message was being sent

bit 4 TXATIF: Transmit Attempts Exhausted Interrupt Pending bit

1 = Interrupt is pending

0 = Interrupt is not pending

bit 3 Unimplemented: Read as '0'

bit 2 TXQEIF: Transmit Queue Empty Interrupt Flag bit

1 = TXQ is empty

0 = TXQ is not empty, at least one message is queued to be transmitted

bit 1 Unimplemented: Read as '0'

bit 0 TXQNIF: Transmit Queue Not Full Interrupt Flag bit

1 = TXQ is not full

0 = TXQ is full

Note 1: The TXQCI[4:0] bits give a zero-indexed value to the message in the TXQ. If the TXQ is four messages deep (FSIZE[4:0] = 3), TXQCIX will take on a value of 0 to 3, depending on the state of the TXQ.

2: This bit is updated when a message completes (or aborts) or when the TXQ is reset.

3: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-136: C1FIFOCONxH: CAN FIFO CONTROL REGISTER x (x = 1 TO 7) HIGH ^(2)

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PLSIZE2(1)PLSIZE1(1)PLSIZE0(1)FSIZE4(1)FSIZE3(1)FSIZE2(1)FSIZE1(1)FSIZE0(1)
bit 15 bit 8
U-0 R/W-1 R/W-1 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
TXAT1TXAT0TXPRI4TXPRI3TXPRI2TXPRI1TXPRI0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-13 PLSIZE[2:0]: Payload Size bits ^(1)

111 = 64 data bytes

110 = 48 data bytes

101 = 32 data bytes

100 = 24 data bytes

011 = 20 data bytes

010 = 16 data bytes

001 = 12 data bytes

000 = 8 data bytes

bit 12-8 FSIZE[4:0]: FIFO Size bits (1)

11111 = FIFO is 32 messages deep

• • •

00010 = FIFO is 3 messages deep

00001 = FIFO is 2 messages deep

00000 = FIFO is 1 message deep

bit 7 Unimplemented: Read as '0'

bit 6-5 TXAT[1:0]: Retransmission Attempts bits

This feature is enabled when RTXAT (C1CONH[0]) is set.

11 = Unlimited number of retransmission attempts

10 = Unlimited number of retransmission attempts

01 = Three retransmission attempts

00 = Disables retransmission attempts

bit 4-0 TXPRI[4:0]: Message Transmit Priority bits

11111 = Highest message priority

• • •

00000 = Lowest message priority

Note 1: These bits can only be modified in Configuration mode (OPMOD[2:0] = 100).

2: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-137: C1FIFOCONxL: CAN FIFO CONTROL REGISTER x (x = 1 TO 7) LOW ^(2)

U-0 U-0 U-0 U-0 U-0 S/HC-1 R/W/HC-0 S/HC-0
— — —— — FRESETTXREQUINC
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
TXENRTREN RXTSEN (1)TXATIERXOVIETFERFFIETFHRFHIETFNRFNIE
bit 7 bit 0
Legend:S = Settable bitHC = Hardware Clearable bit
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-11 Unimplemented: Read as '0'

bit 10 FRESET: FIFO Reset bit

1 = FIFO will be reset when bit is set, cleared by hardware when FIFO is reset; user should poll whether this bit is clear before taking any action 0 = No effect

bit 9 TXREQ: Message Send Request bit

TXEN = 1 (FIFO configured as a transmit FIFO):

1 = Requests sending a message; the bit will automatically clear when all the messages queued in the FIFO are successfully sent 0 = Clearing the bit to '0' while set ('1') will request a message abort TXEN = 0 (FIFO configured as a receive FIFO): This bit has no effect.

bit 8 UINC: Increment Head/Tail bit

TXEN = 1 (FIFO configured as a transmit FIFO):

When this bit is set, the FIFO head will increment by a single message.

TXEN = 0 (FIFO configured as a receive FIFO):

When this bit is set, the FIFO tail will increment by a single message.

bit 7 TXEN: TX/RX Buffer Selection bit

1 = Transmits message object

0 = Receives message object

bit 6 RTREN: Auto-Remote Transmit (RTR) Enable bit

1 = When a Remote Transmit is received, TXREQ will be set

0 = When a Remote Transmit is received, TXREQ will be unaffected

bit 5 RXTSEN: Received Message Timestamp Enable bit ^(1)

1 = Captures timestamp in received message object in RAM 0 = Does not capture timestamp

bit 4 TXATIE: Transmit Attempts Exhausted Interrupt Enable bit

1 = Enables interrupt 0 = Disables interrupt

RXOVIE: Overflow Interrupt Enable bit

1 = Interrupt is enabled for overflow event 0 = Interrupt is disabled for overflow event

Note 1: This bit can only be modified in Configuration mode (OPMOD[2:0] = 100).

2: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-137: C1FIFOCONxL: CAN FIFO CONTROL REGISTER x (x = 1 TO 7) LOW ^(2) (CONTINUED)

bit 2 TFERFFIE: Transmit/Receive FIFO Empty/Full Interrupt Enable bit

TXEN = 1 (FIFO configured as a transmit FIFO):

Transmit FIFO Empty Interrupt Enable

1 = Interrupt is enabled for FIFO empty

0 = Interrupt is disabled for FIFO empty

TXEN = 0 (FIFO configured as a receive FIFO):

Receive FIFO Full Interrupt Enable

1 = Interrupt is enabled for FIFO full

0 = Interrupt is disabled for FIFO full

bit 1 TFHRFHIE: Transmit/Receive FIFO Half Empty/Half Full Interrupt Enable bit

TXEN = 1 (FIFO configured as a transmit FIFO):

Transmit FIFO Half Empty Interrupt Enable

1 = Interrupt is enabled for FIFO half empty

0 = Interrupt is disabled for FIFO half empty

TXEN = 0 (FIFO configured as a receive FIFO):

Receive FIFO Half Full Interrupt Enable

1 = Interrupt is enabled for FIFO half full

0 = Interrupt is disabled for FIFO half full

bit 0 TFNRFNIE: Transmit/Receive FIFO Not Full/Not Empty Interrupt Enable bit

TXEN = 1 (FIFO configured as a transmit FIFO):

Transmit FIFO Not Full Interrupt Enable

1 = Interrupt is enabled for FIFO not full

0 = Interrupt is disabled for FIFO not full

TXEN = 0 (FIFO configured as a receive FIFO):

Receive FIFO Not Empty Interrupt Enable

1 = Interrupt is enabled for FIFO not empty

0 = Interrupt is disabled for FIFO not empty

Note 1: This bit can only be modified in Configuration mode (OPMOD[2:0] = 100).

2: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-138: C1FIFOSTAx: CAN FIFO STATUS REGISTER x (x = 1 TO 7) ^(4)

U-0 U-0 U-0 R-0 R-0 R-0 R-0 R-0
— — —FIFOCI4(1) FIFOCI3^(1) FIFOCI2^(1) FIFOCI1^(1) FIFOCI0^(1)
bit 15 bit 8
R-0 R-0 R-0 HS/C-0HS/C-0R-0 R-0 R-0
TXABT(3)TXLARB(2)TXERR(2)TXATIFRXOVIFTFERFFIFTFHRFHIFTFNRFNIF
bit 7 bit 0
Legend:C = Clearable bitHS = Hardware Settable bit
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-13 Unimplemented: Read as '0'

bit 12-8 FIFOCI[4:0]: FIFO Message Index bits ^(1)

TXEN = 1 (FIFO configured as a transmit buffer):

A read of this register will return an index to the message that the FIFO will next attempt to transmit.

TXEN = 0 (FIFO configured as a receive buffer):

A read of this register will return an index to the message that the FIFO will use to save the next message.

bit 7 TXABT: Message Aborted Status bit ^(3)

1 = Message was aborted
0 = Message completed successfully

bit 6 TXLARB: Message Lost Arbitration Status bit ^(2)

1 = Message lost arbitration while being sent
0 = Message did not lose arbitration while being sent

bit 5 TXERR: Error Detected During Transmission bit ^(2)

1 = A bus error occurred while the message was being sent
0 = A bus error did not occur while the message was being sent

bit 4 TXATIF: Transmit Attempts Exhausted Interrupt Pending bit

TXEN = 1 (FIFO configured as a transmit buffer):

1 = Interrupt is pending
0 = Interrupt is not pending

TXEN = 0 (FIFO configured as a receive buffer):

Unused, read as '0'.

bit 3 RXOVIF: Receive FIFO Overflow Interrupt Flag bit

TXEN = 1 (FIFO configured as a transmit buffer):

Unused, read as '0'.

TXEN = 0 (FIFO configured as a receive buffer):

1 = Overflow event has occurred
0 = No overflow event has occurred

Note 1: FIFOCI[4:0] gives a zero-indexed value to the message in the FIFO. If the FIFO is four messages deep (FSIZE[4:0] = 3), FIFOCIx will take on a value of 0 to 3, depending on the state of the FIFO.

2: These bits are updated when a message completes (or aborts) or when the FIFO is reset.
3: This bit is reset on any read of this register or when the TXQ is reset. The bits are cleared when TXREQ is set or using an SPI write.
4: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-138: C1FIFOSTAx: CAN FIFO STATUS REGISTER x (x = 1 TO 7) ^(4) (CONTINUED)

bit 2 TFERFFIF: Transmit/Receive FIFO Empty/Full Interrupt Flag bit

TXEN = 1 (FIFO configured as a transmit FIFO):

Transmit FIFO Empty Interrupt Flag

1 = FIFO is empty

0 = FIFO is not empty, at least one message is queued to be transmitted

TXEN = 0 (FIFO configured as a receive FIFO):

Receive FIFO Full Interrupt Flag

1 = FIFO is full

0 = FIFO is not full

bit 1 TFHRFHIF: Transmit/Receive FIFO Half Empty/Half Full Interrupt Flag bit

TXEN = 1 (FIFO configured as a transmit FIFO):

Transmit FIFO Half Empty Interrupt Flag

1 = FIFO is ≤ half full

0 = FIFO is > half full

TXEN = 0 (FIFO configured as a receive FIFO):

Receive FIFO Half Full Interrupt Flag

1 = FIFO is ≥ half full

0 = FIFO is < half full

bit 0 TFNRFNIF: Transmit/Receive FIFO Not Full/Not Empty Interrupt Flag bit

TXEN = 1 (FIFO configured as a transmit FIFO):

Transmit FIFO Not Full Interrupt Flag

1 = FIFO is not full

0 = FIFO is full

TXEN = 0 (FIFO configured as a receive FIFO):

Receive FIFO Not Empty Interrupt Flag

1 = FIFO is not empty, has at least one message

0 = FIFO is empty

Note 1: FIFOCI[4:0] gives a zero-indexed value to the message in the FIFO. If the FIFO is four messages deep (FSIZE[4:0] = 3), FIFOClx will take on a value of 0 to 3, depending on the state of the FIFO.

2: These bits are updated when a message completes (or aborts) or when the FIFO is reset.

3: This bit is reset on any read of this register or when the TXQ is reset. The bits are cleared when TXREQ is set or using an SPI write.

4: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-139: C1TEFCONH: CAN TRANSMIT EVENT FIFO CONTROL REGISTER HIGH (2)

U-0 U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
— — —FSIZE[4:0](1)
bit 15 bit 8
R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-13 Unimplemented: Read as '0'

bit 12-8 FSIZE[4:0]: FIFO Size bits ^(1)

11111 = FIFO is 32 messages deep

...

00010 = FIFO is 3 messages deep

00001 = FIFO is 2 messages deep

00000 = FIFO is 1 message deep

bit 7-0 Unimplemented: Read as '0'

Note 1: These bits can only be modified in Configuration mode (OPMOD[2:0] = 100).

2: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-140: C1TEFCONL: CAN TRANSMIT EVENT FIFO CONTROL REGISTER LOW ^(2)

U-0 U-0 U-0 U-0 U-0 S/HC-0 U-0 S/HC-0
FRESETUINC
bit 15 bit 8
U-0U-0R/W-0U-0R/W-0R/W-0R/W-0R/W-0
— —TEFTSEN(1)TEFOVIETEFFIETEFHIETEFNEIE
bit 7 bit 0
Legend:S = Settable bitHC = Hardware Clearable bit
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-11 Unimplemented: Read as '0'

bit 10 FRESET: FIFO Reset bit

1 = FIFO will be reset when bit is set, cleared by hardware when FIFO is reset; the user should poll whether this bit is clear before taking any action 0 = No effect

bit 9 Unimplemented: Read as '0'

bit 8 UINC: Increment Tail bit

1 = When this bit is set, the FIFO tail will increment by a single message 0 = FIFO tail will not increment

bit 7-6 Unimplemented: Read as '0'

bit 5 TEFTSEN: Transmit Event FIFO Timestamp Enable bit ^(1)

1 = Timestamps elements in TEF 0 = Does not timestamp elements in TEF

bit 4 Unimplemented: Read as '0'

bit 3 TEFOVIE: Transmit Event FIFO Overflow Interrupt Enable bit

1 = Interrupt is enabled for overflow event 0 = Interrupt is disabled for overflow event

bit 2 TEFFIE: Transmit Event FIFO Full Interrupt Enable bit

1 = Interrupt is enabled for FIFO full 0 = Interrupt is disabled for FIFO full

bit 1 TEFHIE: Transmit Event FIFO Half Full Interrupt Enable bit

1 = Interrupt is enabled for FIFO half full 0 = Interrupt is disabled for FIFO half full

bit 0 TEFNEIE: Transmit Event FIFO Not Empty Interrupt Enable bit

1 = Interrupt is enabled for FIFO not empty 0 = Interrupt is disabled for FIFO not empty

Note 1: These bits can only be modified in Configuration mode (OPMOD[2:0] = 100).

2: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-141: C1TEFSTA: CAN TRANSMIT EVENT FIFO STATUS REGISTER (2)

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-0S/HC-0R-0 R-0 R-0
———TEFOVIFTEFFIF(1)TEFHIF(1)TEFNEIF(1)
bit 7 bit 0
Legend:HC = Hardware Clearable bitS = Settable by ‘1’ 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 15-4 Unimplemented: Read as '0'

bit 3 TEFOVIF: Transmit Event FIFO Overflow Interrupt Flag bit

1 = Overflow event has occurred

0 = No overflow event has occurred

bit 2 TEFFIF: Transmit Event FIFO Full Interrupt Flag bit ^(1)

1 = FIFO is full

0 = FIFO is not full

bit 1 TEFHIF: Transmit Event FIFO Half Full Interrupt Flag bit ^(1)

1 = FIFO is ≥ half full

0 = FIFO is < half full

bit 0 TEFNEIF: Transmit Event FIFO Not Empty Interrupt Flag bit ^(1)

1 = FIFO is not empty

0 = FIFO is empty

Note 1: These bits are read-only and reflect the status of the FIFO.

2: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-142: C1FIFOUAHx: CAN FIFO USER ADDRESS HIGH x (x = 1 TO 7) REGISTER ^(1,2)

R-x R-x R-x R-x R-x R-x R-x R-x
FIFOUA[31:24]
bit 15 bit 8
R-x R-x R-x R-x R-x R-x R-x R-x
FIFOUA[23:16]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 FIFOUA[31:16]: FIFO User Address bits

TXEN = 1 (FIFO configured as a transmit buffer):

A read of this register will return the address where the next message is to be written (FIFO head).

TXEN = 0 (FIFO configured as a receive buffer):

A read of this register will return the address where the next message is to be read (FIFO tail).

Note 1: This register is not ensured to read correctly in Configuration mode and should only be accessed when the module is not in Configuration mode.

2: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-143: C1FIFOUALx: CAN FIFO USER ADDRESS LOW x (x = 1 TO 7) REGISTER ^(1,2)

R-x R-x R-x R-x R-x R-x R-x R-x
FIFOUA[15:8]
bit 15 bit 8
R-x R-x R-x R-x R-x R-x R-x R-x
FIFOUA[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 FIFOUA[15:0]: FIFO User Address bits

TXEN = 1 (FIFO configured as a transmit buffer):

A read of this register will return the address where the next message is to be written (FIFO head).

TXEN = 0 (FIFO configured as a receive buffer):

A read of this register will return the address where the next message is to be read (FIFO tail).

Note 1: This register is not ensured to read correctly in Configuration mode and should only be accessed when the module is not in Configuration mode.

2: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-144: C1TEFUAH: CAN TRANSMIT EVENT FIFO USER ADDRESS REGISTER HIGH (1,2)

R-x R-x R-x R-x R-x R-x R-x R-x
TEFUA[31:24]
bit 15 bit 8
R-x R-x R-x R-x R-x R-x R-x R-x
TEFUA[23:16]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR

'1' = Bit is set

'0' = Bit is cleared

x = Bit is unknown

bit 15-0 TEFUA[31:16]: Transmit Event FIFO User Address bits

A read of this register will return the address where the next event is to be read (FIFO tail).

Note 1: This register is not ensured to read correctly in Configuration mode and should only be accessed when the module is not in Configuration mode.

2: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-145: C1TEFUAL: CAN TRANSMIT EVENT FIFO USER ADDRESS REGISTER LOW (1,2)

R-x R-x R-x R-x R-x R-x R-x R-x
TEFUA[15:8]
bit 15 bit 8
R-x R-x R-x R-x R-x R-x R-x R-x
TEFUA[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR

'1' = Bit is set

'0' = Bit is cleared

x = Bit is unknown

bit 15-0 TEFUA[15:0]: Transmit Event FIFO User Address bits

A read of this register will return the address where the next event is to be read (FIFO tail).

Note 1: This register is not ensured to read correctly in Configuration mode and should only be accessed when the module is not in Configuration mode.

2: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-146: C1TXQUAH: CAN TRANSMIT QUEUE USER ADDRESS REGISTER HIGH (1,2)

R-x R-x R-x R-x R-x R-x R-x R-x
TXQUA[31:24]
bit 15 bit 8
R-x R-x R-x R-x R-x R-x R-x R-x
TXQUA[23:16]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-0 TXQUA[31:16]: TXQ User Address bits

A read of this register will return the address where the next message is to be written (TXQ head).

Note 1: This register is not ensured to read correctly in Configuration mode and should only be accessed when the module is not in Configuration mode.

2: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-147: C1TXQUAL: CAN TRANSMIT QUEUE USER ADDRESS REGISTER LOW ^(1,2)

R-x R-x R-x R-x R-x R-x R-x R-x
TXQUA[15:8]
bit 15 bit 8
R-x R-x R-x R-x R-x R-x R-x R-x
TXQUA[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-0 TXQUA[15:0]: TXQ User Address bits

A read of this register will return the address where the next message is to be written (TXQ head).

Note 1: This register is not ensured to read correctly in Configuration mode and should only be accessed when the module is not in Configuration mode.

2: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-148: C1TRECH: CAN TRANSMIT/RECEIVE ERROR COUNT REGISTER HIGH ^(1)

U-0 U-0 U-0 U-0 U-0 U-0 U-0
—————
bit 15 bit 8
U-0 U-0 R-1 R-0 R-0 R-0 R-0 R-0
TXBOTXBPRXBPTXWARNRXWARNEWARN
bit 7 bit 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-6 Unimplemented: Read as '0'

bit 5 TXBO: Transmitter in Error State Bus Off bit (TERRCNT[7:0] > 255)

In Configuration mode, TXBO is set since the module is not on the bus.

bit 4 TXBP: Transmitter in Error State Bus Passive bit (TERRCNT[7:0] > 127)

bit 3 RXBP: Receiver in Error State Bus Passive bit (RERRCNT[7:0] > 127)

bit 2 TXWARN: Transmitter in Error State Warning bit (128 > TERRCNT[7:0] > 95)

bit 1 RXWARN: Receiver in Error State Warning bit (128 > RERRCNT[7:0] > 95)

bit 0 EWARN: Transmitter or Receiver in Error State Warning bit

Note 1: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-149: C1TRECL: CAN TRANSMIT/RECEIVE ERROR COUNT REGISTER LOW (1)

R-0R-0R-0R-0R-0R-0R-0R-0
TERRCNT[7:0]
bit 15bit 8
R-0R-0R-0R-0R-0R-0R-0R-0
RERRCNT[7:0]
bit 7bit 0
Legend:
R = Readable bit W = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown

bit 15-8 TERRCNT[7:0]: Transmit Error Counter bits

bit 7-0 RERRCNT[7:0]: Receive Error Counter bits

Note 1: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-150: C1BDIAG0H: CAN BUS DIAGNOSTICS REGISTER 0 HIGH (1)

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
DTERRCNT[7:0]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
DRERRCNT[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-8 DTERRCNT[7:0]: Data Bit Rate Transmit Error Counter bits

bit 7-0 DRERRCNT[7:0]: Data Bit Rate Receive Error Counter bits

Note 1: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-151: C1BDIAG0L: CAN BUS DIAGNOSTICS REGISTER 0 LOW (1)

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
NTERRCNT[7:0]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
NRERRCNT[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-8 NTERRCNT[7:0]: Nominal Bit Rate Transmit Error Counter bits

bit 7-0 NRERRCNT[7:0]: Nominal Bit Rate Receive Error Counter bits

Note 1: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-152: C1BDIAG1H: CAN BUS DIAGNOSTICS REGISTER 1 HIGH (1)

R/W-0 R/W-0 R/C-0 R/W-0 R/W-0 U-0 R/W-0 R/W-0
DLCMM ESI DCRCERRDSTUFERR DFORMERR— DBIT1ERR DBIT0ERRR
bit 15 bit 8
R/W-0 U-0 R/W-0R/W-0 R/W-0R/W-0 R/W-0 R/W-0
TXBOERR— NCRERR NSTUFERR NFORMERRNACKERRNBIT1ERRNBIT0ERR
bit 7 bit 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 15DLCMM: DLC Mismatch bitDuring a transmission or reception, the specified DLC is larger than the PLSIZE[2:0] of the FIFO element.
bit 14ESI: ESI Flag of a Received CAN FD Message Set bit
bit 13DCRCERR: Same as for nominal bit rate
bit 12DSTUFERR: Same as for nominal bit rate
bit 11DFORMERR: Same as for nominal bit rate
bit 10Unimplemented: Read as ‘0’
bit 9DBIT1ERR: Same as for nominal bit rate
bit 8DBIT0ERR: Same as for nominal bit rate
bit 7TXBOERR: Device Went to Bus Off bit (and auto-recovered)
bit 6Unimplemented: Read as ‘0’
bit 5NCRCERR: Received Message with CRC Incorrect Checksum bitThe CRC checksum of a received message was incorrect. The CRC of an incoming message does not match with the CRC calculated from the received data.
bit 4NSTUFERR: Received Message with Illegal Sequence bitMore than 5 equal bits in a sequence have occurred in a part of a received message where this is not allowed.
bit 3NFORMERR: Received Frame Fixed Format bitA fixed format part of a received frame has the wrong format.
bit 2NACKERR: Transmitted Message Not Acknowledged bitTransmitted message was not acknowledged.
bit 1NBIT1ERR: Transmitted Message Recessive Level bitDuring the transmission of a message (with the exception of the arbitration field), the device wanted to send a recessive level (bit of logical value ‘1’), but the monitored bus value was dominant.
bit 0NBIT0ERR: Transmitted Message Dominant Level bitDuring the transmission of a message (or Acknowledge bit, active error flag or overload flag), the device wanted to send a dominant level (data or identifier bit of logical value ‘0’), but the monitored bus value was recessive. During bus off recovery, this status is set each time a sequence of 11 recessive bits has been monitored. This enables the CPU to monitor the proceeding of the bus off recovery sequence (indicating the bus is not stuck at dominant or continuously disturbed).

Note 1: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-153: C1BDIAG1L: CAN BUS DIAGNOSTICS REGISTER 1 LOW (1)

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
EFMSGCNT[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
EFMSGCNT[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-0 EFMSGCNT[15:0]: Error-Free Message Counter bits

Note 1: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-154: C1FLTCONxH: CAN FILTER CONTROL REGISTER x HIGH (x = 0 TO 3; c = 2, 6, 10, 14; d = 3, 7, 11, 15) ^(1)

R/W-0 U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
FLTENd— — FdB4FdB3FdB2FdB1FdBPO
bit 15 bit 8
R/W-0 U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
FLTENcFcBP4FcBP3FcBP2FcBP1FcBP0
bit 7 bit 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 FLTENd: Enable Filter d to Accept Messages bit
1 = Filter is enabled
0 = Filter is disabled

bit 14-13 Unimplemented: Read as '0'
bit 12-8 FdBP[4:0]: Pointer to Object When Filter d Hits bits
11111 to 11000 = Reserved
00111 = Message matching filter is stored in Object 7
00110 = Message matching filter is stored in Object 6
...
00010 = Message matching filter is stored in Object 2
00001 = Message matching filter is stored in Object 1
00000 = Reserved; Object 0 is the TX Queue and can't receive messages 
bit 7 FLTENc: Enable Filter c to Accept Messages bit
1 = Filter is enabled
0 = Filter is disabled

bit 6-5 Unimplemented: Read as '0'
bit 4-0 FcBP[4:0]: Pointer to Object When Filter c Hits bits
11111 to 11000 = Reserved
00111 = Message matching filter is stored in Object 7
00110 = Message matching filter is stored in Object 6
...
00010 = Message matching filter is stored in Object 2
00001 = Message matching filter is stored in Object 1
00000 = Reserved; Object 0 is the TX Queue and can't receive messages 

Note 1: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-155: C1FLTCONxL: CAN FILTER CONTROL REGISTER x LOW (x = 0 TO 3; a = 0, 4, 8, 12; b = 1, 5, 9, 13) ^(1)

R/W-0 U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
FLTENbFbBP4FbBP3FbBP2FbBP1FbBP0
bit 15 bit 8
R/W-0 U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
FLTENaFaBP4FaBP3FaBP2FaBP1FaBP0
bit 7 bit 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 FLTENb: Enable Filter b to Accept Messages bit

1 = Filter is enabled

0 = Filter is disabled

bit 14-13 Unimplemented: Read as '0'

bit 12-8 FbBP[4:0]: Pointer to Object When Filter b Hits bits

11111 to 11000 = Reserved

00111 = Message matching filter is stored in Object 7

00110 = Message matching filter is stored in Object 6

...

00010 = Message matching filter is stored in Object 2

00001 = Message matching filter is stored in Object 1

00000 = Reserved; Object 0 is the TX Queue and can't receive messages

bit 7 FLTENa: Enable Filter a to Accept Messages bit

1 = Filter is enabled

0 = Filter is disabled

bit 6-5 Unimplemented: Read as '0'

bit 4-0 FaBP[4:0]: Pointer to Object When Filter a Hits bits

11111 to 11000 = Reserved

00111 = Message matching filter is stored in Object 7

00110 = Message matching filter is stored in Object 6

• • •

00010 = Message matching filter is stored in Object 2

00001 = Message matching filter is stored in Object 1

00000 = Reserved; Object 0 is the TX Queue and can't receive messages

Note 1: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-156: C1FLTOBJxH: CAN FILTER OBJECT REGISTER x HIGH (x = 0 TO 15) ^(1)

U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
— EXIDE SID11 EID17EID16 EID15EID14 EID13
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
EID12EID11EID10EID9EID8EID7EID6EID5
bit 7 bit 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 Unimplemented: Read as '0'

bit 14 EXIDE: Extended Identifier Enable bit

If MIDE = 1:

1 = Matches only messages with Extended Identifier addresses

0 = Matches only messages with Standard Identifier addresses

bit 13 SID11: Standard Identifier Filter bit

bit 12-0 EID[17:5]: Extended Identifier Filter bits

In DeviceNet ^™ mode, these are the filter bits for the first two data bytes.

Note 1: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-157: C1FLTOBJxL: CAN FILTER OBJECT REGISTER x LOW (x = 0 TO 15) ^(1)

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
EID4EID3EID2EID1EID0SID10SID9SID8
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
SID7SID6SID5SID4SID3SID2SID1SID0
bit 7 bit 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-11 EID[4:0]: Extended Identifier Filter bits

In DeviceNet™ mode, these are the filter bits for the first two data bytes.

bit 10-0 SID[10:0]: Standard Identifier Filter bits

Note 1: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-158: C1MASKxH: CAN MASK REGISTER x HIGH (x = 0 TO 15) ^(1)

U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
— MIDEMSID11 MEID17 MEID16 MEID15 MEID14MEID13
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
MEID12MEID11MEID10MEID9MEID8MEID7MEID6MEID5
bit 7 bit 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 Unimplemented: Read as '0'

bit 14 MIDE: Identifier Receive Mode bit

1 = Matches only message types (standard or extended address) that correspond to the EXIDE bit in the filter 0 = Matches either standard or extended address message if filters match (i.e., if (Filter SID) = (Message SID) or if (Filter SID/EID) = (Message SID/EID))

bit 13 MSID11: Standard Identifier Mask bit

bit 12-0 MEID[17:5]: Extended Identifier Mask bits

In DeviceNet ^™ mode, these are the mask bits for the first two data bytes.

Note 1: CAN is available only on the dsPIC33CHXXXMP50X devices.

REGISTER 3-159: C1MASKxL: CAN MASK REGISTER x LOW (x = 0 TO 15) ^(1)

R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
MEID4MEID3MEID2MEID1MEID0MSID10MSID9MSID8
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
MSID7MSID6MSID5MSID4MSID3MSID2MSID1MSID0
bit 7 bit 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-11 MEID[4:0]: Extended Identifier Mask bits

In DeviceNet ^™ mode, these are the mask bits for the first two data bytes.

bit 10-0 MSID[10:0]: Standard Identifier Mask bits

Note 1: CAN is available only on the dsPIC33CHXXXMP50X devices.

3.10 High-Speed, 12-Bit

Analog-to-Digital Converter (Main ADC)

Note 1: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive reference source. To complement the information in this data sheet, refer to “12-Bit High-Speed, Multiple SARs A/D Converter (ADC)” (www.microchip.com/DS70005213), which is available from the Microchip website (www.microchip.com).

2: This section describes the Host ADC module, which implements one shared core and no dedicated cores.

dsPIC33CH128MP508 devices have a high-speed, 12-bit Analog-to-Digital Converter (ADC) that features a low conversion latency, high resolution and oversampling capabilities to improve performance in AC/DC and DC/DC power converters. The Host implements one SAR core ADC.

3.10.1 HOST ADC FEATURES OVERVIEW

The high-speed, 12-bit multiple SARs Analog-to-Digital Converter (ADC) includes the following features:

• One Shared (common) Core
- User-Configurable Resolution of up to 12 Bits
- Up to 3.5 Msps Conversion Rate per Channel at 12-Bit Resolution
- Low Latency Conversion

- Up to 20 Analog Input Channels, with a Separate 16-Bit Conversion Result Register for each Input Channel

- Conversion Result can be Formatted as Unsigned or Signed Data, on a per Channel Basis, for All Channels

• Channel Scan Capability
- Multiple Conversion Trigger Options, including:
- PWM triggers from Main and Secondary CPU cores
- SCCP modules triggers
- CLC modules triggers
- External pin trigger event (ADTRG31)
- Software trigger

- Four Integrated Digital Comparators with Dedicated Interrupts:

  • Multiple comparison options
  • Assignable to specific analog inputs

- Four Oversampling Filters with Dedicated Interrupts:

  • Provide increased resolution
  • Assignable to a specific analog input

Simplified block diagrams of the 12-bit ADC are shown in Figure 3-24 and Figure 3-25.

The analog inputs (channels) are connected through multiplexers and switches to the Sample-and-Hold (S&H) circuit of the ADC core. The core uses the channel information (the output format, the Measurement mode and the input number) to process the analog sample. When conversion is complete, the result is stored in the result buffer for the specific analog input, and passed to the digital filter and digital comparator if they were configured to use data from this particular channel.

The ADC provides each analog input the ability to specify its own trigger source. This capability allows the ADC to sample and convert analog inputs that are associated with PWM generators operating on independent time bases.

FIGURE 3-24: ADC MODULE BLOCK DIAGRAM
Microchip dsPIC33CH64MP208 - HOST ADC FEATURES OVERVIEW - 1

flowchart
graph TD
    A["AVDD AVSS"] --> B["Voltage Reference (REFSEL[2:0"])]
    B --> C["Digital Comparator 0"]
    B --> D["Digital Comparator 1"]
    B --> E["Digital Comparator 2"]
    B --> F["Digital Comparator 3"]
    C --> G["ADCMP0 Interrupt"]
    D --> H["ADCMP1 Interrupt"]
    E --> I["ADCMP2 Interrupt"]
    F --> J["ADCMP3 Interrupt"]
    K["AN0"] --> L["Shared ADC Core"]
    M["AN15"] --> L
    N["SPGA1 (AN16)"] --> L
    O["SPGA2 (AN17)"] --> L
    P["SPGA3 (AN18)"] --> L
    Q["Temperature Sensor (AN19)"] --> L
    R["Band Gap 1.2V (AN20)"] --> L
    S["Reference"] --> T["Output Data"]
    U["Clock"] --> V["Divider (CLKDIV[5:0"])]
    V --> W["Clock Selection (CLKSEL[1:0"])]
    W --> X["Fvco/4 AFvcodiv FP (Fosc/2)"]
    W --> Y["Fosc"]

Note: SPGA1, SPGA2 and SPGA3 are internal analog inputs and are not available on device pins.

FIGURE 3-25: SHARED CORE BLOCK DIAGRAM
Microchip dsPIC33CH64MP208 - HOST ADC FEATURES OVERVIEW - 2

flowchart
graph TD
    A["AN0"] --> B["AND"]
    C["AN15"] --> B
    D["SPGA1 (AN16)"] --> E["AND"]
    F["SPGA2 (AN17)"] --> E
    G["SPGA3 (AN18)"] --> H["AND"]
    I["Temperature Sensor (AN19)"] --> J["AND"]
    K["Band Gap 1.2V (AN20)"] --> L["AND"]
    M["AVss"] --> N["Analog Channel Number from Current Trigger"]
    O["Shared Sample-and-Hold"] --> P["12-Bit SAR ADC"]
    P --> Q["ADC Core Clock Divider"]
    Q --> R["SHRSAMC[9:0"]]
    S["Sampling Time"] --> T["Ground"]
    U["Reference"] --> P
    V["Output Data"] --> P
    W["Clock"] --> Q
    X["SHRADCS[6:0"]] --> Q

3.10.2 SAMPLING TIME REQUIREMENTS

The analog input model of the ADC is shown in the figure below.

FIGURE: ADC ANALOG INPUT MODEL
Microchip dsPIC33CH64MP208 - SAMPLING TIME REQUIREMENTS - 1

text_image Signal Source Source Resistance Rs Pin Capacitance CPIN(1) Total Interconnect Resistance Rc(2) Sampling Switch Sample and Hold Capacitance CHOLD(3)

Note 1: The CPIN value depends on the device package and is not tested. The effect of the CPIN is negligible if Rs ≤ 5 kΩ.
2: See the AD62 parameter in Table 24-43.
3: See the AD60 and AD61 parameters in Table 24-43.

The total acquisition time for the Analog-to-Digital conversion is a function of the Holding Capacitor (CHOLD) charge time. For the ADC module to meet its specified accuracy, the Holding Capacitor (CHOLD) must be allowed to fully charge to the voltage level on the analog input pin. The Signal Source Impedance (Rs) and the Interconnect Impedance (Ric) combine to affect the time required to charge the CHOLD. The total

resistance (Rs + Ric) must therefore, be small enough to fully charge the Holding Capacitor within the selected sample time.

3.10.3 TEMPERATURE SENSOR

The ADC channel, AN19, is connected to a forward biased diode; it can be used to measure die temperature. This diode provides a voltage output that can be monitored by the ADC. To get the exact gain and offset numbers, two-point temperature calibration is recommended.

The temperature coefficient is listed in Table 24-44 in Section 24.0, Electrical Characteristics. To get the exact gain and offset numbers, the two temperature points calibration is recommended.

3.10.4 ANALOG-TO-DIGITAL CONVERTER RESOURCES

Many useful resources are provided on the main product page of the Microchip website for the devices listed in this data sheet. This product page contains the latest updates and additional information.

3.10.4.1 Key Resources

  • “12-Bit High-Speed, Multiple SARs A/D Converter (ADC)” (www.microchip.com/DS70005213)
  • Code Samples
  • Application Notes
  • Software Libraries
  • Webinars
  • All Related "dsPIC33/PIC24 Family Reference Manual" Sections
  • Development Tools

3.10.5 ADC CONTROL/STATUS REGISTERS

REGISTER 3-160: ADCON1L: ADC CONTROL REGISTER 1 LOW

R/W-0 U-0 R/W-0 U-0 U-0 U-0 U-0 U-0
ADON^(1) ADSIDL——
bit 15 bit 8
U-0 U-0 U-0 U-0 U-0 U-0 U-0 U-0
—————— —
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 15 ADON: ADC Enable bit ^(1)

1 = ADC module is enabled

0 = ADC module is off

bit 14 Unimplemented: Read as '0'

bit 13 ADSIDL: ADC Stop in Idle Mode bit

1 = Discontinues module operation when device enters Idle mode

0 = Continues module operation in Idle mode

bit 12-0 Unimplemented: Read as '0'

Note 1: Set the ADON bit only after the ADC module has been configured. Changing ADC Configuration bits when ADON = 1 will result in unpredictable behavior.

REGISTER 3-161: ADCON1H: ADC CONTROL REGISTER 1 HIGH

U-0 U-0 U-0 U-0 U-0 U-0 U-0 U-0
——————
bit 15 bit 8
R/W-0 R/W-1 R/W-1 U-0 U-0 U-0 U-0 U-0
FORM SHRRES1 SHRRES0—————
bit 7 bit 0

Legend:

R = Readable bit W = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown

bit 15-8 Unimplemented: Read as '0'

bit 7 FORM: Fractional Data Output Format bit

1 = Fractional

0 = Integer

bit 6-5 SHRRES[1:0]: Shared ADC Core Resolution Selection bits

11 = 12-bit resolution

10 = 10-bit resolution

01 = 8-bit resolution

00 = 6-bit resolution

bit 4-0 Unimplemented: Read as '0'

REGISTER 3-162: ADCON2L: ADC CONTROL REGISTER 2 LOW

R/W-0 R/W-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
REFCIE REFERCIE— EIENPTGEN SHREISEL2(1)SHREISEL1(1)SHREISEL0(1)
bit 15 bit 8
U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
SHRADCS[6:0]
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 15REFCIE: Band Gap and Reference Voltage Ready Common Interrupt Enable bit1 = Common interrupt will be generated when the band gap becomes ready0 = Common interrupt is disabled for the band gap ready event
bit 14REFERCIE: Band Gap or Reference Voltage Error Common Interrupt Enable bit1 = Common interrupt will be generated when a band gap or reference voltage error is detected0 = Common interrupt is disabled for the band gap and reference voltage error event
bit 13Unimplemented: Read as ‘0’
bit 12EIEN: Early Interrupts Enable bit1 = The early interrupt feature is enabled for the input channel interrupts (when the EISTATx flag is set)0 = The individual interrupts are generated when conversion is done (when the ANxRDY flag is set)
bit 11PTGEN: External Conversion Request Interface bitSetting this bit will enable the PTG to request conversion of an ADC input.
bit 10-8SHREISEL[2:0]: Shared Core Early Interrupt Time Selection bits(1)111 = Early interrupt is set and interrupt is generated 8 TADCORE clocks prior to when the data are ready110 = Early interrupt is set and interrupt is generated 7 TADCORE clocks prior to when the data are ready101 = Early interrupt is set and interrupt is generated 6 TADCORE clocks prior to when the data are ready100 = Early interrupt is set and interrupt is generated 5 TADCORE clocks prior to when the data are ready011 = Early interrupt is set and interrupt is generated 4 TADCORE clocks prior to when the data are ready010 = Early interrupt is set and interrupt is generated 3 TADCORE clocks prior to when the data are ready001 = Early interrupt is set and interrupt is generated 2 TADCORE clocks prior to when the data are ready000 = Early interrupt is set and interrupt is generated 1 TADCORE clock prior to when the data are ready
bit 7Unimplemented: Read as ‘0’
bit 6-0SHRADCS[6:0]: Shared ADC Core Input Clock Divider bitsThese bits determine the number of TCORESRC (Source Clock Periods) for one shared TADCORE (Core Clock Period).1111111 = 254 Source Clock Periods...0000011 = 6 Source Clock Periods0000010 = 4 Source Clock Periods0000001 = 2 Source Clock Periods0000000 = 2 Source Clock Periods

Note 1: For the 6-bit shared ADC core resolution (SHRES[1:0] = 00), the SHREISEL[2:0] settings, from '100' to '111', are not valid and should not be used. For the 8-bit shared ADC core resolution (SHRES[1:0] = 01), the SHREISEL[2:0] settings, '110' and '111', are not valid and should not be used.

REGISTER 3-163: ADCON2H: ADC CONTROL REGISTER 2 HIGH

HSC/R-0 HSC/R-0 U-0 r-0 r-0 r-0 R/W-0 R/W-0
REFRDY REFERR———SHRSAMC9SHRSAMC8
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
SHRSAMC7SHRSAMC6 SSHRSAMC5 SHRSAMC4 SHRSAMC3 SHRSAMMC2 SHRSAMC1 SHRSAMC0
bit 7 bit 0
Legend:r = Reserved bitU = Unimplemented bit, read as ‘0’
R = Readable bitW = Writable bitHISC = Hardware Settable/Clearable bit
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15 REFRDY: Band Gap and Reference Voltage Ready Flag bit

1 = Band gap is ready

0 = Band gap is not ready

bit 14 REFERR: Band Gap or Reference Voltage Error Flag bit

1 = Band gap was removed after the ADC module was enabled (ADON = 1)

0 = No band gap error was detected

bit 13 Unimplemented: Read as '0'

bit 12-10 Reserved: Maintain as '0'

bit 9-0 SHRSAMC[9:0]: Shared ADC Core Sample Time Selection bits

These bits specify the number of shared ADC Core Clock Periods (T ADCORE) for the shared ADC core sample time (Sample Time = (SHRSAMC[9:0] + 2) * T ADCORE).

1111111111 = 1025 TADCORE

...

0000000001 = 3 T ADCORE

0000000000 = 2 TADCORE

REGISTER 3-164: ADCON3L: ADC CONTROL REGISTER 3 LOW

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0HSC/R-0R/W-0HSC/R-0
REFSEL2REFSEL1REFSEL0SUSPENDSUSPCIE SUSPRDY SHRSAMP CNVRTCH
bit 15 bit 8
R/W-0HSC/R-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
SWLCTRGSWCTRGCNVCHSEL5CNVCHSEL4CNVCHSEL3CNVCHSEL2CNVCHSEL1CNVCHSEL0
bit 7 bit 0
Legend:U = Unimplemented bit, read as ‘0’
R = Readable bitW = Writable bitHSC = Hardware Settable/Clearable bit
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown

bit 15-13 REFSEL[2:0]: ADC Reference Voltage Selection bits

ValueVREFHVREFL
000AVDDAVSS

001-111 = Unimplemented: Do not use

bit 12 SUSPEND: All ADC Core Triggers Disable bit

1 = All new trigger events for all ADC cores are disabled
0 = All ADC cores can be triggered

bit 11 SUSPCIE: Suspend All ADC Cores Common Interrupt Enable bit

1 = Common interrupt will be generated when ADC core triggers are suspended (SUSPEND bit = 1) and all previous conversions are finished (SUSPRDY bit becomes set)
0 = Common interrupt is not generated for suspend ADC cores event

bit 10 SUSPRDY: All ADC Cores Suspended Flag bit

1 = ADC core is suspended (SUSPEND bit = 1) and has no conversions in progress
0 = ADC cores have previous conversions in progress

bit 9 SHRSAMP: Shared ADC Core Sampling Direct Control bit

This bit should be used with the individual channel conversion trigger controlled by the CNVRTCH bit. It connects an analog input, specified by the CNVCHSEL[5:0] bits, to the shared ADC core and allows extending the sampling time. This bit is not controlled by hardware and must be cleared before the conversion starts (setting CNVRTCH to '1').
1 = Shared ADC core samples an analog input specified by the CNVCHSEL[5:0] bits
0 = Sampling is controlled by the shared ADC core hardware

bit 8 CNVRTCH: Software Individual Channel Conversion Trigger bit

1 = Single trigger is generated for an analog input specified by the CNVCHSEL[5:0] bits; when the bit is set, it is automatically cleared by hardware on the next instruction cycle
0 = Next individual channel conversion trigger can be generated

bit 7 SWLCTRG: Software Level-Sensitive Common Trigger bit

1 = Triggers are continuously generated for all channels with the software; level-sensitive common trigger selected as a source in the ADTRIGnL and ADTRIGnH registers
0 = No software, level-sensitive common triggers are generated

bit 6 SWCTRG: Software Common Trigger bit

1 = Single trigger is generated for all channels with the software; common trigger selected as a source in the ADTRIGnL and ADTRIGnH registers; when the bit is set, it is automatically cleared by hardware on the next instruction cycle
0 = Ready to generate the next software common trigger

bit 5-0 CNVCHSEL [5:0]: Channel Number Selection for Software Individual Channel Conversion Trigger bits

These bits define a channel to be converted when the CNVRTCH bit is set.

REGISTER 3-165: ADCON3H: ADC CONTROL REGISTER 3 HIGH

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CLKSEL1CLKSEL0CLKDIV5CLKDIV4CLKDIV3CLKDIV2CLKDIV1CLKDIV0
bit 15 bit 8
R/W-0 U-0 U-0 U-0 U-0 U-0 U-0
SHREN——————
bit 7 bit 0

Legend:

R = Readable bit W = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown

bit 15-14 CLKSEL[1:0]: ADC Module Clock Source Selection bits

11 = Fvco/4

10 = AFVCODIV

01 = Fosc

00 = FP (Fosc/2)

bit 13-8 CLKDIV[5:0]: ADC Module Clock Source Divider bits

The divider forms a TCORESRC clock used by all ADC cores (shared and dedicated), from the TSRC ADC module clock source, selected by the CLKSEL[1:0] bits. Then, each ADC core individually divides the TCORESRC clock to get a core-specific TADCORE clock using the ADCS[6:0] bits in the ADCORExH register or the SHRADCS[6:0] bits in the ADCON2L register.

111111 = 64 Source Clock Periods

000011 = 4 Source Clock Periods

000010 = 3 Source Clock Periods

000001 = 2 Source Clock Periods

000000 = 1 Source Clock Period

bit 7 SHREN: Shared ADC Core Enable bit

1 = Shared ADC core is enabled

0 = Shared ADC core is disabled

bit 6-0 Unimplemented: Read as '0'

REGISTER 3-166: ADCON5L: ADC CONTROL REGISTER 5 LOW

HSC/R-0 U-0 U-0 U-0 U-0 U-0 U-0 U-0
SHRRDY— — —— — — —
bit 15 bit 8
R/W-0 U-0 U-0 U-0 U-0 U-0 U-0
SHRPWR——————
bit 7 bit 0
Legend: U = Unimplemented bit, read as '0'
R = Readable bit W = Writable bit HSC = Hardware Settable/Clearable bit
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown
bit 15SHRRDY: Shared ADC Core Ready Flag bit1 = ADC core is powered and ready for operation0 = ADC core is not ready for operation
bit 14-8Unimplemented: Read as '0'
bit 7SHRPWR: Shared ADC Core Power Enable bit1 = ADC core is powered0 = ADC core is off
bit 6-0Unimplemented: Read as '0'

REGISTER 3-167: ADCON5H: ADC CONTROL REGISTER 5 HIGH

U-0 U-0 U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0
— — —— WARMTIME[3:0]
bit 15 bit 8
R/W-0U-0U-0U-0U-0U-0U-0U-0
SHRCIE
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-12 Unimplemented: Read as '0'

bit 11-8 WARMTIME[3:0]: ADC Dedicated Core Power-up Delay bits

These bits determine the power-up delay in the number of the Core Source Clock Periods (TCORESRC) for all ADC cores.

1111 = 32768 Source Clock Periods
1110 = 16384 Source Clock Periods
1101 = 8192 Source Clock Periods
1100 = 4096 Source Clock Periods
1011 = 2048 Source Clock Periods
1010 = 1024 Source Clock Periods
1001 = 512 Source Clock Periods
1000 = 256 Source Clock Periods
0111 = 128 Source Clock Periods
0110 = 64 Source Clock Periods
0101 = 32 Source Clock Periods
0100 = 16 Source Clock Periods
00xx = 16 Source Clock Periods

bit 7 SHRCIE: Shared ADC Core Ready Common Interrupt Enable bit

1 = Common interrupt will be generated when ADC core is powered and ready for operation
0 = Common interrupt is disabled for an ADC core ready event

bit 6-0 Unimplemented: Read as '0'

REGISTER 3-168: ADLVLTRGL: ADC LEVEL-SENSITIVE TRIGGER CONTROL REGISTER LOW

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
LVLEN[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
LVLEN[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 LVLEN[15:0]: Level Trigger for Corresponding Analog Input Enable bits

1 = Input trigger is level-sensitive

0 = Input trigger is edge-sensitive

REGISTER 3-169: ADLVLTRGH: ADC LEVEL-SENSITIVE TRIGGER CONTROL REGISTER HIGH

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-5 Unimplemented: Read as '0'

bit 4-0 LVLEN[20:16]: Level Trigger for Corresponding Analog Input Enable bits

1 = Input trigger is level-sensitive

0 = Input trigger is edge-sensitive

REGISTER 3-170: ADEIEL: ADC EARLY INTERRUPT ENABLE REGISTER LOW

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
EIEN[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
EIEN[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 EIEN[15:0]: Early Interrupt Enable for Corresponding Analog Input bits

1 = Early interrupt is enabled for the channel
0 = Early interrupt is disabled for the channel

REGISTER 3-171: ADEIEH: ADC EARLY INTERRUPT ENABLE REGISTER HIGH

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-5 Unimplemented: Read as '0'

bit 4-0 EIEN[20:16]: Early Interrupt Enable for Corresponding Analog Input bits

1 = Early interrupt is enabled for the channel
0 = Early interrupt is disabled for the channel

REGISTER 3-172: ADEISTATL: ADC EARLY INTERRUPT STATUS REGISTER LOW

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
EISTAT[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
EISTAT[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 EISTAT[15:0]: Early Interrupt Status for Corresponding Analog Input bits

1 = Early interrupt was generated
0 = Early interrupt was not generated since the last ADCBUFx read

REGISTER 3-173: ADEISTATH: ADC EARLY INTERRUPT STATUS REGISTER HIGH

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-5 Unimplemented: Read as '0'

bit 4-0 EISTAT[20:16]: Early Interrupt Status for Corresponding Analog Input bits

1 = Early interrupt was generated
0 = Early interrupt was not generated since the last ADCBUFx read

dsPIC33CH128MP508 FAMILY

REGISTER 3-174: ADMOD0L: ADC INPUT MODE CONTROL REGISTER 0 LOW

U-0 R/W-0 U-0 R/W-0 U-0 R/W-0 U-0 R/W-0
SIGN7SIGN
bit 15 bit 8
U-0 R/W-0 U-0 R/W-0 U-0 R/W-0 U-0 R/W-0
SIGN3SIGN
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-1 (odd) Unimplemented: Read as '0'

bit 14-0 (even) SIGNn (n = 7 to 0): Output Data Sign for Corresponding Analog Input bits

1 = Channel output data are signed

0 = Channel output data are unsigned

REGISTER 3-175: ADMOD0H: ADC INPUT MODE CONTROL REGISTER 0 HIGH

U-0 R/W-0 U-0 R/W-0 U-0 R/W-0 U-0 R/W-0
SIGN15SIGN14SIGN13SIGN12
bit 15 bit 8
U-0 R/W-0 U-0 R/W-0 U-0 R/W-0 U-0 R/W-0
SIGN11SIGN10SIGN9SIGN8
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-1 (odd) Unimplemented: Read as '0'

bit 14-0 (even) SIGNn (n = 15 to 8): Output Data Sign for Corresponding Analog Input bits

1 = Channel output data are signed

0 = Channel output data are unsigned

REGISTER 3-176: ADMOD1L: ADC INPUT MODE CONTROL REGISTER 1 LOW

U-0 U-0 U-0 U-0 U-0 U-0 R/W-0
——————SIGN20
bit 15 bit 8
U-0 R/W-0 U-0 R/W-0 U-0 R/W-0 U-0 R/W-0
SIGN19SIGN18SIGN17SIGN16
bit 7 bit 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-9 Unimplemented: Read as '0'

bit 7-1 (odd) Unimplemented: Read as '0'

bit 8-0 (even) SIGNn (n = 20 to 16): Output Data Sign for Corresponding Analog Input bits

1 = Channel output data are signed

0 = Channel output data are unsigned

REGISTER 3-177: ADIEL: ADC INTERRUPT ENABLE REGISTER LOW

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
IE[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
IE[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 IE[15:0]: Common Interrupt Enable bits

1 = Common and individual interrupts are enabled for the corresponding channel
0 = Common and individual interrupts are disabled for the corresponding channel

REGISTER 3-178: ADIEH: ADC INTERRUPT ENABLE REGISTER HIGH

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-5 Unimplemented: Read as '0'

bit 4-0 IE[20:16]: Common Interrupt Enable bits

1 = Common and individual interrupts are enabled for the corresponding channel
0 = Common and individual interrupts are disabled for the corresponding channel

REGISTER 3-179: ADSTATL: ADC DATA READY STATUS REGISTER LOW

HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0
AN[15:8]RDY
bit 15 bit 8
HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0
AN[7:0]RDY
bit 7 bit 0
Legend: U = Unimplemented bit, read as '0'
R = Readable bit W = Writable bit HSC = Hardware Settable/Clearable bit -n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0

AN[15:0]RDY: Common Interrupt Enable for Corresponding Analog Input bits

1 = Channel conversion result is ready in the corresponding ADCBUFx register
0 = Channel conversion result is not ready

REGISTER 3-180: ADSTATH: ADC DATA READY STATUS REGISTER HIGH

U-0U-0U-0HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0
AN[20:16]RDY
bit 7 bit 0
Legend: U = Unimplemented bit, read as '0'
R = Readable bit W = Writable bit HSC = Hardware Settable/Clearable bit
-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-5 Unimplemented: Read as '0'

bit 4-0 AN[20:16]RDY: Common Interrupt Enable for Corresponding Analog Input bits 1 = Channel conversion result is ready in the corresponding ADCBUFx register 0 = Channel conversion result is not ready

REGISTER 3-181: ADTRIGnL AND ADTRIGnH: ADC CHANNEL TRIGGER n(x) SELECTION REGISTERS LOW AND HIGH (x = 0 TO 19; n = 0 TO 4)

U-0 U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
— — + TRGSRC(x+1)[4:0]
bit 15 bit 8
U-0 U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
— — + TRGSRCx[4:0]
bit 7 bit 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-13 Unimplemented: Read as '0'

bit 12-8 TRGSRC(x+1)[4:0]: Trigger Source Selection for Corresponding Analog Input bits
(TRGSRC1 to TRGSRC19 – Odd)
11111 = ADTRG31 (PPS input)
11110 = Host PTG
11101 = Client CLC1
11100 = Host CLC1
11011 = Client PWM8 Trigger 2
11010 = Client PWM5 Trigger 2
11001 = Client PWM3 Trigger 2
11000 = Client PWM1 Trigger 2
10111 = Host SCCP4 input capture/output compare
10110 = Host SCCP3 input capture/output compare
10101 = Host SCCP2 input capture/output compare
10100 = Host SCCP1 input capture/output compare
10011 = Reserved
10010 = Reserved
10001 = Reserved
10000 = Reserved
01111 = Reserved
01110 = Reserved
01101 = Reserved
01100 = Reserved
01011 = Host PWM4 Trigger 2
01010 = Host PWM4 Trigger 1
01001 = Host PWM3 Trigger 2
01000 = Host PWM3 Trigger 1
00111 = Host PWM2 Trigger 2
00110 = Host PWM2 Trigger 1
00101 = Host PWM1 Trigger 2
00100 = Host PWM1 Trigger 1
00011 = Reserved
00010 = Level software trigger
00001 = Common software trigger
00000 = No trigger is enabled

bit 7-5 Unimplemented: Read as 'o' 

REGISTER 3-181: ADTRIGnL AND ADTRIGnH: ADC CHANNEL TRIGGER n(x) SELECTION REGISTERS LOW AND HIGH (x = 0 TO 19; n = 0 TO 4) (CONTINUED)

bit 4-0TRGSRCx[4:0]: Common Interrupt Enable for Corresponding Analog Input bits (TRGSRCx0 to TRGSRCx20 – Even)
11111 = ADTRG31 (PPS input)
11110 = Host PTG
11101 = Client CLC1
11100 = Host CLC1
11011 = Client PWM8 Trigger 2
11010 = Client PWM5 Trigger 2
11001 = Client PWM3 Trigger 2
11000 = Client PWM1 Trigger 2
10111 = Host SCCP4 input capture/output compare
10110 = Host SCCP3 input capture/output compare
10101 = Host SCCP2 input capture/output compare
10100 = Host SCCP1 input capture/output compare
10011 = Reserved
10010 = Reserved
10001 = Reserved
10000 = Reserved
01111 = Reserved
01110 = Reserved
01101 = Reserved
01100 = Reserved
01011 = Host PWM4 Trigger 2
01010 = Host PWM4 Trigger 1
01001 = Host PWM3 Trigger 2
01000 = Host PWM3 Trigger 1
00111 = Host PWM2 Trigger 2
00110 = Host PWM2 Trigger 1
00101 = Host PWM1 Trigger 2
00100 = Host PWM1 Trigger 1
00011 = Reserved
00010 = Level software trigger
00001 = Common software trigger
00000 = No trigger is enabled

REGISTER 3-182: ADCMPxCON: ADC DIGITAL COMPARATOR x CONTROL REGISTER (x =0, 1, 2, 3)

U-0 U-0 U-0HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0HSC/R-0
— — —CHNL[4:0]
bit 15 bit 8
R/W-0R/W-0HC/HS/R-0R/W-0R/W-0R/W-0R/W-0R/W-0
CMPENIESTATBTWNHIHIHILOLOHILOLO
bit 7 bit 0
Legend:HC = Hardware Clearable bitU = Unimplemented bit, read as '0'
R = Readable bit W = Writable bitHSC = Hardware Settable/Clearable bit
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedHS = Hardware Settable bit

bit 15-13 Unimplemented: Read as '0'

bit 12-8 CHNL[4:0]: Input Channel Number bits

11111 = Reserved

• • •

10101 = Reserved

10100 = Band gap, 1.2V (AN20)

10011 = Temperature sensor (AN19)

10010 = SPGA3 (AN18)

10001 = SPGA2 (AN17)

10000 = SPGA1 (AN16)

01111 = AN15

...

00000 = AN0

bit 7 CMPEN: Comparator Enable bit

1 = Comparator is enabled

0 = Comparator is disabled and the STAT status bit is cleared

bit 6 IE: Comparator Common ADC Interrupt Enable bit

1 = Common ADC interrupt will be generated if the comparator detects a comparison event

0 = Common ADC interrupt will not be generated for the comparator

bit 5 STAT: Comparator Event Status bit

This bit is cleared by hardware when the channel number is read from the CHNL[4:0] bits.

1 = A comparison event has been detected since the last read of the CHNL[4:0] bits

0 = A comparison event has not been detected since the last read of the CHNL[4:0] bits

bit 4 BTWN: Between Low/High Comparator Event bit

1 = Generates a comparator event when ADCMPxLO ≤ ADCBUFx < ADCMPxHI

0 = Does not generate a digital comparator event when ADCMPxLO ≤ ADCBUFx < ADCMPxHI

bit 3 HIHI: High/High Comparator Event bit

1 = Generates a digital comparator event when ADCBUFx ≥ ADCMPxHI

0 = Does not generate a digital comparator event when ADCBUFx ≥ ADCMPxHI

bit 2 HILO: High/Low Comparator Event bit

1 = Generates a digital comparator event when ADCBUFx < ADCMPxHI

0 = Does not generate a digital comparator event when ADCBUFx < ADCMPxHI

bit 1 LOHI: Low/High Comparator Event bit

1 = Generates a digital comparator event when ADCBUFx ≥ ADCMPxLO

0 = Does not generate a digital comparator event when ADCBUFx ≥ ADCMPxLO

bit 0 LOLO: Low/Low Comparator Event bit

1 = Generates a digital comparator event when ADCBUFx < ADCMPxLO

0 = Does not generate a digital comparator event when ADCBUFx < ADCMPxLO

REGISTER 3-183: ADCMPxENL: ADC DIGITAL COMPARATOR x CHANNEL ENABLE REGISTER LOW (x = 0, 1, 2, 3)

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CMPEN[15:8]
bit 15 bit 8
R/W/0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CMPEN[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0' -n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 CMPEN[15:0]: Comparator Enable for Corresponding Input Channel bits

1 = Conversion result for corresponding channel is used by the comparator
0 = Conversion result for corresponding channel is not used by the comparator

REGISTER 3-184: ADCMPxENH: ADC DIGITAL COMPARATOR x CHANNEL ENABLE REGISTER HIGH (x = 0, 1, 2, 3)

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0' -n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-5 Unimplemented: Read as '0'

bit 4-0 CMPEN[20:16]: Comparator Enable for Corresponding Input Channel bits

1 = Conversion result for corresponding channel is used by the comparator
0 = Conversion result for corresponding channel is not used by the comparator

REGISTER 3-185: ADFLxCON: ADC DIGITAL FILTER x CONTROL REGISTER
(x = 0, 1, 2, 3)

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 HSC/R-0
FLEN MODE1 MODE0 OVR SAM2 OVR SAM1 OVR SAM0 IE RDY
bit 15 bit 8
U-0U-0U-0R/W-0R/W-0R/W-0R/W-0R/W-0
FLCHSEL[4:0]
bit 7 bit 0
Legend:U = Unimplemented bit, read as '0'
R = Readable bitW = Writable bitHSC = Hardware Settable/Clearable bit
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 15 FLEN: Filter Enable bit

1 = Filter is enabled

0 = Filter is disabled and the RDY bit is cleared

bit 14-13 MODE[1:0]: Filter Mode bits

11 = Averaging mode

10 = Reserved

01 = Reserved

00 = Oversampling mode

bit 12-10 OVRSAM[2:0]: Filter Averaging/Oversampling Ratio bits

If MODE[1:0] = 00:

111 = 128x (16-bit result in the ADFLxDAT register is in 12.4 format)

110 = 32x (15-bit result in the ADFLxDAT register is in 12.3 format)

101 = 8x (14-bit result in the ADFLxDAT register is in 12.2 format)

100 = 2x (13-bit result in the ADFLxDAT register is in 12.1 format)

011 = 256x (16-bit result in the ADFLxDAT register is in 12.4 format)

010 = 64x (15-bit result in the ADFLxDAT register is in 12.3 format)

001 = 16x (14-bit result in the ADFLxDAT register is in 12.2 format)

000 = 4x (13-bit result in the ADFLxDAT register is in 12.1 format)

If MODE[1:0] = 11 (12-bit result in the ADFLxDAT register in all instances):

111 = 256x

110 = 128x

101 = 64x

100 = 32x

011 = 16x

110 = 8x

001 = 4x

000 = 2x

bit 9 IE: Filter Interrupts Enable bit

1 = Individual and common interrupts will be generated when the filter result is ready

0 = Individual and common interrupts will not be generated for the filter

bit 8 RDY: Oversampling Filter Data Ready Flag bit

This bit is cleared by hardware when the result is read from the ADFLxDAT register.

1 = Data in the ADFLxDAT register are ready

0 = The ADFLxDAT register has been read and new data in the ADFLxDAT register are not ready

bit 7-5 Unimplemented: Read as '0'

REGISTER 3-185: ADFLxCON: ADC DIGITAL FILTER x CONTROL REGISTER (x = 0, 1, 2, 3) (CONTINUED)

bit 4-0 FLCHSEL[4:0]: Oversampling Filter Input Channel Selection bits

11111 = Reserved

...

10101 = Reserved

10100 = Band gap, 1.2V (AN20)

10011 = Temperature sensor (AN19)

10010 = SPGA3 (AN18)

10001 = SPGA2 (AN17)

10000 = SPGA1 (AN16)

01111 = AN15

• • •

00000 = ANO

3.11 Peripheral Trigger Generator (PTG)

Note 1: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive reference source. To complement the information in this data sheet, refer to “Peripheral Trigger Generator (PTG)” (www.microchip.com/DS70000669), which is available from the Microchip website (www.microchip.com)

Table 3-44 shows an overview of the PTG module.

TABLE 3-44: PTG MODULE OVERVIEW

No. of PTG ModulesIdentical (Modules)
Host 1 NA
Client NoneNA

The dsPIC33CH128MP508 family Peripheral Trigger Generator (PTG) module is a user-programmable sequencer that is capable of generating complex trigger signal sequences to coordinate the operation of other peripherals. The PTG module is designed to interface with the modules, such as an Analog-to-Digital Converter (ADC), output compare and PWM modules, timers and interrupt controllers.

3.11.1 FEATURES

- Behavior is Step Command-Driven:

- Step commands are eight bits wide

- Commands are Stored in a Step Queue:

- Queue depth is parameterized (8-32 entries)

- Programmable Step execution time (Step delay)

• Supports the Command Sequence Loop:

- Can be nested one-level deep

- Conditional or unconditional loop

- Two 16-bit loop counters

• 16 Hardware Input Triggers:

- Sensitive to either positive or negative edges, or a high or low level

• One Software Input Trigger

- Generates up to 32 Unique Output Trigger Signals

- Generates Two Types of Trigger Outputs:

- Individual

- Broadcast

• Strobed Output Port for Literal Data Values:
- 5-bit literal write (literal part of a command)
- 16-bit literal write (literal held in the PTGL0 register)
- Generates up to Ten Unique Interrupt Signals
- Two 16-Bit General Purpose Timers
- Flexible Self-Contained Watchdog Timer (WDT) to Set an Upper Limit to Trigger Wait Time
- Single-Step Command Capability in Debug mode
- Selectable Clock (system, Pulse-Width Modulator (PWM) or ADC)
- Programmable Clock Divider

FIGURE 3-26: PTG BLOCK DIAGRAM
Microchip dsPIC33CH64MP208 - FEATURES - 1

flowchart
graph TD
    A["PTGHOLD"] --> B["PTGADJ"]
    C["PTGOLD"] --> D["PTGADJ"]
    B --> E["PTGADJ"]
    D --> E
    E --> F["PTGADJ"]
    F --> G["PTGADJ"]
    G --> H["PTGADJ"]
    H --> I["PTGADJ"]
    I --> J["PTGADJ"]
    J --> K["PTGADJ"]
    K --> L["PTGADJ"]
    L --> M["PTGADJ"]
    M --> N["PTGADJ"]
    N --> O["PTGADJ"]
    O --> P["PTGADJ"]
    P --> Q["PTGADJ"]
    Q --> R["PTGADJ"]
    R --> S["PTGADJ"]
    S --> T["PTGADJ"]
    T --> U["PTGADJ"]
    U --> V["PTGADJ"]
    V --> W["PTGADJ"]
    W --> X["PTGADJ"]
    X --> Y["PTGADJ"]
    Y --> Z["PTGADJ"]
    Z --> AA["PTGADJ"]
    AA --> AB["PTGADJ"]
    AB --> AC["PTGADJ"]
    AC --> AD["PTGADJ"]
    AD --> AE["PTGADJ"]
    AE --> AF["PTGADJ"]
    AF --> AG["PTGADJ"]
    AG --> AH["PTGADJ"]
    AH --> AI["PTGADJ"]
    AI --> AJ["PTGADJ"]
    AJ --> AK["PTGADJ"]
    AK --> AL["PTGADJ"]
    AL --> AM["PTGADJ"]
    AM --> AN["PTGADJ"]
    AN --> AO["PTGADJ"]
    AO --> AP["PTGADJ"]
    AP --> AQ["PTGADJ"]
    AQ --> AR["PTGADJ"]
    AR --> AS["PTGADJ"]
    AS --> AT["PTGADJ"]
    AT --> AU["PTGADJ"]
    AU --> AV["PTGADJ"]
    AV --> AW["PTGADJ"]
    AW --> AX["PTGADJ"]
    AX --> AY["PTGADJ"]
    AY --> AZ["PTGADJ"]
    AZ --> BA["PTGADJ"]
    BA --> BB["PTGADJ"]
    BB --> BC["PTGADJ"]
    BC --> BD["PTGADJ"]
    BD --> BE["PTGADJ"]
    BE --> BF["PTGADJ"]
    BF --> BG["PTGADJ"]
    BG --> BH["PTGADJ"]
    BH --> BI["PTGADJ"]
    BI --> BJ["PTGADJ"]
    BJ --> BK["PTGADJ"]
    BK --> BL["PTGADJ"]
    BL --> BM["PTGADJ"]
    BM --> BN["PTGADJ"]
    BN --> BO["PTGADJ"]
    BO --> BP["PTGADJ"]
    BP --> BQ["PTGADJ"]
    BQ --> BR["PTGADJ"]
    BR --> BS["PTGADJ"]
    BS --> BT["PTGADJ"]
    BT --> BU["PTGADJ"]
    BU --> BV["PTGADJ"]
    BV --> BW["PTGADJ"]
    BW --> BX["PTGADJ"]
    BX --> BY["PTGADJ"]
    BY --> BZ["PTGADJ"]
    BZ --> CA["PTGADJ"]
    CA --> CB["PTGADJ"]
    CB --> CC["PTGADJ"]
    CC --> CD["PTGADJ"]
    CD --> CE["PTGADJ"]
    CE --> CF["PTGADJ"]
    CF --> CG["PTGADJ"]
    CG --> CH["PTGADJ"]
    CH --> CI["PTGADJ"]
    CI --> CJ["PTGADJ"]
    CJ --> CK["PTGADJ"]
    CK --> CL["PTGADJ"]
    CL --> CM["PTGADJ"]
    CM --> CN["PTGADJ"]
    CN --> CO["PTGADJ"]
    CO --> CP["PTGADJ"]
    CP --> CQ["PTGADJ"]
    CQ --> CR["PTGADJ"]
    CR --> CS["PTGADJ"]
    CS --> CT["PTGADJ"]
    CT --> CU["PTGADJ"]
    CU --> CV["PTGADJ"]
    CV --> CW["PTGADJ"]
    CW --> CX["PTGADJ"]
    CX --> CY["PTGADJ"]
    CY --> CZ["PTGADJ"]
    CZ --> DA["PTGADJ"]
    DA --> DB["PTGADJ"]
    DB --> DC["PTGADJ"]
    DC --> DD["PTGADJ"]
    DD --> DE["PTGADJ"]
    DE --> DF["PTGADJ"]
    DF --> DG["PTGADJ"]
    DG --> DH["PTGADJ"]
    DH --> DI["PTGADJ"]
    DI --> DJ["PTGADJ"]
    DJ --> DK["PTGADJ"]
    DK --> DL["PTGADJ"]
    DL --> DV["PTGADJ"]
    DV --> DW["PTGADJ"]
    DW --> DX["PTGADJ"]
    DX --> DY["PTGADJ"]

Note 1: This is a dedicated Watchdog Timer for the PTG module and is independent of the device Watchdog Timer.
2: See Figure 4-11.
3: See Figure 4-9.
4: See Figure 4-2.

3.11.2 PTG CONTROL/STATUS REGISTERS

REGISTER 3-186: PTGCST: PTG CONTROL/STATUS LOW REGISTER

R/W-0 U-0 R/W-0 R/W-0 U-0 HC/R/W-0 R/W-0 R/W-0
PTGENPTGSIDLPTGTOGLPTGSWT ^(2) PTGSSEN ^(3) PTGIVIS
bit 15 bit 8
HC/R/W-0HS/R/W-0HS/HC/R/W-0U-0U-0U-0R/W-0R/W-0
PTGSTRTPTGWDTOPTGBUSY PTGITM1^(1) PTGITM0^(1)
bit 7 bit 0
Legend:HC = Hardware Clearable bitHS = Hardware Settable bit
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15 PTGEN: PTG Enable bit

1 = PTG is enabled

0 = PTG is disabled

bit 14 Unimplemented: Read as '0'

bit 13 PTGSIDL: PTG Freeze in Debug Mode bit

1 = Halts PTG operation when device is Idle

0 = PTG operation continues when device is Idle

bit 12 PTGTOGL: PTG Toggle Trigger Output bit

1 = Toggles state of TRIG output for each execution of PTGTRIG

0 = Generates a single TRIG pulse for each execution of PTGTRIG

bit 11 Unimplemented: Read as '0'

bit 10 PTGSWT: PTG Software Trigger bit ^(2)

1 = If the PTG state machine is executing a "Wait for software trigger" Step command (OPTION[3:0] = 1010 or 1011), the command will complete and execution will continue

0 = No action other than to clear the bit

bit 9 PTGSSEN: PTG Single-Step Command bit ^(3)

1 = Enables single Step when in Debug mode

0 = Disables single Step

bit 8 PTGIVIS: PTG Counter/Timer Visibility bit

1 = Reading the PTGSDLIM, PTGCxLIM or PTGTxLIM registers returns the current values of their corresponding Counter/Timer registers (PTGSDLIM, PTGCxLIM and PTGTxLIM)

0 = Reading the PTGSDLIM, PTGCxLIM or PTGTxLIM registers returns the value of these Limit registers

bit 7 PTGSTRT: PTG Start Sequencer bit

1 = Starts to sequentially execute the commands (Continuous mode)

0 = Stops executing the commands

bit 6 PTGWDTO: PTG Watchdog Timer Time-out Status bit

1 = PTG Watchdog Timer has timed out

0 = PTG Watchdog Timer has not timed out

bit 5 PTGBUSY: PTG State Machine Busy bit

1 = PTG is running on the selected clock source; no SFR writes are allowed to PTGCLK[2:0] or PTGDIV[4:0]

0 = PTG state machine is not running

Note 1: These bits apply to the PTGWHI and PTGWLO commands only.

2: This bit is only used with the PTGCTRL Step command software trigger option.

3: The PTGSSEN bit may only be written when in Debug mode.

REGISTER 3-186: PTGCST: PTG CONTROL/STATUS LOW REGISTER (CONTINUED)

bit 4-2 Unimplemented: Read as '0'

bit 1-0 PTGITM[1:0]: PTG Input Trigger Operation Selection bit ^(1)

11 = Single-level detect with Step delay not executed on exit of command (regardless of the PTGCTRL command) (Mode 3)
10 = Single-level detect with Step delay executed on exit of command (Mode 2)
01 = Continuous edge detect with Step delay not executed on exit of command (regardless of the PTGCTRL command) (Mode 1)
00 = Continuous edge detect with Step delay executed on exit of command (Mode 0)

Note 1: These bits apply to the PTGWHI and PTGWLO commands only.

2: This bit is only used with the PTGCTRL Step command software trigger option.

3: The PTGSSEN bit may only be written when in Debug mode.

REGISTER 3-187: PTGCON: PTG CONTROL/STATUS HIGH REGISTER

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PTGCLK2 PTGCLK1PTGCLK0PTGDIV4PTGDIV3PTGDIV2PTGDIV1PTGDIV0
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0U-0R/W-0R/W-0R/W-0
PTGPWD3PTGPWD2PTGPWD1PTGPWD0PTGWDT2PTGWDT1PTGWDT0
bit 7 bit 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-13 PTGCLK[2:0]: PTG Module Clock Source Selection bits

111 = Reserved

110 = PLL VCO DIV 4 output

101 = PTG module clock source will be SCCP7

100 = PTG module clock source will be SCCP8

011 = Input from Timer1 Clock pin, T1CK

010 = PTG module clock source will be ADC clock

001 = PTG module clock source will be Fosc

000 = PTG module clock source will be Fosc/2 (FP)

bit 12-8 PTGDIV[4:0]: PTG Module Clock Prescaler (Divider) bits

11111 = Divide-by-32

11110 = Divide-by-31

...

00001 = Divide-by-2

00000 = Divide-by-1

bit 7-4 PTGPWD[3:0]: PTG Trigger Output Pulse-Width (in PTG clock cycles) bits

1111 = All trigger outputs are 16 PTG clock cycles wide

1110 = All trigger outputs are 15 PTG clock cycles wide

...

0001 = All trigger outputs are 2 PTG clock cycles wide

0000 = All trigger outputs are 1 PTG clock cycle wide

bit 3 Unimplemented: Read as '0'

bit 2-0 PTGWDT[2:0]: PTG Watchdog Timer Time-out Selection bits

111 = Watchdog Timer will time out after 512 PTG clocks

110 = Watchdog Timer will time out after 256 PTG clocks

101 = Watchdog Timer will time out after 128 PTG clocks

100 = Watchdog Timer will time out after 64 PTG clocks

011 = Watchdog Timer will time out after 32 PTG clocks

010 = Watchdog Timer will time out after 16 PTG clocks

001 = Watchdog Timer will time out after 8 PTG clocks

000 = Watchdog Timer is disabled

REGISTER 3-188: PTGBTE: PTG BROADCAST TRIGGER ENABLE LOW REGISTER (1)

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PTGBTE[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PTGBTE[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 PTGBTE[15:0]: PTG Broadcast Trigger Enable bits

1 = Generates trigger when the broadcast command is executed
0 = Does not generate trigger when the broadcast command is executed

Note 1: These bits are read-only when the module is executing Step commands.

REGISTER 3-189: PTGBTEH: PTG BROADCAST TRIGGER ENABLE HIGH REGISTER (1)

R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
PTGBTE[31:24]
bit 15bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
PTGBTE[23:16]
bit 7bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 PTGBTE[31:16]: PTG Broadcast Trigger Enable bits

1 = Generates trigger when the broadcast command is executed
0 = Does not generate trigger when the broadcast command is executed

Note 1: These bits are read-only when the module is executing Step commands.

REGISTER 3-190: PTGHOLD: PTG HOLD REGISTER (1)

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PTGHOLD[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PTGHOLD[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 15-0 PTGHOLD[15:0]: PTG General Purpose Hold Register bits

This register holds the user-supplied data to be copied to the PTGTxLIM, PTGCxLIM, PTGSDLIM or PTGL0 register using the PTGCOPY command.

Note 1: These bits are read-only when the module is executing Step commands.

REGISTER 3-191: PTGT0LIM: PTG TIMER0 LIMIT REGISTER (1)

R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
PTGTOLIM[15:8]
bit 15bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
PTGTOLIM[7:0]
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 cleared x = Bit is unknown

bit 15-0 PTGTOLIM[15:0]: PTG Timer0 Limit Register bits

General Purpose Timer0 Limit register.

Note 1: These bits are read-only when the module is executing Step commands.

REGISTER 3-192: PTGT1LIM: PTG TIMER1 LIMIT REGISTER (1)

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PTGT1LIM[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PTGT1LIM[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0' -n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 PTGT1LIM[15:0]: PTG Timer1 Limit Register bits

General Purpose Timer1 Limit register.

Note 1: These bits are read-only when the module is executing Step commands.

REGISTER 3-193: PTGSDLIM: PTG STEP DELAY LIMIT REGISTER (1)

R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
PTGSDLIM[15:8]
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
PTGSDLIM[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0' -n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 PTGSDLIM[15:0]: PTG Step Delay Limit Register bits

This register holds a PTG Step delay value representing the number of additional PTG clocks between the start of a Step command and the completion of a Step command.

Note 1: These bits are read-only when the module is executing Step commands.

REGISTER 3-194: PTGC0LIM: PTG COUNTER 0 LIMIT REGISTER (1)

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PTGC0LIM[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PTGC0LIM[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 PTGC0LIM[15:0]: PTG Counter 0 Limit Register bits

This register is used to specify the loop count for the PTGJMPC0 Step command or as a Limit register for the General Purpose Counter 0.

Note 1: These bits are read-only when the module is executing Step commands.

REGISTER 3-195: PTGC1LIM: PTG COUNTER 1 LIMIT REGISTER (1)

R/W-0R/W-0 R/W-0 R/W-0 R/W-0 R/W-0R/W-0 R/W-0
PTGC1LIM[15:8]
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
PTGC1LIM[7:0]
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-0 PTGC1LIM[15:0]: PTG Counter 1 Limit Register bits

This register is used to specify the loop count for the PTGJMPC1 Step command or as a Limit register for the General Purpose Counter 1.

Note 1: These bits are read only when the module is executing step commands.

REGISTER 3-196: PTGADJ: PTG ADJUST REGISTER (1)

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PTGADJ[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PTGADJ[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR

'1' = Bit is set

'0' = Bit is cleared

x = Bit is unknown

bit 15-0

PTGADJ[15:0]: PTG Adjust Register bits

This register holds the user-supplied data to be added to the PTGTxLIM, PTGCxLIM, PTGSDLIM or PTGL0 register using the PTGADD command.

Note 1: These bits are read-only when the module is executing Step commands.

REGISTER 3-197: PTGL0: PTG LITERAL 0 REGISTER (1,2)

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PTGL0[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PTGL0[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR

'1' = Bit is set

'0' = Bit is cleared

x = Bit is unknown

bit 15-0 PTGL0[15:0]: PTG Literal 0 Register bits

This register holds the 6-bit value to be written to the CNVCHSEL[5:0] bits (ADCON3L[5:0]) with the PTGCTRL Step command.

Note 1: These bits are read-only when the module is executing Step commands.

2: The PTG strobe output is typically connected to the ADC Channel Select register. This allows the PTG to directly control ADC channel switching. See the specific device data sheet for connections of the PTG output.

REGISTER 3-198: PTGQPTR: PTG STEP QUEUE POINTER REGISTER (1)

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-5 Unimplemented: Read as '0'

bit 4-0 PTGQPTR[4:0]: PTG Step Queue Pointer Register bits

This register points to the currently active Step command in the Step queue.

Note 1: These bits are read only when the module is executing step commands.

REGISTER 3-199: PTGQUEn: PTG STEP QUEUE n POINTER REGISTER (n = 0-15) ^(1,2)

R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
STEP2n+1[7:0]
bit 15bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
STEP2n[7:0]
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 cleared x = Bit is unknown

bit 15-8 STEP2n+1[7:0]: PTG Command 4n+1 bits

A queue location for storage of the STEP2n+1 command byte, where 'n' is from PTGQUEn.

bit STEP2n[7:0]: PTG Command 4n+2 bits

A queue location for storage of the STEP2n command byte, where 'n' are the odd numbered Step Queue Pointers.

Note 1: These bits are read-only when the module is executing Step commands.

2: Refer to Table 3-1 for the Step command encoding.

TABLE 3-45: PTG STEP COMMAND FORMAT AND DESCRIPTION

Step Command Byte
STEPx[7:0]
CMD[3:0] OPTION[3:0]
bit 7 bit 4 bit 3 bit 0
bit 7-4Step CommandCMD[3:0] Command Description
PTGCTRL 0000 Execute the control command as described by the OPTION[3:0] bits.
PTGADD0001 Add contents of the PTGADJ register to the target register as described by the OPTION[3:0] bits.
PTGCOPY
PTGSTRB001x Copy the values contained in the bits, CMD[0]:OPTION[3:0], to the strobe output bits[4:0].
PTGWHI 0100 Wait for a low-to-high edge input from a selected PTG trigger input as described by the OPTION[3:0] bits.
PTGWLO 0101 Wait for a high-to-low edge input from a selected PTG trigger input as described by the OPTION[3:0] bits.
— 0110 Reserved; do not use. (1)
PTGIRQ0111 Generate individual interrupt request as described by the OPTION[3:0] bits.
PTGTRIG 100x Generate individual trigger output as described by the bits, CMD[0]:OPTION[3:0].
PTGJMP101x Copy the values contained in the bits, CMD[0]:OPTION[3:0], to the PTGQPTR register and jump to that Step queue.
PTGJMPC0110x PTGC0 = PTGC0LIM: Increment the PTGQPTR register.
PTGC0 ≠ PTGC0LIM: Increment Counter 0 (PTGC0) and copy the values contained in the bits, CMD[0]:OPTION[3:0], to the PTGQPTR register, and jump to that Step queue.
PTGJMPC1111x PTGC1 = PTGC1LIM: Increment the PTGQPTR register.

Note 1: All reserved commands or options will execute, but they do not have any affect (i.e., execute as a NOP instruction).

TABLE 3-46: PTG COMMAND OPTIONS

bit 3-0Step CommandOPTION[3:0]Command Description
PTGWHI^(1) or PTGWLO^(1) 0000PTGI0 (seeTable 3-47for input assignments).
··········
1111PTGI15 (seeTable 3-47for input assignments).
PTGIRQ^(1) 0000 Generate PTG Interrupt 0.
··········
0111 Generate PTG Interrupt 7.
1000 Reserved; do not use.
··········
1111 Reserved; do not use.
PTGTRIG0000PTGO0 (seeTable 3-48for output assignments).
0001PTGO1 (seeTable 3-48for output assignments).
··········
1110PTGO30 (seeTable 3-48for output assignments).
1111PTGO31 (seeTable 3-48for output assignments).

Note 1: All reserved commands or options will execute, but they do not have any affect (i.e., execute as a NOP instruction).

TABLE 3-47: PTG INPUT DESCRIPTIONS

PTG Input Number PTG InputDescription
PTG Trigger Input 0 Trigger Input fromMain Core PWM1 ADC Trigger 2
PTG Trigger Input 1 Trigger Input fromMain Core PWM2 ADC Trigger 2
PTG Trigger Input 2 Trigger Input fromMain Core PWM3 ADC Trigger 2
PTG Trigger Input 3 Trigger Input fromMain Core PWM4 ADC Trigger 2
PTG Trigger Input 4 Trigger Input fromSecondary Core PWM1 ADC Trigger 2
PTG Trigger Input 5 Trigger Input fromSecondary Core PWM2 ADC Trigger 2
PTG Trigger Input 6 Trigger Input fromSecondary Core PWM3 ADC Trigger 2
PTG Trigger Input 7 Trigger Input fromMain Core SCCP4 IC/OC
PTG Trigger Input 8 Trigger Input fromSecondary Core SCCP4 IC/OC
PTG Trigger Input 9 Trigger Input fromMain Core Comparator 1
PTG Trigger Input 10 Trigger Input fromSecondary Core Comparator 1
PTG Trigger Input 11 Trigger Input fromSecondary Core Comparator 2
PTG Trigger Input 12 Trigger Input fromSecondary Core Comparator 3
PTG Trigger Input 13 Trigger Input MainCore ADC Done Group Interrupt
PTG Trigger Input 14 Trigger Input SecondaryCore ADC Done Group Interrupt
PTG Trigger Input 15 Trigger Input fromINT2 PPS

TABLE 3-48: PTG OUTPUT DESCRIPTIONS

PTG Output Number PTGOutput Description
PTGO0 to PTGO11 Reserved
PTGO12 Trigger for Main Core ADC TRGSRC[30]
PTGO13 Trigger for Secondary Core ADC TRGSRC[30]
PTGO16 to PTGO23 Reserved
PTGO24 PPS Main Core OutputRP46
PTGO25 PPS Main Core OutputRP47
PTGO26 PPS Main Core Input RP6
PTGO27 PPS Main Core Input RP7
PTGO28 PPS Secondary Core Output RP46
PTGO29 PPS Secondary Core Output RP47
PTGO30 PPS Secondary Core Input RP6
PTGO31 PPS Secondary Core Input RP7

4.0 SECONDARY MODULES

4.1 Target CPU

Note 1: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive reference source. To complement the information in this data sheet, refer to “Enhanced CPU” (www.microchip.com/DS70005158), which is available from the Microchip website (www.microchip.com).

The Target CPU fetches instructions from the PRAM (Program RAM Memory for the Secondary). The Main core and Secondary core can run independently asynchronously, at the same speed, or at a different speed.

On a POR, the PRAM will not have the user code. The Main core will load the Secondary code from the Host Flash to the Client PRAM, and once the code is verified, the Main core will release the Secondary core to start executing the code (SLVEN (MSI1CON[15] = 1).

Note: All of the associated register names are the same on the Main as well as the Secondary. The Secondary code will be developed in a separate project in MPLAB X IDE with the device selection, MP50XS1/20XS1, where S1 indicates the Secondary device.

The dsPIC33CH128MP508S1 family CPU has a 16-bit (data) modified Harvard architecture with an enhanced instruction set, including significant support for Digital Signal Processing (DSP). 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.

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.

4.1.1 REGISTERS

The dsPIC33CH128MP508S1 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 16th Working register (W15) operates as a Software Stack Pointer for interrupts and calls.

In addition, the dsPIC33CH128MP508S1 devices include four Alternate Working register sets, which consist of W0 through W14. The Alternate Working 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 IPL7) 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.

4.1.2 INSTRUCTION SET

The instruction set for dsPIC33CH128MP508S1 devices 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.

Note 1: Unlike the Main core, there is no prefetch of the instruction implemented for the Secondary core.

4.1.3 DATA SPACE ADDRESSING

The base Data Space can be addressed as up to 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. 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 memory map can optionally be mapped into Program Space (PS) at any 16K program word boundary. The program-to-Data Space mapping feature, known as Program Space Visibility (PSV), lets any instruction access Program Space as if it were Data Space. Refer to "Data Memory" (DS70595) for more details on PSV and table accesses.

On dsPIC33CH128MP508S1 family 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 re-ordering for radix-2 FFT algorithms.

4.1.4 ADDRESSING 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 4-1: dsPIC33CH128MP508S1 FAMILY (SECONDARY) CPU BLOCK DIAGRAM
Microchip dsPIC33CH64MP208 - ADDRESSING MODES - 1

flowchart
graph TD
    A["X Address Bus"] --> B["Interrupt Controller"]
    A --> C["PSV and Table Data Access Control Block"]
    A --> D["Program Counter"]
    A --> E["Y Data Bus"]
    A --> F["X Data Bus"]
    B --> G["Address Latch"]
    C --> H["PRAM Memory"]
    C --> I["Data Latch"]
    D --> J["PCU PCH PCL"]
    D --> K["Stack Control Logic Loop Control Logic"]
    E --> L["Y Data RAM"]
    E --> M["Address Latch"]
    F --> N["X Data RAM"]
    F --> O["Address Latch"]
    F --> P["X RAGU X WAGU"]
    F --> Q["Y AGU"]
    F --> R["EA MUX"]
    R --> S["16-Bit Working Register Arrays"]
    R --> T["Literal Data"]
    R --> U["DSP Engine"]
    R --> V["Divide Support"]
    R --> W["16-Bit ALU"]
    W --> X["Ports"]
    W --> Y["Peripheral Modules"]
    W --> Z["Main CPU"]
    W --> AA["MSI"]
    AA --> AB["Instruction Decode and Control"]
    AB --> AC["Power, Reset and Oscillator Modules"]
    AC --> AD["Control Signals to Various Blocks"]
    E --> AE["ROM Latch IR"]
    AE --> AF["16-Bit Working Register Arrays"]
    AE --> AG["Literal Data"]

4.1.5 PROGRAMMER'S MODEL

The programmer's model for the dsPIC33CH128MP508S1 family is shown in Figure 4-2. All registers in the programmer's model are memory-mapped and can be manipulated directly by instructions. Table4-1 lists a description of each register.

In addition to the registers contained in the programmer's model, the dsPIC33CH128MP508S1 devices contain control registers for Modulo Addressing, 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 Figure 4-3.

TABLE 4-1: PROGRAMMER'S MODEL REGISTER DESCRIPTIONS

Register(s) Name Description
W0 through W15 ^(1) Working Register Array
W0 through W14 ^(1) Alternate 1 Working Register Array
W0 through W14 ^(1) Alternate 2 Working Register Array
W0 through W14 ^(1) Alternate 3 Working Register Array
W0 through W14 ^(1) Alternate 4 Working Register Array
ACCA, ACCB 40-Bit DSP Accumulators(Additional 4 Alternate Accumulators)
PC 23-Bit Program Counter
SR ALU and DSP Engine STATUS Register
SPLIM Stack Pointer Limit Value Register
TBLPAGTable Memory Page Address Register
DSRPAGExtended Data Space (EDS) Read Page Register
RCOUNTREPEAT Loop Counter Register
DCOUNTDO Loop Counter Register
DOSTARTH ^(2) , DOSTARTL ^(2) DO Loop Start Address Register (High and Low)
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 represent the value of the register in the currently active CPU context.
2: The DOSTARTH and DOSTARTL registers are read-only.

FIGURE 4-2: PROGRAMMER'S MODEL (SECONDARY)
Microchip dsPIC33CH64MP208 - PROGRAMMER'S MODEL - 1

flowchart
graph TD
    A["Working/Address Registers"] --> B["W0-W3"]
    A --> C["DSP Operand Registers"]
    A --> D["DSP Address Registers"]
    B --> E["W0 (WREG)"]
    C --> F["W1"]
    C --> G["W2"]
    C --> H["W3"]
    C --> I["W4"]
    C --> J["W5"]
    C --> K["W6"]
    C --> L["W7"]
    C --> M["W8"]
    C --> N["W9"]
    C --> O["W10"]
    C --> P["W11"]
    C --> Q["W12"]
    C --> R["W13"]
    C --> S["Frame Pointer/W14"]
    C --> T["Stack Pointer/W15"]

    U["DSP Accumulators(1)"] --> V["ACCA"]
    U --> W["ACCB"]

    X["Alternate Working/Address Registers"] --> Y["SPLIM"]
    X --> Z["Stack Pointer Limit"]

    AA["Program Counter"] --> AB["Program Counter"]

    AC["Data Table Page Address"] --> AD["TBLPAG"]
    AD --> AE["X Data Space Read Page Address"]

    AF["Data Table Page Address"] --> AG["Data Table Page Address"]

    AH["Data Table Page Address"] --> AI["Data Table Page Address"]

    AJ["Data Table Page Address"] --> AK["X Data Space Read Page Address"]

    AL["Data Table Page Address"] --> AM["Data Table Page Address"]

    AN["Data Table Page Address"] --> AO["X Data Space Read Page Address"]

    AP["Data Table Page Address"] --> AQ["X Data Space Read Page Address"]

    AR["Data Table Page Address"] --> AS["X Data Space Read Page Address"]

    AT["Data Table Page Address"] --> AU["X Data Space Read Page Address"]

    AV["Data Table Page Address"] --> AW["X Data Space Read Page Address"]

    AX["Data Table Page Address"] --> AY["X Data Space Read Page Address"]

    AZ["Data Table Page Address"] --> BA["X Data Space Read Page Address"]

    BB["Data Table Page Address"] --> BC["X Data Space Read Page Address"]

    BD["Data Table Page Address"] --> BE["X Data Space Read Page Address"]

    BF["Data Table Page Address"] --> BG["X Data Space Read Page Address"]

    BH["Data Table Page Address"] --> BH1["X Data Space Read Page Address"]

    BI["Data Table Page Address"] --> BJ["X Data Space Read Page Address"]

    BK["Data Table Page Address"] --> BL["X Data Space Read Page Address"]

    BM["Data Table Page Address"] --> BM1["X Data Space Read Page Address"]

    BN["Data Table Page Address"] --> BN1["X Data Space Read Page Address"]

    BO["Data Table Page Address"] --> BP["X Data Space Read Page Address"]

    BQ["DO Loop Counter and Stack"] --> BR["DO Loop Counter and Stack"]

    BS["DO Loop Start Address and Stack"] --> BT["DO Loop Start Address and Stack"]

    BU["DO Loop End Address and Stack"] --> BV["DO Loop End Address and Stack"]

    BW["DO Loop End Address and Stack"] --> BX["DO Loop End Address and Stack"]

    BY["DO Loop End Address and Stack"] --> BY1["DO Loop End Address and Stack"]

    CA["DO Loop End Address and Stack"] --> CB["DO Loop End Address and Stack"]

    CC["CPU Core Control Register"] --> DD["CPU Core Control Register"]

    DE["SRL"] --> DF["SRL"]

    DG["OA OB SA SB"] --> DH["OAB SAB DA DC IPL2 IPL1 IPL0 RA N O V 2 CSTATUS Register"]

4.1.6 CPU RESOURCES

Many useful resources are provided on the main product page of the Microchip website for the devices listed in this data sheet. This product page contains the latest updates and additional information.

4.1.6.1 Key Resources

  • “Enhanced CPU” (www.microchip.com/DS70005158)
  • Code Samples
  • Application Notes
  • Software Libraries
  • Webinars
  • All related "dsPIC33/PIC24 Family Reference Manual" Sections
  • Development Tools

4.1.7 CPU CONTROL/STATUS REGISTERS

REGISTER 4-1: SR: CPU STATUS REGISTER

R/W-0 R/W-0 R/W-0 R/W-0 R/C-0 R/C-0 R-0 R/W-0
OA OB SA(3)SB(3)OAB SABDADC
bit 15 bit 8
R/W-0^(2) R/W-0^(2) R/W-0^(2) R-0R/W-0R/W-0R/W-0R/W-0
IPL2^(1) IPL1^(1) IPL0^(1) RANOVZC
bit 7 bit 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 15 OA: Accumulator A Overflow Status bit

1 = Accumulator A has overflowed

0 = Accumulator A has not overflowed

bit 14 OB: Accumulator B Overflow Status bit

1 = Accumulator B has overflowed

0 = Accumulator B has not overflowed

bit 13 SA: Accumulator A Saturation 'Sticky' Status bit ^(3)

1 = Accumulator A is saturated or has been saturated at some time

0 = Accumulator A is not saturated

bit 12 SB: Accumulator B Saturation 'Sticky' Status bit ^(3)

1 = Accumulator B is saturated or has been saturated at some time

0 = Accumulator B is not saturated

bit 11 OAB: OA || OB Combined Accumulator Overflow Status bit

1 = Accumulator A or B has overflowed

0 = Neither Accumulator A or B has overflowed

bit 10 SAB: SA || SB Combined Accumulator 'Sticky' Status bit

1 = Accumulator A or B is saturated or has been saturated at some time

0 = Neither Accumulator A or B is saturated

bit 9 DA: DO Loop Active bit

1 = DO loop is in progress

0 = DO loop is not in progress

bit 8 DC: MCU ALU Half Carry/Borrow bit

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

Note 1: The IPL[2:0] bits are concatenated with the IPL[3] bit (CORCON[3]) to form the CPU Interrupt Priority Level. The value in parentheses indicates the IPL, if IPL[3] = 1. User interrupts are disabled when IPL[3] = 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 bit operations.

REGISTER 4-1: SR: CPU STATUS REGISTER (CONTINUED)

bit 7-5 IPL[2:0]: CPU Interrupt Priority Level Status bits

(1,2)

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 4 RA: REPEAT Loop Active bit

1 = REPEAT loop is in progress
0 = REPEAT loop is not in progress 

bit 3 N: MCU ALU Negative bit

1 = Result was negative
0 = Result was non-negative (zero or positive) 

bit 2 OV: 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 = No overflow occurred 

bit 1 Z: 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 0 C: MCU ALU Carry/Borrow bit

1 = A carry-out from the Most Significant bit of the result occurred
0 = No carry-out from the Most Significant bit of the result occurred 

Note 1: The IPL[2:0] bits are concatenated with the IPL[3] bit (CORCON[3]) to form the CPU Interrupt Priority Level. The value in parentheses indicates the IPL, if IPL[3] = 1. User interrupts are disabled when IPL[3] = 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 bit operations.

REGISTER 4-2: CORCON: CORE CONTROL REGISTER

R/W-0 U-0 R/W-0 R/W-0 R/W-0 R-0 R-0 R-0
VAR— US1 US0 EDT(1)DL2 DL1 DL0
bit 15 bit 8
R/W-0R/W-0R/W-1R/W-0R/C-0R-0R/W-0R/W-0
SATASATBSATDWACCSAT IPL3^(2) SFARND IF
bit 7 bit 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 15 VAR: Variable Exception Processing Latency Control bit

1 = Variable exception processing is enabled

0 = Fixed exception processing is enabled

bit 14 Unimplemented: Read as '0'

bit 13-12 US[1:0]: DSP Multiply Unsigned/Signed Control bits

11 = Reserved

10 = DSP engine multiplies are mixed sign

01 = DSP engine multiplies are unsigned

00 = DSP engine multiplies are signed

bit 11 EDT: Early DO Loop Termination Control bit ^(1)

1 = Terminates executing DO loop at the end of the current loop iteration

0 = No effect

bit 10-8 DL[2:0]: DO Loop Nesting Level Status bits

111 = Seven DO loops are active

• • •

001 = One DO loop is active

000 = Zero DO loops are active

bit 7 SATA: ACCA Saturation Enable bit

1 = Accumulator A saturation is enabled

0 = Accumulator A saturation is disabled

bit 6 SATB: ACCB Saturation Enable bit

1 = Accumulator B saturation is enabled

0 = Accumulator B saturation is disabled

bit 5 SATDW: Data Space Write from DSP Engine Saturation Enable bit

1 = Data Space write saturation is enabled

0 = Data Space write saturation is disabled

bit 4 ACCSAT: Accumulator Saturation Mode Select bit

1 = 9.31 saturation (super saturation)

0 = 1.31 saturation (normal saturation)

bit 3 IPL3: CPU Interrupt Priority Level Status bit 3 ^(2)

1 = CPU Interrupt Priority Level is greater than 7

0 = CPU Interrupt Priority Level is 7 or less

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.

REGISTER 4-2: CORCON: CORE CONTROL REGISTER (CONTINUED)

bit 2 SFA: Stack Frame Active Status bit

1 = Stack frame is active; W14 and W15 address 0x0000 to 0xFFFF, regardless of DSRPAG
0 = Stack frame is not active; W14 and W15 address the base Data Space

bit 1 RND: Rounding Mode Select bit

1 = Biased (conventional) rounding is enabled
0 = Unbiased (convergent) rounding is enabled

bit 0 IF: 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.

REGISTER 4-3: CTXTSTAT: CPU W REGISTER CONTEXT STATUS REGISTER

U-0 U-0 U-0 U-0 R-0 R-0 R-0
CCTXI[2:0]
bit 15 bit 8
U-0 U-0 U-0 U-0 U-0 R-0 R-0 R-0
MCTXI[2:0]
bit 7 bit 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-11 Unimplemented: Read as '0'

bit 10-8 CCTXI[2:0]: Current (W Register) Context Identifier bits

111 = Reserved
...
100 = Alternate Working Register Set 4 is currently in use
011 = Alternate Working Register Set 3 is currently in use
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-3 Unimplemented: Read as '0'

bit 2-0 MCTXI[2:0]: Manual (W Register) Context Identifier bits

111 = Reserved
...
100 = Alternate Working Register Set 4 was most recently manually selected
011 = Alternate Working Register Set 3 was most recently manually selected
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

REGISTER 4-4: MSTRPR: DATA SPACE BUS MASTER PRIORITY CONTROL REGISTER (SECONDARY)

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-6 Unimplemented: Read as '0'

bit 5 DMAPR: Modify DMA Controller Bus Master Priority Relative to CPU bit

1 = Raise DMA Controller bus Master priority to above that of the CPU

0 = No change to DMA Controller bus Master priority

bit 4-0 Unimplemented: Read as '0'

4.1.8 ARITHMETIC LOGIC UNIT (ALU)

The dsPIC33CH128MP508S1 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 Borrow and Digit Borrow bits, respectively, for subtraction operations.

The ALU can perform 8-bit or 16-bit operations, depending on the mode of the instruction that is used. Data for the ALU operation can come from the W register array or data memory, depending on the addressing mode of the instruction. Likewise, output data from the ALU can be written to the W register array or a data memory location.

Refer to the "16-Bit MCU and DSC Programmer's Reference Manual" (DS70000157) for information on the SR bits affected by each instruction.

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.

4.1.8.1 Multiplier

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

4.1.8.2 Divider

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. 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 one cycle per bit of divisor, so both 32-bit/16-bit and 16-bit/16-bit instructions take the same number of cycles to execute.

4.1.9 DSP 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 accumulator-to-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 listed below:

• Fractional or integer DSP multiply (IF)
• Signed, unsigned or mixed-sign DSP multiply (USx)
- 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 4-2: DSP INSTRUCTIONS SUMMARY

InstructionAlgebraic OperationACC Write-Back
CLR A = 0 Yes
ED A = (x - y) ^2 No
EDAC A = A + (x - y)^2 No
MAC A = A + (x · y) Yes
MAC A = A + x ^2 No
MOVSACNo change in AYes
MPY A = x · y No
MPY A = x ^2 No
MPY.N A = -x · y No
MSC A = A - x · y Yes

4.2 Secondary Memory Organization

Note: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive reference source. To complement the information in this data sheet, refer to “dsPIC33/PIC24 Program Memory” (www.microchip.com/DS70000613), which is available from the Microchip website (www.microchip.com).

The dsPIC33CH128MP508S1 family architecture features separate program and data memory spaces, and buses. This architecture also allows the direct access of program memory from the Data Space (DS) during code execution.

4.2.1 PROGRAM ADDRESS SPACE

The program address memory space of the dsPIC33CH128MP508S1 family devices is 4M instructions. The space is addressable by a 24-bit value derived either from the 23-bit PC during program execution, or from table operation or Data Space remapping, as described in Section 4.2.8 "Interfacing Program and Data Memory Spaces".

User application access to the program memory space is restricted to the lower half of the address range (0x000000 to 0x7FFFFFF). The exception is the use of

TBLRD operations, which use TBLPAG[7] to permit access to calibration data and Device ID sections of the configuration memory space.

The PRAM for the Secondary dsPIC33CH128MP508S1 devices implements two 12-Kbyte PRAM panels with a total of 24 Kbytes of PRAM available for the Secondary device. All variants of the Secondary have the same amount of PRAM available, irrespective of the size of the Flash available on the Host Flash program memory, as shown in Figure 4-3.

FIGURE 4-3: PRAM (PROGRAM MEMORY) FOR SECONDARY dsPIC33CH128MP508S1 DEVICES
Normal Operation or Single Partition
Microchip dsPIC33CH64MP208 - PROGRAM ADDRESS SPACE - 1

text_image coto Instruction Reset Address Interrupt Vector Table User PRAM (24 Kbytes) Unimplemented (Read '0's) Reserved Calibration Data Write Latches Reserved DEVID Reserved 0x000000 0x000002 0x000004 0x0001FE 0x000200 0x003FFE 0x004000 0x7FFFFE 0x800000 0xF7FFFE 0xF80000 0xF80050 0xFA0000 0xFA0002 0xFA0004 0xFEFFF 0xFF0000 0xFF0002 0xFF0004 0xFFFFFE

Note: Memory areas are not shown to scale.

Dual Partition PRAM Organization
Microchip dsPIC33CH64MP208 - PROGRAM ADDRESS SPACE - 2

text_image GOTO Instruction Reset Address Interrupt Vector Table User Program Memory (12 Kbytes) Unimplemented (Read '0's) GOTO Instruction Reset Address Interrupt Vector Table User Program Memory (12 Kbytes) Unimplemented (Read '0's) 0x000000 0x000002 0x000004 0x0001FE 0x000200 0x000200 0x3FFFFFE 0x400000 0x400002 0x400004 0x4001FE 0x400200 0x401FFE 0x402000 0x7FFFFFE

4.2.1.1 Program Memory Organization

The program memory space is organized in word-addressable blocks. Although it is treated as 24 bits wide, it is more appropriate to think of each address of the program memory as a lower and upper word, with the upper byte of the upper word being unimplemented. The lower word always has an even address, while the upper word has an odd address (Figure 4-4).

Program memory addresses are always word-aligned on the lower word, and addresses are incremented, or decremented, by two, during code execution. This arrangement provides compatibility with data memory space addressing and makes data in the program memory space accessible.

4.2.1.2 Interrupt and Trap Vectors

All dsPIC33CH128MP508S1 family devices reserve the addresses between 0x000000 and 0x000200 for hard-coded program execution vectors. A hardware Reset vector is provided to redirect code execution from the default value of the PC on device Reset to the actual start of code. A GOTO instruction is programmed by the user application at address, 0x000000, of PRAM memory, with the actual address for the start of code at address, 0x000200, of PRAM memory.

A more detailed discussion of the Interrupt Vector Tables (IVTs) is provided in Table 4-21.

FIGURE 4-4: PROGRAM MEMORY ORGANIZATION
Microchip dsPIC33CH64MP208 - Interrupt and Trap Vectors - 1

text_image msw Address (Isw Address) most significant word least significant word PC Address 0x000001 0x000003 0x000005 0x000007 23 0816 Program Memory 'Phantom' Byte (read as '0') Instruction Width 0x000000 0x000002 0x000004 0x000006

4.2.2 DATA ADDRESS SPACE (SECONDARY)

The dsPIC33CH128MP508S1 family CPU has a separate 16-bit wide data memory space. The Data Space is accessed using separate Address Generation Units (AGUs) for read and write operations. The data memory map is shown in Figure 4-5.

All Effective Addresses (EAs) in the data memory space are 16 bits wide and point to bytes within the Data Space. This arrangement gives a base Data Space address range of 64 Kbytes or 32K words.

The lower half of the data memory space (i.e., when EA[15] = 0) is used for implemented memory addresses, while the upper half (EA[15] = 1) is reserved for the Program Space Visibility (PSV).

The dsPIC33CH128MP508S1 family devices implement up to 4 Kbytes of data memory. If an EA points to a location outside of this area, an all-zero word or byte is returned.

4.2.2.1 Data Space Width

The data memory space is organized in byte-addressable, 16-bit wide blocks. Data are aligned in data memory and registers as 16-bit words, but all Data Space EAs resolve to bytes. The Least Significant Bytes (LSBs) of each word have even addresses, while the Most Significant Bytes (MSBs) have odd addresses.

4.2.2.2 Data Memory Organization and Alignment

To maintain backward compatibility with PIC® MCU devices and improve Data Space memory usage efficiency, the dsPIC33CH128MP508S1 family instruction set supports both word and byte operations. As a consequence of byte accessibility, all Effective Address calculations are internally scaled to step through word-aligned memory. For example, the core recognizes that Post-Modified Register Indirect Addressing mode [Ws++] results in a value of Ws + 1 for byte operations and Ws + 2 for word operations.

A data byte read, reads the complete word that contains the byte, using the LSb of any EA to determine which byte to select. The selected byte is placed onto the LSB of the data path. That is, data memory and registers are organized as two parallel, byte-wide entities with shared (word) address decode, but separate write lines. Data byte writes only write to the corresponding side of the array or register that matches the byte address.

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. If a misaligned read or write is attempted, an address error trap is generated. If the error occurred on a read, the instruction underway is completed. If the error occurred on a write, the instruction is executed but the write does not occur. In either case, a trap is then executed, allowing the system and/or user application to examine the machine state prior to execution of the address Fault.

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 user applications to translate 8-bit signed data to 16-bit signed values. Alternatively, for 16-bit unsigned data, user applications can clear the MSB of any W register by executing a Zero-Extend (ZE) instruction on the appropriate address.

4.2.2.3 SFR Space

The first 4 Kbytes of the Near Data Space, from 0x0000 to 0x0FFF, is primarily occupied by Special Function Registers (SFRs). These are used by the dsPIC33CH128MP508S1 family core and peripheral modules for controlling the operation of the device.

SFRs are distributed among the modules that they control and are generally grouped together by module. Much of the SFR space contains unused addresses; these are read as '0'.

Note: The actual set of peripheral features and interrupts varies by the device. Refer to the corresponding device tables and pinout diagrams for device-specific information.

4.2.2.4 Near Data Space

The 8-Kbyte area, between 0x0000 and 0x1FFF, is referred to as the Near Data Space. Locations in this space are directly addressable through a 13-bit absolute address field within all memory direct instructions. Additionally, the whole Data Space is addressable using MOV instructions, which support Memory Direct Addressing mode with a 16-bit address field, or by using Indirect Addressing mode using a Working register as an Address Pointer.

FIGURE 4-5: DATA MEMORY MAP FOR SECONDARY dsPIC33CH128MP508S1 DEVICES
Microchip dsPIC33CH64MP208 - Near Data Space - 1

text_image MSB Address 16 Bits LSBMSB 0x0000 0x0FFE 0x1000 0x17FE 0x1801 0x1FFF 0x2001 SFR Space X Data RAM (X) (2K) Y Data RAM (Y) (2K) 0x80000x8001 X Data Unimplemented (X) Optionally Mapped into Program Memory 4-Kbyte SFR Space 4-Kbyte SRAM Space LSB Address 8-Kbyte Near Data Space 0x0001 0x0FFF 0x1001 0x1801 0x1802 0x1FFE 0x2000 0xFFFF

Note: Memory areas are not shown to scale.

4.2.2.5 X and Y Data Spaces

The dsPIC33CH128MP508S1 family core has two Data Spaces, X and Y. These 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. This feature allows certain instructions to concurrently fetch two words from RAM, thereby enabling efficient execution of DSP algorithms, such as Finite Impulse Response (FIR) filtering and Fast Fourier Transform (FFT).

The X Data Space is used by all instructions and supports all addressing modes. X Data Space has separate read and write data buses. The X read data bus is the read data path for all instructions that view Data Space as combined X and Y address space. It is also the X data prefetch path for the dual operand DSP instructions (MAC class).

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.

Both the X and Y Data Spaces support Modulo Addressing mode for all instructions, subject to addressing mode restrictions. Bit-Reversed Addressing mode is only supported for writes to X Data Space.

All data memory writes, including in DSP instructions, view Data Space as combined X and Y address space. The boundary between the X and Y Data Spaces is device-dependent and is not user-programmable.

4.2.3 MEMORY RESOURCES

Many useful resources are provided on the main product page of the Microchip website for the devices listed in this data sheet. This product page contains the latest updates and additional information.

4.2.3.1 Key Resources

  • "dsPIC33/ PIC24 Program Memory" (www.microchip.com/DS70000613)
  • Code Samples
  • Application Notes
  • Software Libraries
  • Webinars
  • All Related "dsPIC33/PIC24 Family Reference Manual" Sections
  • Development Tools

4.2.4 SFR MAPS

The following tables show dsPIC33CH128MP508 family Secondary SFR names, addresses and Reset values. These tables contain all registers applicable to the

dsPIC33CH128MP508S1 family. Not all registers are present on all device variants. Refer to Table1 and Table 2 for peripheral availability. Table 4-25 details port availability for the different package options.

TABLE 4-3: SECONDARY SFR BLOCK 000h

RegisterAddressAll ResetsRegisterAddressAll ResetsRegisterAddressAll Resets
CoreDSRPAG032----000000001CLC1GLSL0C8000000000000000
WREG0000000000000000000DSWPAG034----0000000001CLC1GLSH0CA000000000000000
WREG1002000000000000000RCOUNT036xxxxxxxxxxxxxxCLC2CONL0CC0-0-00--000--000
WREG2004000000000000000DCOUNT038xxxxxxxxxxxxxxCLC2CONH0CE----0000
WREG3006000000000000000DOSTART03A111111111111111CLC2SELL0D0-000-000-000-000
WREG4008000000000000000DOSTARTL03A111111111111110CLC2SELH0D2----
WREG500A000000000000000DOSTARTH03C000000011111111CLC2GLSL0D4000000000000000
WREG600C000000000000000DOENDL03Exxxxxxxxxxxxxx0CLC2GLSH0D600000000000000
WREG700E000000000000000DOENDH040----xxxxxxCLC3CONL0D80-0-00--000--000
WREG8010000000000000000SR042000000000000000CLC3CONH0DA----0000
WREG9012000000000000000CORCON044x-xx00000100000CLC3SELL0DC-000-000-000-000
WREG10014000000000000000MODCON04600--0000000000CLC3GLSL0E000000000000000
WREG11016000000000000000XMODSRT048xxxxxxxxxxxxxx0CLC3GLSH0E200000000000000
WREG12018000000000000000XMODEND04Axxxxxxxxxxxxxx1CLC4CONL0E40-0-00--000--000
WREG1301A000000000000000YMODSRT04Cxxxxxxxxxxxxxx0CLC4CONH0E6----0000
WREG1401C000000000000000YMODEND04Exxxxxxxxxxxxxx1CLC4SELL0E8-000-000-000-000
WREG1501E00010000000000XBREV0500xxxxxxxxxxxxxxCLC4GLSL0EC00000000000000
SPLIM020xxxxxxxxxxxxxxDISICNT052xxxxxxxxxxxxxx00CLC4GLSH0EE0000000000000
ACCAL022xxxxxxxxxxxxxxTBLPAG054----0000000ECCCONL0F0----0
ACCAH024xxxxxxxxxxxxxxYPAG056----0000001ECCCONH0F20000000000000
ACCAU026xxxxxxxxxxxxxxMSTRPR058----0----ECCADDRL0F40000000000000
ACCBL028xxxxxxxxxxxxxxCTXTSTAT05A00C0C0C0C0C0C0CECCADDRH0F60000000000000
ACCBH02AxxxxxxxxxxxxxxCLCECCSTATL0F8000000000000
ACCBU02CxxxxxxxxxxxxxxCLC1CONL0C00-0-00--000--000ECCSTATH0FA----000C0C
PCL02E00000000000000CLC1CONH0C2----0000
PCH030----00C0C0CCLC1SELL0C4-000-000-000-00

Legend: x = unknown or indeterminate value; "-" = unimplemented bits. Address and Reset values are in hexadecimal and binary, respectively.

TABLE 4-4: SECONDARY SFR BLOCK 100h

Register Address AllResets Register Address All ResetsRegister Address All Resets
TimersINT1TMRL15C0000000000000000SI1MBX2D
T1CON1000-000000-00-00-INT1TMRH15E0000000000000000SI1MBX3D
TMR1104000000000000000INT1HLDL1600000000000000000SI1MBX4D
PR1108000000000000000INT1HLDH1620000000000000000SI1MBX5D
QEIINDX1CNTL1640000000000000000SI1MBX6D
QEI1CON140000000000000000INDX1CNTH1660000000000000000SI1MBX7D
QEI1IOCL14400000000000xxxxINDX1HLDL1680000000000000000SI1MBX8D
QEI1IOCH146----0INDX1HLDH16A0000000000000000SI1MBX9D
QEI1STAT148--0000000000000QEI1GECL16C000000000000000SI1MBX10D
POS1CNTL14C00000000000000QEI1GECH16E000000000000000SI1MBX11D
POS1CNTH14E00000000000000QEI1LECL170000000000000000SI1MBX12D
POS1HLDL15000000000000000QEI1LECH172000000000000000SI1MBX13D
POS1HLDH1520000000000000SI1CON1D20---xx000000000SI1MBX14D
VEL1CNTL1540000000000000SI1STAT1D400000000000000SI1MBX15D
VEL1CNTH156000000000000SI1MBXS1D8----000000SI1FIFOCS
VEL1HLDL158000000000000SI1MBX0D1DA00000000000000SWMRFDATA
VEL1HLDH15A000000000000SI1MBX1D1DC0000000000000SRMWFDATA

Legend: x = unknown or indeterminate value; "-" = unimplemented bits. Address and Reset values are in hexadecimal and binary, respectively.

TABLE 4-5: SECONDARY SFR BLOCK 200h

RegisterAddressAll ResetsRegisterAddressAll ResetsRegisterAddressAll Resets
I2CU1BRGH242----0000SPI1CON2L2B0----00000
I2C1CONL2000-01000000000000U1RXREG244----xxxxxxxxSPI1CON2H2B2----
I2C1CONH202----0000000U1TXREG248----xxxxxxxxSPI1STATL2B4---00--0001-1-00
I2C1STAT204000--0000000000U1P124C----00000000SPI1STATH2B6--000000--000000
I2C1ADD208----000000000U1P224E----00000000SPI1BUFL2B8000000000000000
I2C1MSK20C----000000000U1P325000000000000000SPI1BUFH2BA000000000000000
I2C1BRG210000000000000000U1P3H252----0000000SPI1BRGL2BC---xxxxxxxxxxxxx
I2C1TRN214----1111111U1TXCHK254----0000000SPI1BRGH2BE----
I2C1RCV218----0000000U1RXCHK256----0000000SPI1IMSKL2C0---00--0000-0-00
UARTU1SCCON258----00000-SPI1IMSKH2C20-0000000-000000
U1MODE2380-000-000000000U1SCINT25A--00-000--00-000SPI1URDTL2C400000000000000
U1MODEH23A00----000000000U1INT25C----00--0--SPI1URDTH2C600000000000000
U1STA23C00000001000000SPI
U1STAH23E-000-00000101110SPI1CON1L2AC0-0000000000000
U1BRG24000000000000000SPI1CON1H2AE00000000000000

Legend: x = unknown or indeterminate value; “-” = unimplemented bits. Address and Reset values are in hexadecimal and binary, respectively.

TABLE 4-6: SECONDARY SFR BLOCK 300h

Register Address AllResets Register AddressAll ResetsRegister Address All Resets
High-Speed PWMPG1TRIGB3560000000000000000PG3FFPCIH3AE
PCLKCON30000----0--00--00PG1TRIGC3580000000000000000PG3SPCIL3B0
FSCL3020000000000000000PG1DTL35A--000000000000000PG3SPCIH3B2
FSMINPER3040000000000000000PG1DTH35C--000000000000000PG3LEBL3B4
MPHASE3060000000000000000PG1CAP35E0000000000000000PG3LEBH3B6
MDC3080000000000000000PG2CONL3600-000000000000000PG3PHASE3B8
MPER30A0000000000000000PG2CONH362000-00000--0000PG3DC3BA
LFSR30C0000000000000000PG2STAT3640000000000000000PG3DCA3BC
CMBTRIGL30E----00000000PG2IOCONL3660000000000000000PG3PER3BE
CMBTRIGH310----00000000PG2IOCONH368-000--0--00000PG3TRIGA3C0
LOGCONA31200000000000-000PG2EVTL36A0000000--00000PG3TRIGB3C2
LOGCONB31400000000000-000PG2EVTH36C0000--00000000PG3TRIGC3C4
LOGCONC31600000000000-000PG2FPCIL36E000000000000000PG3DTL3C6
LOGCOND3180000000000-000PG2FPCIH3700000-00000000PG3DTH3C8
LOGCONE31A0000000000-000PG2CLPCIL37200000000000000PG3CAP3CA
LOGCONF31C0000000000-000PG2CLPCIH3740000-00000000PG4CONL3CC
PWMEVTA31E0000----0000-000PG2FFPCIL37600000000000000PG4CONH3CE
PWMEVTB3200000----000-000PG2FFPCIH3780000-00000000PG4STAT3D0
PWMEVTC3220000----000-000PG2SPCIL37A0000000000000PG4IOCONL3D2
PWMEVTD3240000----000-000PG2SPCH37C0000-00000000PG4IOCONH3D4
PWMEVTE3260000----000-000PG2LEBL37E0000000000000PG4EVTL3D6
PWMEVTF3280000----000-000PG2LEBH380----00----000PG4EVTH3D8
PG1CONL32A0-0000000000000PG2PHASE3820000000000000PG4FPCIL3DA
PG1CONH32C000-00000--000PG2DC3840000000000000PG4FPCIH3DC
PG1STAT32E0000000000000PG2DCA386----00000PG4CLPCIL3DE
PG1IOCONL330000000000000PG2PER388000000000000PG4CLPCIH3E0
PG1IOCONH332-000--0--000PG2TRIGA38A000000000000PG4FFPCIL3E2
PG1EVTL3340000000--000PG2TRIGB38C000000000000PG4FFPCIH3E4
PG1EVTH3360000--0000000PG2TRIGC38E000000000000PG4SPCIL3E6
PG1FPCIL33800000000000PG2DTL390--000000000PG4SPCH3E8
PG1FPCIH33A0000-0000000PG2DTH392--000000000PG4LEBL3EA
PG1CLPCIL33C0000000000PG2CAP394000000000PG4LEBH3EC
PG1CLPCIH33E0000-0000000PG3CONL3960-00000000PG4PHASE3EE
PG1FFPCIL340000000000PG3CONH398000-0000--000PG4DC3F0
PG1FFPCIH3420000-0000000PG3STAT39A000000000PG4DCA3F2
PG1SPCIL344000000000PG3IOCONL39C000000000PG4PER3F4
PG1SPCH3460000-0000000PG3IOCONH39E-00--0--0PG4TRIGA3F6
PG1LEBL34800000000PG3EVTL3A000000--0--0PG4TRIGB3F8
PG1LEBH34A----00----00PG3EVTH3A2000--00000PG4TRIGC3FA
PG1PHASE34C00000000PG3FPCIL3A400000000PG4DTL3FC
PG1DC34E00000000PG3FPCIH3A6000--0000PG4DTH3FE
PG1DCA350----0000PG3CLPCIL3A800000000PG4CAP400
PG1PER35200000000PG3CLPCIH3AA000--000
PG1TRIGA35400000000PG3FFPCIL3AC00000000

Legend: x = unknown or indeterminate value; "-" = unimplemented bits. Address and Reset values are in hexadecimal and binary, respectively.

TABLE 4-7: SECONDARY SFR BLOCK 400h

Register Address AllResets Register AddressAll ResetsRegister Address All Resets
High-Speed PWM (Continued)PG6CLPCIL44A000000000000000PG7DC492
PG5CONL4020-00000000000000PG6CLPCIH44C0000-0000000000PG7DCA
PG5CONH404000-00000--0000PG6FFPCIL44E000000000000000PG7PER
PG5STAT406000000000000000PG6FFPCIH4500000-0000000000PG7TRIGA
PG5IOCONL408000000000000000PG6SPCIL45200000000000000PG7TRIGB
PG5IOCONH40A-000--0--00000PG6SPCIH4540000-0000000000PG7TRIGC
PG5EVTL40C0000000--0000PG6LEBL45600000000000000PG7DTL
PG5EVTH40E000--0000000PG6LEBH458----000----000PG7DTH
PG5FPCIL41000000000000000PG6PHASE45A00000000000000PG7CAP
PG5FPCIH4120000-000000000PG6DC45C00000000000000PG8CONL
PG5CLPCIL41400000000000000PG6DCA45E----000000PG8CONH
PG5CLPCIH4160000-000000000PG6PER46000000000000000PG8STAT
PG5FFPCIL4180000000000000PG6TRIGA4620000000000000PG8IOCONL
PG5FFPCIH41A0000-000000000PG6TRIGB4640000000000000PG8IOCONH
PG5SPCIL41C0000000000000PG6TRIGC4660000000000000PG8EVTL
PG5SPCIH41E0000-000000000PG6DTL468--00000000000PG8EVTH
PG5LEBL420000000000000PG6DTH46A--00000000000PG8FPCIL
PG5LEBH422----000----000PG6CAP46C000000000000PG8FPCIH
PG5PHASE424000000000000PG7CONL46E0-0000000000PG8CLPCIL
PG5DC426000000000000PG7CONH47000-0000--000PG8CLPCIH
PG5DCA428----000000PG7STAT472000000000000PG8FFPCIL
PG5PER42A000000000000PG7IOCONL474000000000000PG8FFPCIH
PG5TRIGA42C000000000000PG7IOCONH476-000--0--000PG8SPCIL
PG5TRIGB42E00000000000PG7EVTL478000000--000PG8SPCIH
PG5TRIGC43000000000000PG7EVTH47A000--0000000PG8LEBL
PG5DTL432--000000000PG7FPCIL47C00000000000PG8LEBH
PG5DTH434--000000000PG7FPCIH47E000-0000000PG8PHASE
PG5CAP4360000000000PG7CLPCIL4800000000000PG8DC
PG6CONL4380-000000000PG7CLPCIH482000-0000000PG8DCA
PG6CONH43A00-0000--0PG7FFPCIL4840000000000PG8PER
PG6STAT43C000000000PG7FFPCIH486000-0000000PG8TRIGA
PG6IOCONL43E000000000PG7SPCIL488000000000PG8TRIGB
PG6IOCONH440-000--0--0PG7SPCIH48A00C-00CPG8TRIGC
PG6EVTL442000000--0PG7LEBL48C000000000PG8DTL
PG6EVTH44400C--00CPG7LEBH48E----0C--0CPG8DTH
PG6FPCIL446000000000PG7PHASE490000000000PG8CAP
PG6FPCIH448 00-0-0-0-0-0-0-0-

Legend: x = unknown or indeterminate value; “-” = unimplemented bits. Address and Reset values are in hexadecimal and binary, respectively.

TABLE 4-8: SECONDARY SFR BLOCK 800h

Register Address AllResets Register AddressAll ResetsRegister Address All Resets
InterruptsIPC2844-100-100-100-100IPC34884
IFS08000000000000-00000IPC3846-100-100-100-100IPC35886
IFS1802000000000000000IPC4848-100-100-100-100IPC35886
IFS280400000-00-0000--IPC584A-100-100-100-100IPC36888
IFS3806000----00000IPC684C-100-100-100-100IPC42894
IFS4808--000----0000-00IPC8850-100-100----IPC43896
IFS580A000000000000000-IPC9852----100-100-100IPC44898
IFS680C000000000000000IPC10854-100----100-100IPC4589A
IFS780E000000000000---IPC12858-100-100-100-100IPC4789E
IFS8810--000000000000-IPC1585E-100-100-100----INTCON18C0
IFS9812--0----00-00--0--IPC16860-100----100-100INTCON28C2
IFS1081400000000----IPC17862----100-100-100INTCON38C4
IFS11816-00----00000IPC18864-100----INTCON48C6
IEC0820000000000-00000IPC19866----100-100INTTREG8C8
IEC1822000000000000000IPC20868-100-100-100----Flash
IEC282400000-00-0000--IPC2186A-100-100-100-100NVMCON8D0
IEC3826000----00000IPC2286C-100-100-100-100NVMADR8D2
IEC4828--000----0000-00IPC2386E-100-100-100-100NVMADRU8D4
IEC582A00000000000000-IPC24870-100-100-100-100NVMKEY8D6
IEC682C000000000000000IPC25872-100-100-100-100NVMSRCADRL8D8
IEC782E000000000000---IPC26874-100-100-100-100NVMSRCADRH8DA
IEC8830--000000000000-IPC27876-100-100-100-100PGA1CON8E0
IEC8830--000000000000-IPC28878-100----PGA1CAL8E2
IEC9832--0----00-00--0--IPC2987A-100-100-100-100PGA2CON8E4
IEC1083400000000----00IPC3087C-100-100-100-100PGA2CAL8E6
IEC11836-00----00000IPC3187E-100-100-100-100PGA3CON8E8
IPC0840-100-100-100-100IPC32880-100-100-100----PGA3CAL8EA
IPC1842-100-100----100IPC33882-100-100-100-100

Legend: x = unknown or indeterminate value; "-" = unimplemented bits. Address and Reset values are in hexadecimal and binary, respectively.

TABLE 4-9: SECONDARY SFR BLOCK 900h

Register Address AllResets Register AddressAss All ResetsRegister Address All Resets
CCPCCP2CON3H97E0000----0-00--CCP3PRH9AE1111111111111111
CCP1CON1L9500-00000000000000CCP2STATL980----0--00xx0000CCP3RAL9B0000000000000000
CCP1CON1H95200--000000000000CCP2TMRL984000000000000000CCP3RBL9B4000000000000000
CCP1CON2L9540C-0----0000000CCP2TMRH986000000000000000CCP3BUFL9B8000000000000000
CCP1CON2H9560----100-00000CCP2PRL988111111111111111CCP3BUFH9BA000000000000000
CCP1CON3H95A0000----0-00--CCP2PRH98A111111111111111CCP4CON1L9BC0-0000000000000
CCP1STATL95C----0--00xx0000CCP2RAL98C000000000000000CCP4CON1H9BE00--000000000000
CCP1TMRL960000000000000000CCP2RBL990000000000000000CCP4CON2L9C000-0----00000000
CCP1TMRH962000000000000000CCP2BUFL994000000000000000CCP4CON2H9C20----100-0000
CCP1PRL964111111111111111CCP2BUFH996000000000000000CCP4CON3H9C60000----0-00--
CCP1PRH966111111111111111CCP3CON1L9980-0000000000000CCP4STATL9C8----0--00xx000
CCP1RAL96800000000000000CCP3CON1H99A00--00000000000CCP4TMRL9CC00000000000000
CCP1RBL96C00000000000000CCP3CON2L99C0C-0----0000000CCP4TMRH9CE00000000000000
CCP1BUFL97000000000000000CCP3CON2H99E0----100-0000CCP4PRL9D0111111111111111
CCP1BUFH97200000000000000CCP3CON3H9A20000----0-00--CCP4PRH9D2111111111111111
CCP2CON1L9740-000000000000CCP3STATL9A4----0--00xx000CCP4RAL9D400000000000000
CCP2CON1H97600--000000000CCP3TMRL9A800000000000000CCP4RBL9D800000000000000
CCP2CON2L9780C-0----00000CCP3TMRH9AA00000000000000CCP4BUFL9DC00000000000000
CCP2CON2H97A0----100-0000CCP3PRL9AC111111111111111CCP4BUFH9DE00000000000000

Legend: x = unknown or indeterminate value; "-" = unimplemented bits. Address and Reset values are in hexadecimal and binary, respectively.

TABLE 4-10: SECONDARY SFR BLOCK A00h

Register Address All Resets Register Address All Resets
DMADMACH0AC4---C-00000000000DMACH1ACE---C-00000000000
DMACONABC0-0----0DMAINT0AC6000000000000--0DMAINT1AD0000000000000--0
DMABUFABE00000000000000DMASRC0AC800000000000000DMASRC1AD200000000000000
DMALAC0000100000000000DMADST0ACA00000000000000DMADST1AD400000000000000
DMAHAC2000100000000000DMACNT0ACC000000000000001DMACNT1AD600000000000001

Legend: x = unknown or indeterminate value; "-" = unimplemented bits. Address and Reset values are in hexadecimal and binary, respectively.

TABLE 4-11: SECONDARY SFR BLOCK B00h

Register Address AllResets Register AddressAss All ResetsRegister Address All Resets
ADCADCMP1ENHB42----00000ADTRIG2LB88
ADCON1LB00000-00000----000ADCMP1LOB440000000000000000ADTRIG2HB8A
ADCON1HB02----011----ADCMP1HIB460000000000000000ADTRIG3LB8C
ADCON2LB0400-0000000000000ADCMP2ENLB480000000000000000ADTRIG3HB8E
ADCON2HB0600-000000000000ADCMP2ENHB4A----00000ADTRIG4LB90
ADCON3LB080000x000000000ADCMP2LOB4C0000000000000000ADTRIG4HB92
ADCON3HB0A00000000----ADCMP2HIB4E0000000000000000ADTRIG5LB94
ADCON4LB0C0----000----xxADCMP3ENLB500000000000000000ADCMP0CONBA0
ADCON4HB0E00----0000ADCMP3ENHB52----00000ADCMP1CONBA4
ADMOD0LB10-0-0-0-0-0-00000ADCMP3LOB540000000000000000ADCMP2CONBA8
ADMOD0HB12-0-0-0-0-0-0-0-0ADCMP3HIB560000000000000000ADCMP3CONBAC
ADMOD1LB14----0-0-0-0-0ADFL0DATB680000000000000000ADLVLTRGLBD0
ADIELB20xxxxxxxxxxxxxxxxADFL0CONB6A0xx0000000000000ADLVLTRGHBD2
ADIEHB22----xxxxADFL1DATB6C0000000000000000ADCORE0LBD4
ADCSS1LB2800000000000000ADFL1CONB6E0xx0000000000000ADCORE0HBD6
ADCSS1HB2A----000ADFL2DATB700000000000000000ADCORE1LBD8
ADSTATLB3000000000000000ADFL2CONB720xx0000000000000ADCORE1HBDA
ADSTATHB32----0000ADFL3DATB74000000000000000ADEIELBF0
ADCMP0ENLB380000000000000ADFL3CONB760xx0000000000000ADEIEHBF2
ADCMP0ENHB3A----0000ADTRIG0LB80000000000000000ADEISTATLBF8
ADCMP0LOB3C000000000000ADTRIG0HB82000000000000000ADEISTATHBFA
ADCMP0HIB3E00000000000ADTRIG1LB840000000000000
ADCMP1ENLB4000000000000ADTRIG1HB86000000000000

Legend: x = unknown or indeterminate value; "-" = unimplemented bits. Address and Reset values are in hexadecimal and binary, respectively.

TABLE 4-12: SECONDARY SFR BLOCK C00h

Register Address AllResets Register Address All ResetsRegister Address All Resets
ADC (Continued)ADCBUF12C24000000000000000SLP1CONLC90000000000000000
ADCON5LC000----0----ADCBUF13C26000000000000000SLP1CONHC920----000----
ADCON5HC020----xxxx0----ADCBUF14C28000000000000000SLP1DATC94000000000000000
ADCAL0LC04000000000000000ADCBUF15C2A000000000000000DAC2CONLC98000--000x000000
ADCAL1HC0A00000-00-000----ADCBUF16C2C000000000000000DAC2CONHC9A----000000000
ADCBUF0C0C000000000000000ADCBUF17C2E000000000000000DAC2DATLC9C000000000000000
ADCBUF1C0E000000000000000ADCBUF18C30000000000000000DAC2DATHC9E000000000000000
ADCBUF2C10000000000000000ADCBUF19C32000000000000000SLP2CONLCA0000000000000000
ADCBUF3C12000000000000000DACSLP2CONHCA20----000----
ADCBUF4C14000000000000000DACCTRL1LC80000----0000-000SLP2DATCA4000000000000000
ADCBUF5C16000000000000000DACCTRL2LC84----00010101DAC3CONLCA8000--000x000000
ADCBUF6C18000000000000000DACCTRL2HC86----001000101DAC3CONHCAA----000000000
ADCBUF7C1A000000000000000DAC1CONLC88000--000x000000DAC3DATLCAC000000000000000
ADCBUF8C1C000000000000000ADCBUF12C24000000000000000DAC3DATHCAE000000000000000
ADCBUF9C1E000000000000000DAC1CONHC8A----000000000SLP3CONLCB0000000000000000
ADCBUF10C20000000000000000DAC1DATLC8C000000000000000SLP3CONHCB20----000----
ADCBUF11C22000000000000000DAC1DATHC8E000000000000000SLP3DATCB4000000000000000

Legend: x = unknown or indeterminate value; "-" = unimplemented bits. Address and Reset values are in hexadecimal and binary, respectively.

TABLE 4-13: SECONDARY SFR BLOCK D00h

Register Address All Resets Register Address All Resets Register Address All Resets
I/O PortsRPINR23D321111111111111111RPOR8D90--000000--000000
RPCOND00----0----RPINR37D4E11111111----RPOR9D92--000000--000000
RPINR0D0411111111----RPINR38D50----1111111RPOR10D94--000000--000000
RPINR1D061111111111111111RPINR42D58111111111111111RPOR11D96--000000--000000
RPINR2D0811111111----RPINR43D5A111111111111111RPOR12D98--000000--000000
RPINR3D0A111111111111111RPINR44D5C111111111111111RPOR13D9A--000000--000000
RPINR4D0C111111111111111RPINR45D5E111111111111111RPOR14D9C--000000--000000
RPINR5D0E111111111111111RPINR46D60111111111111111RPOR15D9E--000000--000000
RPINR6D10111111111111111RPINR47D62111111111111111RPOR16DA0--000000--000000
RPINR11D1A111111111111111RPOR0D80--000000--000000RPOR17DA2--000000--000000
RPINR12D1C111111111111111RPOR1D82--000000--000000RPOR18DA4--000000--000000
RPINR13D1E111111111111111RPOR2D84--000000--000000RPOR19DA6--000000--000000
RPINR14D20111111111111111RPOR3D86--000000--000000RPOR20DA8--000000--000000
RPINR15D22111111111111111RPOR4D88--000000--000000RPOR21DAA--000000--000000
RPINR18D28111111111111111RPOR5D8A--000000--000000RPOR22DAC--000000--000000
RPINR20D2C111111111111111RPOR6D8C--000000--000000
RPINR21D2E111111111111111RPOR7D8E--000000--000000

Legend: x = unknown or indeterminate value; “-” = unimplemented bits. Address and Reset values are in hexadecimal and binary, respectively.

TABLE 4-14: SECONDARY SFR BLOCK E00h

Register Address AllResets Register Address All ResetsRegister Address All Resets
I/O Ports (Continued)CNEN0BE2C0000000000000000CNPUDE5E
ANSELAE00----1111-CNSTATBE2E0000000000000000CNPDDE60
TRISAE02----11111CNEN1BE300000000000000000CNCONDE62
PORTAE04----xxxxxCNFBE320000000000000000CNEN0DE64
LATAE06----xxxxxANSELCE38----11--1111CNSTATDE66
ODCAE08----00000TRISCE3A1111111111111111CNEN1DE68
CNPUAE0A----00000PORTCE3CxxxxxxxxxxxxxxxxxxCNFDE6A
CNPDAE0C----00000LATCE3ExxxxxxxxxxxxxxxxxxANSELEE70
CNEN0AE10----00000ODCCE400000000000000000TRISEE72
CNSTATAE12----00000CNPUCE420000000000000000PORTEE74
CNEN1AE14----00000CNPDCE440000000000000000LATEE76
CNFAE16----00000CNCONCE460---0----ODCEE78
ANSELBE1C----11--11111CNEN0CE480000000000000000CNPUEE7A
TRISBE1E1111111111111111CNSTATCE4A0000000000000000CNPDEE7C
PORTBE20xxxxxxxxxxxxxxxxxxCNEN1CE4C0000000000000000CNCONEE7E
LATBE22xxxxxxxxxxxxxxxxxxCNFCE4E0000000000000000CNEN0EE80
ODCBE240000000000000000ANSELDE54-11111----CNSTATEE82
CNPUBE260000000000000000TRISDE561111111111111111CNEN1EE84
CNPDBE280000000000000000PORTDE58xxxxxxxxxxxxxxxxxxCNFEE86
CNEN0AE10----00000LATDE5Axxxxxxxxxxxxxxxxxx
CNCONBE2A0---0----ODCDE5C0000000000000000

Legend: x = unknown or indeterminate value; "-" = unimplemented bits. Address and Reset values are in hexadecimal and binary, respectively.

TABLE 4-15: SECONDARY SFR BLOCK F00h

Register Address AllResets Register Address All ResetsRegister Address All Resets
ResetPMD1FA4----000-00000-00REFOTRIMHFBE000000000----
RCONF8000--x-0000000011PMD2FA6----00000000PCTRAPLFBF000000000000000
OscillatorPMD4FAA----0---PCTRAPLFC0000000000000000
OSCCONF84-000-xxx0-0-0--0PMD6FAE--000000----PCTRAPHFC2----0000000
CLKDIVF8600110000--000001PMD7FB0----x----0---
PLLFBDF88----000010010110PMD8FB2----00--0--xx000-
PLLDIVF8A----00-011-001WDT
APLLFBD1F90----00010010110WDTCONLFB40--0000000000000
APLLDIV1F92----00-011-001WDTCONHFB6000000000000000
PMDREFOCONLFB80-000-00----0000
PMDCONFA0----0----REFOCONHFBA-000000000000000

Legend: x = unknown or indeterminate value; "-" = unimplemented bits. Reset and address values are in hexadecimal.

4.2.4.1 Paged Memory Scheme

The dsPIC33CH128MP508S1 architecture extends the available Data Space through a paging scheme, which allows the available Data Space to be accessed using MOV instructions in a linear fashion for pre- and post-modified Effective Addresses (EAs). The upper half of the base Data Space address is used in conjunction with the Data Space Read Page (DSRPAG) register to form the Program Space Visibility (PSV) address.

The Data Space Read Page (DSRPAG) register is located in the SFR space. Construction of the PSV address is shown in Figure 4-6. When DSRPAG[9] = 1 and the base address bit, EA[15] = 1, the DSRPAG[8:0] bits are concatenated onto EA[14:0] to form the 24-bit PSV read address.

The paged memory scheme provides access to multiple 32-Kbyte windows in the PSV memory. The Data Space Read Page (DSRPAG) register, in combination with the upper half of the Data Space address, can provide up to 8 Mbytes of PSV address space. The paged data memory space is shown in Figure 4-7.

The Program Space (PS) can be accessed with a DSRPAG of 0x200 or greater. Only reads from PS are supported using the DSRPAG.

FIGURE 4-6: PROGRAM SPACE VISIBILITY (PSV) READ ADDRESS GENERATION
Microchip dsPIC33CH64MP208 - Paged Memory Scheme - 1

flowchart
graph TD
    A["Select DSRPAG"] --> B{DSRPAG["8:0"]]
    B --> C["Select EDS Access"]
    C --> D["DAIR"]
    D --> E["Select16-Bit DS EA"]
    E --> F["Byte24-Bit PSV EA Select"]
    style A fill:#f9f,stroke:#333
    style F fill:#ccf,stroke:#333

Note: DS read access when DSRPAG = 0x000 will force an address error trap.

FIGURE 4-7: PAGED DATA MEMORY SPACE
Microchip dsPIC33CH64MP208 - Paged Memory Scheme - 2

flowchart
graph TD
    A["Local Data Space"] --> B["DS_Addr[14:0"]]
    B --> C["(DSRPAG = 0x200) No Writes Allowed"]
    B --> D["(DSRPAG = 0x2FF) No Writes Allowed"]
    B --> E["(DSRPAG = 0x300) No Writes Allowed"]
    B --> F["(DSRPAG = 0x3FF) No Writes Allowed"]
    C --> G["Program Memory (Isw - [15:0"])]
    D --> H["Program Memory (MSB - [23:16"])]
    E --> I["Program Memory (Isw - [15:0"])]
    F --> J["Program Memory (Isw - [15:0"])]
    K["Table Address Space"] --> L["(TBLPAG = 0x00) Isw Using TBLRDL/TBLWTL, MSB Using TBLRDR/TBLWTH"]
    L --> M["(TBLPAG = 0x7F) Isw Using TBLRDL/TBLWTL, MSB Using TBLRDR/TBLWTH"]
    M --> N["0xFFFF"]
    N --> O["0x0000"]
    O --> P["0x0000"]
    P --> Q["0x0000"]
    Q --> R["0x7F_FFFF"]
    R --> S["0x7F_FFFF"]
    S --> T["0x7FFF"]
    T --> U["0x7FFF"]
    U --> V["0x7FFF"]
    V --> W["0x7FFF"]
    W --> X["0x7FFF"]
    X --> Y["0x7FFF"]
    Y --> Z["0x7FFF"]
    Z --> AA["0x7FFF"]
    AA --> AB["0x7FFF"]
    AB --> AC["0x7FFF"]
    AC --> AD["0x7FFF"]
    AD --> AE["0x7FFF"]
    AE --> AF["0x7FFF"]
    AF --> AG["0x7FFF"]
    AG --> AH["0x7FFF"]
    AH --> AI["0x7FFF"]
    AI --> AJ["0x7FFF"]
    AJ --> AK["0x7FFF"]
    AK --> AL["0x7FFF"]
    AL --> AM["0x7FFF"]
    AM --> AN["0x7FFF"]
    AN --> AO["0x7FFF"]
    AO --> AP["0x7FFF"]
    AP --> AQ["0x7FFF"]
    AQ --> AR["0x7FFF"]
    AR --> AS["0x7FFF"]
    AS --> AT["0x7FFF"]
    AT --> AU["0x7FFF"]
    AU --> AV["0x7FFF"]
    AV --> AW["0x7FFF"]
    AW --> AX["0x7FFF"]
    AX --> AY["0x7FFF"]
    AY --> AZ["0x7FFF"]
    AZ --> BA["0x7FFF"]
    BA --> BB["0x7FFF"]
    BB --> BC["0x7FFF"]
    BC --> BD["0x7FFF"]
    BD --> BE["0x7FFF"]
    BE --> BF["0x7FFF"]
    BF --> BG["0x7FFF"]
    BG --> BH["0x7FFF"]
    BH --> BI["0x7FFF"]
    BI --> BJ["0x7FFF"]
    BJ --> BK["0x7FFF"]
    BK --> BL["0x7FFF"]
    BL --> BM["0x7FFF"]
    BM --> BN["0x7FFF"]

When a PSV page overflow or underflow occurs, EA[15] is cleared as a result of the register indirect EA calculation. An overflow or underflow of the EA in the PSV pages can occur at the page boundaries when:

  • The initial address, prior to modification, addresses the PSV page
  • The EA calculation uses Pre- or Post-Modified Register Indirect Addressing; however, this does not include Register Offset Addressing

In general, when an overflow is detected, the DSRPAG register is incremented and the EA[15] bit is set to keep the base address within the PSV window. When an underflow is detected, the DSRPAG register is decremented and the EA[15] bit is set to keep the base address within the PSV window. This creates a linear PSV address space, but only when using Register Indirect Addressing modes.

Exceptions to the operation described above arise when entering and exiting the boundaries of Page 0 and PSV spaces. Table 4-16 lists the effects of overflow and underflow scenarios at different boundaries.

In the following cases, when overflow or underflow occurs, the EA[15] bit is set and the DSRPAG is not modified; therefore, the EA will wrap to the beginning of the current page:

  • Register Indirect with Register Offset Addressing
  • Modulo Addressing
  • Bit-Reversed Addressing

TABLE 4-16: OVERFLOW AND UNDERFLOW SCENARIOS AT PAGE 0 AND PSV SPACE BOUNDARIES ^(2,3,4)

O/U,R/WOperationBefore After
DSRPAGDSEA[15]PageDescriptionDSRPAGDSEA[15]PageDescription
O,Read[++Wn]or[Wn++]DSRPAG = 0x2FF 1PSV: Last lswpageDSRPAG = 0x300 1PSV: First MSBpage
O,ReadDSRPAG = 0x3FF 1PSV: Last MSBpageDSRPAG = 0x3FF0See Note 1
U,Read[--Wn]or[Wn--]DSRPAG = 0x0011PSV pageDSRPAG = 0x0010See Note 1
U,ReadDSRPAG = 0x200 1PSV: First lswpageDSRPAG = 0x2000See Note 1
U,ReadDSRPAG = 0x300 1PSV: First MSBpageDSRPAG = 0x2FF 1PSV: Last lswpage

Legend: O = Overflow, U = Underflow, R = Read, W = Write
Note 1: The Register Indirect Addressing now addresses a location in the base Data Space (0x0000-0x8000).
2: An EDS access, with DSRPAG = 0x000, will generate an address error trap.
3: Only reads from PS are supported using DSRPAG.
4: Pseudolinear Addressing is not supported for large offsets.

4.2.4.2 Extended X Data Space

The lower portion of the base address space range, between 0x0000 and 0x7FFF, is always accessible, regardless of the contents of the Data Space Read Page register. It is indirectly addressable through the register indirect instructions. It can be regarded as being located in the default EDS Page 0 (i.e., EDS address range of 0x000000 to 0x007FFF with the base address bit, EA[15] = 0, for this address range). However, Page 0 cannot be accessed through the upper 32 Kbytes, 0x8000 to 0xFFFF, of base Data Space in combination with DSRPAG = 0x00. Consequently, DSRPAG is initialized to 0x001 at Reset.

Note 1: DSRPAG should not be used to access Page 0. An EDS access with DSRPAG set to 0x000 will generate an address error trap.

2: Clearing the DSRPAG in software has no effect.

The remaining PSV pages are only accessible using the DSRPAG register in combination with the upper 32 Kbytes, 0x8000 to 0xFFFF, of the base address, where base address bit, EA[15] = 1.

4.2.4.3 Software Stack

The W15 register serves as a dedicated Software Stack Pointer (SSP), and is automatically modified by exception processing, subroutine calls and returns; however, W15 can be referenced by any instruction in the same manner as all other W registers. This simplifies reading, writing and manipulating the Stack Pointer (for example, creating stack frames).

Note: To protect against misaligned stack accesses, W15[0] is fixed to '0' by the hardware.

W15 is initialized to 0x1000 during all Resets. This address ensures that the SSP points to valid RAM in all dsPIC33CH128MP508S1 devices and permits stack availability for non-maskable trap exceptions. These can occur before the SSP is initialized by the user software. You can reprogram the SSP during initialization to any location within Data Space.

The Software Stack Pointer always points to the first available free word and fills the software stack, working from lower toward higher addresses. Figure 4-8 illustrates how it pre-decrements for a stack pop (read) and post-increments for a stack push (writes).

When the PC is pushed onto the stack, PC[15:0] are pushed onto the first available stack word, then PC[22:16] are pushed into the second available stack location. For a PC push during any CALL instruction, the MSB of the PC is zero-extended before the push, as shown in Figure 4-8. During exception processing, the MSB of the PC is concatenated with the lower eight bits of the CPU STATUS Register, SR. This allows the contents of SRL to be preserved automatically during interrupt processing.

Note 1: To maintain system Stack Pointer (W15) coherency, W15 is never subject to (EDS) paging, and is therefore, restricted to an address range of 0x0000 to 0xFFFF. The same applies to W14 when used as a Stack Frame Pointer (SFA = 1).

2: As the stack can be placed in, and can access X and Y spaces, care must be taken regarding its use, particularly with regard to local automatic variables in a C development environment

FIGURE 4-8: CALL STACK FRAME
Microchip dsPIC33CH64MP208 - Software Stack - 1

text_image 0x0000 Stack Grows Toward Higher Address 015 CALL SUBR PC[15:1] b'000000000' PC[22:16] [Free Word] W15 (before CALL) W15 (after CALL)

4.2.5 INSTRUCTION ADDRESSING MODES

The addressing modes shown in Table 4-17 form the basis of the addressing modes optimized to support the specific features of individual instructions. The addressing modes provided in the MAC class of instructions differ from those in the other instruction types.

4.2.5.1 File Register Instructions

Most file register instructions use a 13-bit address field (f) to directly address data present in the first 8192 bytes of data memory (Near Data Space). Most file register instructions employ a Working register, W0, which is denoted as WREG in these instructions. The destination is typically either the same file register or WREG (with the exception of the MUL instruction), which writes the result to a register or register pair. The MOV instruction allows additional flexibility and can access the entire Data Space.

4.2.5.2 MCU Instructions

The three-operand MCU instructions are of the form:

Operand 3 = Operand 1 Operand 2

where Operand 1 is always a Working register (that is, the addressing mode can only be Register Direct), which is referred to as Wb. Operand 2 can be a W register fetched from data memory or a 5-bit literal. The result location can either be a W register or a data memory location. The following addressing modes are supported by MCU instructions:

  • Register Direct
  • Register Indirect
  • Register Indirect Post-Modified
  • Register Indirect Pre-Modified
  • 5-Bit or 10-Bit Literal

Note: Not all instructions support all the addressing modes given above. Individual instructions can support different subsets of these addressing modes.

TABLE 4-17: FUNDAMENTAL ADDRESSING MODES SUPPORTED

Addressing Mode Description
File Register DirectThe address of the file register is specified explicitly.
Register DirectThe contents of a register are accessed directly.
Register IndirectThe contents of Wn form the Effective Address (EA).
Register Indirect Post-ModifiedThe contents of Wn form the EA. Wn is post-modified (incremented or decremented) by a constant value.
Register Indirect Pre-ModifiedWn is pre-modified (incremented or decremented) by a signed constant value to form the EA.
Register Indirect with Register Offset (Register Indexed)The sum of Wn and Wb forms the EA.
Register Indirect with Literal OffsetThe sum of Wn and a literal forms the EA.

4.2.5.3 Move and Accumulator Instructions

Move instructions, and the DSP accumulator class of instructions, provide a greater degree of addressing flexibility than other instructions. In addition to the addressing modes supported by most MCU instructions, move and accumulator instructions also support Register Indirect with Register Offset Addressing mode, also referred to as Register Indexed mode.

Note:

For the MOV instructions, the addressing mode specified in the instruction can differ for the source and destination EA. However, the 4-bit Wb (Register Offset) field is shared by both source and destination (but typically only used by one).

In summary, the following addressing modes are supported by move and accumulator instructions:

  • 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: Not all instructions support all the addressing modes given above. Individual instructions may support different subsets of these addressing modes.

4.2.5.4 MAC Instructions

The dual source operand DSP instructions (CLR, ED, EDAC, MAC, MPY, MPY.N, MOVSAC and MSC), also referred to as MAC instructions, use a simplified set of addressing modes to allow the user application to effectively manipulate the Data Pointers through register indirect tables.

The two-source operand prefetch registers must be members of the set {W8, W9, W10, W11}. For data reads, W8 and W9 are always directed to the X RAGU, and W10 and W11 are always directed to the Y AGU. The Effective Addresses generated (before and after modification) must therefore, be valid addresses within X Data Space for W8 and W9, and Y Data Space for W10 and W11.

Note: Register Indirect with Register Offset Addressing mode is available only for W9 (in X space) and W11 (in Y space).

In summary, the following addressing modes are supported by the MAC class of instructions:

  • 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.2.5.5 Other Instructions

Besides the addressing modes outlined previously, some instructions use literal constants of various sizes. For example, BRA (branch) instructions use 16-bit signed literals to specify the branch destination directly, whereas the DISI instruction uses a 14-bit unsigned literal field. In some instructions, such as ULNK, the source of an operand or result is implied by the opcode itself. Certain operations, such as a NOP, do not have any operands.

4.2.6 MODULO ADDRESSING

Modulo Addressing mode 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.

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 be configured to operate in only 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 that have a power-of-two length. As these buffers satisfy the start and end address criteria, they can operate in a Bidirectional mode (that is, address boundary checks are performed on both the lower and upper address boundaries).

4.2.6.1 Start and End Address

The Modulo Addressing scheme requires that a starting and ending address be specified and loaded into the 16-bit Modulo Buffer Address registers: XMODSRT, XMODEND, YMODSRT and YMODEND (see Table 4-1).

Note: Y space Modulo Addressing EA calculations assume word-sized data (LSb of every EA is always clear).

The length of a circular buffer is not directly specified. It is determined by the difference between the corresponding start and end addresses. The maximum possible length of the circular buffer is 32K words (64 Kbytes).

4.2.6.2 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 the registers that operate with Modulo Addressing:

  • If XWM = 1111, X RAGU and X WAGU Modulo Addressing is disabled
  • I f Y W M = 1111, Y AGU Modulo Addressing is disabled

The X Address Space Pointer W (XWM) register, to which Modulo Addressing is to be applied, is stored in MODCON[3:0] (see Table4-1). Modulo Addressing is enabled for X Data Space when XWM is set to any value other than '1111' and the XMODEN bit is set (MODCON[15]).

The Y Address Space Pointer W (YWM) register, 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 '1111' and the YMODEN bit (MODCON[14]) is set.

FIGURE 4-9: MODULO ADDRESSING OPERATION EXAMPLE
Microchip dsPIC33CH64MP208 - W Address Register Selection - 1

text_image Byte Address 0x1100 0x1163 MOV #0x1100, W0 MOV W0, XMODSRT ;set modulo start address MOV #0x1163, W0 MOV W0, MODEND ;set modulo end address 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 Start Addr = 0x1100 End Addr = 0x1163 Length = 0x0032 words

4.2.6.3 Modulo Addressing Applicability

Modulo Addressing can be applied to the Effective Address (EA) calculation associated with any W register. Address boundaries check for addresses equal to:

  • The upper boundary addresses for incrementing buffers
  • The lower boundary addresses for decrementing buffers

It is important to realize that the address boundaries check for addresses less than, or greater than, the upper (for incrementing buffers) and lower (for decrementing buffers) boundary addresses (not just equal to). Address changes can, therefore, jump beyond boundaries and still be adjusted correctly.

Note: The modulo corrected Effective Address is written back to the register only when Pre-Modify or Post-Modify Addressing mode is used to compute the Effective Address. When an address offset (such as [W7 + W2] ) is used, Modulo Addressing correction is performed, but the contents of the register remain unchanged.

4.2.7 BIT-REVERSED ADDRESSING

Bit-Reversed Addressing mode is intended to simplify data reordering for radix-2 FFT algorithms. It is supported by the X AGU for data writes only.

The modifier, which can be a constant value or register contents, is regarded as having its bit order reversed. The address source and destination are kept in normal order. Thus, the only operand requiring reversal is the modifier.

4.2.7.1 Bit-Reversed Addressing Implementation

Bit-Reversed Addressing mode is enabled in any of these situations:

  • BWMx bits (W register selection) in the MODCON register are any value other than '1111' (the stack cannot be accessed using Bit-Reversed Addressing)

• The BREN bit is set in the XBREV register

- The addressing mode used is Register Indirect with Pre-Increment or Post-Increment

If the length of a bit-reversed buffer is M = 2^N bytes, the last 'N' bits of the data buffer start address must be zeros.

XB[14:0] is the Bit-Reversed Addressing modifier, or 'pivot point', which is typically a constant. In the case of an FFT computation, its value is equal to half of the FFT data buffer size.

Note: All bit-reversed EA calculations assume word-sized data (LSb of every EA is always clear). The XB value is scaled accordingly to generate compatible (byte) addresses.

When enabled, Bit-Reversed Addressing is executed only for Register Indirect with Pre-Increment or Post-Increment Addressing and word-sized data writes. It does not function for any other addressing mode or for byte-sized data and normal addresses are generated instead. When Bit-Reversed Addressing is active, the W Address Pointer is always added to the address modifier (XB) and the offset associated with the Register Indirect Addressing mode is ignored. In addition, as word-sized data are a requirement, the LSb of the EA is ignored (and always clear).

Note: Modulo Addressing and Bit-Reversed Addressing can be enabled simultaneously using the same W register, but Bit-Reversed Addressing operation will always take precedence for data writes when enabled.

If Bit-Reversed Addressing has already been enabled by setting the BREN (XBREV[15]) bit, a write to the XBREV register should not be immediately followed by an indirect read operation using the W register that has been designated as the Bit-Reversed Pointer.

FIGURE 4-10: BIT-REVERSED ADDRESSING EXAMPLE
Microchip dsPIC33CH64MP208 - Bit-Reversed Addressing Implementation - 1

flowchart
graph TD
    A["Sequential Address"] --> B["b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 0"]
    B --> C["b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b1 b2 b3 b4 0"]
    C --> D["Pivot Point"]
    D --> E["Bit-Reversed Address"]
    E --> F["XB = 0x0008 for a 16-Word Bit-Reversed Buffer"]
    style A fill:#f9f,stroke:#333
    style B fill:#ccf,stroke:#333
    style C fill:#cfc,stroke:#333
    style D fill:#fcc,stroke:#333
    style E fill:#ffc,stroke:#333
    style F fill:#fcc,stroke:#333

TABLE 4-18: BIT-REVERSED ADDRESSING SEQUENCE (16-ENTRY)

Normal Address Bit-Reversed Address
A3 A2A1 A0DecimalA3 A2 A1A0 Decimal
00000 00000
00011 10008
00102 01004
00113 110012
01004 00102
01015 101010
01106 01106
01117 111014
10008 00011
10019 10019
10101001015
101111110113
11001200113
110113101111
11101401117
111115111115

4.2.8 INTERFACING PROGRAM AND DATA MEMORY SPACES

The dsPIC33CH128MP508S1 family architecture uses a 24-bit wide Program Space (PS) and a 16-bit wide Data Space (DS). The architecture is also a modified Harvard scheme, meaning that data can also be present in the Program Space. To use these data successfully, they must be accessed in a way that preserves the alignment of information in both spaces.

Aside from normal execution, the architecture of the dsPIC33CH128MP508S1 family devices provides two methods by which Program Space can be accessed during operation:

  • Using table instructions to access individual bytes or words anywhere in the Program Space
  • Remapping a portion of the Program Space into the Data Space (Program Space Visibility)

Table instructions allow an application to read small areas of the program memory. This capability makes the method ideal for accessing data tables that need to be updated periodically. It also allows access to all bytes of the program word. The remapping method allows an application to access a large block of data on a read-only basis, which is ideal for look-ups from a large table of static data. However, this method only provides visibility to the lower 16 bits in each location addressed.

TABLE 4-19: PROGRAM SPACE ADDRESS CONSTRUCTION

Access TypeAccess SpaceProgram Space Address
[23] [22:16] [15] [14:1] [0]
Instruction Access (Code Execution)User 0 PC[22:1] 0
0xxxx xxxx xxxx xxxx xxxx xxxx
TBLRD (Byte/Word Read)User TBLPAG[7:0]Data EA[15:0]
0xxxx xxxxxxxx xxxx xxxx

FIGURE 4-11: DATA ACCESS FROM PROGRAM SPACE ADDRESS GENERATION

Microchip dsPIC33CH64MP208 - INTERFACING PROGRAM AND DATA MEMORY SPACES - 1

flowchart
graph TD
    A["Program Counter(1)"] --> B["0"]
    B --> C["Program Counter"]
    C --> D["0"]
    D --> E["23 Bits"]
    E --> F["EA"]
    F --> G["1/0"]
    G --> H["Table Operations(2)"]
    H --> I["1/0"]
    I --> J["TBLPAG"]
    J --> K["8 Bits"]
    K --> L["16 Bits"]
    L --> M["24 Bits"]
    M --> N["User/Configuration Space Select"]
    M --> O["Byte Select"]

Note 1: The Least Significant bit (LSb) of Program Space addresses is always fixed as '0' to maintain word alignment of data in the Program and Data Spaces.

2: Table operations are not required to be word-aligned. Table Read operations are permitted in the configuration memory space.

4.2.8.1 Data Access from Program Memory Using Table Instructions

The TBLRDL instruction offers a direct method of reading the lower word of any address within the Program Space without going through Data Space. The TBLRDH instruction is the only method to read the upper eight bits of a Program Space word as data.

This allows program memory addresses to directly map to Data Space addresses. Program memory can thus be regarded as two 16-bit wide word address spaces, residing side by side, each with the same address range. TBLRDL accesses the space that contains the least significant data word. TBLRDH accesses the space that contains the upper data byte.

Two table instructions are provided to read byte or word-sized (16-bit) data from Program Space. Both function as either byte or word operations.

• TBLRDL (Table Read Low):

- In Word mode, this instruction maps the lower word of the Program Space location (P[15:0]) to a data address (D[15:0]).

- In Byte mode, either the upper or lower byte of the lower program word is mapped to the lower byte of a data address. The upper byte is selected when Byte Select is '1'; the lower byte is selected when it is '0'.

• TBLRDH (Table Read High):

- In Word mode, this instruction maps the entire upper word of a program address (P[23:16]) to a data address. The 'phantom' byte (D[15:8]) is always '0'.

- In Byte mode, either the upper or lower byte of the upper program word is mapped to the lower byte of a data address. The upper byte is selected when Byte Select is '1'; the lower byte is selected when it is '0'. When the upper byte is selected, the 'phantom' byte is read as '0'.

FIGURE 4-12: ACCESSING PROGRAM MEMORY WITH TABLE INSTRUCTIONS
Microchip dsPIC33CH64MP208 - Data Access from Program Memory Using Table Instructions - 1

flowchart
graph TD
    A["TBLPAG 02"] --> B["23 15 0"]
    B --> C["0x000000"]
    C --> D["0x020000"]
    D --> E["0x030000"]
    E --> F["0x800000"]
    F --> G["0x800000"]
    G --> H["0x800000"]
    H --> I["0x800000"]
    I --> J["0x800000"]
    J --> K["0x800000"]
    K --> L["0x800000"]
    L --> M["0x800000"]
    M --> N["0x800000"]
    N --> O["0x800000"]
    O --> P["0x800000"]
    P --> Q["0x800000"]
    Q --> R["0x800000"]
    R --> S["0x800000"]
    S --> T["0x800000"]
    T --> U["0x800000"]
    U --> V["0x800000"]
    V --> W["0x800000"]
    W --> X["0x800000"]
    X --> Y["0x800000"]
    Y --> Z["0x800000"]
    Z --> AA["0x800000"]
    AA --> AB["0x800000"]
    AB --> AC["0x800000"]
    AC --> AD["0x800000"]
    AD --> AE["0x800000"]
    AE --> AF["0x800000"]
    AF --> AG["0x800000"]
    AG --> AH["0x800000"]
    AH --> AI["0x800000"]
    AI --> AJ["0x800000"]
    AJ --> AK["0x800000"]
    AK --> AL["0x800000"]
    AL --> AM["O81623"]
    subgraph 'Phantom' Byte
        B
        C
        D
        E
        F
        G
        H
        I
        J
        K
        L
        M
        N
        O
        P
        Q
        R
        S
        T
        U
        V
        W
        X
        Y
        Z
        AA
        AB
        AC
        AD
        AE
        AF
        AG
        AH
        AI
        AJ
        AK
        AL
        AM
        AN
        AO
        AP
        AQ
        AR
        AS
        AT
        AU
        AV
        AW
        AX
        AY
        AZ
        BA
        BB
        BC
        BD
        BE
        BF
        BG
        BH
        BI
        BJ
        BK
        BL
        BM
        BN
        BO
        BP
        BPB
        BW
        BWB
        BWN
        BWN1
        BWN2
        BWN3
        BWN4
        BWN5
        BWN6
        BWN7
        BWN8
        BWN9
        BWN11
        BWN12
        BWN13
        BWN14
        BWN15
        BWN16
        BWN17
        BWN18
        BWN19
        BWN21
        BWN22
        BWN23
        BWN24
        BWN25
        BWN26
        BWN27
        BWN28
        BWN29
        BWN31
        BWN32
        BWN33
        BWN34
        BWN35
        BWN36
        BWN37
        BWN38
        BWN39
        BWN41
        BWN42
        BWN43
        BWN44
        BWN45
        BWN46
        BWN47
        BWN48
        BWN49
        BWN51
        BWN52
        BWN53
        BWN54
        BWN55
        BWN56
        BWN57
        BWN58
        BWN59
        BWN61
    end

4.3 Secondary PRAM Program Memory

Note 1: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive reference source. To complement the information in this data sheet, refer to “Dual Partition Flash Program Memory” (www.microchip.com/DS70005156).

2: Though the reference to the chapter is "Dual Partition Flash Program Memory" (www.microchip.com/DS70005156), the program memory for the Secondary code is PRAM. Therefore, after each POR, the Host will have to reload the content of the Client PRAM.

The dsPIC33CH128MP508S1 family devices contain internal PRAM program memory for storing and executing application code. The PRAM program memory array is organized into rows of 128 instructions or 64 double instruction words. Though the PRAM is volatile, it is writable during normal operation over the entire VDD range.

PRAM memory can be programmed in two ways:

• In-Circuit Serial Programming (ICSP)
- Main to Secondary Image Loading (MSIL)

ICSP allows for a dsPIC33CH128MP508S1 family device to be serially programmed in the application circuit. Since the Secondary PRAM is volatile, Secondary PRAM ICSP programming is supported only as a development and debugging feature.

Main to Secondary Image Loading (MSIL) allows the Host user code to load the Client PRAM at run time. A Client PRAM compatible image is stored in Host Flash memory. At run time, the Host user code is responsible for loading and verifying the contents of the Client PRAM.

Note: In an actual application mode, the Client PRAM is loaded by the Host, so the ICSP mode of PRAM operation is valid only for the Debug mode during the code development.

4.3.1 PRAM PROGRAMMING OPERATIONS

Unlike when self-programming the Host Flash, TBLWTL and TBLWTH instructions are not supported during user application mode. This means that RTSP programming of the PRAM is not supported.

For ICSP programming of the Secondary PRAM, TBLWTL and TBLWTH instructions are used to write to the NVM write latches. An NVM write operation then writes the contents of both latches to the PRAM, starting at the address defined in the NVMADR and NVMADRU registers.

For Main to Secondary Image Loading (MSIL) of the Client PRAM, the Host user code is responsible for transferring the Client image contents, stored in the Host Flash, to the Client PRAM. The LDSLV instruction is used, along with the DSRPAG and DSWPAG registers, to transfer a single 24-bit instruction to the Client PRAM.

The VFSLV instruction allows the Host user code to verify that the PRAM has been loaded correctly.

Note: Main to Secondary Image Loading is the only supported method for programming the Client PRAM in a final user application.

Regardless of the method used to program the PRAM, a few basic requirements should be met:

  • A full 48-bit double instruction word should always be programmed to a PRAM location. Either instruction may simply be a NOP to fulfill this requirement. This ensures a valid ECC value is generated for each pair of instructions written.
    • Assuming the above step is followed, the last 24-bit location in implemented Program Space, or prior to any unprogrammed region in Program Space, should never be executed. The penultimate instruction, in either case, must contain a program flow change instruction, such as a RETURN or a BRA instruction.

4.3.2 MAIN TO SECONDARY IMAGE LOADING (MSIL)

Main to Secondary Image Loading (MSIL) allows the Host user application code to transfer the Client image, stored in the Host Flash, to the Client PRAM. This is the only supported method for programming the Client PRAM in a final user application.

The LDSLV instruction is executed by the Host user application to transfer a single 24-bit instruction from the Host Flash address, defined by Ws[14:0] (DSRPAG), to the Client PRAM address, defined by Wd[14:0] (DSWPAG).

The LDSLV instruction should be executed in pairs to ensure correct ECC value generation for each double instruction word that is loaded into the Client PRAM. The Client image instruction found at a given even address should be loaded first. This will be the lower instruction word of a 48-bit double instruction word. The upper instruction word should then be loaded from the following odd address. After the pair of LDSLV instructions is executed by the Host user application, both 24-bit Client image instructions and the generated 7-bit ECC value are actually loaded into the PRAM destination address locations.

The VFSLV instruction allows the Host user application to verify that the PRAM has been loaded correctly. The VFSLV instruction compares the 24-bit instruction word stored in the Host Flash address, defined by Ws[14:0] (DSRPAG), to the 24 bit instruction written to the Client PRAM address, defined by Wd[14:0] (DSWPAG).

The VESLV instruction should also be executed in pairs. The lower instruction word found on a given even address should be verified first. The upper instruction word found in the following odd address should then be verified. Then, the Client image instruction pair read from the Host Flash will have a valid generated ECC value. This full double instruction word with ECC is then compared to the 55-bit value that was actually loaded into the PRAM destination locations. The entire Secondary image may be loaded into the PRAM first and then subsequently verified.

4.3.3 USING DEVELOPMENT TOOL SUPPORTED FUNCTIONS

The Microchip development environment provides some utility functions to simplify loading the Secondary image and starting the Secondary core operation. The __program_secondary() routine within the libpic30.h library programs the Secondary core with the specified Secondary image created within the Microchip language tool format.

The _program_secondary() routine uses the "verify" parameter as a switch to either load or verify the Secondary image using the LDSLV or VFSLV instructions. A '0' will load the entire Secondary image to the PRAM and a '1' will verify the entire Secondary image in the PRAM. An example of how this routine can be used to load and verify the contents of the Secondary PRAM is shown in Example 4-1.

EXAMPLE 4-1: SECONDARY PRAM LOAD AND VERIFY ROUTINE

#include [libpic30.h]
// _program_Secondary(core#, verify,
//&secondary_image)
if (_program_secondary(1, 0, &secondary_image)
== 0)
{
    /* now verify */
    if (_program_secondary(1, 1,
&secondary_image) ==
    ESLV_VERIFY_FAIL)
    {
    asm("reset"); // try again
    }
} 

Secondary PRAM images not following the Microchip language tool format will require a custom routine that follows all requirements for the PRAM Main to Secondary Image Loading process described in this chapter.

The __start_secondary routine is used to start the Secondary core after it has had its image loaded by the Main core. If an application requires the Secondary core to be stopped, the __stop_secondary routine is also provided. Example usage of these routines are shown in Example 4-2.

EXAMPLE 4-2: SECONDARY START AND STOP EXAMPLE

#include [libpic30.h]
int main()
{
    // Main initialization code
    _start_secondary(); // Start Secondary core
    // Main application code
    _stop_secondary(); // Stop Secondary core
    while(1);
} 

The __start_secondary and __stop_secondary routines perform the MSI1KEY unlock sequence and set or clear the SLVEN bit (MSI1CON[15]).

4.3.4 PRAM DUAL PARTITION CONSIDERATIONS

For dsPIC33CH512MP508S1 family devices operating in Dual Partition PRAM Program Memory modes, both partitions would be loaded using the Main to Secondary Image Loading process. The Main can load the Active Partition of the PRAM only when SLVEN = 0 (Secondary is not running). The Main can load the PRAM Inactive Partition any time. To support LiveUpdate, the Main would load the PRAM Inactive Partition while the Secondary is running and then the Secondary would execute the BOOTSWP instruction to swap partitions.

4.3.4.1 PRAM Partition Swapping

At device Reset, the default PRAM partition is Partition 1. The BOOTSWP instruction provides the means of swapping the Active and Inactive Partitions (soft swap) without the need for a device Reset. The BOOTSWP must always be followed by a GOTO instruction. The BOOTSWP instruction swaps the Active and Inactive Partitions, and the PC vectors to the location specified by the GOTO instruction in the newly Active Partition.

It is important to note that interrupts should temporarily be disabled while performing the soft swap sequence, and that after the partition swap, all peripherals and interrupts, which were enabled remain enabled. Additionally, the RAM and stack will maintain their state after the switch. As a result, it is recommended that applications using soft swaps jump to a routine that will reinitialize the device in order to ensure the firmware runs as expected. The Configuration registers will have no effect during a soft swap.

4.3.5 ERROR CORRECTING CODE (ECC)

In order to improve program memory performance and durability, these devices include Error Correcting Code functionality (ECC) as an integral part of the PRAM memory controller. ECC can determine the presence of single bit errors in program data, including which bit is in error, and correct the data automatically without user intervention. ECC cannot be disabled.

When data are written to program memory, ECC generates a 7-bit Hamming code parity value for every two (24-bit) instruction words. The data are stored in blocks of 48 data bits and seven parity bits; parity data are not memory-mapped and are inaccessible. When the data are read back, the ECC calculates the parity on them and compares it to the previously stored parity value. If a parity mismatch occurs, there are two possible outcomes:

  • Single bit errors are automatically identified and corrected on read back. An optional device-level interrupt (ECCSBEIF) is also generated.
  • Double-bit errors will generate a generic hard trap and the read data are not changed. If special exception handling for the trap is not implemented, a device Reset will also occur.

To use the single bit error interrupt, set the ECC Single Bit Error Interrupt Enable bit (ECCSBEIE) and configure the ECCSBEIPx bits to set the appropriate interrupt priority. Except for the single bit error interrupt, error events are not captured or counted by hardware. This functionality can be implemented in the software application, but it is the user's responsibility to do so.

4.3.6 CONTROL REGISTERS

Six SFRs are used to write and erase the Program Flash Memory: NVMCON, NVMKEY, NVMADR, NVMADRU, NVMSRCADRL and NVMSRCADRH.

The NVMCON register (Register 4-5) selects the operation to be performed (page erase, word/row program, Inactive Partition erase) and initiates the program or erase cycle.

NVMKEY (Register 4-8) is a write-only register that is used for write protection. To start a programming or erase sequence, the user application must consecutively write 0x55 and 0xAA to the NVMKEY register.

There are two NVM Address registers: NVMADRU and NVMADR. These two registers, when concatenated, form the 24-bit Effective Address (EA) of the selected word/row for programming operations, or the selected page for erase operations. The NVMADRU register is used to hold the upper eight bits of the EA, while the NVMADR register is used to hold the lower 16 bits of the EA.

For row programming operation, data to be written to the Secondary PRAM are written into Secondary data memory space (RAM) at an address defined by the NVMSRCADRL/H registers (location of first element in row programming data).

4.3.7 SECONDARY PROGRAM MEMORY CONTROL/STATUS REGISTERS

REGISTER 4-5: NVMCON: PROGRAM MEMORY SECONDARY CONTROL REGISTER

R/SO-0^(1) R/W-0^(1) R/W-0^(1) R/W-0 R/C-0 R/C-0 R/W-0 R/C-0
WR WREN WRERR NVMSIDL(2)SFTSWP P2ACTIV RPDFURERR
bit 15bit 8
U-0U-0U-0U-0 R/W-0^(1) R/W-0^(1) R/W-0^(1) R/W-0^(1)
NVMOP[3:0] ^(3,4)
bit 7 bit 0
Legend:C = Clearable bitSO = Settable Only bit
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15 WR: Write Control bit ^(1)

1 = Initiates a PRAM memory program or erase operation; the operation is self-timed and the bit is cleared by hardware once the operation is complete
0 = Program or erase operation is complete and inactive

bit 14 WREN: Write Enable bit ^(1)

1 = Enables program/erase operations
0 = Inhibits program/erase operations

bit 13 WRERR: Write Sequence Error Flag bit ^(1)

1 = An improper program or erase sequence attempt, or termination has occurred (bit is set automatically on any set attempt of the WR bit)
0 = The program or erase operation completed normally

bit 12 NVMSIDL: PRAM Stop in Idle Control bit ^(2)

1 = PRAM voltage regulator goes into Standby mode during Idle mode
0 = PRAM voltage regulator is active during Idle mode

bit 11 SFTSWP: Soft Swap Status bit

1 = Panels have been successfully swapped using the BOOTSWP instruction
0 = Awaiting for panels to be successfully swapped using the BOOTSWP instruction

bit 10 P2ACTIV: Dual Boot Active Region Status bit

1 = Panel 2 PRAM is mapped into the active region
0 = Panel 1 PRAM is mapped into the active region

bit 9 RPDF: Row Programming Data Format bit

1 = Row data to be stored in PRAM are in compressed format
0 = Row data to be stored in PRAM are in uncompressed format

bit 8 URERR: Row Programming Data Underrun Error bit

1 = Indicates row programming operation has been terminated
0 = No data underrun error is detected

bit 7-4 Unimplemented: Read as '0'

Note 1: These bits can only be reset on a POR.

2: If this bit is set, there will be minimal power savings (IIDLE) and upon exiting Idle mode, there is a delay (TVREG) before PRAM memory becomes operational.
3: All other combinations of NVMOP[3:0] are unimplemented.
4: Execution of the PWRSAV instruction is ignored while any of the NVM operations are in progress.
5: Two adjacent words on a 4-word boundary are programmed during execution of this operation.

REGISTER 4-5: NVMCON: PROGRAM MEMORY SECONDARY CONTROL REGISTER

bit 3-0 NVMOP[3:0]: NVM Operation Select bits (1,3,4)

1111 = Reserved

...

0101 = Reserved

0100 = Inactive Partition memory erase operation

0011 = Reserved

0010 = Reserved

0001 = Memory double-word program operation ^(5)

0000 = Reserved

Note 1: These bits can only be reset on a POR.

2: If this bit is set, there will be minimal power savings (IIDLE) and upon exiting Idle mode, there is a delay (TVREG) before PRAM memory becomes operational.
3: All other combinations of NVMOP[3:0] are unimplemented.
4: Execution of the PWRSAV instruction is ignored while any of the NVM operations are in progress.
5: Two adjacent words on a 4-word boundary are programmed during execution of this operation.

REGISTER 4-6: NVMADR: SECONDARY PROGRAM MEMORY LOWER ADDRESS REGISTER

R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x
NVMADR[15:8]
bit 15 bit 8
R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x
NVMADR[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 NVMADR[15:0]: PRAM Memory Lower Write Address bits

Selects the lower 16 bits of the location to program or erase in PRAM. This register may be read or written to by the user application.

REGISTER 4-7: NVMADRU: SECONDARY PROGRAM MEMORY UPPER ADDRESS REGISTER

R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x R/W-xR/W-x
NVMADRU[23:16]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-8 Unimplemented: Read as '0'

bit 7-0 NVMADRU[23:16]: PRAM Memory Upper Write Address bits

Selects the upper eight bits of the location to program or erase in PRAM. This register may be read or written to by the user application.

REGISTER 4-8: NVMKEY: SECONDARY NONVOLATILE MEMORY KEY REGISTER

U-0 U-0 U-0 U-0 U-0 U-0 U-0 U-0
——————
bit 15bit 8
W-0W-0W-0W-0W-0W-0W-0W-0
NVMKEY[7:0]
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-8 Unimplemented: Read as '0'

bit 7-0 NVMKEY[7:0]: NVM Key Register bits (write-only)

REGISTER 4-9: NVMSRCADRL: SECONDARY NVM SOURCE DATA ADDRESS REGISTER LOW

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
NVMSRCADR[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
NVMSRCADR[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 15-0 NVMSRCADR[15:0]: NVM Source Data Address bits

The RAM address of the data to be programmed into PRAM when the NVMOP[3:0] bits are set to row programming.

REGISTER 4-10: NVMSRCADRH: SECONDARY NVM SOURCE DATA ADDRESS REGISTER HIGH

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
NVMSRCADR[23:16]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 15-8 Unimplemented: Read as '0'

bit 7-0 NVMSRCADR[23:16]: NVM Source Data Address bits

The RAM address of the data to be programmed into PRAM when the NVMOP[3:0] bits are set to row programming.

4.3.8 SECONDARY ECC CONTROL/STATUS REGISTERS

REGISTER 4-11: ECCCONL: ECC FAULT INJECTION CONFIGURATION REGISTER LOW

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-1 Unimplemented: Read as '0'

bit 0 FLTINJ: Fault Injection Sequence Enable bit

1 = Enabled

0 = Disabled

REGISTER 4-12: ECCCONH: ECC FAULT INJECTION CONFIGURATION REGISTER HIGH

R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
FLT2PTR[7:0]
bit 15bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
FLT1PTR[7:0]
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 cleared x = Bit is unknown

bit 15-8 FLT2PTR[7:0]: ECC Fault Injection Bit Pointer 2 bits

11111111-10001001 = No Fault injection occurs

10001000 = Fault injection (bit inversion) occurs on bit 136 of ECC bit order

* * *

00000001 = Fault injection occurs on bit 1 of ECC bit order

00000000 = Fault injection occurs on bit 0 of ECC bit order

bit 7-0 FLT1PTR[7:0]: ECC Fault Injection Bit Pointer 1 bits

1111111-10001001 = No Fault injection occurs

10001000 = Fault injection (bit inversion) occurs on bit 136 of ECC bit order

...

00000001 = Fault injection (bit inversion) occurs on bit 1 of ECC bit order

00000000 = Fault injection (bit inversion) occurs on bit 0 of ECC bit order

REGISTER 4-13: ECCADDRL: ECC FAULT INJECT ADDRESS COMPARE REGISTER LOW

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
ECCADDR[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
ECCADDR[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-0 ECCADDR[15:0]: ECC Fault Injection NVM Address Match Compare bits

REGISTER 4-14: ECCADDRH: ECC FAULT INJECT ADDRESS COMPARE REGISTER HIGH

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
ECCADDR[31:24]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
ECCADDR[23:16]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-0 ECCADDR[31:16]: ECC Fault Injection NVM Address Match Compare bits

REGISTER 4-15: ECCSTATL: ECC SYSTEM STATUS DISPLAY REGISTER LOW

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
SECOUT[7:0]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
SECIN[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-8 SECOUT[7:0]: Calculated Single Error Correction Parity Value bits

Indicates the latches' SEC output parity bits, generated by the ECC XOR tree logic, based on the data portion of the word being read.

bit 7-0 SECIN[7:0]: Read Single Error Correction Parity Value bits

Indicates the latched value of input parity from a previous read address match.

REGISTER 4-16: ECCSTATH: ECC SYSTEM STATUS DISPLAY REGISTER HIGH

U-0U-0U-0U-0U-0U-0R/W-0R/W-0
DEDOUTDEDIN
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
SECSYND[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-10 Unimplemented: Read as '0'

bit 9 DEDOUT: Dual Bit Error Detection Flag bit

Indicates the latched value of the DED parity out from a previous read address match.

1 = Dual bit error has occurred

0 = No dual bit error has occurred

bit 8 DEDIN: Dual Bit Error Read Parity bit

1 = DED in parity is set

0 = DED in parity is not set

bit 7-0 SECSYND[7:0]: Calculated ECC Syndrome Value bits

4.4 Secondary Resets

Note 1: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive reference source. To complement the information in this data sheet, refer to "Reset" (www.microchip.com/DS70000602), which is available from the Microchip website (www.microchip.com).

The Reset module combines all Reset sources and controls the device Master Reset Signal, SYSRST. The following is a list of device Reset sources:

  • POR: Power-on Reset
    • BOR: Brown-out Reset
    • M C LMBster Clear Pin Reset
  • S W R : RESET Instruction
  • WDTO: Watchdog Timer Time-out Reset
    • CM: Configuration Mismatch Reset
    • TRAPR: Trap Conflict Reset
    • IOPUWR: Illegal Condition Device Reset
  • Illegal Opcode Reset
  • Uninitialized W Register Reset
  • Security Reset

A simplified block diagram of the Reset module is shown in Figure 4-13.

Any active source of Reset will make the SYSRST signal active. On system Reset, some of the registers associated with the CPU and peripherals are forced to a known Reset state, and some are unaffected.

Note: Refer to the specific peripheral section or Section 4.2 "Secondary Memory Organization" of this data sheet for register Reset states.

All types of device Reset set a corresponding status bit in the RCON register to indicate the type of Reset (see Register 4-17).

A POR clears all the bits, except for the BOR and POR bits (RCON[1:0]) that are set. The user application can set or clear any bit, at any time, during code execution. The RCON bits only serve as status bits. Setting a particular Reset status bit in software does not cause a device Reset to occur.

The RCON register also has other bits associated with the Watchdog Timer and device power-saving states. The function of these bits is discussed in other sections of this data sheet.

Note: The status bits in the RCON register should be cleared after they are read so that the next RCON register value after a device Reset is meaningful.

For all Resets, the default clock source is determined by the FNOSC[2:0] bits in the FOSCSEL Configuration register. The value of the FNOSCx bits is loaded into the NOSC[2:0] (OSCCON[10:8]) bits on Reset, which in turn, initializes the system clock.

FIGURE 4-13: RESET SYSTEM BLOCK DIAGRAM
Microchip dsPIC33CH64MP208 - Secondary Resets - 1

flowchart
graph TD
    A["MCLR, S1MCLR1, S1MCLR2, S1MCLR3"] --> B["RESET Instruction"]
    B --> C["Glitch Filter"]
    C --> D["AND Gate"]
    D --> E["Internal Regulator"]
    E --> F["VDD Rise Detect"]
    F --> G["POR"]
    G --> H["SYSRST"]
    I["WDT Module"] --> J["Sleep or Idle"]
    K["Trap Conflict"] --> L["Uninitialized W Register"]
    M["Illegal Opcode"] --> L
    N["Security Reset"] --> L
    O["Configuration Mismatch"] --> L
    P["BOR"] --> D

4.4.1 RESET RESOURCES

Many useful resources are provided on the main product page of the Microchip website for the devices listed in this data sheet. This product page contains the latest updates and additional information.

4.4.1.1 Key Resources

  • “Reset” (www.microchip.com/DS70000602)
  • Code Samples
  • Application Notes
  • Software Libraries
  • Webinars
  • All Related "dsPIC33/PIC24 Family Reference Manual" Sections
  • Development Tools

4.4.2 SECONDARY RESET CONTROL REGISTER

REGISTER 4-17: RCON: RESET CONTROL REGISTER (1)

R/W-0 R/W-0 U-0 U-0 U-0 R/W-0 R/W-0
TRAPR IOPUWRCMVREGS
bit 15 bit 8
R/W-0R/W-0U-0R/W-0R/W-0R/W-0R/W-1R/W-1
EXTR SWRWDTOSLEEPIDLEBORPOR
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15 TRAPR: Trap Reset Flag bit

1 = A Trap Conflict Reset has occurred
0 = A Trap Conflict Reset has not occurred

bit 14 IOPUWR: Illegal Opcode or Uninitialized W Register Access Reset Flag bit

1 = An Illegal Opcode, an Illegal Address mode or Uninitialized W Register used as an Address Pointer caused a Reset
0 = An Illegal Opcode or Uninitialized W Register Reset has not occurred

bit 13-10 Unimplemented: Read as '0'

bit 9 CM: Configuration Mismatch Flag bit

1 = A Configuration Mismatch Reset has occurred.
0 = A Configuration Mismatch Reset has not occurred

bit 8 VREGS: Voltage Regulator Standby During Sleep bit

1 = Voltage regulator is active during Sleep
0 = Voltage regulator goes into Standby mode during Sleep

bit 7 EXTR: External Reset (MCLR, S1MCLRx) Pin bit

1 = A Master Clear (pin) Reset has occurred
0 = A Master Clear (pin) Reset has not occurred

bit 6 SWR: Software RESET (Instruction) Flag bit

1 = A RESET instruction has been executed
0 = A RESET instruction has not been executed

bit 5 Unimplemented: Read as '0'

bit 4 WDTO: Watchdog Timer Time-out Flag bit

1 = WDT time-out has occurred
0 = WDT time-out has not occurred

bit 3 SLEEP: Wake-up from Sleep Flag bit

1 = Device has been in Sleep mode
0 = Device has not been in Sleep mode

bit 2 IDLE: Wake-up from Idle Flag bit

1 = Device has been in Idle mode
0 = Device has not been in Idle mode

bit 1 BOR: Brown-out Reset Flag bit

1 = A Brown-out Reset has occurred
0 = A Brown-out Reset has not occurred

Note 1: All of the Reset status bits can be set or cleared in software. Setting one of these bits in software does not cause a device Reset.

REGISTER 4-17: RCON: RESET CONTROL REGISTER (1) (CONTINUED)

bit 0 POR: Power-on Reset Flag bit

1 = A Power-on Reset has occurred
0 = A Power-on Reset has not occurred

Note 1: All of the Reset status bits can be set or cleared in software. Setting one of these bits in software does not cause a device Reset.

4.5 Secondary Interrupt Controller

Note 1: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive reference source. To complement the information in this data sheet, refer to “Interrupts” (www.microchip.com/DS70000600), which is available from the Microchip website (www.microchip.com).

The dsPIC33CH128MP508S1 family interrupt controller reduces the numerous peripheral interrupt request signals to a single interrupt request signal to the dsPIC33CH128MP508S1 family CPU.

The interrupt controller has the following features:

  • Six Processor Exceptions and Software Traps
  • Seven User-Selectable Priority Levels
  • Interrupt Vector Table (IVT) with a Unique Vector for each Interrupt or Exception Source
  • Fixed Priority within a Specified User Priority Level
    • Fixed Interrupt Entry and Return Latencies

Note: There is no Alternate Interrupt Vector Table (AIVT) for the Secondary.

4.5.1 INTERRUPT VECTOR TABLE

The dsPIC33CH128MP508S1 family Interrupt Vector Table (IVT), shown in Figure 4-14, resides in program memory, starting at location, 000004h. The IVT contains six non-maskable trap vectors and up to 246 sources of interrupts. In general, each interrupt source has its own vector. Each interrupt vector contains a 24-bit wide address. The value programmed into each interrupt vector location is the starting address of the associated Interrupt Service Routine (ISR).

Interrupt vectors are prioritized in terms of their natural priority. This priority is linked to their position in the vector table. Lower addresses generally have a higher natural priority. For example, the interrupt associated with Vector 0 takes priority over interrupts at any other vector address.

4.5.2 RESET SEQUENCE

A device Reset is not a true exception because the interrupt controller is not involved in the Reset process. The dsPIC33CH128MP508S1 family devices clear their registers in response to a Reset, which forces the PC to zero. The device then begins program execution at location, 0x000000. A GOTO instruction at the Reset address can redirect program execution to the appropriate start-up routine.

Note: Any unimplemented or unused vector locations in the IVT should be programmed with the address of a default interrupt handler routine that contains a RESET instruction.

FIGURE 4-14: dsPIC33CH128MP508S1 FAMILY INTERRUPT VECTOR TABLE
Microchip dsPIC33CH64MP208 - RESET SEQUENCE - 1

text_image Reset - GOTO Instruction 0x000000 Reset - GOTO Address 0x000002 Oscillator Fail Trap Vector 0x000004 Address Error Trap Vector 0x000006 Generic Hard Trap Vector 0x000008 Stack Error Trap Vector 0x00000A Math Error Trap Vector 0x00000C Reserved 0x00000E Generic Soft Trap Vector 0x000010 Reserved 0x000012 Interrupt Vector 0 0x000014 Interrupt Vector 1 0x000016 : : : Interrupt Vector 52 0x00007C Interrupt Vector 53 0x00007E Interrupt Vector 54 0x000080 : : : Interrupt Vector 116 0x0000FC Interrupt Vector 117 0x0000FE Interrupt Vector 118 0x000100 Interrupt Vector 119 0x000102 Interrupt Vector 120 0x000104 : : : Interrupt Vector 244 0x0001FC Interrupt Vector 245 0x0001FE START OF CODE 0x000200 See Table 4-21 for Interrupt Vector Details

Note: In Dual Partition modes, each partition has a dedicated Interrupt Vector Table.

TABLE 4-20: TRAP TABLE

Trap DescriptionMPLAB® XC16 Trap ISR NameVector #IVT AddressTrap Bit Location
Generic FlagSource FlagEnablePriority Level
Oscillator Failure Trap _OscillatorFail 0 0x000004 INTCON1[1]— —15
Address Error Trap _AddressError 1 0x000006 INTCON1[3]— —14
Generic Hard Trap – ECCDBE _HardTrapError20x000008INTCON4[1]13
Generic Hard Trap – SGHT _HardTrapError2 0x000008INTCON4[0]INTCON2[13]13
Stack Error Trap _StackError30x00000AINTCON1[2]— —12
Math Error Trap – OVAERR _MathError40x00000CINTCON1[4]INTCON1[14]INTCON1[10]11
Math Error Trap – OVBERR _MathError40x00000CINTCON1[4]INTCON1[13]INTCON1[9]11
Math Error Trap – COVAERR _MathError40x00000CINTCON1[4]INTCON1[12]INTCON1[8]11
Math Error Trap – COVBERR _MathError40x00000CINTCON1[4]INTCON1[11]INTCON1[8]11
Math Error Trap – SFTACERR _MathError40x00000CINTCON1[4]INTCON1[7]INTCON1[8]11
Math Error Trap – DIV0ERR _MathError40x00000CINTCON1[4]INTCON1[6]INTCON1[8]11
ReservedReserved50x00000E
Generic Soft Trap – CAN _SoftTrapError 6 0x0000010INTCON3[9]9
Generic Soft Trap – NAE _SoftTrapError 6 0x0000010INTCON3[8]9
Generic Soft Trap – CAN2 _SoftTrapError 6 0x000010INTCON3[6]9
Generic Soft Trap – DAE _SoftTrapError 6 0x000010INTCON3[5]9
Generic Soft Trap – DOOVR _SoftTrapError 6 0x000010INTCON3[4]9
Generic Soft Trap – APLL Lock _SoftTrapError 6 0x000010INTCON3[0]9
ReservedReserved70x000012

TABLE 4-21: SECONDARY INTERRUPT VECTOR DETAILS (1)

Interrupt DescriptionMPLAB® XC16ISR NameVector #IRQ #IVT AddressInterrupt Bit Location
Flag Enable Priority
External Interrupt 0_INT0Interrupt8 0 0x000014 IFS0[0]IEC0[0]IPC0[2:0]
Timer1_T1Interrupt 9 1 0x000016IFS0[1] IEC0[1] IPC0[6:4]
Change Notice Interrupt A_CNAInterrupt1020x000018IFS0[2]IEC0[2]IPC0[10:8]
Change Notice Interrupt B_CNBInterrupt1130x00001AIFS0[3]IEC0[3]IPC0[14:12]
DMA Channel 0_DMA0Interrupt1240x00001CIFS0[4]IEC0[4]IPC1[2:0]
ReservedReserved1350x00001E
Input Capture/Output Compare 1_CCP1Interrupt1460x000020IFS0[6]IEC0[6]IPC1[10:8]
CCP1 Timer_CCT1Interrupt1570x000022IFS0[7]IEC0[7]IPC1[14:12]
DMA Channel 1_DMA1Interrupt1680x000024IFS0[8]IEC0[8]IPC2[2:0]
SPI1 Receiver_SPI1RXInterrupt1790x000026IFS0[9]IEC0[9]IPC2[6:4]
SPI1 Transmitter_SPI1TXInterrupt18100x000028IFS0[10]IEC0[10]IPC2[10:8]
UART1 Receiver_U1RXInterrupt19110x00002AIFS0[11]IEC0[11]IPC2[14:12]
UART1 Transmitter_U1TXInterrupt20120x00002CIFS0[12]IEC0[12]IPC3[2:0]
ECC Single Bit Error_ECCSBEnterrupt21130x00002EIFS0[13]IEC0[13]IPC3[6:4]
NVM Write Complete_NVMInterrupt22140x000030IFS0[14]IEC0[14]IPC3[10:8]
External Interrupt 1_INT1Interrupt23150x000032IFS0[15]IEC0[15]IPC3[14:12]
I2C1 Secondary Event_SI2C1Interrupt24160x000034IFS1[0]IEC1[0]IPC4[2:0]
I2C1 Main Event_MI2C1Interrupt25170x000036IFS1[1]IEC1[1]IPC4[6:4]
ReservedReserved26180x000038
Change Notice Interrupt C_CNCInterrupt27190x00003AIFS1[3]IEC1[3]IPC4[14:12]
External Interrupt 2_INT2Interrupt28200x00003CIFS1[4]IEC1[4]IPC5[2:0]
ReservedReserved29-3021-220x00003E-0x000040
Input Capture/Output Compare 2_CCP2Interrupt31230x000042IFS1[7]IEC1[7]IPC5[14:12]
CCP2 Timer_CCT2Interrupt32240x000044IFS1[8]IEC1[8]IPC6[2:0]
ReservedReserved33250x000046IFS1[9]IEC1[9]IPC6[6:4]
External Interrupt 3_INT3Interrupt34260x000048IFS1[10]IEC1[10]IPC6[10:8]
ReservedReserved35-4227-340x00004A-0x000058
Input Capture/Output Compare 3_CCP3Interrupt43350x00005AIFS2[3]IEC2[3]IPC8[14:12]
CCP3 Timer_CCT3Interrupt44360x00005CIFS2[4]IEC2[4]IPC9[2:0]
ReservedReserved45-4737-390x00005E-0x000062
Input Capture/Output Compare 4_CCP4Interrupt48400x000064IFS2[8]IEC2[8]IPC10[2:0]
CCP4 Timer_CCT4Interrupt49410x000066IFS2[9]IEC2[9]IPC10[6:4]
ReservedReserved50-5542-470x000068-0x000072
QEI Position Counter Compare_QEI1Interrupt56480x000074IFS3[0]IEC3[0]IPC12[2:0]
UART1 Error_U1EInterrupt57490x000076IFS3[1]IEC3[1]IPC12[6:4]
ReservedReserved58-6850-600x000078-0x00008C
In-Circuit Debugger_ICDInterrupt69610x00008EIFS3[13]IEC3[13]IPC15[6:4]
ReservedReserved70-7162-630x000090-0x000092
I2C1 Bus Collision_I2C1BCInterrupt72640x000094IFS4[0]IEC4[0]IPC16[2:0]
ReservedReserved73-7465-660x000096-0x000098
PWM Generator 1_PWM1Interrupt75670x00009AIFS4[3]IEC4[3]IPC16[14:12]
PWM Generator 2_PWM2Interrupt76680x00009CIFS4[4]IEC4[4]IPC17[2:0]
PWM Generator 3_PWM3Interrupt77690x00009EIFS4[5]IEC4[5]IPC17[6:4]
PWM Generator 4_PWM4Interrupt78700x0000A0IFS4[6]IEC4[6]IPC17[10:8]
PWM Generator 5_PWM5Interrupt79710x0000A2IFS4[7]IEC4[7]IPC17[14:12]
PWM Generator 6_PWM6Interrupt80720x0000A4IFS4[8]IEC4[8]IPC18[2:0]
PWM Generator 7_PWM7Interrupt81730x0000A6IFS4[9]IEC4[9]IPC18[6:4]
PWM Generator 8 _PWM8Interrupt82 74 0x0000A8 IFS4[10] IEC4[10] IPC18[10:8]
Change Notice D_CNDInterrupt83750x0000AAIFS4[11]IEC4[11]IPC18[14:12]
Change Notice E_CNEInterrupt84760x0000ACIFS4[12]IEC4[12]IPC19[2:0]
ReservedReserved85770x0000AE
Secondary Comparator 1_CMP1Interrupt86780x0000B0IFS4[14]IEC4[14]IPC19[10:8]
Secondary Comparator 2_CMP2Interrupt87790x0000B2IFS4[15]IEC4[15]IPC19[14:12]
Secondary Comparator 3_CMP3Interrupt88800x0000B4IFS5[0]IEC5[0]IPC20[2:0]
ReservedReserved89810x0000B6
Main Core PTG Trigger 4_PTG4Interrupt90820x0000B8IFS5[2]IEC5[2]IPC20[10:8]
Main Core PTG Trigger 5_PTG5Interrupt91830x0000BAIFS5[3]IEC5[3]IPC20[14:12]
Main Core PTG Trigger 6_PTG6Interrupt92840x0000BCIFS5[4]IEC5[4]IPC21[2:0]
Main Core PTG Trigger 7_PTG7Interrupt93850x0000BEIFS5[5]IEC5[5]IPC21[6:4]
ReservedReserved94-9786-890x0000C0-0x0000C6
ADC Global Interrupt_ADCInterrupt98900x0000C8IFS5[10]IEC5[10]IPC22[10:8]
ADC AN0 Interrupt_ADCAN0Interrupt99910x0000CAIFS5[11]IEC5[11]IPC22[14:12]
ADC AN1 Interrupt_ADCAN1Interrupt100920x0000CCIFS5[12]IEC5[12]IPC23[2:0]
ADC AN2 Interrupt_ADCAN2Interrupt101930x0000CEIFS5[13]IEC5[13]IPC23[6:4]
ADC AN3 Interrupt_ADCAN3Interrupt102940x0000D0IFS5[14]IEC5[14]IPC23[10:8]
ADC AN4 Interrupt_ADCAN4Interrupt103950x0000D2IFS5[15]IEC5[15]IPC23[14:12]
ADC AN5 Interrupt_ADCAN5Interrupt104960x0000D4IFS6[0]IEC6[0]IPC24[2:0]
ADC AN6 Interrupt_ADCAN6Interrupt105970x0000D6IFS6[1]IEC6[1]IPC24[6:4]
ADC AN7 Interrupt_ADCAN7Interrupt106980x0000D8IFS6[2]IEC6[2]IPC24[10:8]
ADC AN8 Interrupt_ADCAN8Interrupt107990x0000DAIFS6[3]IEC6[3]IPC24[14:12]
ADC AN9 Interrupt_ADCAN9Interrupt1081000x0000DCIFS6[4]IEC6[4]IPC25[2:0]
ADC AN10 Interrupt_ADCAN10Interrupt1091010x0000DEIFS6[5]IEC6[5]IPC25[6:4]
ADC AN11 Interrupt_ADCAN11Interrupt1101020x0000E0IFS6[6]IEC6[6]IPC25[10:8]
ADC AN12 Interrupt_ADCAN12Interrupt1111030x0000E2IFS6[7]IEC6[7]IPC25[14:12]
ADC AN13 Interrupt_ADCAN13Interrupt1121040x0000E4IFS6[8]IEC6[8]IPC26[2:0]
ADC AN14 Interrupt_ADCAN14Interrupt1131050x0000E6IFS6[9]IEC6[9]IPC26[6:4]
ADC AN15 Interrupt_ADCAN15Interrupt1141060x0000E8IFS6[10]IEC6[10]IPC26[10:8]
ADC AN16 Interrupt_ADCAN16Interrupt1151070x0000EAIFS6[11]IEC6[11]IPC26[14:12]
ADC AN17 Interrupt_ADCAN17Interrupt1161080x0000ECIFS6[12]IEC6[12]IPC27[2:0]
ADC AN18 Interrupt_ADCAN18Interrupt1171090x0000EEIFS6[13]IEC6[13]IPC27[6:4]
ADC AN19 Interrupt_ADCAN19Interrupt1181100x0000F0IFS6[14]IEC6[14]IPC27[10:8]
ADC AN20 Interrupt_ADCAN20Interrupt1191110x0000F2IFS6[15]IEC6[15]IPC27[14:12]
ReservedReserved120-122112-1140x0000F4-0x0000F8
ADC Fault_ADFLTInterrupt1231150x0000FAIFS7[3]IEC7[3]IPC28[14:12]
ADC Digital Comparator 0_ADCMP0Interrupt1241160x0000FCIFS7[4]IEC7[4]IPC29[2:0]
ADC Digital Comparator 1_ADCMP1Interrupt1251170x0000FEIFS7[5]IEC7[5]IPC29[6:4]
ADC Digital Comparator 2_ADCMP2Interrupt1261180x000100IFS7[6]IEC7[6]IPC29[10:8]
ADC Digital Comparator 3_ADCMP3Interrupt1271190x000102IFS7[7]IEC7[7]IPC29[14:12]
ADC Oversample Filter 0_ADFLTR0Interrupt1281200x000104IFS7[8]IEC7[8]IPC30[2:0]
ADC Oversample Filter 1_ADFLTR1Interrupt1291210x000106IFS7[9]IEC7[9]IPC30[6:4]
ADC Oversample Filter 2_ADFLTR2Interrupt1301220x000108IFS7[10]IEC7[10]IPC30[10:8]
ADC Oversample Filter 3_ADFLTR3Interrupt1311230x00010AIFS7[11]IEC7[11]IPC30[14:12]
CLC1 Positive Edge_CLC1PInterrupt1321240x00010CIFS7[12]IEC7[12]IPC31[2:0]
CLC2 Positive EdgeSPI1 Error _SPI1GInterrupt 134 1_CLC2PInterrupt26 0x000110 IFS7[14]133IEC7[14]125IPC31[10:8]0x00010EIFS7[13]IEC7[13]IPC31[6:4]
ReservedReserved135-136127-1280x000112-0x000114
MSI Main Initiated Interrupt_MSIS1Interrupt1371290x000116IFS8[1]IEC8[1]IPC32[6:4]
MSIA - MSI Protocol A_MSIAInterrupt1381300x000118IFS8[2]IEC8[2]IPC32[10:8]
MSIB - MSI Protocol B_MSIBInterrupt1391310x00011AIFS8[3]IEC8[3]IPC32[14:12]
MSIC - MSI Protocol C_MSICInterrupt1401320x00011CIFS8[4]IEC8[4]IPC33[2:0]
MSID - MSI Protocol D_MSIDInterrupt1411330x00011EIFS8[5]IEC8[5]IPC33[6:4]
MSIE - MSI Protocol E_MSIEInterrupt1421340x000120IFS8[6]IEC8[6]IPC33[10:8]
MSIF - MSI Protocol F_MSIFInterrupt1431350x000122IFS8[7]IEC8[7]IPC33[14:12]
MSIG - MSI Protocol G_MSIGInterrupt1441360x000124IFS8[8]IEC8[8]IPC34[2:0]
MSIH - MSI Protocol H_MSIHInterrupt1451370x000126IFS8[9]IEC8[9]IPC34[6:4]
MSI Secondary Read FIFO Data Ready_MSIDInterrupt1461380x000128IFS8[10]IEC8[10]IPC34[10:8]
MSI Secondary Write FIFO Empty_MSIWFEInterrupt1471390x00012AIFS8[11]IEC8[11]IPC34[14:12]
Read or Write FIFO Fault (Over/Underflow)_MSIFLTInterrupt1481400x00012CIFS8[12]IEC8[12]IPC35[2:0]
MSI Secondary Reset_MSTSRSTInterrupt1491410x00012EIFS8[13]IEC8[13]IPC35[6:4]
ReservedReserved150-152142-1440x000130-0x000136
Main Core Break_MSTBRKInterrupt1531450x000138IFS9[1]IEC9[1]IPC36[6:4]
ReservedReserved154-163146-1550x00013A-0x00014C
Main Core Clock Fail_MCLKFInterrupt1641560x00014EIFS9[12]IEC9[12]IPC39[2:0]
ReservedReserved165-175157-1670x000150-0x000162
ADC FIFO Ready_ADFIFOInterrupt1761680x000164IFS10[8]IEC10[8]IPC42[2:0]
PWM Event A_PEVTALntrupt1771690x000166IFS10[9]IEC10[9]IPC42[6:4]
PWM Event B_PEVTBInterrupt1781700x000168IFS10[10]IEC10[10]IPC42[10:8]
PWM Event C_PEVTCInterrupt1791710x00016AIFS10[11]IEC10[11]IPC42[14:12]
PWM Event D_PEVTDInterrupt1801720x00016CIFS10[12]IEC10[12]IPC43[2:0]
PWM Event E_PEVTEInterrupt1811730x00016EIFS10[13]IEC10[13]IPC43[6:4]
PWM Event F_PEVTFInterrupt1821740x000170IFS10[14]IEC10[14]IPC43[10:8]
CLC3 Positive Edge_CLC3PInterrupt1831750x000172IFS10[15]IEC10[15]IPC43[14:12]
CLC4 Positive Edge_CLC4PInterrupt1841760x000174IFS11[0]IEC11[0]IPC44[2:0]
CLC1 Negative Edge_CLC1NInterrupt1851770x000176IFS11[1]IEC11[1]IPC44[6:4]
CLC2 Negative Edge_CLC2NInterrupt1861780x000178IFS11[2]IEC11[2]IPC44[10:8]
CLC3 Negative Edge_CLC3NInterrupt1871790x00017AIFS11[3]IEC11[3]IPC44[14:]
CLC4 Negative Edge_CLC4NInterrupt1881800x00017CIFS11[4]IEC11[4]IPC45[2:0]
ReservedReserved189-196181-1880x0017E- 0x0018C
UART1 Event_U1EVTInterrupt1971890x00018EIFS11[13]IEC11[13]IPC47[6:4]

Note 1: Not all interrupts are available on all packages. Make sure the selected device variant has the interrupt available on the device.

TABLE 4-22: SECONDARY INTERRUPT FLAG REGISTERS

RegisterBit 15 Bit 14Bit 13 Bit 12Bit 11 Bit 10Bit 9 Bit 8 Bit 7Bit 6 Bit 5 Bit 4Bit 3 Bit 2Bit 1 Bit 0
IFS0INT1IFNVMIFECCSBEIFU1TXIFU1RXIFSPI1TXIFSPI1RXIFDMA1IFCCT1IFCCP1IFDMA0IFCNBIFCNAIFT1IFINT0IF
IFS1INT3IFCCT2IFCCP2IFINT2IFCNCIFMI2C1IFSI2C1IF
IFS2CCT4IFCCP4IFCCT3IFCCP3IF
IFS3ICDIFU1EIFQE11IF
IFS4 CMP2IF CMP1IFCNEIFCNDIFPWM8IFPWM7IFPWM6IFPWM5IFPWM4IFPWM3IFPWM2IFPWM1IFI2C1BCIF
IFS5ADCAN4IFADCAN3IFADCAN2IFADCAN1IFADCAN0IFADCIFPTG7IFPTG6IFPTG5IFPTG4IFCMP3IF
IFS6ADCAN20IFADCAN19IFADCAN18IFADCAN17IFADCAN16IFADCAN15IFADCAN14IFADCAN13IFADCAN12IFADCAN11IFADCAN10IFADCAN9IFADCAN8IFADCAN7IFADCAN6IFADCAN5IF
IFS7SPI1IFCLC2PIFCLC1PIFADFLTR3IFADFLTR2IFADFLTR1IFADFLTR0IFADCMP3IFADCMP2IFADCMP1IFADCMP0IFADFLTIF
IFS8MSIMRSTIFMSIFLTIFMSIWFEIFMSIDTIFMSIHIFMSIGIFMSIFIFMSIEIFMSIDIFMSICIFMSIBIFMSIAIFMSIMIF
IFS9MCLKFIFMSTBRKIF
IFS10CLC3PIFPEVTFIFPEVTEIFPEVTDIFPEVTCIFPEVTBIFPEVTAIFADFIFOIF
IFS11U1EVTIFCLC4NIFCLC3NIFCLC2NIFCLC1NIFCLC4PIF

TABLE 4-23: SECONDARY INTERRUPT ENABLE REGISTERS

RegisterBit 15Bit 14Bit 13Bit 12Bit 11Bit 10Bit 9Bit 8Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
IEC0INT1IENVMIEECCSBEIEU1TXIEU1RXIESPI1TXIESPI1RXIEDMA1IECCT1IECCP1IEDMA0IECNBIECNAIET1IEINT0IE
IEC1INT3IECCT2IECCP2IEINT2IECNCIEMI2C1IESI2C1IE
IEC2CCT4IECCP4IECCT3IECCP3IE
IEC3ICDIEU1EIEQE1IIE
IEC4 CMP2IE CMP1IECNEIECNDIEPWM8IEPWM7IEPWM6IEPWM5IEPWM4IEPWM3IEPWM2IEPWM1IEI2C1BCIE
IEC5ADCAN4IEADCAN3IEADCAN2IEADCAN1IEADCAN0IEADCIEPTG7IEPTG6IEPTG5IEPTG4IECMP3IE
IEC6ADCAN20IEADCAN19IEADCAN18IEADCAN17IEADCAN16IEADCAN15IEADCAN14IEADCAN13IEADCAN12IEADCAN11IEADCAN10IEADCAN9IEADCAN8IEADCAN7IEADCAN6IEADCAN5IE
IEC7SP1IECLC2PIECLC1PIEADFLTR3IEADFLTR2IEADFLTR1IEADFLTR0IEADCMP3IEADCMP2IEADCMP1IEADCMP0IEADFLTIE
IEC8MSIMRSTIEMSIFLTIEMSIWFEIEMSIDTIEMSIHIEMSIGIEMSIFIEMSIEIEMSIDIEMSICIEMSIBIEMSIAIEMSIMIF
IEC9MCLKFIEMSTBRKIE
IEC10CLC3PIEPEVTFIEPEVTEIEPEVTDIEPEVTCIEPEVTBIEPEVTAIEADFIFOIE
IEC11U1EVTIECLC4NIECLC3NIECLC2NIECLC1NIECLC4PIE

TABLE 4-24: SECONDARY INTERRUPT PRIORITY REGISTERS

RegisterBit 15Bit 14Bit 13Bit 12Bit 11Bit 10Bit 9Bit 8Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
IPC0CNBIP2CNBIP1CNBIP0CNAIP2CNAIP1CNAIP0T1IP2T1IP1T1IP0INT0IP2INT0IP1INT0IP0
IPC1CCT1IP2CCT1IP1CCT1IP0CCP1IP2CCP1IP1CCP1IP0DMA0IP2DMA0IP1DMA0IP0
IPC2U1RXIP2U1RXIP1U1RXIP0SPI1TXIP2SPI1TXIP1SPI1TXIP0SPI1RXIP2SPI1RXIP1SPI1RXIP0DMA1IP2DMA1IP1DMA1IP0
IPC3INT1IP2INT1IP1INT1IP0NVMIP2NVMIP1NVMIP0ECCSBEIP2ECCSBEIP1ECCSBEIP0U1TXIP2U1TXIP1U1TXIP0
IPC4CNCIP2CNCIP1CNCIP0MI2C1IP2MI2C1IP1MI2C1IP0SI2C1IP2SI2C1IP1SI2C1IP0
IPC5CCP2IP2CCP2IP1CCP2IP0INT2IP2INT2IP1INT2IP0
IPC6INT3IP2INT3IP1INT3IP0CCT2IP2CCT2IP1CCT2IP0
IPC7
IPC8CCP3IP2CCP3IP1CCP3IP0
IPC9CCT3IP2CCT3IP1CCT3IP0
IPC10CCT4IP2CCT4IP1CCT4IP0CCP4IP2CCP4IP1CCP4IP0
IPC11
IPC12U1EIP2U1EIP1U1EIP0QE11IP2QE11IP1QE11IP0
IPC13
IPC14
IPC15JTAGIP2JTAGIP1JTAGIP0ICDIP2ICDIP1ICDIP0
IPC16PWM1IP2PWM1IP1PWM1IP0I2C1BCIP2I2C1BCIP1I2C1BCIP0
IPC17PWM5IP2PWM5IP1PWM5IP0PWM4IP2PWM4IP1PWM4IP0PWM3IP2PWM3IP1PWM3IP0PWM2IP2PWM2IP1PWM2IP0
IPC18CNDIP2CNDIP1CNDIP0PWM8IP2PWM8IP1PWM8IP0PWM7IP2PWM7IP1PWM7IP0PWM6IP2PWM6IP1PWM6IP0
IPC19CMP2IP2CMP2IP1CMP2IP0CMP1IP2CMP1IP1CMP1IP0CNEIP2CNEIP1CNEIP0
IPC20PTG5IP2PTG5IP1PTG5IP0PTG4IP2PTG4IP1PTG4IP0CMP3IP2CMP3IP1CMP3IP0
IPC21PTG7IP2PTG7IP1PTG7IP0PTG6IP2PTG6IP1PTG6IP0
IPC22ADCAN0IP2ADCAN0IP1ADCAN0IP0ADCIP2ADCIP1ADCIP
IPC23ADCAN4IP2ADCAN4IP1ADCAN4IP0ADCAN3IP2ADCAN3IP1ADCAN3IP0ADCAN2IP2ADCAN2IP1ADCAN2IP0ADCAN1IP2ADCAN1IP1ADCAN1IP0
IPC24ADCAN8IP2ADCAN8IP1ADCAN8IP0ADCAN7IP2ADCAN7IP1ADCAN7IP0ADCAN6IP2ADCAN6IP1ADCAN6IP0ADCAN5IP2ADCAN5IP1ADCAN5IP0
IPC25ADCAN12IP2ADCAN12IP1ADCAN12IP0ADCAN11IP2ADCAN11IP1ADCAN11IP0ADCAN10IP2ADCAN10IP1ADCAN10IP0ADCAN9IP2ADCAN9IP1ADCAN9IP0
IPC26ADCAN16IP2ADCAN16IP1ADCAN16IP0ADCAN15IP2ADCAN15IP1ADCAN15IP0ADCAN14IP2ADCAN14IP1ADCAN14IP0ADCAN13IP2ADCAN13IP1ADCAN13IP0
IPC27ADCAN20IP2ADCAN20IP1ADCAN20IP0ADCAN19IP2ADCAN19IP1ADCAN19IP0ADCAN18IP2ADCAN18IP1ADCAN18IP0ADCAN17IP2ADCAN17IP1ADCAN17IP0
IPC28ADFLTIP2ADFLTIP1ADFLTIP0ADCAN21IP2ADCAN21IP1ADCAN21IP0
IPC29ADCMP3IP2ADCMP3IP1ADCMP3IP0ADCMP2IP2ADCMP2IP1ADCMP2IP0ADCMP1IP2ADCMP1IP1ADCMP1IP0ADCMP0IP2ADCMP0IP1ADCMP0IP0
IPC30ADFLTR3IP2ADFLTR3IP1ADFLTR3IP0ADFLTR2IP2ADFLTR2IP1ADFLTR2IP0ADFLTR1IP2ADFLTR1IP1ADFLTR1IP0ADFLTR0IP2ADFLTR0IP1ADFLTR0IP0
IPC31SPI1IP2SPI1IP1SPI1IP0CLC2PEIP2CLC2PEIP1CLC2PEIP0CLC1PEIP2CLC1PEIP1CLC1PEIP0
IPC32MSIBIP2MSIBIP1MSIBIP0MSIAIP2MSIAIP1MSIAIP0MSMIP2MSMIP1MSMIP0
IPC33MSIFIP2MSIFIP1MSIFIP0MSIEIP2MSIEIP1MSIEIP0MSIDIP2MSIDIP1MSIDIP0MSICIP2MSICIP1MSICIP0
IPC34MSIWFEIP2MSIWFEIP1MSIWFEIP0MSIDTIP2MSIDTIP1MSIDTIP0MSIHP2MSIHP1MSIHP0MSIGIP2MSIGIP1MSIGIP0
IPC35MSIMRSTIP2MSIMRSTIP1MSIMRSTIP0MSIFLTIP2MSIFLTIP1MSIFLTIP0
IPC36 —— — —— — —MSTBRKIP2 MSTBRKIP1 MSTBRKIP0 — —— —
IPC37 —— — —— — —— — —
IPC38 —— — —— — —— — —
IPC39MCLKFIP2MCLKFIP1MCLKFIP0
IPC40ADC1IP2ADC1IP1ADC1IP0ADC0IP2ADC0IP1ADC0IP0
IPC41 —— — —— — —— — —
IPC42PEVTCIP2PEVTCIP1PEVTCIP0PEVTBIP2PEVTBIP1PEVTBIP0PEVTAIP2PEVTAIP1PEVTAIP0ADFIFOIP2ADFIFOIP1ADFIFOIP0
IPC43CLC3PIP2CLC3PIP1CLC3PIP0PEVTFIP2PEVTFIP1PEVTFIP0PEVTEIP2PEVTEIP1PEVTEIP0PEVTDIP2PEVTDIP1PEVTDIP0
IPC44CLC3NIP2CLC3NIP1CLC3NIP0CLC2NIP2CLC2NIP1CLC2NIP0CLC1NIP2CLC1NIP1CLC1NIP0CLC4PIP2CLC4PIP1CLC4PIP0
IPC45CLC4NIP2CLC4NIP1CLC4NIP0
IPC46 —— — —— — —— — —
IPC47U1EVTIP2U1EVTIP1U1EVTIP0

4.5.3 INTERRUPT RESOURCES

Many useful resources are provided on the main product page of the Microchip website for the devices listed in this data sheet. This product page contains the latest updates and additional information.

4.5.3.1 Key Resources

  • "Interrupts" (www.microchip.com/DS70000600)
  • Code Samples
  • Application Notes
  • Software Libraries
  • Webinars
  • All Related "dsPIC33/PIC24 Family Reference Manual" Sections
    • Development Tools

4.5.4 INTERRUPT CONTROL AND STATUS REGISTERS

The dsPIC33CH128MP508S1 family devices implement the following registers for the interrupt controller:

  • INTCON1
  • INTCON2
  • INTCON3
  • INTCON4

• INT TREG

4.5.4.1 INTCON1 through INTCON4

Global interrupt control functions are controlled from INTCON1, INTCON2, INTCON3 and INTCON4.

INTCON1 contains the Interrupt Nesting Disable bit (NSTDIS), as well as the control and status flags for the processor trap sources.

The INTCON2 register controls external interrupt request signal behavior and contains the Global Interrupt Enable bit (GIE).

INTCON3 contains the status flags for the Auxiliary PLL and DO stack overflow status trap sources.

The INTCON4 register contains the Software Generated Hard Trap Status bit (SGHT).

4.5.4.2 IFSx

The IFSx registers maintain all of the interrupt request flags. Each source of interrupt has a status bit, which is set by the respective peripherals or external signal and is cleared via software.

4.5.4.3 IECx

The IECx registers maintain all of the interrupt enable bits. These control bits are used to individually enable interrupts from the peripherals or external signals.

4.5.4.4 IPCx

The IPCx registers are used to set the Interrupt Priority Level (IPL) for each source of interrupt. Each user interrupt source can be assigned to one of seven priority levels.

4.5.5 INTTREG

The INTTREG register contains the associated interrupt vector number and the new CPU Interrupt Priority Level, which are latched into the Vector Number (VECNUM[7:0]) and Interrupt Level bits (ILR[3:0]) fields in the INTTREG register. The new Interrupt Priority Level is the priority of the pending interrupt.

The interrupt sources are assigned to the IFSx, IECx and IPCx registers in the same sequence as they are listed in Table 4-21. For example, INT0 (External Interrupt 0) is shown as having Vector Number 8 and a natural order priority of 0. Thus, the INT0IF bit is found in IFS0[0], the INT0IE bit in IEC0[0] and the INT0IP[2:0] bits in the first position of IPC0 (IPC0[2:0]).

4.5.6 STATUS/CONTROL REGISTERS

Although these registers are not specifically part of the interrupt control hardware, two of the CPU Control registers contain bits that control interrupt functionality. For more information on these registers, refer to "Enhanced CPU" (www.microchip.com/DS70005158).

  • The CPU STATUS Register, SR, contains the IPL[2:0] bits (SR[7:5]). These bits indicate the current CPU Interrupt Priority Level. The user software can change the current CPU Interrupt Priority Level by writing to the IPLx bits.
  • The CORCON register contains the IPL3 bit which, together with IPL[2:0], also indicates the current CPU priority level. IPL3 is a read-only bit so that trap events cannot be masked by the user software.

All Interrupt registers are described in Register 4-20 through Register 4-24 on the following pages.

4.5.7 CROSS CORE INTERRUPTS

There are three interrupts that can occur in the Secondary core based on the Main events:

  • MSIMRSTIF is a Main Reset interrupt which gets set in the Secondary if the Main gets a Reset. This interrupt is enabled only when the MRTSIE bit (SI1CON[7]) is set
  • MCLKIF is a Secondary interrupt which gets set if the Main core loses its system clock.
  • MSTBRKIF is the Main Core Break interrupt. This interrupt gets set in the Secondary if the Main core stops at a breakpoint (valid only when the Main is being debugged).

4.5.8 SECONDARY INTERRUPT CONTROL/STATUS REGISTERS

REGISTER 4-18: SR: CPU STATUS REGISTER (1)

R/W-0 R/W-0 R/W-0 R/W-0 R/C-0 R/C-0 R-0 R/W-0
OAOBSASBOABSABDADC
bit 15 bit 8
R/W-0^(3) R/W-0^(3) R/W-0^(3) R-0 R/W-0R/W-0 R/W-0 R/W-0
IPL2^(2) IPL1^(2) IPL0^(2) RANOVZC
bit 7 bit 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 7-5 IPL[2:0]: CPU Interrupt Priority Level Status bits ^(2,3)

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)

Note 1: For complete register details, see Register 4-1.

2: The IPL[2:0] bits are concatenated with the IPL[3] bit (CORCON[3]) to form the CPU Interrupt Priority Level. The value in parentheses indicates the IPL, if IPL[3] = 1. User interrupts are disabled when IPL[3] = 1.
3: The IPL[2:0] Status bits are read-only when the NSTDIS bit (INTCON1[15]) = 1.

REGISTER 4-19: CORCON: SECONDARY CORE CONTROL REGISTER (1)

R/W-0 U-0 R/W-0 R/W-0 R/W-0 R-0 R-0 R-0
VARUS1US0EDTDL2DL1DL0
bit 15 bit 8
R/W-0R/W-0R/W-1R/W-0R/C-0R-0R/W-0R/W-0
SATASATBSATDWACCSAT IPL3^(2) SFARNDIF
bit 7 bit 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 15 VAR: Variable Exception Processing Latency Control bit

1 = Variable exception processing is enabled
0 = Fixed exception processing is enabled

bit 3 IPL3: CPU Interrupt Priority Level Status bit 3 (2)

1 = CPU Interrupt Priority Level is greater than 7
0 = CPU Interrupt Priority Level is 7 or less

Note 1: For complete register details, see Register 4-2.

2: The IPL3 bit is concatenated with the IPL[2:0] bits (SR[7:5]) to form the CPU Interrupt Priority Level.

REGISTER 4-20: INTCON1: SECONDARY INTERRUPT CONTROL REGISTER 1

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
NSTDISOVAERROVBERRCOVAERRCOVBERROVATEOVBTECOVTE
bit 15 bit 8
R/W-0R/W-0U-0R/W-0R/W-0R/W-0R/W-0U-0
SFTACERRDIV0ERRMATHERRADDRERRSTKERROSCFAIL
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15 NSTDIS: Interrupt Nesting Disable bit

1 = Interrupt nesting is disabled

0 = Interrupt nesting is enabled

bit 14 OVAERR: Accumulator A Overflow Trap Flag bit

1 = Trap was caused by overflow of Accumulator A

0 = Trap was not caused by overflow of Accumulator A

bit 13 OVBERR: Accumulator B Overflow Trap Flag bit

1 = Trap was caused by overflow of Accumulator B

0 = Trap was not caused by overflow of Accumulator B

bit 12 COVAERR: Accumulator A Catastrophic Overflow Trap Flag bit

1 = Trap was caused by catastrophic overflow of Accumulator A

0 = Trap was not caused by catastrophic overflow of Accumulator A

bit 11 COVBERR: Accumulator B Catastrophic Overflow Trap Flag bit

1 = Trap was caused by catastrophic overflow of Accumulator B

0 = Trap was not caused by catastrophic overflow of Accumulator B

bit 10 OVATE: Accumulator A Overflow Trap Enable bit

1 = Trap overflow of Accumulator A

0 = Trap is disabled

bit 9 OVBTE: Accumulator B Overflow Trap Enable bit

1 = Trap overflow of Accumulator B

0 = Trap is disabled

bit 8 COVTE: Catastrophic Overflow Trap Enable bit

1 = Trap on catastrophic overflow of Accumulator A or B is enabled

0 = Trap is disabled

bit 7 SFTACERR: Shift Accumulator Error Status bit

1 = Math error trap was caused by an invalid accumulator shift

0 = Math error trap was not caused by an invalid accumulator shift

bit 6 DIV0ERR: Divide-by-Zero Error Status bit

1 = Math error trap was caused by a divide-by-zero

0 = Math error trap was not caused by a divide-by-zero

bit 5 Unimplemented: Read as '0'

bit 4 MATHERR: Math Error Status bit

1 = Math error trap has occurred

0 = Math error trap has not occurred

bit 3 ADDRERR: Address Error Trap Status bit

1 = Address error trap has occurred

0 = Address error trap has not occurred

REGISTER 4-20: INTCON1: SECONDARY INTERRUPT CONTROL REGISTER 1 (CONTINUED)

bit 2 STKERR: Stack Error Trap Status bit

1 = Stack error trap has occurred
0 = Stack error trap has not occurred

bit 1 OSCFAIL: Oscillator Failure Trap Status bit

1 = Oscillator failure trap has occurred
0 = Oscillator failure trap has not occurred

bit 0 Unimplemented: Read as '0'

REGISTER 4-21: INTCON2: SECONDARY INTERRUPT CONTROL REGISTER 2

R/W-1 R/W-0 R/W-0 U-0 U-0 U-0 U-0 U-0
GIE DISI $WTRAP— —
bit 15 bit 8
U-0U-0U-0U-0R/W-0R/W-0R/W-0R/W-0
INT3EPINT2EPINT1EPINT0EP
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15 GIE: Global Interrupt Enable bit

1 = Interrupts and associated IE bits are enabled

0 = Interrupts are disabled, but traps are still enabled

bit 14 DISI: DISI Instruction Status bit

1 = DISI instruction is active

0 = DISI instruction is not active

bit 13 SWTRAP: Software Trap Status bit

1 = Software trap is enabled

0 = Software trap is disabled

bit 12-4 Unimplemented: Read as '0'

bit 3 INT3EP: External Interrupt 3 Edge Detect Polarity Select bit

1 = Interrupt on negative edge

0 = Interrupt on positive edge

bit 2 INT2EP: External Interrupt 2 Edge Detect Polarity Select bit

1 = Interrupt on negative edge

0 = Interrupt on positive edge

bit 1 INT1EP: External Interrupt 1 Edge Detect Polarity Select bit

1 = Interrupt on negative edge

0 = Interrupt on positive edge

bit 0 INT0EP: External Interrupt 0 Edge Detect Polarity Select bit

1 = Interrupt on negative edge

0 = Interrupt on positive edge

REGISTER 4-22: INTCON3: SECONDARY INTERRUPT CONTROL REGISTER 3

U-0 U-0 U-0 U-0 U-0 U-0 R/W-0
NAE
bit 15 bit 8
U-0 U-0R/W-0R/W-0U-0 U-0U-0 R/W-0
DAEDOOVRAPLL
bit 7 bit 0
Legend:
R = Readable bitW = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown

bit 15-9 Unimplemented: Read as '0'

bit 8 NAE: NVM Address Error Soft Trap Status bit

1 = NVM address error soft trap has occurred

0 = NVM address error soft trap has not occurred

bit 7-6 Unimplemented: Read as '0'

bit 5 DAE: DMA Address Error (Soft) Trap Status bit

1 = DMA address error trap has occurred

0 = DMA address error trap has not occurred

bit 4 DOOVR: DO Stack Overflow Soft Trap Status bit

1 = DO stack overflow soft trap has occurred

0 = DO stack overflow soft trap has not occurred

bit 3-1 Unimplemented: Read as '0'

bit 0 APLL: Auxiliary PLL Loss of Lock Soft Trap Status bit

1 = APLL lock soft trap has occurred

0 = APLL lock soft trap has not occurred

REGISTER 4-23: INTCON4: SECONDARY INTERRUPT CONTROL REGISTER 4

Legend:
R = Readable bitW = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 15-1 Unimplemented: Read as '0'

bit 0 SGHT: Software Generated Hard Trap Status bit

1 = Software generated hard trap has occurred

0 = Software generated hard trap has not occurred

REGISTER 4-24: INTTREG: SECONDARY INTERRUPT CONTROL AND STATUS REGISTER

U-0 U-0 R-0 U-0 R-0 R-0 R-0 R-0
VHOLDILR3ILR2ILR1ILR0
bit 15 bit 8
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
VECNUM[7:0]
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 cleared x = Bit is unknown

bit 15-14 Unimplemented: Read as '0'

bit 13 VHOLD: Vector Number Capture Enable bit

1 = VECNUM[7:0] bits read current value of vector number encoding tree (i.e., highest priority pending interrupt) 0 = Vector number latched into VECNUM[7:0] at Interrupt Acknowledge and retained until next IACK

bit 12 Unimplemented: Read as '0'

bit 11-8 ILR[3:0]: New CPU Interrupt Priority Level bits

1111 = CPU Interrupt Priority Level is 15

• • •

0001 = CPU Interrupt Priority Level is 1

0000 = CPU Interrupt Priority Level is 0

bit 7-0 VECNUM[7:0]: Vector Number of Pending Interrupt bits

11111111 = 255, Reserved; do not use

...

00001001 = 9, IC1 - Input Capture 1

00001000 = 8, INT0 - External Interrupt 0

00000111 = 7, Reserved; do not use

00000110 = 6, Generic soft error trap

00000101 = 5, Reserved; do not use

00000100 = 4, Math error trap

00000011 = 3, Stack error trap

00000010 = 2, Generic hard trap

00000001 = 1, Address error trap

00000000 = 0, Oscillator fail trap

4.6 Secondary I/O Ports

Note 1: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive reference source. To complement the information in this data sheet, refer to "I/O Ports with Edge Detect" (www.microchip.com/DS70005322), which is available from the Microchip website (www.microchip.com).
2: The I/O ports are shared by the Main core and Secondary core. All input goes to both the Main and Secondary. The I/O ownership is defined by the Configuration bits.
3: The TMS pin function may be active multiple times during ICSP device erase, programming and debugging. When the TMS function is active, the integrated pull-up resistor will pull the pin to VDD. Proper care should be taken if there are sensitive circuits connected on the TMS pin during programming/erase and debugging.

Many of the device pins are shared among the peripherals and the Parallel I/O ports. All I/O input ports feature Schmitt Trigger inputs for improved noise immunity. The Main and the Secondary have the same number of I/O ports and are shared. The Main PORT registers are located in the Main SFR and the Secondary PORT registers are located in the Secondary SFR, respectively.

All of the input goes to both Main and Secondary. For example, a high in RA0 can be read as high on both Main and Secondary as long as the TRISA0 bit is maintained as an input of both Main and Secondary. The ownership of the output functionality is assigned by the Configuration registers, FCFGPRA0 to FCFGPRE0. Setting the bits in the FCFGPRA0 to FCFGPRE0 registers assigns ownership to the Main or Secondary pin.

4.6.1 PARALLEL I/O (PIO) PORTS

Generally, a Parallel I/O port that shares a pin with a peripheral is subservient to the peripheral. The peripheral's 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 pin. The logic also prevents "loop through", in which a port's digital output can drive the input of a peripheral that shares the same pin. Figure 4-15 illustrates how ports are shared with other peripherals and the associated I/O pin to which they are connected.

When a peripheral is enabled and the peripheral is actively driving an associated pin, the use of the pin as a general purpose output pin is disabled. The I/O pin can be read, but the output driver for the parallel port bit is disabled. If a peripheral is enabled, but the peripheral is not actively driving a pin, that pin can be driven by a port.

All port pins have twelve registers directly associated with their operation as digital I/Os. The Data Direction register (TRISx) determines whether the pin is an input or an output. If the data direction bit is a '1', then the pin is an input.

All port pins are defined as inputs after a Reset. Reads from the latch (LATx), read the latch. Writes to the latch, write the latch. Reads from the port (PORTx), read the port pins, while writes to the port pins, write the latch. Any bit and its associated data and control registers that are not valid for a particular device are disabled. This means the corresponding LATx and TRISx registers, and the port pin are read as zeros.

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. Table4-25 shows the pin availability. Table 3-29 shows the 5V input tolerant pins across this device.

TABLE 4-25: PIN AND ANSELx AVAILABILITY

Device Rx15 Rx14 Rx113 Rx12Rx11Rx10Rx9 Rx8Rx7Rx6 Rx5Rx4Rx3Rx2 Rx1 Rx0
PORTA
dsPIC33XXXMP508/208XXXXX
dsPIC33XXXMP506/206XXXXX
dsPIC33XXXMP505/205XXXXX
dsPIC33XXXMP503/203XXXXX
dsPIC33XXXMP502/202XXXXX
ANSELAXXXX
PORTB
dsPIC33XXXMP508/208XXXXXXXXXXXXXXXX
dsPIC33XXXMP506/206XXXXXXXXXXXXXXXX
dsPIC33XXXMP505/205XXXXXXXXXXXXXXXX
dsPIC33XXXMP503/203XXXXXXXXXXXXXXXX
dsPIC33XXXMP502/202XXXXXXXXXXXXXXXX
ANSELBXXXXXXX
PORTC
dsPIC33XXXMP508/208XXXXXXXXXXXXXXXX
dsPIC33XXXMP506/206XXXXXXXXXXXXXXX
dsPIC33XXXMP505/205XXXXXXXXXXXXXX
dsPIC33XXXMP503/203XXXXXX
dsPIC33XXXMP502/202
ANSELCXXXXXX
PORTD
dsPIC33XXXMP508/208XXXXXXXXXXXXXXXX
dsPIC33XXXMP506/206XXXXXXXXXX XXXXXXX
dsPIC33XXXMP505/205XXXX
dsPIC33XXXMP503/203
dsPIC33XXXMP502/202
ANSELDXXXXX
PORTE
dsPIC33XXXMP508/208XXXXXXXXXX XXXXXXX
dsPIC33XXXMP506/206
dsPIC33XXXMP505/205
dsPIC33XXXMP503/203
dsPIC33XXXMP502/202

FIGURE 4-15: BLOCK DIAGRAM OF A TYPICAL SHARED PORT STRUCTURE
Microchip dsPIC33CH64MP208 - PARALLEL I/O (PIO) PORTS - 1

flowchart
graph TD
    subgraph Peripheral Module
        A["Peripheral Input Data"] --> B["Output Multiplexers"]
        C["Peripheral Module Enable"] --> B
        D["Peripheral Output Enable"] --> B
        E["Peripheral Output Data"] --> B
    end

    subgraph Output Multiplexers
        F["Data Bus"] --> G["TRISx Latch"]
        H["WR TRISx"] --> G
        I["Data Bus"] --> G
        J["WR LATx + WR PORTx"] --> G
        K["Read LATx"] --> G
        L["Read PORTx"] --> G
    end

    subgraph PIO Module
        M["Read TRISx"] --> N["D Q"]
        O["Data Bus"] --> N
        P["WR TRISx"] --> N
        Q["WR LATx + WR PORTx"] --> N
        R["Read LATx"] --> N
        S["Read PORTx"] --> N
    end

    F -->|Output Enable| T["I/O Pin"]
    T --> U["I/O Pin"]
    U --> V["Input Data"]

4.6.1.1 Open-Drain Configuration

In addition to the PORTx, LATx and TRISx registers for data control, port pins can also be individually configured for either digital or open-drain output. This is controlled by the Open-Drain Control x register, ODCx, associated with each port. Setting any of the bits configures the corresponding pin to act as an open-drain output.

The open-drain feature allows the generation of outputs, other than VDD, by using external pull-up resistors. The maximum open-drain voltage allowed on any pin is the same as the maximum VIH specification for that particular pin.

See the "Pin Diagrams" section for the available 5V tolerant pins and Table 24-19 for the maximum VIH specification for each pin.

4.6.2 CONFIGURING ANALOG AND DIGITAL PORT PINS

The ANSELx register controls the operation of the analog port pins. The port pins that are to function as analog inputs or outputs must have their corresponding ANSELx and TRISx bits set. In order to use port pins for I/O functionality with digital modules, such as timers, UARTs, etc., the corresponding ANSELx bit must be cleared.

The ANSELx register has a default value of 0xFFFF; therefore, all pins that share analog functions are analog (not digital) by default.

Pins with analog functions affected by the ANSELx registers are listed with a buffer type of analog in the Pinout I/O Descriptions (see Table 1-1).

If the TRISx bit is cleared (output) while the ANSELx bit is set, the digital output level (VOH or VOL) is converted by an analog peripheral, such as the ADC module or comparator module.

When the PORTx register is read, all pins configured as analog input channels are read as cleared (a low level).

Pins configured as digital inputs do not convert an analog input. Analog levels on any pin, defined as a digital input (including the ANx pins), can cause the input buffer to consume current that exceeds the device specifications.

4.6.2.1 I/O Port Write/Read Timing

One instruction cycle is required between a port direction change or port write operation and a read operation of the same port. Typically, this instruction would be a NOP, as shown in Example 4-3.

The following registers are in the PORT module:

  • Register 4-25: ANSELx (one per port)
  • Register 4-26: TRISx (one per port)
  • Register 4-27: PORTx (one per port)
  • Register 4-28: LATx (one per port)
  • Register 4-29: ODCx (one per port)
  • Register 4-30: CNPUx (one per port)
  • Register 4-31: CNPDx (one per port)
  • Register 4-32: CNCONx (one per port – optional)
  • Register 4-33: CNEN0x (one per port)
  • Register 4-34: CNSTATx (one per port – optional)
  • Register 4-35: CNEN1x (one per port)
  • Register 4-36: CNFx (one per port)

4.6.3 SECONDARY PORT CONTROL/STATUS REGISTERS

REGISTER 4-25: ANSELx: ANALOG SELECT FOR PORTx REGISTER

R/W-1 R/W-1 R/W-1 R/W-1 R/W-1 R/W-1 R/W-1 R/W-1
ANSELx[15:8]
bit 15 bit 8
R/W-1 R/W-1 R/W-1 R/W-1 R/W-1 R/W-1 R/W-1 R/W-1
ANSELx[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 15-0 ANSELx[15:0]: Analog Select for PORTx bits

1 = Analog input is enabled and digital input is disabled on PORTx[n] pin
0 = Analog input is disabled and digital input is enabled on PORTx[n] pin

REGISTER 4-26: TRISx: OUTPUT ENABLE FOR PORTx REGISTER

R/W-1 R/W-1 R/W-1 R/W-1 R/W-1 R/W-1 R/W-1 R/W-1
TRISx[15:8]
bit 15 bit 8
R/W-1 R/W-1 R/W-1 R/W-1 R/W-1 R/W-1 R/W-1 R/W-1
TRISx[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-0 TRISx[15:0]: Output Enable for PORTx bits

1 = LATx[n] is not driven on PORTx[n] pin
0 = LATx[n] is driven on PORTx[n] pin

REGISTER 4-27: PORTx: INPUT DATA FOR PORTx REGISTER

R/W-1R/W-1R/W-1R/W-1R/W-1R/W-1R/W-1R/W-1
PORTx[15:8]
bit 15bit 8
R/W-1R/W-1R/W-1R/W-1R/W-1R/W-1R/W-1R/W-1
PORTx[7:0]
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 cleared x = Bit is unknown

bit 15-0

PORTx[15:0]: PORTx Data Input Value bits

REGISTER 4-28: LATx: OUTPUT DATA FOR PORTx REGISTER

R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x
LATx[15:8]
bit 15 bit 8
R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x R/W-x
LATx[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 15-0 LATx[15:0]: PORTx Data Output Value bits

REGISTER 4-29: ODCx: OPEN-DRAIN ENABLE FOR PORTx REGISTER

R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
ODCx[15:8]
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
ODCx[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 15-0 ODCx[15:0]: PORTx Open-Drain Enable bits

1 = Open-drain is enabled on PORTx pin
0 = Open-drain is disabled on PORTx pin

REGISTER 4-30: CNPUx: CHANGE NOTIFICATION PULL-UP ENABLE FOR PORTx REGISTER

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CNPUx[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CNPUx[7:0]
bit 7bit0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-0 CNPUx[15:0]: Change Notification Pull-up Enable for PORTx bits

1 = The pull-up for PORTx[n] is enabled – takes precedence over pull-down selection
0 = The pull-up for PORTx[n] is disabled

REGISTER 4-31: CNPDx: CHANGE NOTIFICATION PULL-DOWN ENABLE FOR PORTx REGISTER

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CNPDx[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CNPDx[7:0]
bit 7bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-0 CNPDx[15:0]: Change Notification Pull-Down Enable for PORTx bits

1 = The pull-down for PORTx[n] is enabled (if the pull-up for PORTx[n] is not enabled)
0 = The pull-down for PORTx[n] is disabled

REGISTER 4-32: CNCONx: CHANGE NOTIFICATION CONTROL FOR PORTx REGISTER

R/W-0 U-0 U-0 U-0 R/W-0 U-0 U-0 U-0
ONCNSTYLE
bit 15 bit 8
U-0 U-0 U-0 U-0 U-0 U-0 U-0
bit 7 bit 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 ON: Change Notification (CN) Control for PORTx On bit

1 = CN is enabled

0 = CN is disabled

bit 14-12 Unimplemented: Read as '0'

bit 11 CNSTYLE: Change Notification Style Selection bit

1 = Edge style (detects edge transitions, CNFx[15:0] bits are used for a Change Notification event)

0 = Mismatch style (detects change from last port read, CNSTATx[15:0] bits are used for a Change Notification event)

bit 10-0 Unimplemented: Read as '0'

REGISTER 4-33: CNEN0x: INTERRUPT CHANGE NOTIFICATION ENABLE FOR PORTx REGISTER

R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
CNEN0x[15:8]
bit 15bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
CNEN0x[7:0]
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-0 CNEN0x[15:0]: Interrupt Change Notification Enable for PORTx bits

1 = Interrupt-on-change (from the last read value) is enabled for PORTx[n]

0 = Interrupt-on-change is disabled for PORTx[n]

REGISTER 4-34: CNSTATx: INTERRUPT CHANGE NOTIFICATION STATUS FOR PORTx REGISTER

R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
CNSTATx[15:8]
bit 15 bit 8
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
CNSTATx[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 15-0

CNSTAT[15:0]: Interrupt Change Notification Status for PORTx bits

When CNSTYLE (CNCONx[11]) = 0:

1 = Change occurred on PORTx[n] since last read of PORTx[n]
0 = Change did not occur on PORTx[n] since last read of PORTx[n]

REGISTER 4-35: CNEN1x: INTERRUPT CHANGE NOTIFICATION EDGE SELECT FOR PORTx REGISTER

R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
CNEN1x[15:8]
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
CNEN1x[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 15-0

CNEN1x[15:0]: Interrupt Change Notification Edge Select for PORTx bits

REGISTER 4-36: CNFx: INTERRUPT CHANGE NOTIFICATION FLAG FOR PORTx REGISTER

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CNFx[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CNFx[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR

'1' = Bit is set

'0' = Bit is cleared

x = Bit is unknown

bit 15-0

CNFx[15:0]: Interrupt Change Notification Flag for PORTx bits

When CNSTYLE (CNCONx[11]) = 1:

1 = An enabled edge event occurred on PORTx[n] pin
0 = An enabled edge event did not occur on PORTx[n] pin

4.6.4 INPUT CHANGE NOTIFICATION (ICN)

The Input Change Notification function of the I/O ports allows the dsPIC33CH128MP508S1 family devices to generate interrupt requests to the processor in response to a Change-of-State (COS) on selected input pins. This feature can detect input Change-of-States, even in Sleep mode, when the clocks are disabled. Every I/O port pin can be selected (enabled) for generating an interrupt request on a Change-of-State. Five control registers are associated with the Change Notification (CN) functionality of each I/O port. To enable the Change Notification feature for the port, the ON bit (CNCONx[15]) must be set.

The CNEN0x and CNEN1x registers contain the CN interrupt enable control bits for each of the input pins. The setting of these bits enables a CN interrupt for the corresponding pins. Also, these bits, in combination with the CNSTYLE bit (CNCONx[11]), define a type of transition when the interrupt is generated. Possible CN event options are listed in Table 4-26.

The CNSTATx register indicates whether a change occurred on the corresponding pin since the last read of the PORTx bit. In addition to the CNSTATx register, the CNFx register is implemented for each port. This register contains flags for Change Notification events. These flags are set if the valid transition edge, selected in the CNEN0x and CNEN1x registers, is detected. CNFx stores the occurrence of the event. CNFx bits must be cleared in software to get the next Change Notification interrupt. The CN interrupt is generated only for the I/Os configured as inputs (corresponding TRISx bits must be set).

TABLE 4-26: CHANGE NOTIFICATION EVENT OPTIONS

CNSTYLE Bit (CNCONx[11])CNEN1x BitCNEN0x BitChange Notification Event Description
0 Does not matter0 Disabled
0 Does not matter1 Detects a mismatch between the last read state and the current state of the pin
100Disabled
101Detects a positive transition only (from ‘0’ to ‘1’)
110Detects a negative transition only (from ‘1’ to ‘0’)
111Detects both positive and negative transitions

Note: Pull-ups and pull-downs on Input Change Notification pins should always be disabled when the port pin is configured as a digital output.

EXAMPLE 4-3: PORT WRITE/READ EXAMPLE

MOV 0xFF00, W0 ; Configure PORTB<15:8> ; as inputs
MOV W0, TRISB ; and PORTB<7:0> ; as outputs
NOP ; Delay 1 cycle
BTSS PORTB, #13 ; Next Instruction

4.6.5 PERIPHERAL PIN SELECT (PPS)

A major challenge in general purpose devices is providing the largest possible set of peripheral features, while minimizing the conflict of features on I/O pins. The challenge is even greater on low pin count devices. In an application where more than one peripheral needs to be assigned to a single pin, inconvenient work arounds in application code, or a complete redesign, may be the only option.

Peripheral Pin Select configuration provides an alternative to these choices by enabling peripheral set selection and placement on a wide range of I/O pins. By increasing the pinout options available on a particular device, users can better tailor the device to their entire application, rather than trimming the application to fit the device.

The Peripheral Pin Select configuration feature operates over a fixed subset of digital I/O pins. Users may independently map the input and/or output of most digital peripherals to any one of these I/O pins. Hardware safeguards are included that prevent accidental or spurious changes to the peripheral mapping once it has been established.

4.6.5.1 Available Pins

The number of available pins is dependent on the particular device and its pin count. Pins that support the Peripheral Pin Select feature include the label, "S1RPn", in their full pin designation, where "n" is the remappable pin number. "S1RP" is used to designate pins that support both remappable input and output functions.

4.6.5.2 Available Peripherals

The peripherals managed by the Peripheral Pin Select are all digital only peripherals. These include general serial communications (UART and SPI), general purpose timer clock inputs, timer-related peripherals (input capture and output compare) and interrupt-on-change inputs.

In comparison, some digital only peripheral modules are never included in the Peripheral Pin Select feature. This is because the peripheral's function requires special I/O circuitry on a specific port and cannot be easily connected to multiple pins. One example includes I^2C modules. A similar requirement excludes all modules with analog inputs, such as the ADC Converter.

A key difference between remappable and non-remappable peripherals is that remappable peripherals are not associated with a default I/O pin. The peripheral must always be assigned to a specific I/O pin before it can be used. In contrast, non-remappable peripherals are always available on a default pin, assuming that the peripheral is active and not conflicting with another peripheral.

When a remappable peripheral is active on a given I/O pin, it takes priority over all other digital I/Os and digital communication peripherals associated with the pin. Priority is given regardless of the type of peripheral that is mapped. Remappable peripherals never take priority over any analog functions associated with the pin.

4.6.5.3 Controlling Configuration Changes

Because peripheral mapping can be changed during run time, some restrictions on peripheral remapping are needed to prevent accidental configuration changes. The dsPIC33CH128MP508 devices have implemented the control register lock sequence to prevent accidental changes.

4.6.5.4 Control Register Lock

Under normal operation, writes to the RPINRx and RPORx registers are not allowed. Attempted writes will appear to execute normally, but the contents of the registers will remain unchanged. To change these registers, they must be unlocked in hardware. The register lock is controlled by the IOLOCK bit (RPCON[11]).

Setting IOLOCK prevents writes to the control registers; clearing IOLOCK allows writes.

To set or clear IOLOCK, the NVMKEY unlock sequence must be executed:

  1. Write 0x55 to NVMKEY.
  2. Write 0xAA to NVMKEY.
  3. Clear (or set) IOLOCK as a single operation.

IOLOCK remains in one state until changed. This allows all of the Peripheral Pin Selects to be configured with a single unlock sequence, followed by an update to all of the control registers. Then, IOLOCK can be set with a second lock sequence.

4.6.5.5 Considerations for Peripheral Pin Selection

The ability to control Peripheral Pin Selection introduces several considerations into application design that most users would never think of otherwise. This is particularly true for several common peripherals, which are only available as remappable peripherals.

The main consideration is that the Peripheral Pin Selects are not available on default pins in the device's default (Reset) state. More specifically, because all RPINRx registers reset to '1's and RPORx registers reset to '0's, this means all PPS inputs are tied to Vss, while all PPS outputs are disconnected. This means that before any other application code is executed, the user must initialize the device with the proper peripheral configuration. Because the IOLOCK bit resets in the unlocked state, it is not necessary to execute the unlock sequence after the device has come out of Reset. For application safety, however, it is always better to set IOLOCK and lock the configuration after writing to the control registers.

The NVMKEY unlock sequence must be executed as an assembly language routine. If the bulk of the application is written in C, or another high-level language, the unlock sequence should be performed by writing in-line assembly or by using the _builtin_write_RPCON(value) function provided by the compiler.

Choosing the configuration requires a review of all Peripheral Pin Selects and their pin assignments, particularly those that will not be used in the application. In all cases, unused pin-selectable peripherals should be disabled completely. Unused peripherals should have their inputs assigned to an unused RPn pin function. I/O pins with unused RPn functions should be configured with the null peripheral output.

Note: MPLAB XC16 provides a built-in C language function for unlocking and modifying the RPCON register: _builtin_write_RPCON(value); For more information, see the MPLAB XC16 Help files. 

The inputs of the Peripheral Pin Select options are mapped on the basis of the peripheral. That is, a control register associated with a peripheral dictates the pin it will be mapped to. The RPINRx registers are used to configure peripheral input mapping (see Register 4-38 through Register 4-61). Each register contains sets of 8-bit fields, with each set associated with one of the remappable peripherals. Programming a given peripheral's bit field with an appropriate 8-bit index value maps the S1RPn pin with the corresponding value, or internal signal, to that peripheral. See Table 4-27 for a list of available inputs.

For example, Figure 4-16 illustrates remappable pin selection for the U1RX input.

FIGURE 4-16: REMAPPABLE INPUT FOR U1RX
Microchip dsPIC33CH64MP208 - Considerations for Peripheral Pin Selection - 1

flowchart
graph LR
    A["Vss"] --> B["U1RXR[7:0"]]
    C["Main CMP1"] --> B
    D["Secondary CMP1"] --> B
    E["S1RP181"] --> B
    B --> F["U1RX Input to Peripheral"]
    style B fill:#f9f,stroke:#333
    note right of B
        Note: For input only, Peripheral Pin Select functionality does not have priority over TRISx settings. Therefore, when configuring an S1RPn pin for input, the corresponding bit in the TRISx register must also be configured for input (set to '1'). 
    Note

Example 4-4 provides a configuration for bidirectional communication with flow control using UART1. The following input and output functions are used:

  • Input Functions: U1RX, U1CTS
    • Output Functions: U1TX, U1RTS

EXAMPLE 4-4: CONFIGURING UART1 INPUT AND OUTPUT FUNCTIONS

//
**************************
// Unlock Registers
**************************
__builtin_write_RPCON(0x0000);
// **************************
// Configure Input Functions (See Table 4-28)
// Assign U1Rx To Pin RP35
// **************************
_U1RXR = 35;
// Assign U1CTS To Pin RP36
// ***************************
_U1CTSR = 36;
// **************************
// Configure Output Functions (See Table 4-31)
// **************************
// Assign U1Tx To Pin RP37
// ***************************
_RP37 = 1;
// **************************
// Assign U1RTS To Pin RP38
// ***************************
_RP38 = 2;
// **************************
// Lock Registers
// ***************************
__builtin_write_RPCON(0x0800); 

TABLE 4-27: SECONDARY CORE REMAPPABLE PIN INPUTS

RPINRx[15:8] or RPINRx[7:0]Function Available on Ports
0Vss Internal
1 Main Core Comparator 1 Internal
2 Secondary Comparator 1 Internal
3 Secondary Comparator 2 Internal
4 Secondary Comparator 3 Internal
5 Main Core REFCLKO Internal
6 Main Core PTG Trigger 30 Internal
7 Main Core PTG Trigger 31 Internal
8 Secondary PWM Event Output CInternal
9 Secondary PWM Event Output DInternal
10Secondary PWM Event Output EInternal
11Main Core PWM Event Output CInternal
12Main Core PWM Event Output DInternal
13Main Core PWM Event Output EInternal
14-31ReservedReserved
32S1RP32Port Pin RB0
33S1RP33Port Pin RB1
34S1RP34Port Pin RB2
35S1RP35Port Pin RB3
36S1RP36Port Pin RB4
37S1RP37Port Pin RB5
38S1RP38Port Pin RB6
39S1RP39Port Pin RB7
40S1RP40Port Pin RB8
41S1RP41Port Pin RB9
42S1RP42Port Pin RB10
43S1RP43Port Pin RB11
44S1RP44Port Pin RB12
45S1RP45Port Pin RB13
46S1RP46Port Pin RB14
47S1RP47Port Pin RB15
48S1RP48Port Pin RC0
49S1RP49Port Pin RC1
50S1RP50Port Pin RC2
51S1RP51Port Pin RC3
52S1RP52Port Pin RC4
53S1RP53Port Pin RC5
54S1RP54Port Pin RC6
55S1RP55Port Pin RC7
56S1RP56Port Pin RC8
57S1RP57Port Pin RC9
58S1RP58Port Pin RC10
59S1RP59Port Pin RC11
RPINRx[15:8] or RPINRx[7:0]FunctionAvailable on Ports
60 S1RP60Port Pin RC12
61 S1RP61Port Pin RC13
62 S1RP62Port Pin RC14
63 S1RP63Port Pin RC15
64 S1RP64Port Pin RD0
65 S1RP65Port Pin RD1
66 S1RP66Port Pin RD2
67 S1RP67Port Pin RD3
68 S1RP68Port Pin RD4
69 S1RP69Port Pin RD5
70 S1RP70Port Pin RD6
71 S1RP71Port Pin RD7
72-161 Reserved Reserved
162 DAC3 pwm_req_on Internal
163 DAC3 pwm_req_off Internal
164 DAC2 pwm_req_on Internal
165 DAC2 pwm_req_off Internal
166 DAC1 pwm_req_on Internal
167 DAC1 pwm_req_off Internal
168-169 Reserved Reserved
170 S1RP170 Main RPV0
171 S1RP171 Main RPV1
172 S1RP172 Main RPV2
173 S1RP173 Main RPV3
174 S1RP174 Main RPV4
175 S1RP175 Main RPV5
176 S1RP176 Secondary RPV0
177 S1RP177 Secondary RPV1
178 S1RP178 Secondary RPV2
179 S1RP179 Secondary RPV3
180 S1RP180 Secondary RPV4
181 S1RP181 Secondary RPV5

4.6.5.7 Virtual Connections

The dsPIC33CH128MP508S1 family devices support six virtual S1RPn pins (S1RP170-S1RP175), which are identical in functionality to all other S1RPn pins, with the exception of pinouts. These six pins are internal to the devices and are not connected to a physical device pin.

These pins provide a simple way for inter-peripheral connection without utilizing a physical pin. For example, the output of the analog comparator can be connected to S1RP170 and the PWM control input can be configured for S1RP170 as well. This configuration allows the analog comparator to trigger PWM Faults without the use of an actual physical pin on the device.

4.6.5.8 Secondary PPS Inputs to Main Core PPS

The dsPIC33CH128MP508S1 Secondary core subsystem PPS has connections to the Main core subsystem virtual PPS (S1RPV5-S1RPV0) output blocks. These inputs are mapped as S1RP175, S1RP174, S1RP173, S1RP172, S1RP171 and S1RP170.

The S1RPn inputs, S1RP1-S1RP13, are connected to internal signals from both the Main and Secondary core subsystems. Additionally, the Main core virtual PPS output blocks (RPV5-RPV0) are connected to the Secondary core PPS circuitry.

There are virtual pins in PPS to share between Main and Secondary:

• RP181 is for Main input (RPV5)
• RP180 is for Main input (RPV4)
• RP179 is for Main input (RPV3)
• RP178 is for Main input (RPV2)
• RP177 is for Main input (RPV1)
- RP176 is for Main input (RPV0)

• S1RP175 is for Secondary input (S1RPV5)

• S1RP174 is for Secondary input (S1RPV4)

• S1RP173 is for Secondary input (S1RPV3)

• S1RP172 is for Secondary input (S1RPV2)

• S1RP171 is for Secondary input (S1RPV1)

• S1RP170 is for Secondary input (S1RPV0)

The idea of the S1RPVn (Remappable Pin Virtual) is to interconnect between Main and Secondary without an I/O pin. For example, the Main UART receiver can be connected to the Secondary UART transmit using S1RPVn and data communication can happen from Secondary to Main without using any physical pin.

TABLE 4-28: SELECTABLE INPUT SOURCES (MAPS INPUT TO FUNCTION)

Input Name^(1) Function Name Regster Configuration Bits
External Interrupt 1 S1INT1 RPINR0 INT1R[7:0]
External Interrupt 2 S1INT2 RPINR1 INT2R[7:0]
External Interrupt 3 S1INT3 RPINR1 INT3R[7:0]
Timer1 External Clock S1T1CK RPINR2 T1CKR[7:0]
SCCP Timer1 S1TCKI1RPINR3TCKI1R[7:0]
SCCP Capture 1S1ICM1RPINR3ICM1R[7:0]
SCCP Timer2 S1TCKI2RPINR4TCKI2R[7:0]
SCCP Capture 2S1ICM2RPINR4ICM2R[7:0]
SCCP Timer3 S1TCKI3RPINR5TCKI3R[7:0]
SCCP Capture 3S1ICM3RPINR5ICM3R[7:0]
SCCP Timer4 S1TCKI4RPINR6TCKI4R[7:0]
SCCP Capture 4S1ICM4RPINR6ICM4R[7:0]
Output Compare Fault AS1OCFARPINR11OCFAR[7:0]
Output Compare Fault BS1OCFBRPINR11OCFBR[7:0]
PWM PCI Input 8S1PCI8RPINR12PCI8R[7:0]
PWM PCI Input 9S1PCI9RPINR12PCI9R[7:0]
PWM PCI Input 10S1PCI10RPINR13PCI10R[7:0]
PWM PCI Input 11S1PCI11RPINR13PCI11R[7:0]
QEI Input AS1QEIA1RPINR14QEIA1R[7:0]
QEI Input BS1QEIB1RPINR14QEIB1R[7:0]
QEI Index 1 InputS1QEINDX1RPINR15 QEINDX1R[7:0]
QEI Home 1 InputS1QEIHOM1RPINR15QEIHOM1R[7:0]
UART1 ReceiveS1U1RXRPINR18U1RXR[7:0]
UART1 Data-Set-Ready 1U1DSR RPINR18U1DSRR[7:0]
SPI1 Data InputS1SDI1RPINR20SDI1R[7:0]
SPI1 Clock InputS1SCK1RPINR20SCK1R[7:0]
SPI1 Secondary Select 1SS1 RPINR21SS1R[7:0]
Reference Clock InputS1REFOI RPINR21REFOIR[7:0]
UART1 Clear-to-Send 1U1CTS RPINR23U1CTSR[7:0]
PWM PCI Input 17S1PCI17RPINR37PCI17R[7:0]
PWM PCI Input 18S1PCI18RPINR38PCI18R[7:0]
PWM PCI Input 12S1PCI12RPINR42PCI12R[7:0]
PWM PCI Input 13S1PCI13RPINR42PCI13R[7:0]
PWM PCI Input 14S1PCI14RPINR43PCI14R[7:0]
PWM PCI Input 15S1PCI15RPINR43PCI15R[7:0]
PWM PCI Input 16S1PCI16RPINR44PCI16R[7:0]
CLC Input AS1CLCINARPINR45CLCINAR[7:0]
CLC Input BS1CLCINBRPINR46CLCINBR[7:0]
CLC Input CS1CLCINCRPINR46CLCINCR[7:0]
CLC Input DS1CLCINDRPINR47CLCINDR[7:0]
ADC External Trigger Input (ADTRIG31)S1ADCTRGRPINR47ADCTRGR[7:0]

Note 1: Unless otherwise noted, all inputs use the Schmitt Trigger input buffers.

TABLE 4-29: SECONDARY PPS INPUT CONTROL REGISTERS

RegisterBit 15 Bit 14 BitBit 13 Bit 12 BitBit 11 Bit 10 Bit 9Bit 8 Bit 7 Bit 6Bit 5 Bit 4 BitBit 3 Bit 2 Bit 1 Bit 0
RPCONLIOLOCK
RPINR0INT1R7INT1R6INT1R5INT1R4INT1R3INT1R2INT1R1INT1R0
RPINR1INT3R7INT3R6INT3R5INT3R4INT3R3INT3R2INT3R1INT3R0INT2R7INT2R6INT2R5INT2R4INT2R3INT2R2INT2R1INT2R0
RPINR2T1CKR7T1CKR6T1CKR5T1CKR4T1CKR3T1CKR2T1CKR1T1CKR0
RPINR3ICM1R7ICM1R6ICM1R5ICM1R4ICM1R3ICM1R2ICM1R1ICM1R0TCKI1R7TCKI1R6TCKI1R5TCKI1R4TCKI1R3TCKI1R2TCKI1R1TCKI1R0
RPINR4ICM2R7ICM2R6ICM2R5ICM2R4ICM2R3ICM2R2ICM2R1ICM2R0TCKI2R7TCKI2R6TCKI2R5TCKI2R4TCKI2R3TCKI2R2TCKI2R1TCKI2R0
RPINR5ICM3R7ICM3R6ICM3R5ICM3R4ICM3R3ICM3R2ICM3R1ICM3R0TCKI3R7TCKI3R6TCKI3R5TCKI3R4TCKI3R3TCKI3R2TCKI3R1TCKI3R0
RPINR6ICM4R7ICM4R6ICM4R5ICM4R4ICM4R3ICM4R2ICM4R1ICM4R0TCKI4R7TCKI4R6TCKI4R5TCKI4R4TCKI4R3TCKI4R2TCKI4R1TCKI4R0
RPINR11OCFBR7OCFBR6OCFBR5OCFBR4OCFBR3OCFBR2OCFBR1OCFBR0OCFAR7OCFAR6OCFAR5OCFAR4OCFAR3OCFAR2OCFAR1OCFAR0
RPINR12PCI9R7PCI9R6PCI9R5PCI9R4PCI9R3PCI9R2PCI9R1PCI9R0PCI8R7PCI8R6PCI8R5PCI8R4PCI8R3PCI8R2PCI8R1PCI8R0
RPINR13PCI11R7PCI11R6PCI11R5PCI11R4PCI11R3PCI11R2PCI11R1PCI11R0PCI10R7PCI10R6PCI10R5PCI10R4PCI10R3PCI10R2PCI10R1PCI10R0
RPINR14QEIB1R7QEIB1R6QEIB1R5QEIB1R4QEIB1R3QEIB1R2QEIB1R1QEIB1R0QEIA1R7QEIA1R6QEIA1R5QEIA1R4QEIA1R3QEIA1R2QEIA1R1QEIA1R0
RPINR15QEIHOM1R7QEIHOM1R6QEIHOM1R5QEIHOM1R4QEIHOM1R3QEIHOM1R2QEIHOM1R1QEIHOM1R0QEINDX1R7QEINDX1R6QEINDX1R5QEINDX1R4QEINDX1R3QEINDX1R2QEINDX1R1QEINDX1R0
RPINR18U1DSRR7U1DSRR6U1DSRR5U1DSRR4U1DSRR3U1DSRR2U1DSRR1U1DSRR0U1RXR7U1RXR6U1RXR5U1RXR4U1RXR3U1RXR2U1RXR1U1RXR0
RPINR20SCK1R7SCK1R6SCK1R5SCK1R4SCK1R3SCK1R2SCK1R1SCK1R0SDI1R7SDI1R6SDI1R5SDI1R4SDI1R3SDI1R2SDI1R1SDI1R0
RPINR21REFOIR7REFOIR6REFOIR5REFOIR4REFOIR3REFOIR2REFOIR1REFOIR0SS1R7SS1R6SS1R5SS1R4SS1R3SS1R2SS1R1SS1R0
RPINR23U1CTSR7U1CTSR6U1CTSR5U1CTSR4U1CTSR3U1CTSR2U1CTSR1U1CTSR0
RPINR37PCI17R7PCI17R6PCI17R5PCI17R4PCI17R3PCI17R2PCI17R1PCI17R0
RPINR38PCI18R7PCI18R6PCI18R5PCI18R4PCI18R3PCI18R2PCI18R1PCI18R0
RPINR42PCI13R7PCI13R6PCI13R5PCI13R4PCI13R3PCI13R2PCI13R1PCI13R0PCI12R7PCI12R6PWM12R5PWM12R4PWM12R3PWM12R2PWM12R1PWM12R0
RPINR43PCI15R7PCI15R6PCI15R5PCI15R4PCI15R3PCI15R2PCI15R1PCI15R0PCI14R7PCI14R6PCI14R5PCI14R4PCI14R3PCI14R2PCI14R1PCI14R0
RPINR44PCI16R7PCI16R6PCI16R5PCI16R4PCI16R3PCI16R2PCI16R1PCI16R0
RPINR45CLCINAR7CLCINAR6CLCINAR5CLCINAR4CLCINAR3CLCINAR2CLCINAR1CLCINAR0
RPINR46CLCINCR7CLCINCR6CLCINCR5CLCINCR4CLCINCR3CLCINCR2CLCINCR1CLCINCR0CLCINBR7CLCINBR6CLCINBR5CLCINBR4CLCINBR3CLCINBR2CLCINBR1CLCINBR0
RPINR47ADCTRGR7ADCTRGR6ADCTRGR5ADCTRGR4ADCTRGR3ADCTRGR2ADCTRGR1ADCTRGR0CLCINDR7CLCINDR6CLCINDR5CLCINDR4CLCINDR3CLCINDR2CLCINDR1CLCINDR0

4.6.5.9 Output Mapping

In contrast to inputs, the outputs of the Peripheral Pin Select options are mapped on the basis of the pin. In this case, a control register associated with a particular pin dictates the peripheral output to be mapped. The RPORx registers are used to control output mapping. Each register contains sets of 6-bit fields, with each set associated with one S1RPn pin (see Register 4-62 through Register 4-84). The value of the bit field corresponds to one of the peripherals and that peripheral's output is mapped to the pin (see Table 4-31 and Figure 4-17).

A null output is associated with the PPS Output register Reset value of '0'. This is done to ensure that remappable outputs remain disconnected from all output pins by default.

FIGURE 4-17: MULTIPLEXING REMAPPABLE OUTPUTS FOR S1RPn
Microchip dsPIC33CH64MP208 - Output Mapping - 1

text_image RPnR[5:0] Default 0 S1U1TX Output 1 S1U1RTS Output 2 MPTGTRG2 49 S1CLC3OUT 50 Output Data S1RP32-S1RP71 (Physical Pins) S1RP170-S1RP175 (Internal Virtual Output Ports)

Note 1: There are six virtual output ports which are not connected to any I/O ports (S1RP170-S1RP175). These virtual ports can be accessed by RPOR20, RPOR21 and RPOR22.

4.6.5.10 Mapping Limitations

The control schema of the peripheral select pins is not limited to a small range of fixed peripheral configurations. There are no mutual or hardware-enforced lockouts between any of the peripheral mapping SFRs. Literally any combination of peripheral mappings, across any or all of the S1RPn pins, is possible. This includes both many-to-one and one-to-many mappings of peripheral inputs, and outputs to pins. While such mappings may be technically possible from a configuration point of view, they may not be supportable from an electrical point of view.

TABLE 4-30: SECONDARY REMAPPABLE OUTPUT PIN REGISTERS

Register S1RP Pin I/O Port
RPOR0[5:0] S1RP32 Port Pin S1RB0
RPOR0[13:8] S1RP33 Port Pin S1RB1
RPOR1[5:0] S1RP34 Port Pin S1RB2
RPOR1[13:8] S1RP35 Port Pin S1RB3
RPOR2[5:0] S1RP36 Port Pin S1RB4
RPOR2[13:8] S1RP37 Port Pin S1RB5
RPOR3[5:0] S1RP38 Port Pin S1RB6
RPOR3[13:8] S1RP39 Port Pin S1RB7
RPOR4[5:0] S1RP40 Port Pin S1RB8
RPOR4[13:8] S1RP41 Port Pin S1RB9
RPOR5[5:0] S1RP42 Port Pin S1RB10
RPOR5[13:8] S1RP43 Port Pin S1RB11
RPOR6[5:0] S1RP44 Port Pin S1RB12
RPOR6[13:8] S1RP45 Port Pin S1RB13
RPOR7[5:0] S1RP46 Port Pin S1RB14
RPOR7[13:8] S1RP47 Port Pin S1RB15
RPOR8[5:0] S1RP48 Port Pin S1RC0
RPOR8[13:8] S1RP49 Port Pin S1RC1
RPOR9[5:0] S1RP50 Port Pin S1RC2
RPOR9[13:8] S1RP51 Port Pin S1RC3
RPOR10[5:0] S1RP52 Port Pin S1RC4
RPOR10[13:8] S1RP53 Port Pin S1RC5
RPOR11[5:0] S1RP54 Port Pin S1RC6
RPOR11[13:8] S1RP55 Port Pin S1RC7
RPOR12[5:0] S1RP56 Port Pin S1RC8
RPOR12[13:8] S1RP57 Port Pin S1RC9
RPOR13[5:0] S1RP58 Port Pin S1RC10
RPOR13[13:8] S1RP59 Port Pin S1RC11
RPOR14[5:0] S1RP60 Port Pin S1RC12
RPOR14[13:8] S1RP61 Port Pin S1RC13
RPOR15[5:0] S1RP62 Port Pin S1RC14
RPOR15[13:8] S1RP63 Port Pin S1RC15
RPOR16[5:0] S1RP64 Port Pin S1RD0
RPOR16[13:8] S1RP65 Port Pin S1RD1
RPOR17[5:0] S1RP66 Port Pin S1RD2
RPOR17[13:8] S1RP67 Port Pin S1RD3
RPOR18[5:0] S1RP68 Port Pin S1RD4
RPOR18[13:8] S1RP69 Port Pin S1RD5
RPOR19[5:0] S1RP70 Port Pin S1RD6
RPOR19[13:8] S1RP71 Port Pin S1RD7
RPOR20[5:0] S1RP170Virtual Pin S1RPV0
RPOR20[13:8] S1RP171Virtual Pin S1RPV1
RPOR21[5:0] S1RP172Virtual Pin S1RPV2
RPOR21[13:8] S1RP173Virtual Pin S1RPV3
RPOR22[5:0] S1RP174Virtual Pin S1RPV4
RPOR22[13:8] S1RP175Virtual Pin S1RPV5

TABLE 4-31: OUTPUT SELECTION FOR REMAPPABLE PINS (S1RPn)

Function RPnR[5:0] Output Name
Default PORT0S1RPn tied to Default Pin
S1U1TX 1 S1RPn tied to UART1 Transmit
1U1RTS 2S1RPn tied to UART1 Request-to-Send
S1SDO1 3 S1RPn tied to SPI1 Data Output
S1SCK1OUT 6 S1RPn tied to SPI1 Clock Output
1SS1OUT 7S1RPn tied to SPI1 Secondary Select
S1REFCLKO 14 S1RPn tied to Reference Clock Output
S1OCM115 S1RPn tied to SCCP1 Output
S1OCM216 S1RPn tied to SCCP2 Output
S1OCM317 S1RPn tied to SCCP3 Output
S1OCM418 S1RPn tied to SCCP4 Output
S1CMP123 S1RPn tied to Comparator 1 Output
S1CMP224 S1RPn tied to Comparator 2 Output
S1CMP325 S1RPn tied to Comparator 3 Output
S1PWMH434 S1RPn tied to PWM4H Output
S1PWML435 S1RPn tied to PWM4L Output
S1PWMEA36 S1RPn tied to PWM Event A Output
S1PWMEB37 S1RPn tied to PWM Event B Output
S1QEICMP138 S1RPn tied to QEI Comparator Output
S1CLC1OUT40 S1RPn tied to CLC1 Output
S1CLC2OUT41 S1RPn tied to CLC2 Output
S1PWMEC44 S1RPn tied to PWM Event C Output
S1PWMED45 S1RPn tied to PWM Event D Output
MPTGTRG146 Main PTG24 Output
MPTGTRG247Main PTG25 Output
S1CLC3OUT50 S1RPn tied to CLC3 Output

TABLE 4-32: SECONDARY PPS OUTPUT CONTROL REGISTERS

Register 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
RPOR0RP33R5RP33R4RP33R3RP33R2RP33R1RP33R0RP32R5RP32R4RP32R3RP32R2RP32R1RP32R0
RPOR1RP35R5RP35R4RP35R3RP35R2RP35R1RP35R0RP34R5RP34R4RP34R3RP34R2RP34R1RP34R0
RPOR2RP37R5RP37R4RP37R3RP37R2RP37R1RP37R0RP36R5RP36R4RP36R3RP36R2RP36R1RP36R0
RPOR3RP39R5RP39R4RP39R3RP39R2RP39R1RP39R0RP38R5RP38R4RP38R3RP38R2RP38R1RP38R0
RPOR4RP41R5RP41R4RP41R3RP41R2RP41R1RP41R0RP40R5RP40R4RP40R3RP40R2RP40R1RP40R0
RPOR5RP43R5RP43R4RP43R3RP43R2RP43R1RP43R0RP42R5RP42R4RP42R3RP42R2RP42R1RP42R0
RPOR6RP45R5RP45R4RP45R3RP45R2RP45R1RP45R0RP44R5RP44R4RP44R3RP44R2RP44R1RP44R0
RPOR7RP47R5RP47R4RP47R3RP47R2RP47R1RP47R0RP46R5RP46R4RP46R3RP46R2RP46R1RP46R0
RPOR8RP49R5RP49R4RP49R3RP49R2RP49R1RP49R0RP48R5RP48R4RP48R3RP48R2RP48R1RP48R0
RPOR9RP51R5RP51R4RP51R3RP51R2RP51R1RP51R0RP50R5RP50R4RP50R3RP50R2RP50R1RP50R0
RPOR10RP53R5RP53R4RP53R3RP53R2RP53R1RP53R0RP52R5RP52R4RP52R3RP52R2RP52R1RP52R0
RPOR11RP55R5RP55R4RP55R3RP55R2RP55R1RP55R0RP54R5RP54R4RP54R3RP54R2RP54R1RP54R0
RPOR12RP57R5RP57R4RP57R3RP57R2RP57R1RP57R0RP56R5RP56R4RP56R3RP56R2RP56R1RP56R0
RPOR13RP59R5RP59R4RP59R3RP59R2RP59R1RP59R0RP58R5RP58R4RP58R3RP58R2RP58R1RP58R0
RPOR14RP61R5RP61R4RP61R3RP61R2RP61R1RP61R0RP60R5RP60R4RP60R3RP60R2RP60R1RP60R0
RPOR15RP63R5RP63R4RP63R3RP63R2RP63R1RP63R0RP62R5RP62R4RP62R3RP62R2RP62R1RP62R0
RPOR16RP65R5RP65R4RP65R3RP65R2RP65R1RP65R0RP64R5RP64R4RP64R3RP64R2RP64R1RP64R0
RPOR17RP67R5RP67R4RP67R3RP67R2RP67R1RP67R0RP66R5RP66R4RP66R3RP66R2RP66R1RP66R0
RPOR18RP69R5RP69R4RP69R3RP69R2RP69R1RP69R0RP68R5RP68R4RP68R3RP68R2RP68R1RP68R0
RPOR19RP71R5RP71R4RP71R3RP71R2RP71R1RP71R0RP70R5RP70R4RP70R3RP70R2RP70R1RP70R0
RPOR20^(1) RP171R5RP171R4RP171R3RP177R2RP171R1RP171R0RP170R5RP170R4RP170R3RP170R2RP170R1RP170R0
RPOR21^(1) RP173R5RP173R4RP173R3RP173R2RP173R1RP173R0RP172R5RP172R4RP172R3RP172R2RP172R1RP172R0
RPOR22^(1) RP175R5RP175R4RP175R3RP175R2RP175R1RP175R0RP174R5RP174R4RP174R3RP174R2RP174R1RP174R0

Note 1: The RPOR20, RPOR21 and RPOR22 registers are for virtual output pins.

4.6.6 I/O HELPFUL TIPS

  1. In some cases, certain pins, as defined in Table 24-19 under "Injection Current", have internal protection diodes to VDD and Vss. The term, "Injection Current", is also referred to as "Clamp Current". On designated pins, with sufficient external current-limiting precautions by the user, I/O pin input voltages are allowed to be greater or lesser than the data sheet absolute maximum ratings, with respect to the Vss and VDD supplies. Note that when the user application forward biases either of the high or low-side internal input clamp diodes, that the resulting current being injected into the device, that is clamped internally by the VDD and Vss power rails, may affect the ADC accuracy by four to six counts.

  2. I/O pins that are shared with any analog input pin (i.e., ANx) are always analog pins, by default, after any Reset. Consequently, configuring a pin as an analog input pin automatically disables the digital input pin buffer and any attempt to read the digital input level by reading PORTx or LATx will always return a '0', regardless of the digital logic level on the pin. To use a pin as a digital I/O pin on a shared ANx pin, the user application needs to configure the Analog Select for PORTx registers, in the I/O ports module (i.e., ANSELx), by setting the appropriate bit that corresponds to that I/O port pin to a '0'.

Note: Although it is not possible to use a digital input pin when its analog function is enabled, it is possible to use the digital I/O output function, TRISx = 0x0, while the analog function is also enabled. However, this is not recommended, particularly if the analog input is connected to an external analog voltage source, which would create signal contention between the analog signal and the output pin driver.

  1. Most I/O pins have multiple functions. Referring to the device pin diagrams in this data sheet, the priorities of the functions allocated to any pins are indicated by reading the pin name, from left-to-right. The left most function name takes precedence over any function to its right in the naming convention. For example: AN16/T2CK/T7CK/RC1; this indicates that AN16 is the highest priority in this example and will supersede all other functions to its right in the list. Those other functions to its right, even if enabled, would not work as long as any other function to its left was enabled. This rule applies to all of the functions listed for a given pin.

  2. Each pin has an internal weak pull-up resistor and pull-down resistor that can be configured using the CNPUx and CNPDx registers, respectively. These resistors eliminate the need for external resistors in certain applications. The internal pull-up is up to \~(VDD - 0.8), not VDD. This value is still above the minimum VIH of CMOS and TTL devices.

  3. When driving LEDs directly, the I/O pin can source or sink more current than what is specified in the VOH/IOH and VOL/IOL DC characteristics specification. The respective IOH and IOL current rating only applies to maintaining the corresponding output at or above the VOH, and at or below the VOL levels. However, for LEDs, unlike digital inputs of an externally connected device, they are not governed by the same minimum VIH/VIIL levels. An I/O pin output can safely sink or source any current less than that listed in the Absolute Maximum Ratings in Section 24.0, Electrical Characteristics of this data sheet. For example:

V_OH = 2.4v @ I_OH = -8 mA and V_DD = 3.3V

The maximum output current sourced by any 8 mA I/O pin = 12 mA.

LED source current < 12 mA is technically permitted.

  1. The Peripheral Pin Select (PPS) pin mapping rules are as follows:

a) Only one "output" function can be active on a given pin at any time, regardless if it is a dedicated or remappable function (one pin, one output).
b) It is possible to assign a "remappable output" function to multiple pins and externally short or tie them together for increased current drive.
c) If any "dedicated output" function is enabled on a pin, it will take precedence over any remappable "output" function.
d) If any "dedicated digital" (input or output) function is enabled on a pin, any number of "input" remappable functions can be mapped to the same pin.
e) If any “dedicated analog” function(s) are enabled on a given pin, “digital input(s)” of any kind will all be disabled, although a single “digital output”, at the user's cautionary discretion, can be enabled and active as long as there is no signal contention with an external analog input signal. For example, it is possible for the ADC to convert the digital output logic level, or to toggle a digital output on a comparator or ADC input, provided there is no external analog input, such as for a Built-In Self-Test.
f) Any number of "input" remappable functions can be mapped to the same pin(s) at the same time, including to any pin with a single output from either a dedicated or remappable "output".
g) The TRISx registers control only the digital I/O output buffer. Any other dedicated or remappable active "output" will automatically override the TRISx setting. The TRISx register does not control the digital logic "input" buffer. Remappable digital "inputs" do not automatically override TRISx settings, which means that the TRISx bit must be set to input for pins with only remappable input function(s) assigned.
h) All analog pins are enabled by default after any Reset and the corresponding digital input buffer on the pin has been disabled. Only the Analog Select for PORTx (ANSELx) registers control the digital input buffer, not the TRISx register. The user must disable the analog function on a pin using the Analog Select for PORTx registers in order to use any "digital input(s)" on a corresponding pin, no exceptions.

4.6.7 I/O PORTS RESOURCES

Many useful resources are provided on the main product page of the Microchip website for the devices listed in this data sheet. This product page contains the latest updates and additional information.

4.6.7.1 Key Resources

  • "I/O Ports with Edge Detect" (www.microchip.com/DS70005322)
  • Code Samples
  • Application Notes
  • Software Libraries
  • Webinars
  • All Related "dsPIC33/PIC24 Family Reference Manual" Sections
  • Development Tools

4.6.8 PERIPHERAL PIN SELECT REGISTERS

REGISTER 4-37: RPCON: PERIPHERAL REMAPPING CONFIGURATION REGISTER

R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-12 Unimplemented: Read as '0'

bit 11 IOLOCK: Peripheral Remapping Register Lock bit

1 = All Peripheral Remapping registers are locked and cannot be written

0 = All Peripheral Remapping registers are unlocked and can be written

bit 10-0 Unimplemented: Read as '0'

REGISTER 4-38: RPINR0: PERIPHERAL PIN SELECT INPUT REGISTER 0

R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
INT1R7INT1R6INT1R5INT1R4INT1R3INT1R2INT1R1INT1R0
bit 15 bit 8
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-8 INT1R[7:0]: Assign External Interrupt 1 (S1INT1) to the Corresponding S1RPn Pin bits See Table 4-27.

bit 7-0 Unimplemented: Read as '0'

REGISTER 4-39: RPINR1: PERIPHERAL PIN SELECT INPUT REGISTER 1

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
INT3R15INT3R14INT3R13INT3R12INT3R11INT3R10INT3R9INT3R8
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
INT2R7INT2R6INT2R5INT2R4INT2R3INT2R2INT2R1INT2R0
bit 7 bit 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-8 INT3R[15:8]: Assign External Interrupt 3 (S1INT3) to the Corresponding S1RPn Pin bits See Table 4-27.

bit 7-0 INT2R[7:0]: Assign External Interrupt 2 (S1INT2) to the Corresponding S1RPn Pin bits See Table 4-27.

REGISTER 4-40: RPINR2: PERIPHERAL PIN SELECT INPUT REGISTER 2

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
T1CKR7T1CKR6T1CKR5T1CKR4T1CKR3T1CKR2T1CKR1T1CKR0
bit 15 bit 8
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-8 T1CKR[7:0]: Assign Timer1 External Clock (S1T1CK) to the Corresponding S1RPn Pin bits See Table 4-27.

bit 7-0 Unimplemented: Read as '0'

dsPIC33CH128MP508 FAMILY

REGISTER 4-41: RPINR3: PERIPHERAL PIN SELECT INPUT REGISTER 3

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
ICM1R7ICM1R6ICM1R5ICM1R4ICM1R3ICM1R2ICM1R1ICM1R0
bit 15bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
TCKI1R7TCKI1R6TCKI1R5TCKI1R4TCKI1R3TCKI1R2TCKI1R1TCKI1R0
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 cleared x = Bit is unknown
bit 15-8ICM1R[7:0]: Assign SCCP Capture 1 (S1ICM1) to the Corresponding S1RPn Pin bits See Table 4-27.
bit 7-0TCKI1R[7:0]: Assign SCCP Timer1 (S1TCKI1) to the Corresponding S1RPn Pin bits See Table 4-27.

REGISTER 4-42: RPINR4: PERIPHERAL PIN SELECT INPUT REGISTER 4

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
ICM2R7ICM2R6ICM2R5ICM2R4ICM2R3ICM2R2ICM2R1ICM2R0
bit 15bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
TCKI2R7TCKI2R6TCKI2R5TCKI2R4TCKI2R3TCKI2R2TCKI2R1TCKI2R0
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 cleared x = Bit is unknown
bit 15-8ICM2R[7:0]: Assign SCCP Capture 2 (S1ICM2) to the Corresponding S1RPn Pin bits See Table 4-27.
bit 7-0TCKI2R[7:0]: Assign SCCP Timer2 (S1TCKI2) to the Corresponding S1RPn Pin bits See Table 4-27.

REGISTER 4-43: RPINR5: PERIPHERAL PIN SELECT INPUT REGISTER 5

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
ICM3R7 ICM3R6 ICM3R5ICM3R4 ICM3R3 ICM3R2ICM3R1ICM3R0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
TCKI3R7TCKI3R6TCKI3R5TCKI3R4TCKI3R3TCKI3R2TCKI3R1TCKI3R0
bit 7 bit 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-8 ICM3R[7:0]: Assign SCCP Capture 3 (S1ICM3) to the Corresponding S1RPn Pin bits See Table 4-27.

bit 7-0 TCKI3R[7:0]: Assign SCCP Timer3 (S1TCKI3) to the Corresponding S1RPn Pin bits See Table 4-27.

REGISTER 4-44: RPINR6: PERIPHERAL PIN SELECT INPUT REGISTER 6

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
ICM4R7 ICM4R6 ICM4R5ICM4R4 ICM4R3 ICM4R2ICM4R1ICM4R0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
TCKI4R7TCKI4R6TCKI4R5TCKI4R4TCKI4R3TCKI4R2TCKI4R1TCKI4R0
bit 7 bit 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-8 ICM4R[7:0]: Assign SCCP Capture 4 (S1ICM4) to the Corresponding S1RPn Pin bits See Table 4-27.

bit 7-0 TCKI4R[7:0]: Assign SCCP Timer4 (S1TCKI4) to the Corresponding S1RPn Pin bits See Table 4-27.

REGISTER 4-45: RPINR11: PERIPHERAL PIN SELECT INPUT REGISTER 11

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
OCFBR7 OCFBR6 OCFBR5 OCFBR4 OCFBR3 OCFBR2 OCFBR1OCFBR0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
OCFAR7OCFAR6OCFAR5OCFAR4OCFAR3OCFAR2OCFAR1OCFAR0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-8 OCFBR[7:0]: Assign Output Compare Fault B (S1OCFB) to the Corresponding S1RPn Pin bits See Table 4-27

bit 7-0 OCFBA[7:0]: Assign Output Compare Fault A (S1OCFA) to the Corresponding S1RPn Pin bits See Table 4-27

REGISTER 4-46: RPINR12: PERIPHERAL PIN SELECT INPUT REGISTER 12

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PCI9R7PCI9R6PCI9R5PCI9R4PCI9R3PCI9R2PCI9R1PCI9R0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PCI8R7PCI8R6PCI8R5PCI8R4PCI8R3PCI8R2PCI8R1PCI8R0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-8 PCI9R[7:0]: Assign PWM Input 9 (S1PCI9) to the Corresponding S1RPn Pin bits See Table 4-27.

bit 7-0 PCI8R[7:0]: Assign PWM Input 8 (S1PCI8) to the Corresponding S1RPn Pin bits See Table 4-27.

REGISTER 4-47: RPINR13: PERIPHERAL PIN SELECT INPUT REGISTER 13

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PCI11R7 PCI11R6 PCI11R5 PCI11R4 PCI11R3PCI11R2 PCI11R1PCI11R0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PCI10R7PCI10R6PCI10R5PCI10R4PCI10R3PCI10R2PCI10R1PCI10R0
bit 7 bit 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-8 PCI11R[7:0]: Assign PWM Input 11 (S1PCI11) to the Corresponding S1RPn Pin bits See Table 4-27.

bit 7-0 PCI10R[7:0]: Assign PWM Input 10 (S1PCI10) to the Corresponding S1RPn Pin bits See Table 4-27.

REGISTER 4-48: RPINR14: PERIPHERAL PIN SELECT INPUT REGISTER 14

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
QEIB1R7QEIB1R6QEIB1R5QEIB1R4QEIB1R3QEIB1R2QEIB1R1QEIB1R0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
QEIA1R7QEIA1R6QEIA1R5QEIA1R4QEIA1R3QEIA1R2QEIA1R1QEIA1R0
bit 7 bit 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-8 QEIB1R[7:0]: Assign QEI Input B (S1QEIB1) to the Corresponding S1RPn Pin bits See Table 4-27.

bit 7-0 QEIA1R[7:0]: Assign QEI Input A (S1QEIA1) to the Corresponding S1RPn Pin bits See Table 4-27.

REGISTER 4-49: RPINR15: PERIPHERAL PIN SELECT INPUT REGISTER 15

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
QEIHOM1R7QEIHOM1R6QEIHOM1R5QEIHOM1R4QEIHOM1R3QEIHOM1R2QEIHOM1R1QEIHOM1R0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
QEINDX1R7QEINDX1R6QEINDX1R5QEINDX1R4QEINDX1R3QEINDX1R2QEINDX1R1QEINDX1R0
bit 7 bit 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-8 QEIHOM1R[7:0]: Assign QEI Home 1 Input (S1QEIHOM1) to the Corresponding S1RPn Pin bits See Table 4-27.

bit 7-0 QEINDX1R[7:0]: Assign QEI Index 1 Input (S1QEINDX1) to the Corresponding S1RPn Pin bits See Table 4-27.

REGISTER 4-50: RPINR18: PERIPHERAL PIN SELECT INPUT REGISTER 18

R/W-0 R/W-0 R/W-0R/W-0R/W-0 R/W-0 R/W-0 R/W-0
U1DSRR7U1DSRR6U1DSRR5U1DSRR4U1DSRR3U1DSRR2U1DSRR1U1DSRR0
bit 15 bit 8
R/W-0 R/W-0 R/W-0R/W-0R/W-0 R/W-0 R/W-0 R/W-0
U1RXR7U1RXR6U1RXR5U1RXR4U1RXR3U1RXR2U1RXR1U1RXR0
bit 7 bit 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-8 U1DSRR[7:0]: Assign UART1 Data-Set-Ready (S1U1DSR) to the Corresponding S1RPn Pin bits See Table 4-27.

bit 7-0 U1RXR[7:0]: Assign UART1 Receive (S1U1RX) to the Corresponding S1RPn Pin bits See Table 4-27.

REGISTER 4-51: RPINR20: PERIPHERAL PIN SELECT INPUT REGISTER 20

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
SCK1R7 SCK1R6 SCK1R5 SCK1R4 SCK1R3 SCK1R2 SCK1R1SCK1R0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
SDI1R7SDI1R6SDI1R5SDI1R4SDI1R3SDI1R2SDI1R1SDI1R0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-8 SCK1R[7:0]: Assign SPI1 Clock Input (S1SCK1) to the Corresponding S1RPn Pin bits See Table 4-27.

bit 7-0 SDI1R[7:0]: Assign SPI1 Data Input (S1SDI1) to the Corresponding S1RPn Pin bits See Table 4-27.

REGISTER 4-52: RPINR21: PERIPHERAL PIN SELECT INPUT REGISTER 21

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
REFOIR7REFOIR6REFOIR5REFOIR4REFOIR3REFOIR2REFOIR1REFOIR0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
SS1R7SS1R6SS1R5SS1R4SS1R3SS1R2SS1R1SS1R0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-8 REFOIR[7:0]: Assign Reference Clock Input (S1REFOI) to the Corresponding S1RPn Pin bits See Table 4-27.

bit 7-0 SS1R[7:0]: Assign SPI1 Secondary Select (S1SS1) to the Corresponding S1RPn Pin bits See Table 4-27.

REGISTER 4-53: RPINR23: PERIPHERAL PIN SELECT INPUT REGISTER 23

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
U1CTSR7 U11CTSR6 U1TSR5 U1TSR4 U1TSR3 U1TSR2 U1TSR1 U1TSR0 U1
bit 15 bit 8
U-0U-0U-0U-0U-0U-0U-0U-0
bit 7 bit 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-8 U1CTSR[7:0]: Assign UART1 Clear-to-Send (S1U1CTS) to the Corresponding S1RPn Pin bits See Table 4-27.

bit 7-0 Unimplemented: Read as '0'

REGISTER 4-54: RPINR37: PERIPHERAL PIN SELECT INPUT REGISTER 37

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PCI17R7PCI17R6PCI17R5PCI17R4PCI17R3PCI17R2PCI17R1PCI17R0
bit 15 bit 8
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-8 PCI7R[7:0]: Assign PWM Input 17 (S1PCI17) to the Corresponding S1RPn Pin bits See Table 4-27.

bit 7-0 Unimplemented: Read as '0'

REGISTER 4-55: RPINR38: PERIPHERAL PIN SELECT INPUT REGISTER 38

U-0 U-0 U-0 U-0 U-0 U-0 U-0
————
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
PCI18R7PCI18R6PCI18R5PCI18R4PCI18R3PCI18R2PCI18R1PCI18R0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 15-8 Unimplemented: Read as '0'

bit 7-0 PCI18R[7:0]: Assign PWM Input 18 (S1PCI18) to the Corresponding S1RPn Pin bits See Table 4-27.

REGISTER 4-56: RPINR42: PERIPHERAL PIN SELECT INPUT REGISTER 42

R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
PCI13R7PCI13R6PCI13R5PCI13R4PCI13R3PCI13R2PCI13R1PCI13R0
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
PCI12R7PCI12R6PCI12R5PCI12R4PCI12R3PCI12R2PCI12R1PCI12R0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 15-8 PCI13R[7:0]: Assign PWM Input 13 (S1PCI13) to the Corresponding S1RPn Pin bits See Table 4-27.

bit 7-0 PCI12R[7:0]: Assign PWM Input 12 (S1PCI12) to the Corresponding S1RPn Pin bits See Table 4-27.

REGISTER 4-57: RPINR43: PERIPHERAL PIN SELECT INPUT REGISTER 43

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PCI15R7PCI15R6PCI15R5PCI15R4PCI15R3PCI15R2PCI15R1PCI15R0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PCI14R7PCI14R6PCI14R5PCI14R4PCI14R3PCI14R2PCI14R1PCI14R0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-8 PCI15R[7:0]: Assign PWM Input 15 (S1PCI15) to the Corresponding S1RPn Pin bits See Table 4-27.

bit 7-0 PCI14R[7:0]: Assign PWM Input 14 (S1PCI14) to the Corresponding S1RPn Pin bits See Table 4-27.

REGISTER 4-58: RPINR44: PERIPHERAL PIN SELECT INPUT REGISTER 44

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-8 Unimplemented: Read as '0'

bit 7-0 PCI16[7:0]: Assign PWM Input 16 (S1PCI16) to the Corresponding S1RPn Pin bits See Table 4-27.

REGISTER 4-59: RPINR45: PERIPHERAL PIN SELECT INPUT REGISTER 45

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CLCINAR7 CLCINAR6 CLCNAR5 CLCINAR4 CLCINAR3 CLCINAR2CLCINAR1CLCINAR0
bit 15 bit 8
R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-8 CLCINAR[7:0]: Assign CLC Input A (S1CLCINA) to the Corresponding S1RPn Pin bits See Table 4-27.

bit 7-0 Unimplemented: Read as '0'

REGISTER 4-60: RPINR46: PERIPHERAL PIN SELECT INPUT REGISTER 46

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CLCINCR7CLCINCR6CLCINCR5CLCINCR4CLCINCR3CLCINCR2CLCINCR1CLCINCR0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CLCINBR7 CLCINBR6 CLCNBR5 CLCINBR4 CLCINBR3 CLCINBR2CLCINBR1CLCINBR0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-8 CLCINCR[7:0]: Assign CLC Input C (S1CLCINC) to the Corresponding S1RPn Pin bits See Table 4-27.

bit 7-0 CLCINBR[7:0]: Assign CLC Input B (S1CLCINB) to the Corresponding S1RPn Pin bits See Table 4-27.

REGISTER 4-61: RPINR47: PERIPHERAL PIN SELECT INPUT REGISTER 47

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
ADCTRGR7ADCTRGR6ADCTRGR5ADCTRGR4ADCTRGR3ADCTRGR2ADCTRGR1ADCTRGR0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CLCINDR7CLCINDR6CLCINDR5CLCINDR4CLCINDR3CLCINDR2CLCINDR1CLCINDR0
bit 7 bit 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-8 ADCTRGR[7:0]: Assign ADC External Trigger Input (S1ADCTRG) to the Corresponding S1RPn Pin bits See Table 4-27.

bit 7-0 CLCINDR[7:0]: Assign CLC Input D (S1CLCIND) to the Corresponding S1RPn Pin bits See Table 4-27.

REGISTER 4-62: RPOR0: PERIPHERAL PIN SELECT OUTPUT REGISTER 0

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP33R5RP33R4RP33R3RP33R2RP33R1RP33R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP32R5RP32R4RP32R3RP32R2RP32R1RP32R0
bit 7 bit 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-14 Unimplemented: Read as '0'

bit 13-8 RP33R[5:0]: Peripheral Output Function is Assigned to S1RP33 Output Pin bits (see Table 4-31 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP32R[5:0]: Peripheral Output Function is Assigned to S1RP32 Output Pin bits (see Table 4-31 for peripheral function numbers)

REGISTER 4-63: RPOR1: PERIPHERAL PIN SELECT OUTPUT REGISTER 1

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP35R5RP35R4RP35R3RP35R2RP35R1RP35R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP34R5RP34R4RP34R3RP34R2RP34R1RP34R0
bit 7 bit 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-14 Unimplemented: Read as '0'

bit 13-8 RP35R[5:0]: Peripheral Output Function is Assigned to S1RP35 Output Pin bits (see Table 4-31 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP34R[5:0]: Peripheral Output Function is Assigned to S1RP34 Output Pin bits (see Table 4-31 for peripheral function numbers)

REGISTER 4-64: RPOR2: PERIPHERAL PIN SELECT OUTPUT REGISTER 2

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP37R5RP37R4RP37R3RP37R2RP37R1RP37R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP36R5RP36R4RP36R3RP36R2RP36R1RP36R0
bit 7 bit 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-14 Unimplemented: Read as '0'

bit 13-8 RP37R[5:0]: Peripheral Output Function is Assigned to S1RP37 Output Pin bits (see Table 4-31 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP36R[5:0]: Peripheral Output Function is Assigned to S1RP36 Output Pin bits (see Table 4-31 for peripheral function numbers)

REGISTER 4-65: RPOR3: PERIPHERAL PIN SELECT OUTPUT REGISTER 3

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP39R5RP39R4RP39R3RP39R2RP39R1RP39R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP38R5RP38R4RP38R3RP38R2RP38R1RP38R0
bit 7 bit 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-14 Unimplemented: Read as '0'

bit 13-8 RP39R[5:0]: Peripheral Output Function is Assigned to S1RP39 Output Pin bits (see Table 4-31 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP38R[5:0]: Peripheral Output Function is Assigned to S1RP38 Output Pin bits (see Table 4-31 for peripheral function numbers)

REGISTER 4-66: RPOR4: PERIPHERAL PIN SELECT OUTPUT REGISTER 4

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP41R5RP41R4RP41R3RP41R2RP41R1RP41R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP40R5RP40R4RP40R3RP40R2RP40R1RP40R0
bit 7 bit 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-14 Unimplemented: Read as '0'

bit 13-8 RP41R[5:0]: Peripheral Output Function is Assigned to S1RP41 Output Pin bits (see Table 4-31 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP40R[5:0]: Peripheral Output Function is Assigned to S1RP40 Output Pin bits (see Table 4-31 for peripheral function numbers)

REGISTER 4-67: RPOR5: PERIPHERAL PIN SELECT OUTPUT REGISTER 5

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP43R5RP43R4RP43R3RP43R2RP43R1RP43R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP42R5RP42R4RP42R3RP42R2RP42R1RP42R0
bit 7 bit 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-14 Unimplemented: Read as '0'

bit 13-8 RP43R[5:0]: Peripheral Output Function is Assigned to S1RP43 Output Pin bits (see Table 4-31 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP42R[5:0]: Peripheral Output Function is Assigned to S1RP42 Output Pin bits (see Table 4-31 for peripheral function numbers)

REGISTER 4-68: RPOR6: PERIPHERAL PIN SELECT OUTPUT REGISTER 6

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP45R5RP45R4RP45R3RP45R2RP45R1RP45R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP44R5RP44R4RP44R3RP44R2RP44R1RP44R0
bit 7 bit 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-14 Unimplemented: Read as '0'

bit 13-8 RP45R[5:0]: Peripheral Output Function is Assigned to S1RP45 Output Pin bits (see Table 4-31 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP44R[5:0]: Peripheral Output Function is Assigned to S1RP44 Output Pin bits (see Table 4-31 for peripheral function numbers)

REGISTER 4-69: RPOR7: PERIPHERAL PIN SELECT OUTPUT REGISTER 7

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP47R5RP47R4RP47R3RP47R2RP47R1RP47R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP46R5RP46R4RP46R3RP46R2RP46R1RP46R0
bit 7 bit 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-14 Unimplemented: Read as '0'

bit 13-8 RP47R[5:0]: Peripheral Output Function is Assigned to S1RP47 Output Pin bits (see Table 4-31 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP46R[5:0]: Peripheral Output Function is Assigned to S1RP46 Output Pin bits (see Table 4-31 for peripheral function numbers)

REGISTER 4-70: RPOR8: PERIPHERAL PIN SELECT OUTPUT REGISTER 8

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP49R5RP49R4RP49R3RP49R2RP49R1RP49R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP48R5RP48R4RP48R3RP48R2RP48R1RP48R0
bit 7 bit 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-14 Unimplemented: Read as '0'

bit 13-8 RP49R[5:0]: Peripheral Output Function is Assigned to S1RP49 Output Pin bits (see Table 4-31 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP48R[5:0]: Peripheral Output Function is Assigned to S1RP48 Output Pin bits (see Table 4-31 for peripheral function numbers)

REGISTER 4-71: RPOR9: PERIPHERAL PIN SELECT OUTPUT REGISTER 9

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP51R5RP51R4RP51R3RP51R2RP51R1RP51R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP50R5RP50R4RP50R3RP50R2RP50R1RP50R0
bit 7 bit 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-14 Unimplemented: Read as '0'

bit 13-8 RP51R[5:0]: Peripheral Output Function is Assigned to S1RP51 Output Pin bits (see Table 4-31 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP50R[5:0]: Peripheral Output Function is Assigned to S1RP50 Output Pin bits (see Table 4-31 for peripheral function numbers)

REGISTER 4-72: RPOR10: PERIPHERAL PIN SELECT OUTPUT REGISTER 10

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP53R5RP53R4RP53R3RP53R2RP53R1RP53R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP52R5RP52R4RP52R3RP52R2RP52R1RP52R0
bit 7 bit 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-14 Unimplemented: Read as '0'

bit 13-8 RP53R[5:0]: Peripheral Output Function is Assigned to S1RP53 Output Pin bits (see Table 4-31 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP52R[5:0]: Peripheral Output Function is Assigned to S1RP52 Output Pin bits (see Table 4-31 for peripheral function numbers)

REGISTER 4-73: RPOR11: PERIPHERAL PIN SELECT OUTPUT REGISTER 11

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP55R5RP55R4RP55R3RP55R2RP55R1RP55R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP54R5RP54R4RP54R3RP54R2RP54R1RP54R0
bit 7 bit 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-14 Unimplemented: Read as '0'

bit 13-8 RP55R[5:0]: Peripheral Output Function is Assigned to S1RP55 Output Pin bits (see Table 4-31 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP54R[5:0]: Peripheral Output Function is Assigned to S1RP54 Output Pin bits (see Table 4-31 for peripheral function numbers)

REGISTER 4-74: RPOR12: PERIPHERAL PIN SELECT OUTPUT REGISTER 12

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP57R5RP57R4RP57R3RP57R2RP57R1RP57R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP56R5RP56R4RP56R3RP56R2RP56R1RP56R0
bit 7 bit 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-14 Unimplemented: Read as '0'

bit 13-8 RP57R[5:0]: Peripheral Output Function is Assigned to S1RP57 Output Pin bits (see Table 4-31 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP56R[5:0]: Peripheral Output Function is Assigned to S1RP56 Output Pin bits (see Table 4-31 for peripheral function numbers)

REGISTER 4-75: RPOR13: PERIPHERAL PIN SELECT OUTPUT REGISTER 13

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP59R5RP59R4RP59R3RP59R2RP59R1RP59R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP58R5RP58R4RP58R3RP58R2RP58R1RP58R0
bit 7 bit 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-14 Unimplemented: Read as '0'

bit 13-8 RP59R[5:0]: Peripheral Output Function is Assigned to S1RP59 Output Pin bits (see Table 4-31 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP58R[5:0]: Peripheral Output Function is Assigned to S1RP58 Output Pin bits (see Table 4-31 for peripheral function numbers)

REGISTER 4-76: RPOR14: PERIPHERAL PIN SELECT OUTPUT REGISTER 14

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP61R5RP61R4RP61R3RP61R2RP61R1RP61R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP60R5RP60R4RP60R3RP60R2RP60R1RP60R0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-14 Unimplemented: Read as '0'

bit 13-8 RP61R[5:0]: Peripheral Output Function is Assigned to S1RP61 Output Pin bits (see Table 4-31 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP60R[5:0]: Peripheral Output Function is Assigned to S1RP60 Output Pin bits (see Table 4-31 for peripheral function numbers)

REGISTER 4-77: RPOR15: PERIPHERAL PIN SELECT OUTPUT REGISTER 15

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP63R5RP63R4RP63R3RP63R2RP63R1RP63R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP62R5RP62R4RP62R3RP62R2RP62R1RP62R0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-14 Unimplemented: Read as '0'

bit 13-8 RP63R[5:0]: Peripheral Output Function is Assigned to S1RP63 Output Pin bits (see Table 4-31 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP62R[5:0]: Peripheral Output Function is Assigned to S1RP62 Output Pin bits (see Table 4-31 for peripheral function numbers)

REGISTER 4-78: RPOR16: PERIPHERAL PIN SELECT OUTPUT REGISTER 16

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP65R5RP65R4RP65R3RP65R2RP65R1RP65R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP64R5RP64R4RP64R3RP64R2RP64R1RP64R0
bit 7 bit 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-14 Unimplemented: Read as '0'

bit 13-8 RP65R[5:0]: Peripheral Output Function is Assigned to S1RP65 Output Pin bits (see Table 4-31 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP64R[5:0]: Peripheral Output Function is Assigned to S1RP64 Output Pin bits (see Table 4-31 for peripheral function numbers)

REGISTER 4-79: RPOR17: PERIPHERAL PIN SELECT OUTPUT REGISTER 17

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP67R5RP67R4RP67R3RP67R2RP67R1RP67R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP66R5RP66R4RP66R3RP66R2RP66R1RP66R0
bit 7 bit 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-14 Unimplemented: Read as '0'

bit 13-8 RP67R[5:0]: Peripheral Output Function is Assigned to S1RP67 Output Pin bits (see Table 4-31 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP66R[5:0]: Peripheral Output Function is Assigned to S1RP66 Output Pin bits (see Table 4-31 for peripheral function numbers)

REGISTER 4-80: RPOR18: PERIPHERAL PIN SELECT OUTPUT REGISTER 18

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP69R5RP69R4RP69R3RP69R2RP69R1RP69R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP68R5RP68R4RP68R3RP68R2RP68R1RP68R0
bit 7 bit 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-14 Unimplemented: Read as '0'

bit 13-8 RP69R[5:0]: Peripheral Output Function is Assigned to S1RP69 Output Pin bits (see Table 4-31 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP68R[5:0]: Peripheral Output Function is Assigned to S1RP68 Output Pin bits (see Table 4-31 for peripheral function numbers)

REGISTER 4-81: RPOR19: PERIPHERAL PIN SELECT OUTPUT REGISTER 19

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP71R5RP71R4RP71R3RP71R2RP71R1RP71R0
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RP70R5RP70R4RP70R3RP70R2RP70R1RP70R0
bit 7 bit 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-14 Unimplemented: Read as '0'

bit 13-8 RP71R[5:0]: Peripheral Output Function is Assigned to S1RP71 Output Pin bits (see Table 4-31 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP70R[5:0]: Peripheral Output Function is Assigned to S1RP70 Output Pin bits (see Table 4-31 for peripheral function numbers)

REGISTER 4-82: RPOR20: PERIPHERAL PIN SELECT OUTPUT REGISTER 20

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
— —RP1(1)RP171R4(1)RP1R1R3(1)5 RP171R2(1)RP171R1(1)RP171R0(1)
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
— —RP1(1)RP170R4(1)RP1R0R3(1)5 RP170R2(1)RP170R1(1)RP170R0(1)
bit 7 bit 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-14 Unimplemented: Read as '0'

bit 13-8 RP171R[5:0]: Peripheral Output Function is Assigned to S1RP171 Output Pin bits ^(1) (see Table 4-31 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP170R[5:0]: Peripheral Output Function is Assigned to S1RP170 Output Pin bits ^(1) (see Table 4-31 for peripheral function numbers)

Note 1: These are virtual output ports.

REGISTER 4-83: RPOR21: PERIPHERAL PIN SELECT OUTPUT REGISTER 21

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-14 Unimplemented: Read as '0'

bit 13-8 RP173R[5:0]: Peripheral Output Function is Assigned to S1RP173 Output Pin bits ^(1) (see Table 4-31 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP172R[5:0]: Peripheral Output Function is Assigned to S1RP172 Output Pin bits ^(1) (see Table 4-31 for peripheral function numbers)

Note 1: These are virtual output ports.

REGISTER 4-84: RPOR22: PERIPHERAL PIN SELECT OUTPUT REGISTER 22

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
— —RP1(1)RP175R4(1)RP1R5R3(1)5RP175R2(1)RP175R1(1)RP175R0(1)
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
— —RP1(1)RP174R4(1)RP1R4R3(1)5 RP174R2(1)RP174R1(1)
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-14 Unimplemented: Read as '0'

bit 13-8 RP175R[5:0]: Peripheral Output Function is Assigned to S1RP175 Output Pin bits ^(1) (see Table 4-31 for peripheral function numbers)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 RP174R[5:0]: Peripheral Output Function is Assigned to S1RP174 Output Pin bits ^(1) (see Table 4-31 for peripheral function numbers)

Note 1: These are virtual output ports.

TABLE 4-33: PORTA REGISTER SUMMARY

4.7 High-Speed, 12-Bit Analog-to-Digital Converter (Secondary ADC)

Note 1: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive reference source. To complement the information in this data sheet, refer to "12-Bit High-Speed, Multiple SARs A/D Converter (ADC)" (www.microchip.com/DS70005213), which is available from the Microchip website (www.microchip.com).

2: This section describes the Secondary ADC.

dsPIC33CH128MP508S1 devices have a high-speed, 12-bit Analog-to-Digital Converter (ADC) that features a low conversion latency, high resolution and oversampling capabilities to improve performance in AC/DC, DC/DC power converters. The Secondary implements the ADC with three SAR cores, two dedicated and one shared.

4.7.1 SECONDARY ADC FEATURES OVERVIEW

The High-Speed, 12-Bit Multiple SARs Analog-to-Digital Converter (ADC) includes the following features:

  • Three ADC Cores: Two Dedicated Cores and One Shared (common) Core
  • User-Configurable Resolution of up to 12 Bits for each Core
  • Up to 3.5 Msps Conversion Rate per Channel at 12-Bit Resolution
  • Low-Latency Conversion
  • Up to 20 Analog Input Channels, with a Separate 16-Bit Conversion Result Register for each Input
  • Conversion Result can be Formatted as Unsigned or Signed Data, on a per Channel Basis, for All Channels

  • Simultaneous Sampling of up to Three Analog Inputs
    • Channel Scan Capability

  • Multiple Conversion Trigger Options for each Core, including:
  • PWM triggers from Main and Secondary CPU cores
  • SCCP modules triggers
  • CLC modules triggers
  • External pin trigger event (ADTRG31)
  • Software trigger

- Four Integrated Digital Comparators with Dedicated Interrupts:

- Multiple comparison options

- Assignable to specific analog inputs

- Four Oversampling Filters with Dedicated Interrupts:

- Provide increased resolution

- Assignable to a specific analog input

The module consists of three independent SAR ADC cores. Simplified block diagrams of the Multiple SARs 12-Bit ADC are shown in Figure 4-18 and Figure 4-19.

The analog inputs (channels) are connected through multiplexers and switches to the Sample-and-Hold (S&H) circuit of each ADC core. The core uses the channel information (the output format, the Measurement mode and the input number) to process the analog sample. When conversion is complete, the result is stored in the result buffer for the specific analog input, and passed to the digital filter and digital comparator if they were configured to use data from this particular channel.

The ADC module can sample up to three inputs at a time (two inputs from the dedicated SAR cores and one from the shared SAR core). If multiple ADC inputs request conversion on the shared core, the module will convert them in a sequential manner, starting with the lowest order input.

The ADC provides each analog input the ability to specify its own trigger source. This capability allows the ADC to sample and convert analog inputs that are associated with PWM generators operating on independent time bases.

FIGURE 4-18: ADC MODULE BLOCK DIAGRAM
Microchip dsPIC33CH64MP208 - SECONDARY ADC FEATURES OVERVIEW - 1

flowchart
graph TD
    A["AVDD AVSS"] --> B["Voltage Reference (REFSEL[2:0"])]
    B --> C["Dedicated ADC Core 0"]
    C --> D["Output Data"]
    C --> E["Clock"]
    B --> F["Dedicated ADC Core 1"]
    F --> G["Output Data"]
    F --> H["Clock"]
    B --> I["Shared ADC Core"]
    I --> J["Output Data"]
    I --> K["Clock"]
    B --> L["Divider (CLKDIV[5:0"])]
    L --> M["Clock Selection (CLKSEL[1:0"])]
    M --> N["Fvco/4 AFVCODIV FP (Fosc/2)"]
    M --> O["Fosc"]
    C --> P["Digital Comparator 0 ADCMP0 Interrupt"]
    C --> Q["Digital Comparator 1 ADCMP1 Interrupt"]
    C --> R["Digital Comparator 2 ADCMP2 Interrupt"]
    C --> S["Digital Comparator 3 ADCMP3 Interrupt"]
    I --> T["Digital Filter 0 ADFLTR0 Interrupt"]
    I --> U["Digital Filter 1 ADFLTR1 Interrupt"]
    I --> V["Digital Filter 2 ADFLTR2 Interrupt"]
    I --> W["Digital Filter 3 ADFLTR3 Interrupt"]
    L --> X["ADCBUF0 ADCAN0 Interrupt"]
    L --> Y["ADCBUF1 ADCAN1 Interrupt"]
    L --> Z["ADCBUF20 ADCAN20 Interrupt"]
    style A fill:#f9f,stroke:#333
    style B fill:#ccf,stroke:#333
    style C fill:#cfc,stroke:#333
    style D fill:#fcc,stroke:#333
    style E fill:#fcc,stroke:#333
    style F fill:#fcc,stroke:#333
    style G fill:#fcc,stroke:#333
    style H fill:#fcc,stroke:#333
    style I fill:#fcc,stroke:#333
    style J fill:#fcc,stroke:#333
    style K fill:#fcc,stroke:#333
    style L fill:#cff,stroke:#333
    style M fill:#ffc,stroke:#333
    style N fill:#ffc,stroke:#333
    style O fill:#ffc,stroke:#333
    style P fill:#ffc,stroke:#333
    style Q fill:#ffc,stroke:#333
    style R fill:#ffc,stroke:#333
    style S fill:#ffc,stroke:#333
    style T fill:#ffc,stroke:#333
    style U fill:#ffc,stroke:#333
    style V fill:#ffc,stroke:#333
    style W fill:#ffc,stroke:#333

Note 1: SPGA1, SPGA2, SPGA3 and Band Gap Reference (VBG) are internal analog inputs and are not available on device pins.
2: These pins are the negative input for the corresponding analog input channel when in differential mode.

FIGURE 4-19: ADC SHARED CORE BLOCK DIAGRAM
Microchip dsPIC33CH64MP208 - SECONDARY ADC FEATURES OVERVIEW - 2

flowchart
graph TD
    A["SPGA3 (AN2)"] --> B["Organizer"]
    C["S1AN3"] --> B
    D["S1AN18"] --> B
    E["Temperature Sensor (AN19)"] --> B
    F["Band Gap 1.2V (AN20)"] --> B
    B --> G["Shared Sample-and-Hold"]
    G --> H["12-Bit SAR ADC"]
    H --> I["Reference"]
    H --> J["Output Data"]
    G --> K["ADC Core Clock Divider"]
    K --> L["Clock"]
    K --> M["SHRADCS[6:0"]]
    K --> N["SHRSAMC[9:0"]]
    G --> O["Sampling Time"]
    O --> P["AVss"]
    P --> Q["Analog Channel Number from Current Trigger"]

FIGURE 4-20: DEDICATED ADC CORE
Microchip dsPIC33CH64MP208 - SECONDARY ADC FEATURES OVERVIEW - 3

flowchart
graph TD
    A["Analog Input Pins"] --> B["Positive Input Selection (CxCHS<1:0> bits)"]
    C["From Other Analog Modules"] --> B
    D["ANNx"] --> E["Negative Input Selection (DIFFx bit)"]
    B --> F["Sample-and-Hold"]
    E --> F
    F --> G["12-Bit SAR ADC"]
    G --> H["ADC Core Clock Divider (ADCS<6:0> bits)"]
    H --> I["Trigger Stops Sampling"]
    I --> J["AVss"]
    G --> K["Reference"]
    G --> L["Output Data"]
    G --> M["Clock"]

4.7.2 SAMPLING TIME REQUIREMENTS

The analog input model of the ADC is shown in the figure below.

FIGURE: ADC ANALOG INPUT MODEL
Microchip dsPIC33CH64MP208 - SAMPLING TIME REQUIREMENTS - 1

text_image Signal Source Source Resistance R_S Pin Capacitance C_PIN^(1) Total Interconnect Resistance R_IC^(2) Sampling Switch Sample and Hold Capacitance C_HOLD^(3)

Note 1: The CPIN value depends on the device package and is not tested. The effect of the CPIN is negligible if Rs ≤ 5 kΩ.
2: See the AD62 parameter in Table 24-43.
3: See the AD60 and AD61 parameters in Table 24-43.

The total acquisition time for the Analog-to-Digital conversion is a function of the Holding Capacitor (CHOLD) charge time. For the ADC module to meet its specified accuracy, the Holding Capacitor (CHOLD) must be allowed to fully charge to the voltage level on the analog input pin. The Signal Source Impedance (Rs) and the Interconnect Impedance (Ric) combine to affect the time required to charge the CHOLD. The total resistance (Rs + Ric) must therefore be small enough to fully charge the Holding Capacitor within the selected sample time.

4.7.3 TEMPERATURE SENSOR

The ADC channel, S1AN19, is connected to a forward biased diode; it can be used to measure die temperature. This diode provides an output with a temperature coefficient of approximately -1.5 mV/C that can be monitored by the ADC. To get the exact gain and offset numbers, two-point temperature calibration is recommended.

4.7.4 ANALOG-TO-DIGITAL CONVERTER RESOURCES

Many useful resources are provided on the main product page of the Microchip website for the devices listed in this data sheet. This product page contains the latest updates and additional information.

4.7.4.1 Key Resources

  • "12-Bit High-Speed, Multiple SARs A/D Converter (ADC)" (www.microchip.com/DS70005213)
  • Code Samples
    • Application Notes
  • Software Libraries
  • Webinars
  • All Related "dsPIC33/PIC24 Family Reference Manual" Sections
  • Development Tools

4.7.5 ADC CONTROL/STATUS REGISTERS

REGISTER 4-85: ADCON1L: ADC CONTROL REGISTER 1 LOW

R/W-0 U-0 R/W-0 U-0 r-0 U-0 U-0 U-0
ADON^(1) ADSIDL——
bit 15 bit 8
U-0 U-0 U-0 U-0 U-0 U-0 U-0 U-0
——————
bit 7 bit 0
Legend:r = Reserved 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 15 ADON: ADC Enable bit ^(1)

1 = ADC module is enabled

0 = ADC module is off

bit 14 Unimplemented: Read as '0'

bit 13 ADSIDL: ADC Stop in Idle Mode bit

1 = Discontinues module operation when device enters Idle mode

0 = Continues module operation in Idle mode

bit 12 Unimplemented: Read as '0'

bit 11 Reserved: Maintain as '0'

bit 10-0 Unimplemented: Read as '0'

Note 1: Set the ADON bit only after the ADC module has been configured. Changing ADC Configuration bits when ADON = 1 will result in unpredictable behavior.

REGISTER 4-86: ADCON1H: ADC CONTROL REGISTER 1 HIGH

U-0 U-0 U-0 U-0 U-0 U-0 U-0 U-0
——————
bit 15 bit 8
R/W-0 R/W-1 R/W-1 U-0 U-0 U-0 U-0 U-0
FORM SHRRES1 SHRRES0— — —— —
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-8 Unimplemented: Read as '0'

bit 7 FORM: Fractional Data Output Format bit

1 = Fractional

0 = Integer

bit 6-5 SHRRES[1:0]: Shared ADC Core Resolution Selection bits

11 = 12-bit resolution

10 = 10-bit resolution

01 = 8-bit resolution

00 = 6-bit resolution

bit 4-0 Unimplemented: Read as '0'

REGISTER 4-87: ADCON2L: ADC CONTROL REGISTER 2 LOW

R/W-0 R/W-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
REFCIE REFERCIE— EIENPTGEN SHREISEL2(1)SHREISEL1(1)SHREISEL0(1)
bit 15 bit 8
U-0R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0R/W-0
SHRADCS[6:0]
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 15REFCIE: Band Gap and Reference Voltage Ready Common Interrupt Enable bit1 = Common interrupt will be generated when the band gap will become ready0 = Common interrupt is disabled for the band gap ready event
bit 14REFERCIE: Band Gap or Reference Voltage Error Common Interrupt Enable bit1 = Common interrupt will be generated when a band gap or reference voltage error is detected0 = Common interrupt is disabled for the band gap and reference voltage error event
bit 13Unimplemented: Read as '0'
bit 12EIEN: Early Interrupts Enable bit1 = The early interrupt feature is enabled for the input channel interrupts (when the EISTATx flag is set)0 = The individual interrupts are generated when conversion is done (when the ANxRDY flag is set)
bit 11PTGEN: External Conversion Request Interface bitSetting this bit will enable the PTG to request conversion of an ADC input.
bit 10-8SHREISEL[2:0]: Shared Core Early Interrupt Time Selection bits(1)111 = Early interrupt is set and interrupt is generated 8 TADCORE clocks prior to when the data are ready110 = Early interrupt is set and interrupt is generated 7 TADCORE clocks prior to when the data are ready101 = Early interrupt is set and interrupt is generated 6 TADCORE clocks prior to when the data are ready100 = Early interrupt is set and interrupt is generated 5 TADCORE clocks prior to when the data are ready011 = Early interrupt is set and interrupt is generated 4 TADCORE clocks prior to when the data are ready010 = Early interrupt is set and interrupt is generated 3 TADCORE clocks prior to when the data are ready001 = Early interrupt is set and interrupt is generated 2 TADCORE clocks prior to when the data are ready000 = Early interrupt is set and interrupt is generated 1 TADCORE clock prior to when the data are ready
bit 7Unimplemented: Read as '0'
bit 6-0SHRADCS[6:0]: Shared ADC Core Input Clock Divider bitsThese bits determine the number of TCORESRC (Source Clock Periods) for one shared TADCORE (Core Clock Period).1111111 = 254 Source Clock Periods...0000011 = 6 Source Clock Periods0000010 = 4 Source Clock Periods0000001 = 2 Source Clock Periods0000000 = 2 Source Clock Periods

Note 1: For the 6-bit shared ADC core resolution (SHRES[1:0] = 00), the SHREISEL[2:0] settings, from '100' to '111', are not valid and should not be used. For the 8-bit shared ADC core resolution (SHRES[1:0] = 01), the SHREISEL[2:0] settings, '110' and '111', are not valid and should not be used.

REGISTER 4-88: ADCON2H: ADC CONTROL REGISTER 2 HIGH

HSC/R-0 HSC/R-0 U-0 r-0 r-0 r-0 R/W-0 R/W-0
REFRDY REFERR— r r r SHRSAMC[9:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
SHRSAMC[7:0]
bit 7bit 0
Legend:r = Reserved bitU = Unimplemented bit, read as '0'
R = Readable bitW = Writable bitHSC = Hardware Settable/Clearable bit
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown
bit 15REFRDY: Band Gap and Reference Voltage Ready Flag bit1 = Band gap is ready0 = Band gap is not ready
bit 14REFERR: Band Gap or Reference Voltage Error Flag bit1 = Band gap was removed after the ADC module was enabled (ADON = 1)0 = No band gap error was detected
bit 13Unimplemented: Read as '0'
bit 12-10Reserved: Maintain as '0'
bit 9-0SHRSAMC[9:0]: Shared ADC Core Sample Time Selection bitsThese bits specify the number of shared ADC Core Clock Periods (TADCORE) for the shared ADC core sample time.1111111111 = 1025 TADCORE...0000000001 = 3 TADCORE000000000 = 2 TADCORE

REGISTER 4-89: ADCON3L: ADC CONTROL REGISTER 3 LOW

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 HSC/R-0 R/W-0 HSC/R-0
REFSEL2 REFSEL1 REFSEL0 SUSPENDSUSPCIE SUSPRDY SHRSAMP CNVRTCH
bit 15 bit 8
R/W-0 HSC/R-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
SWLCTRGSWCTRGCNVCHSEL5CNVCHSEL4CNVCHSEL3CNVCHSEL2CNVCHSEL1CNVCHSEL0
bit 7 bit 0
Legend:U = Unimplemented bit, read as '0'
R = Readable bitW = Writable bitHSC = Hardware Settable/Clearable bit
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown

bit 15-13 REFSEL[2:0]: ADC Reference Voltage Selection bits

ValueVREFHVREFL
000AVDDAVss

001-111 = Unimplemented: Do not use

bit 12 SUSPEND: All ADC Core Triggers Disable bit

1 = All new trigger events for all ADC cores are disabled
0 = All ADC cores can be triggered

bit 11 SUSPCIE: Suspend All ADC Cores Common Interrupt Enable bit

1 = Common interrupt will be generated when ADC core triggers are suspended (SUSPEND bit = 1) and all previous conversions are finished (SUSPRDY bit becomes set)
0 = Common interrupt is not generated for suspend ADC cores event

bit 10 SUSPRDY: All ADC Cores Suspended Flag bit

1 = All ADC cores are suspended (SUSPEND bit = 1) and have no conversions in progress
0 = ADC cores have previous conversions in progress

bit 9 SHRSAMP: Shared ADC Core Sampling Direct Control bit

This bit should be used with the individual channel conversion trigger controlled by the CNVRTCH bit. It connects an analog input, specified by the CNVCHSEL[5:0] bits, to the shared ADC core and allows extending the sampling time. This bit is not controlled by hardware and must be cleared before the conversion starts (setting CNVRTCH to '1').

1 = Shared ADC core samples an analog input specified by the CNVCHSEL[5:0] bits
0 = Sampling is controlled by the shared ADC core hardware

bit 8 CNVRTCH: Software Individual Channel Conversion Trigger bit

1 = Single trigger is generated for an analog input specified by the CNVCHSEL[5:0] bits; when the bit is set, it is automatically cleared by hardware on the next instruction cycle
0 = Next individual channel conversion trigger can be generated

bit 7 SWLCTRG: Software Level-Sensitive Common Trigger bit

1 = Triggers are continuously generated for all channels with the software, level-sensitive common trigger selected as a source in the ADTRIGnL and ADTRIGnH registers
0 = No software, level-sensitive common triggers are generated

bit 6 SWCTRG: Software Common Trigger bit

1 = Single trigger is generated for all channels with the software; common trigger selected as a source in the ADTRIGnL and ADTRIGnH registers; when the bit is set, it is automatically cleared by hardware on the next instruction cycle
0 = Ready to generate the next software common trigger

bit 5-0 CNVCHSEL [5:0]: Channel Number Selection for Software Individual Channel Conversion Trigger bits

These bits define a channel to be converted when the CNVRTCH bit is set.

REGISTER 4-90: ADCON3H: ADC CONTROL REGISTER 3 HIGH

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CLKSEL1 CLKSEL0 CLKDIV5 CLKDIV4CLKDIV3 CLKDIV2 CLKDIV1CLKDIV0
bit 15 bit 8
R/W-0 U-0 U-0 U-0 U-0 R/W-0 R/W-0
SHREN— — —— — C1EN COEN
bit 7 bit 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-14 CLKSEL[1:0]: ADC Module Clock Source Selection bits ^(1)

11 = Fvco/4

10 = AFVCODIV

01 = Fosc

00 = FP (Fosc/2)

bit 13-8 CLKDIV[5:0]: ADC Module Clock Source Divider bits ^(2)

The divider forms a TCORESRC clock used by all ADC cores (shared and dedicated) from the TSRC ADC module clock source selected by the CLKSEL[1:0] bits. Then, each ADC core individually divides the TCORESRC clock to get a core-specific TADCORE clock using the ADCS[6:0] bits in the ADCORExH register or the SHRADCS[6:0] bits in the ADCON2L register.

111111 = 64 Source Clock Periods

• • •

000011 = 4 Source Clock Periods

000010 = 3 Source Clock Periods

000001 = 2 Source Clock Periods

000000 = 1 Source Clock Period

bit 7 SHREN: Shared ADC Core Enable bit

1 = Shared ADC core is enabled

0 = Shared ADC core is disabled

bit 6-2 Unimplemented: Read as '0'

bit 1 C1EN: Dedicated ADC Core 1 Enable bits

1 = Dedicated ADC Core 1 is enabled

0 = Dedicated ADC Core 1 is disabled

bit 0 C0EN: Dedicated ADC Core 0 Enable bits

1 = Dedicated ADC Core 0 is enabled

0 = Dedicated ADC Core 0 is disabled

Note 1: The ADC input clock frequency, selected by the CLKSEL[1:0] bits, must not exceed AD67 listed in Table 24-44.

2: The ADC clock frequency, after the divider selected by the CLKDIV[5:0] bits, must not exceed AD67 listed in Table 24-44.

REGISTER 4-91: ADCON4L: ADC CONTROL REGISTER 4 LOW

U-0 U-0 U-0 U-0 U-0 U-0 r-0 r-0
——————
bit 15 bit 8
U-0 U-0 U-0 U-0 U-0 R/W-0 R/W-0
———— SAMC1EN SAMC0EN
bit 7 bit 0
Legend:r = Reserved 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 15-10 Unimplemented: Read as '0'

bit 9-8 Reserved: Must be written as '0'

bit 7-2 Unimplemented: Read as '0'

bit 1 SAMC1EN: Dedicated ADC Core 1 Conversion Delay Enable bit

1 = After trigger, the conversion will be delayed and the ADC core will continue sampling during the time specified by the SAMC[9:0] bits in the ADCORE1L register
0 = After trigger, the sampling will be stopped immediately and the conversion will be started on the next core clock cycle

bit 0 SAMC0EN: Dedicated ADC Core 0 Conversion Delay Enable bit

1 = After trigger, the conversion will be delayed and the ADC core will continue sampling during the time specified by the SAMC[9:0] bits in the ADCORE0L register
0 = After trigger, the sampling will be stopped immediately and the conversion will be started on the next core clock cycle

REGISTER 4-92: ADCON4H: ADC CONTROL REGISTER 4 HIGH

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
— — —— C1CHS1 C1CHS0 C0CHS1 C0CHS0
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-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-2 C1CHS[1:0]: Dedicated ADC Core 1 Input Channel Selection bits

11 = S1ANC1

10 = SPGA2

01 = S1ANA1

00 = S1AN1

bit 1-0 C0CHS[1:0]: Dedicated ADC Core 0 Input Channel Selection bits

11 = S1ANC0

10 = SPGA1

01 = S1ANA0

00 = S1AN0

REGISTER 4-93: ADCON5L: ADC CONTROL REGISTER 5 LOW

HSC/R-0 U-0 U-0 U-0 U-0 HSC/R-0 HSC/R-0
SHRRDY— — —— — C1RDYC0RDY
bit 15 bit 8
R/W-0 U-0 U-0 U-0 U-0 R/W-0 R/W-0
SHRPWR————C1PWRC0
bit 7 bit 0
Legend:U = Unimplemented bit, read as '0'
R = Readable bitW = Writable bitHSC = Hardware Settable/Clearable bit
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown
bit 15SHRRDY: Shared ADC Core Ready Flag bit1 = ADC core is powered and ready for operation0 = ADC core is not ready for operation
bit 14-10Unimplemented: Read as '0'
bit 9C1RDY: Dedicated ADC Core 1 Ready Flag bit1 = ADC Core 1 is powered and ready for operation0 = ADC Core 1 is not ready for operation
bit 8C0RDY: Dedicated ADC Core 0 Ready Flag bit1 = ADC Core 0 is powered and ready for operation0 = ADC Core 0 is not ready for operation
bit 7SHRPWR: Shared ADC Core Power Enable bit1 = ADC core is powered0 = ADC core is off
bit 6-2Unimplemented: Read as '0'
bit 1C1PWR: Dedicated ADC Core 1 Power Enable bit1 = ADC Core 1 is powered0 = ADC Core 1 is off
bit 0C0PWR: Dedicated ADC Core 0 Power Enable bit1 = ADC Core 0 is powered0 = ADC Core 0 is off

REGISTER 4-94: ADCON5H: ADC CONTROL REGISTER 5 HIGH

U-0 U-0 U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0
— — —— WARMTIME[3:0]
bit 15 bit 8
R/W-0 U-0 U-0 U-0 U-0 R/W-0 R/W-0
SHRCIEC1CIEC0CIE
bit 7 bit 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-12 Unimplemented: Read as '0'

bit 11-8 WARMTIME[3:0]: ADC Dedicated Core x Power-up Delay bits

These bits determine the power-up delay in the number of the Core Source Clock Periods (TCORESRC) for all ADC cores.

1111 = 32768 Source Clock Periods
1110 = 16384 Source Clock Periods
1101 = 8192 Source Clock Periods
1100 = 4096 Source Clock Periods
1011 = 2048 Source Clock Periods
1010 = 1024 Source Clock Periods
1001 = 512 Source Clock Periods
1000 = 256 Source Clock Periods
0111 = 128 Source Clock Periods
0110 = 64 Source Clock Periods
0101 = 32 Source Clock Periods
0100 = 16 Source Clock Periods
00xx = 16 Source Clock Periods

bit 7 SHRCIE: Shared ADC Core Ready Common Interrupt Enable bit

1 = Common interrupt will be generated when ADC core is powered and ready for operation
0 = Common interrupt is disabled for an ADC core ready event

bit 6-2 Unimplemented: Read as '0'

bit 1 C1CIE: Dedicated ADC Core 1 Ready Common Interrupt Enable bit

1 = Common interrupt will be generated when ADC Core 1 is powered and ready for operation

0 = Common interrupt is disabled for an ADC Core 1 ready event

bit 0 COCIE: Dedicated ADC Core 0 Ready Common Interrupt Enable bit

1 = Common interrupt will be generated when ADC Core 0 is powered and ready for operation

0 = Common interrupt is disabled for an ADC Core 0 ready event

REGISTER 4-95: ADCORExL: DEDICATED ADC CORE x CONTROL REGISTER LOW (x = 0 TO 1)

U-0 U-0 U-0 U-0 U-0 R/W-0 R/W-0
— — —— —SAMC[9:8]
bit 15bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
SAMC[7:0]
bit 7bit 0

Legend:

R = Readable bitW = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 15-10 Unimplemented: Read as '0'

bit 9-0 SAMC[9:0]: Dedicated ADC Core x Conversion Delay Selection bits

These bits determine the time between the trigger event and the start of conversion in the number of the Core Clock Periods (TADCORE). During this time, the ADC Core x still continues sampling. This feature is enabled by the SAMCxEN bits in the ADCON4L register.

1111111111 = 1025 TADCORE

...

0000000001 = 3 TADCORE

0000000000 = 2 TADCORE

REGISTER 4-96: ADCORExH: DEDICATED ADC CORE x CONTROL REGISTER HIGH (x = 0 TO 1)

U-0 U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
EISEL2EISEL1EISEL0RES1RES2
bit 15 bit 8
U-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
ADCS[6:0]
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 cleared x = Bit is unknown

bit 15-13 Unimplemented: Read as '0'

bit 12-10 EISEL[2:0]: ADC Core x Early Interrupt Time Selection bits

111 = Early interrupt is set and an interrupt is generated 8 TADCORE clocks prior to when the data are ready 110 = Early interrupt is set and an interrupt is generated 7 TADCORE clocks prior to when the data are ready 101 = Early interrupt is set and an interrupt is generated 6 TADCORE clocks prior to when the data are ready 100 = Early interrupt is set and an interrupt is generated 5 TADCORE clocks prior to when the data are ready 011 = Early interrupt is set and an interrupt is generated 4 TADCORE clocks prior to when the data are ready 010 = Early interrupt is set and an interrupt is generated 3 TADCORE clocks prior to when the data are ready 001 = Early interrupt is set and an interrupt is generated 2 TADCORE clocks prior to when the data are ready 000 = Early interrupt is set and an interrupt is generated 1 TADCORE clock prior to when the data are ready

bit 9-8 RES[1:0]: ADC Core x Resolution Selection bits

11 = 12-bit resolution 10 = 10-bit resolution 01 = 8-bit resolution ^(1) 00 = 6-bit resolution ^(1)

bit 7 Unimplemented: Read as '0'

bit 6-0 ADCS[6:0]: ADC Core x Input Clock Divider bits

These bits determine the number of Source Clock Periods (TCORESRC) for one Core Clock Period (TADCORE). 1111111 = 254 Source Clock Periods

0000011 = 6 Source Clock Periods 0000010 = 4 Source Clock Periods 0000001 = 2 Source Clock Periods 0000000 = 2 Source Clock Periods

Note 1: For the 6-bit ADC core resolution (RES[1:0] = 00), the EISEL[2:0] bits settings, from '100' to '111', are not valid and should not be used. For the 8-bit ADC core resolution (RES[1:0] = 01), the EISEL[2:0] bits settings, '110' and '111', are not valid and should not be used.

REGISTER 4-97: ADLVLTRGL: ADC LEVEL-SENSITIVE TRIGGER CONTROL REGISTER LOW

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
LVLEN[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
LVLEN[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 LVLEN[15:0]: Level Trigger for Corresponding Analog Input Enable bits

1 = Input trigger is level-sensitive
0 = Input trigger is edge-sensitive

REGISTER 4-98: ADLVLTRGH: ADC LEVEL-SENSITIVE TRIGGER CONTROL REGISTER HIGH

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-5 Unimplemented: Read as '0'

bit 4-0 LVLEN[20:16]: Level Trigger for Corresponding Analog Input Enable bits

1 = Input trigger is level-sensitive
0 = Input trigger is edge-sensitive

REGISTER 4-99: ADEIEL: ADC EARLY INTERRUPT ENABLE REGISTER LOW

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
EIEN[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
EIEN[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 EIEN[15:0]: Early Interrupt Enable for Corresponding Analog Inputs bits

1 = Early interrupt is enabled for the channel

0 = Early interrupt is disabled for the channel

REGISTER 4-100: ADEIEH: ADC EARLY INTERRUPT ENABLE REGISTER HIGH

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-5 Unimplemented: Read as '0'

bit 4-0 EIEN[20:16]: Early Interrupt Enable for Corresponding Analog Inputs bits

1 = Early interrupt is enabled for the channel

0 = Early interrupt is disabled for the channel

REGISTER 4-101: ADEISTATL: ADC EARLY INTERRUPT STATUS REGISTER LOW

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
EISTAT[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
EISTAT[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0

EISTAT[15:0]: Early Interrupt Status for Corresponding Analog Inputs bits

1 = Early interrupt was generated
0 = Early interrupt was not generated since the last ADCBUFx read

REGISTER 4-102: ADEISTATH: ADC EARLY INTERRUPT STATUS REGISTER HIGH

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-5 Unimplemented: Read as '0'

bit 4-0 EISTAT[20:16]: Early Interrupt Status for Corresponding Analog Inputs bits

1 = Early interrupt was generated
0 = Early interrupt was not generated since the last ADCBUFx read

REGISTER 4-103: ADMODOL: ADC INPUT MODE CONTROL REGISTER 0 LOW

U-0 R/W-0 U-0 R/W-0 U-0 R/W-0 U-0 R/W-0
— SIGN7 — SIGN6SI
bit 15 bit 8
U-0 R/W-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
SIGN3SIGN2DIFF1SIGN1DIFF0SIGN0
bit 7 bit 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-5 (odd) Unimplemented: Read as '0'

bit 14-0 (even) SIGNn (n = 7 to 0): Output Data Sign for Corresponding Analog Inputs bits

1 = Channel output data are signed
0 = Channel output data are unsigned

bit 3-1 (odd) DIFFn (n = 1 to 0): Differential-Mode for Corresponding Analog Inputs bits

1 = Channel is differential
0 = Channel is single-ended

REGISTER 4-104: ADMOD0H: ADC INPUT MODE CONTROL REGISTER 0 HIGH

U-0 R/W-0 U-0 R/W-0 U-0 R/W-0 U-0 R/W-0
SIGN15SIGN14SIGN13SIGN12
bit 15 bit 8
U-0 R/W-0 U-0 R/W-0 U-0 R/W-0 U-0 R/W-0
SIGN11SIGN10SIGN9SIGN8
bit 7 bit 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-1 (odd) Unimplemented: Read as '0'

bit 14-0 (even) SIGNn (n = 15 to 8): Output Data Sign for Corresponding Analog Input bits

1 = Channel output data are signed
0 = Channel output data are unsigned

REGISTER 4-105: ADMOD1L: ADC INPUT MODE CONTROL REGISTER 1 LOW

U-0 U-0 U-0 U-0 U-0 U-0 R/W-0
——————SIGN20
bit 15 bit 8
U-0 R/W-0 U-0 R/W-0 U-0 R/W-0 U-0 R/W-0
SIGN19SIGN18SIGN17SIGN16
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-9 Unimplemented: Read as '0'

bit 7-1 (odd) Unimplemented: Read as '0'

bit 8-0 (even) SIGNn (n = 20 to 16): Output Data Sign for Corresponding Analog Input bits

1 = Channel output data are signed

0 = Channel output data are unsigned

REGISTER 4-106: ADIEL: ADC INTERRUPT ENABLE REGISTER LOW

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
IE[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
IE[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 IE[15:0]: Common Interrupt Enable bits

1 = Common and individual interrupts are enabled for the corresponding channel
0 = Common and individual interrupts are disabled for the corresponding channel

REGISTER 4-107: ADIEH: ADC INTERRUPT ENABLE REGISTER HIGH

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-5 Unimplemented: Read as '0'

bit 4-0 IE[20:16]: Common Interrupt Enable bits

1 = Common and individual interrupts are enabled for the corresponding channel
0 = Common and individual interrupts are disabled for the corresponding channel

REGISTER 4-108: ADSTATL: ADC DATA READY STATUS REGISTER LOW

HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0
AN[15:8]RDY
bit 15 bit 8
HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0
AN[7:0]RDY
bit 7 bit 0
Legend: U = Unimplemented bit, read as '0'
R = Readable bit W = Writable bit HSC = Hardware Settable/Clearable bit
-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0

AN[15:0]RDY: Common Interrupt Enable for Corresponding Analog Inputs bits

1 = Channel conversion result is ready in the corresponding ADCBUFx register
0 = Channel conversion result is not ready

REGISTER 4-109: ADSTATH: ADC DATA READY STATUS REGISTER HIGH

U-0U-0U-0HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0
AN[20:16]RDY
bit 7 bit 0
Legend: U = Unimplemented bit, read as '0'
R = Readable bit W = Writable bit HSC = Hardware Settable/Clearable bit
-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-5 Unimplemented: Read as '0'

bit 4-0 AN[20:16]RDY: Common Interrupt Enable for Corresponding Analog Inputs bits

1 = Channel conversion result is ready in the corresponding ADCBUFx register
0 = Channel conversion result is not ready

REGISTER 4-110: ADTRIGnL/ADTRIGnH: ADC CHANNEL TRIGGER n(x) SELECTION REGISTERS LOW AND HIGH (x = 0 TO 19; n = 0 TO 4)

U-0 U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
— — + TRGSRC(x+1)[4:0]
bit 15 bit 8
U-0 U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
— — + TRGSRCx[4:0]
bit 7 bit 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-13 Unimplemented: Read as '0'

bit 12-8 TRGSRC(x+1)[4:0]: Trigger Source Selection for Corresponding Analog Inputs bits (TRGSRC1 to TRGSRC19 – Odd)
11111 = ADTRG31 (PPS input)
11110 = Main PTG
11101 = Secondary CLC1
11100 = Main CLC1
11011 = Reserved
11010 = Reserved
11001 = Main PWM3 Trigger 2
11000 = Main PWM1 Trigger 2
10111 = Secondary SCCP4 input capture/output compare
10110 = Secondary SCCP3 input capture/output compare
10101 = Secondary SCCP2 input capture/output compare
10100 = Secondary SCCP1 input capture/output compare
10011 = Reserved
10010 = Reserved
10001 = Reserved
10000 = Reserved
01111 = Secondary PWM8 Trigger 1
01110 = Secondary PWM7 Trigger 1
01101 = Secondary PWM6 Trigger 1
01100 = Secondary PWM5 Trigger 1
01011 = Secondary PWM4 Trigger 2
01010 = Secondary PWM4 Trigger 1
01001 = Secondary PWM3 Trigger 2
01000 = Secondary PWM3 Trigger 1
00111 = Secondary PWM2 Trigger 2
00110 = Secondary PWM2 Trigger 1
00101 = Secondary PWM1 Trigger 2
00100 = Secondary PWM1 Trigger 1
00011 = Reserved
00010 = Level software trigger
00001 = Common software trigger
00000 = No trigger is enabled

bit 7-5 Unimplemented: Read as 'c' 

REGISTER 4-110: ADTRIGnL/ADTRIGnH: ADC CHANNEL TRIGGER n(x) SELECTION REGISTERS LOW AND HIGH (x = 0 TO 19; n = 0 TO 4) (CONTINUED)

bit 4-0TRGSRCx[4:0]: Common Interrupt Enable for Corresponding Analog Inputs bits (TRGSRC0 to TRGSRC20 – Even)
11111 = ADTRG31 (PPS input)
11110 = Main PTG
11101 = Secondary CLC1
11100 = Main CLC1
11011 = Reserved
11010 = Reserved
11001 = Main PWM3 Trigger 2
11000 = Main PWM1 Trigger 2
10111 = Secondary SCCP4 input capture/output compare
10110 = Secondary SCCP3 input capture/output compare
10101 = Secondary SCCP2 input capture/output compare
10100 = Secondary SCCP1 input capture/output compare
10011 = Reserved
10010 = Reserved
10001 = Reserved
10000 = Reserved
01111 = Secondary PWM8 Trigger 1
01110 = Secondary PWM7 Trigger 1
01101 = Secondary PWM6 Trigger 1
01100 = Secondary PWM5 Trigger 1
01011 = Secondary PWM4 Trigger 2
01010 = Secondary PWM4 Trigger 1
01001 = Secondary PWM3 Trigger 2
01000 = Secondary PWM3 Trigger 1
00111 = Secondary PWM2 Trigger 2
00110 = Secondary PWM2 Trigger 1
00101 = Secondary PWM1 Trigger 2
00100 = Secondary PWM1 Trigger 1
00011 = Reserved
00010 = Level software trigger
00001 = Common software trigger
00000 = No trigger is enabled

REGISTER 4-111: ADCAL1H: ADC CALIBRATION REGISTER 1 HIGH

HS/R/W-0 U-0 U-0 U-0 U-0 r-0 R/W-0 R/W-0
CSHRRDY— — —— — CSHRENCSHRRUN
bit 15 bit 8
Legend:HS = Hardware Settable bitr = Reserved 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 15 CSHRRDY: Shared ADC Core Calibration Status Flag bit

1 = Shared ADC core calibration is finished

0 = Shared ADC core calibration is in progress

bit 14-11 Unimplemented: Read as '0'

bit 10 Reserved: Maintain as '0'

bit 9 CSHREN: Shared ADC Core Calibration Enable bit

1 = Shared ADC core calibration bits (CSHRRDY and CSHRRUN) can be accessed by software

0 = Shared ADC core calibration bits are disabled

bit 8 CSHRRUN: Shared ADC Core Calibration Start bit

1 = If this bit is set by software, the shared ADC core calibration cycle is started; this bit is cleared automatically by hardware

0 = Software can start the next calibration cycle

bit 7-0 Unimplemented: Read as '0'

REGISTER 4-112: ADCMPxCON: ADC DIGITAL COMPARATOR x CONTROL REGISTER (x = 0, 1, 2, 3)

U-0 U-0 U-0HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0HSC/R-0
— — —CHNL[4:0]
bit 15 bit 8
R/W-0 R/W-0 HC/HS/R-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CMPENIESTATBTWNHIHIHILOLOHILOLO
bit 7 bit 0
Legend:HC = Hardware Clearable bitU = Unimplemented bit, read as '0'
R = Readable bitW = Writable bitHSC = Hardware Settable/Clearable bit
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedHS = Hardware Settable bit

bit 15-13 Unimplemented: Read as '0'

bit 12-8 CHNL[4:0]: Input Channel Number bits

If the comparator has detected an event for a channel, this channel number is written to these bits.

11111 = Reserved

...

10101 = Reserved

10100 = Band gap, 1.2V (AN20)

10011 = Temperature sensor (AN19)

10010 = S1AN18

• • •

00011 = S1AN3

00010 = S1AN2

00001 = S1AN1

00000 = S1AN0

bit 7 CMPEN: Comparator Enable bit

1 = Comparator is enabled

0 = Comparator is disabled and the STAT status bit is cleared

bit 6 IE: Comparator Common ADC Interrupt Enable bit

1 = Common ADC interrupt will be generated if the comparator detects a comparison event

0 = Common ADC interrupt will not be generated for the comparator

bit 5 STAT: Comparator Event Status bit

This bit is cleared by hardware when the channel number is read from the CHNL[4:0] bits.

1 = A comparison event has been detected since the last read of the CHNL[4:0] bits

0 = A comparison event has not been detected since the last read of the CHNL[4:0] bits

bit 4 BTWN: Between Low/High Comparator Event bit

1 = Generates a comparator event when ADCMPxLO ≤ ADCBUFx < ADCMPxHI

0 = Does not generate a digital comparator event when ADCMPxLO ≤ ADCBUFx < ADCMPxHI

bit 3 HIHI: High/High Comparator Event bit

1 = Generates a digital comparator event when ADCBUFx ≥ ADCMPxHI

0 = Does not generate a digital comparator event when ADCBUFx ≥ ADCMPxHI

bit 2 HILO: High/Low Comparator Event bit

1 = Generates a digital comparator event when ADCBUFx < ADCMPxHI

0 = Does not generate a digital comparator event when ADCBUFx < ADCMPxHI

bit 1 LOHI: Low/High Comparator Event bit

1 = Generates a digital comparator event when ADCBUFx ≥ ADCMPxLO

0 = Does not generate a digital comparator event when ADCBUFx ≥ ADCMPxLO

bit 0 LOLO: Low/Low Comparator Event bit

1 = Generates a digital comparator event when ADCBUFx < ADCMPxLO

0 = Does not generate a digital comparator event when ADCBUFx < ADCMPxLO

REGISTER 4-113: ADCMPxENL: ADC DIGITAL COMPARATOR x CHANNEL ENABLE REGISTER LOW (x = 0, 1, 2, 3)

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CMPEN[15:8]
bit 15 bit 8
R/W/0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CMPEN[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-0 CMPEN[15:0]: Comparator Enable for Corresponding Input Channels bits

1 = Conversion result for corresponding channel is used by the comparator
0 = Conversion result for corresponding channel is not used by the comparator

REGISTER 4-114: ADCMPxENH: ADC DIGITAL COMPARATOR x CHANNEL ENABLE REGISTER HIGH (x = 0, 1, 2, 3)

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-5 Unimplemented: Read as '0'

bit 4-0 CMPEN[20:16]: Comparator Enable for Corresponding Input Channels bits

1 = Conversion result for corresponding channel is used by the comparator
0 = Conversion result for corresponding channel is not used by the comparator

REGISTER 4-115: ADFLxCON: ADC DIGITAL FILTER x CONTROL REGISTER
(x = 0, 1, 2, 3)

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 HSC/R-0
FLEN MODE1 MODE0 OVRSAM2 OVRSAM1 OVRSAM0 IE RDY
bit 15 bit 8
U-0U-0U-0R/W-0R/W-0R/W-0R/W-0R/W-0
FLCHSEL[4:0]
bit 7bit 0
Legend:U = Unimplemented bit, read as '0'
R = Readable bitW = Writable bitHSC = Hardware Settable/Clearable bit
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 15 FLEN: Filter Enable bit

1 = Filter is enabled

0 = Filter is disabled and the RDY bit is cleared

bit 14-13 MODE[1:0]: Filter Mode bits

11 = Averaging mode

1.0 = Reserved

01 = Reserved

00 = Oversampling mode

bit 12-10 OVRSAM[2:0]: Filter Averaging/Oversampling Ratio bits

If MODE[1:0] = 00:

111 = 128x (16-bit result in the ADFLxDAT register is in 12.4 format)

110 = 32x (15-bit result in the ADFLxDAT register is in 12.3 format)

101 = 8x (14-bit result in the ADFLxDAT register is in 12.2 format)

100 = 2x (13-bit result in the ADFLxDAT register is in 12.1 format)

011 = 256x (16-bit result in the ADFLxDAT register is in 12.4 format)

010 = 64x (15-bit result in the ADFLxDAT register is in 12.3 format)

001 = 16x (14-bit result in the ADFLxDAT register is in 12.2 format)

000 = 4x (13-bit result in the ADFLxDAT register is in 12.1 format)

If MODE[1:0] = 11 (12-bit result in the ADFLxDAT register in all instances):

111 = 256x

110 = 128x

101 = 64x

100 = 32x

011 = 16x

110 = 8x

001 = 4x

000 = 2x

bit 9 IE: Filter Common ADC Interrupt Enable bit

1 = Common ADC interrupt will be generated when the filter result will be ready

0 = Common ADC interrupt will not be generated for the filter

bit 8 RDY: Oversampling Filter Data Ready Flag bit

This bit is cleared by hardware when the result is read from the ADFLxDAT register.

1 = Data in the ADFLxDAT register are ready

0 = The ADFLxDAT register has been read and new data in the ADFLxDAT register are not ready

bit 7-5 Unimplemented: Read as '0'

REGISTER 4-115: ADFLxCON: ADC DIGITAL FILTER x CONTROL REGISTER (x = 0, 1, 2, 3) (CONTINUED)
bit 4-0 FLCHSEL[4:0]: Oversampling Filter Input Channel Selection bits

11111 = Reserved
...
10100 = Reserved
10100 = Band gap, 1.2V (AN20)
10011 = Temperature sensor (AN19)
10010 = S1AN18
...
00011 = S1AN3
00010 = SPGA3 (S1AN2)
00001 = S1AN1
00000 = S1AN0 

4.8 Programmable Gain Amplifier (PGA) Secondary

Note 1: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive reference source. To complement the information in this data sheet, refer to “Programmable Gain Amplifier (PGA)” (www.microchip.com/DS70005146), which is available from the Microchip website (www.microchip.com).

The dsPIC33CH128MP508S1 family devices have three Programmable Gain Amplifiers (PGA1, PGA2, PGA3). The PGA is an op amp-based, noninverting amplifier with user-programmable gains. The output of the PGA can be connected to a number of dedicated Sample-and-Hold inputs of the Analog-to-Digital Converter and/or to the high-speed analog comparator module. The PGA has four selectable gains and may

be used as a ground referenced amplifier (single-ended) or used with an independent ground reference point.

Key features of the PGA module include:

  • Single-Ended or Independent Ground Reference
  • Selectable Gains: 4x, 8x, 16x and 32x (and 6x, 12x, 24x and 48x with the 1.5 gain)
    • High-Gain Bandwidth
    • Rail-to-Rail Output Voltage
  • Wide Input Voltage Range

Table 4-38 shows an overview of the PGA module.

TABLE 4-38: PGA MODULE OVERVIEW (1)

Number of PGA ModulesIdentical (Modules)
Main None(1)NA
Secondary 3 NA

Note 1: The Secondary owns the PGA module, but it is shared with the Main.

FIGURE 4-21: PGAx MODULE BLOCK DIAGRAM
Microchip dsPIC33CH64MP208 - Programmable Gain Amplifier (PGA) Secondary - 1

flowchart
graph TD
    A["PGACAL[7:0"]] --> B["AMPx"]
    C["HIGAIN"] --> D["PGAx Negative Input"]
    D --> E["PGACAL[7:0"]]
    F["GAIN[2:0"] = 5] --> G["Gain of 32x"]
    H["GAIN[2:0"] = 4] --> I["Gain of 16x"]
    J["GAIN[2:0"] = 3] --> K["Gain of 8x"]
    L["GAIN[2:0"] = 2] --> M["Gain of 4x"]
    N["PGACAL[7:0"]] --> O["+"]
    P["PGACAL[7:0"]] --> Q["-"]
    R["PGACAL[7:0"]] --> S["+"]
    T["PGACAL[7:0"]] --> U["-"]
    V["PGACAL[7:0"]] --> W["-"]
    X["PGACAL[7:0"]] --> Y["-"]
    Z["PGACAL[7:0"]] --> AA["-"]
    AB["PGACAL[7:0"]] --> AC["-"]
    AD["PGACAL[7:0"]] --> AE["-"]
    AF["PGACAL[7:0"]] --> AG["-"]
    AH["PGACAL[7:0"]] --> AI["-"]
    AJ["PGACAL[7:0"]] --> AK["-"]
    AL["PGACAL[7:0"]] --> AM["-"]
    AN["PGACAL[7:0"]] --> AO["-"]
    AP["PGACAL[7:0"]] --> AQ["-"]
    AR["PGACAL[7:0"]] --> AS["-"]
    AT["PGACAL[7:0"]] --> AU["-"]
    AV["PGACAL[7:0"]] --> AW["-"]
    AX["PGACAL[7:0"]] --> AY["-"]
    AZ["PGACAL[7:0"]] --> BA["-"]
    BB["PGACAL[7:0"]] --> BC["-"]
    BD["PGACAL[7:0"]] --> BE["-"]
    BF["PGACAL[7:0"]] --> BG["-"]
    BH["PGACAL[7:0"]] --> BI["-"]
    BJ["PGACAL[7:0"]] --> BK["-"]
    BL["PGACAL[7:0"]] --> BM["-"]
    BN["HIGAIN"] --> BO["HIGAIN"]
    BP["HIGAIN"] --> BP["HIGAIN"]

4.8.1 MODULE DESCRIPTION

The Programmable Gain Amplifiers are used to amplify small voltages (i.e., voltages across burden/shunt resistors) to improve the Signal-to-Noise Ratio (SNR) of the measured signal. The PGAx output voltage can be read by any of the four dedicated Sample-and-Hold circuits on the ADC module. The output voltage can also be fed to the comparator module for overcurrent/voltage protection. Figure 4-22 shows a functional block diagram of the PGAx module. Refer to Section 3.10 "High-Speed, 12-Bit Analog-to-Digital Converter (Main ADC)" for more interconnection details.

The gain of the PGAx module is selectable via the GAIN[2:0] bits in the PGAxCON register. There are four gains, ranging from 4x to 48x (with a 1.5 gain multiplier). The SELPI[2:0] and SELNI[2:0] bits in the PGAxCON register select one of the positive/negative inputs to the PGAx module. For single-ended applications, the SELNI[2:0] bits will select the ground as the negative input source. To provide an independent ground reference, S1PGAxN2 is available as the negative input source to the PGAx module.

Note 1: Not all PGA positive/negative inputs are available on all devices. Refer to the specific device pinout for available input source pins.

The output voltage of the PGAx module can be connected to the DACOUT1 pin by setting the PGAOEN bit in the PGAxCON register. When the PGAOEN bit is enabled, the output voltage of PGA1 is connected to DACOUT1. There is only one DACOUT1 pin.

If all three of the DACx output voltages and PGAx output voltages are connected to the DACOUT1 pin, the resulting output voltage would be a combination of signals. There is no assigned priority between the PGAx module and the DACx module.

FIGURE 4-22: PGAx FUNCTIONAL BLOCK DIAGRAM
Microchip dsPIC33CH64MP208 - MODULE DESCRIPTION - 1

flowchart
graph TD
    A["S1PGAxP1"] --> B["SELPI[2:0"]]
    C["S1PGAxP2"] --> D["SELPI[2:0"]]
    E["GND"] --> F["SELNI[2:0"]]
    G["GND"] --> H["SELNI[2:0"]]
    I["S1PGAxN2"] --> J["SELNI[2:0"]]
    K["GND"] --> L["SELNI[2:0"]]
    M["PGAEN"] --> N["+"]
    O["GAIN[2:0"]] --> N
    P["PGACAL[7:0"]] --> N
    Q["PGAXCON(1)"] --> N
    R["PGAXCAL(1)"] --> N
    S["PGAX(1)"] --> T["-"]
    U["PGAOEN"] --> V["To DACOUT1 Pin(2)"]
    W["INSEL[2:0"] (DACxCONL)] --> X["DACX"]
    Y["ADC TS&H"] --> Z["ADC"]
    style A fill:#f9f,stroke:#333
    style C fill:#f9f,stroke:#333
    style E fill:#f9f,stroke:#333
    style G fill:#f9f,stroke:#333
    style I fill:#f9f,stroke:#333
    style K fill:#f9f,stroke:#333
    style M fill:#f9f,stroke:#333
    style Q fill:#f9f,stroke:#333
    style N fill:#ccf,stroke:#333
    style U fill:#ccf,stroke:#333
    style W fill:#ccf,stroke:#333
    style X fill:#cfc,stroke:#333
    style Y fill:#cfc,stroke:#333
    style Z fill:#cfc,stroke:#333

4.8.2 PGA RESOURCES

Many useful resources are provided on the main product page of the Microchip website for the devices listed in this data sheet. This product page contains the latest updates and additional information.

4.8.2.1 Key Resources

  • "Programmable Gain Amplifier (PGA)" (www.microchip.com/DS70005146)
  • Code Samples
  • Application Notes
  • Software Libraries
  • Webinars
  • All Related "dsPIC33/PIC24 Family Reference Manual" Sections
  • Development Tools

4.8.3 PGA CONTROL REGISTERS

REGISTER 4-116: PGAxCON: PGAx CONTROL REGISTER

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PGAENPGAOENSELPI2SELPI1SELPI0SELNI2SELNI1SELNI0
bit 15 bit 8
U-0U-0U-0R/W-0U-0R/W-0R/W-0R/W-0
HIGAINGAIN2GAIN1GAIN0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15

PGAEN: PGAx Enable bit

1 = PGAx module is enabled

0 = PGAx module is disabled (reduces power consumption)

bit 14

PGAOEN: PGAx Output Enable bit

1 = PGAx output is connected to the DACOUT1 pin

0 = PGAx output is not connected to the DACOUT1 pin

bit 13-11

SELPI[2:0]: PGAx Positive Input Selection bits

111 = Reserved

110 = Reserved

101 = Reserved

100 = Reserved

011 = Ground

010 = Ground

001 = S1PGAxP2

000 = S1PGAxP1

bit 10-8 SELNI[2:0]: PGAx Negative Input Selection bits

111 = Reserved

110 = Reserved

101 = Reserved

100 = Reserved

011 = Ground (Single-Ended mode)

010 = Reserved

001 = S1PGAxN2

000 = Ground (Single-Ended mode)

bit 7-5

Unimplemented: Read as '0'

bit 4

HIGAIN: High-Gain Select bit

This bit, when asserted, enables a 50% increase in gain as specified by the GAIN[2:0] bits.

bit 3

Unimplemented: Read as '0'

bit 2-0

GAIN[2:0]: PGAx Gain Selection bits

111 = Reserved

110 = Reserved

101 = Gain of 32x

100 = Gain of 16x

011 = Gain of 8x

010 = Gain of 4x

001 = Reserved

000 = Reserved

REGISTER 4-117: PGAxCAL: PGAx CALIBRATION REGISTER

U-0 U-0 U-0 U-0 U-0 U-0 U-0
——————
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
PGACAL[7:0]
bit 7 bit 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-8 Unimplemented: Read as '0'

bit 7-0 PGACAL[7:0]: PGAx Offset Calibration bits

The calibration values for PGA1, PGA2 and PGA3 must be copied from Flash addresses, 0xF8001C, 0xF8001CE and 0xF800120, respectively, into these bits before the module is enabled. Refer to the calibration data address table (Table 21-4) in Section 21.0, Special Features for more information.

NOTES:

5.0 MAIN SECONDARY INTERFACE (MSI)

Note 1: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive reference source. To complement the information in this data sheet, refer to “Main Secondary Interface (MSI) Module” (www.microchip.com/DS70005278), which is available from the Microchip website (www.microchip.com).

The Main Secondary Interface (MSI) module is a bridge between the Main and a Secondary processor system, each of which operates within independent clock domains. The Main and Secondary have their own registers to communicate between the MSI modules; the Main MSI registers are located in the Main SFR space and the Secondary MSI registers are in the Secondary SFR space. The Main Secondary Interface (MSI) includes these characteristics:

• 16 Unidirectional Data Mailbox Registers:

- Direction of each Mailbox register is fuse-selectable

- Byte and word-addressable

• Eight Mailbox Data Flow Control Protocol Blocks:

- Individual fuse enables

- Write port active; read port passive (i.e., no read data request required)

- Automatic, interrupt driven (or polled), data flow control mechanism across MSI clock boundary

- Fuse assignable to any of the Mailbox registers, supports any length data buffers (up to the number of available Mailbox registers)

- DMA transfer compatible

- Main to Secondary and Secondary to Main Interrupt Request with Acknowledge Data Flow Control

- Two-Channel FIFO Memory Structure:

- One read and one write channel, each 32 words deep

- Circular operation with empty and full status, and interrupts

- Overflow/underflow detection with interrupts to Main core and Secondary core

- Interrupt-based, software polled or DMA transfer compatible

- Main and Secondary Processor Cross-Boundary Control and Status:

- Readable operating mode status for both processors

- Secondary enable from Main (subject to satisfying a hardware write interlock sequencer)

- Main interrupt when Secondary is reset during code execution

- Secondary interrupt when Main is reset during code execution

- Optional (fuse) Decoupling of Main and Secondary Resets; POR/BOR/MCLR always Resets Main and Secondary; Influence of Remaining Run-Time Resets on the Secondary Enable is Fuse-Programmable

5.1 Main MSI Control Registers

The following registers are associated with the Main MSI module and are located in the Main SFR space.

- Register 5-1: MSI1CON

• Register 5-2: MSI1STAT

- Register 5-3: MSI1KEY

- Register 5-4: MSI1MBXS

• Register 5-5: MSI1MBXnD

• Register 5-6: MSI1FIFOCS

- Register 5-7: MRSWFDATA

• Register 5-8: MWSRFDATA

REGISTER 5-1: MSI1CON: MSI1 MAIN CONTROL REGISTER

R/W-0 U-0 U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0
SLVENRFITSEL1RFITSEL0MTSIRQSTMIACK
bit 15 bit 8
R/W-0r-0r-0r-0r-0r-0r-0r-0
SRSTIE
bit 7 bit 0
Legend:r = Reserved 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 15SLVEN: Secondary Enable bitThis bit enables the Secondary processor subsystem. Writing to the SLVEN bit is subject to satisfying the MSI1KEY unlock sequence.1 = Secondary processor is enabled, Secondary Reset is released and execution is permitted0 = Secondary processor is disabled and held in Reset
bit 14-12Unimplemented: Read as ‘0’
bit 11-10RFITSEL[1:0]: Read FIFO Interrupt Threshold Select bits11 = Trigger data valid interrupt when FIFO is full after Secondary write10 = Trigger data valid interrupt when FIFO is 75% full after Secondary write01 = Trigger data valid interrupt when FIFO is 50% full after Secondary write00 = Trigger data valid interrupt when 1st FIFO entry is written by Secondary
bit 9MTSIRQ: Main to Secondary Interrupt Request bit1 = Main has issued an interrupt request to the Secondary0 = Main has not issued a Secondary interrupt request
bit 8STMIACK: Main to Secondary Interrupt Acknowledge bit (to Acknowledge the Secondary interrupt)1 = If STMIRQ = 1, Main Acknowledges Secondary interrupt request, else protocol error0 = If STMIRQ = 0, Main has not yet Acknowledged Secondary interrupt request, else no Secondary to Main interrupt request is pending
bit 7SRSTIE: Secondary Reset Event Interrupt Enable bit1 = Main Secondary Reset event interrupt occurs when Secondary enters Reset state0 = Main Secondary Reset event interrupt does not occur when Secondary enters Reset state
bit 6-0Reserved: Read as ‘0’

REGISTER 5-2: MSI1STAT: MSI1 MAIN STATUS REGISTER

R-0 R/W-0 R-0 R-0 R/W-0 R-0 R-0 R-0
SLVRSTSLVWDRSTSLVPWR1SLVPWR0VERFERRSLVP2ACTSTMIRQMTSIACK
bit 15 bit 8
Legend:r = Reserved 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 15 SLVRST: Secondary Reset Status bit

Indicates when the Secondary is in Reset as the result of any Reset source. Generates a Secondary Reset event interrupt to the Main on leading edge of being set when MTSIRQ (MSI1CON[9]) = 1.

1 = Secondary is in Reset
0 = Secondary is not in Reset

bit 14 SLVWDRST: Secondary Watchdog Timer (WDT) Reset Status bit

Indicates when the Secondary has been reset as the result of a WDT time-out. The SLVRST bit will also get set (at the same time this bit is set) by the hardware.

1 = Secondary has been reset by the WDT
0 = Secondary has not been reset by the WDT

bit 13-12 SLVPWR[1:0]: Secondary Low-Power Operating Mode Status bits

11 = Reserved

10 = Secondary is in Sleep mode
01 = Secondary is in Idle mode
00 = Secondary is not in a Low-Power mode

bit 11 VERFERR: PRAM Verify Error Status bit

1 = Error detected during execution of VFSLV (PRAM write verify) instruction
0 = No error detected during execution of VFSLV (PRAM write verify) instruction

bit 10 SLVP2ACT: Secondary PRAM Panel 2 Active Status bit

This bit is a reflection of the Secondary NVM controller, P2ACTIV (NVMCON[10]) status bit, which is toggled after successful execution of a BOOTSWP instruction (during a Secondary PRAM LiveUpdate operation).

1 = Secondary NVM controller, P2ACTIV (NVMCON[10]) = 1
0 = Secondary NVM controller P2ACTIV (NVMCON[10]) = 0

bit 9 STMIRQ: Secondary to Main Interrupt Request Status bit

1 = Secondary has issued an interrupt request to the Main
0 = Secondary has not issued a Main interrupt request

bit 8 MTSIACK: Acknowledge Status bit (Secondary acknowledged)

1 = If MTSIRQ = 1, Secondary Acknowledges Main interrupt request, else protocol error
0 = If MTSIRQ = 1, Secondary has not yet Acknowledged Main interrupt request, else no Main to Secondary interrupt request is pending

bit 7 SLVDBG: Secondary Debug Mode Status bit

1 = Secondary is operating in Debug mode
0 = Secondary is operating in Mission or Application mode

bit 6-0 Reserved: Read as '0'

REGISTER 5-3: MSI1KEY: MSI1 MAIN INTERLOCK KEY REGISTER

U-0 U-0 U-0 U-0 U-0 U-0 U-0 U-0
————
bit 15 bit 8
W-0W-0W-0W-0W-0W-0W-0W-0
MSI1KEY[7:0]
bit 7bit 0

Legend:

R = Readable bitW = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown

bit 15-8 Unimplemented: Read as '0'

bit 7-0 MSI1KEY[7:0]: MSI1 Key bits

The MSI1KEYx bits are monitored for specific write values.

REGISTER 5-4: MSI1MBXS: MSI1 MAIN MAILBOX DATA TRANSFER STATUS REGISTER

R = Readable bitW = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown

bit 15-8 Unimplemented: Read as '0'

bit 7-0 DTRDY[H:A]: Data Ready Status bits

1 = Data transmitter has indicated that data are available to be read by data receiver in MSI1MBXnD (DTRDYx is automatically set by a data transmitter processor write to assigned MSI1MBXnD); Meaning when configured as a:

- Transmitter: Data are written. Waiting for receiver to read.

- Receiver: New data are ready to read.

0 = No data are available to be read by receiver in MSI1MBXnD (or the handshake protocol logic block is disabled)

REGISTER 5-5: MSI1MBXnD: MSI1 MAIN MAILBOX n DATA REGISTER (n = 0 to 15)

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
MSIMBXnD[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
MSIMBXnD[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-0

MSIMBXnD[15:0]: MSI1 Mailbox n Data bits

When Configuration bit, MBXMx = 1 (programmed):

Mailbox Data Direction: Main read, Secondary write; Main MSIMBXnD[15:0] bits become R-0 (a Main write to MSIMBXnD[15:0] will have no effect).

When Configuration bit, MBXMx = 0 (programmed):

Mailbox Data Direction: Main write, Secondary read; Main MSIMBXnD[15:0] bits become R/W-0.

REGISTER 5-6: MSI1FIFOCS: MSI1 MAIN FIFO CONTROL/STATUS REGISTER

R/W-0 U-0 U-0 U-0 R/C-0 R-0 R-0 R-1
WFEN —— — WFOF(1)WFUF(1)WFFULL(1)WFEMPTY(2)
bit 15 bit 8
R/W-0 U-0 U-0 U-0R-0 R/C-0R-0 R-1
RFENRFOFRFUFRFFULLRFEMPTY
bit 7 bit 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 15 WFEN: Write FIFO Enable bit

1 = Enables (Main) Write FIFO

0 = Disables and initializes (Main) Write FIFO

bit 14-12 Unimplemented: Read as '0'

bit 11 WFOF: Write FIFO Overflow bit ^(1)

1 = Write FIFO overflow is detected

0 = No Write FIFO overflow is detected

bit 10 WFUF: Write FIFO Underflow bit ^(1)

1 = Write FIFO underflow is detected

0 = No Write FIFO underflow is detected

bit 9 WFFULL: Write FIFO Full Status bit (1)

1 = Write FIFO is full, last write by Main to Write FIFO (WFDATA) was into the last free location

0 = Write FIFO is not full

bit 8 WFEMPTY: Write FIFO Empty Status bit (2)

1 = Write FIFO is empty; last read by Secondary from Write FIFO (WFDATA) emptied the FIFO of all valid data or FIFO is disabled (and initialized to the empty state)

0 = Write FIFO contains valid data not yet read by the Secondary

bit 7 RFEN: Read FIFO Enable bit

1 = Enables (Main) the Read FIFO

0 = Disables and initializes the (Main) Read FIFO

bit 6-4 Unimplemented: Read as '0'

bit 3 RFOF: Read FIFO Overflow bit

1 = Read FIFO overflow is detected

0 = No Read FIFO overflow is detected

bit 2 RFUF: Read FIFO Underflow bit

1 = Read FIFO underflow is detected

0 = No Read FIFO underflow is detected

bit 1 RFFULL: Read FIFO Full Status bit

1 = Read FIFO is full; last write by Secondary to Read FIFO (RFDATA) was into the last free location

0 = Read FIFO is not full

bit 0 RFEMPTY: Read FIFO Empty Status bit

1 = Read FIFO is empty; last read by Main from Read FIFO (RFDATA) emptied the FIFO of all valid data or FIFO is disabled (and initialized to the empty state)

0 = Read FIFO contains valid data not yet read by the Main

Note 1: Once set, these bits can be cleared by making WFEN = 0.

2: Clearing WFEN will also cause the WFEMPTY status bit to be set. After WFEN is subsequently set, WFEMPTY will remain set until the Main writes data into the Write FIFO.

REGISTER 5-7: MRSWFDATA: MAIN READ (SECONDARY WRITE) FIFO DATA REGISTER

R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
MRSWFDATA[15:8]
bit 15 bit 8
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
MRSWFDATA[7:0]
bit 7 bit 0
Legend:
R = Readable bit W = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown

bit 15-0 MRSWFDATA[15:0]: Read FIFO Data Out Register bits

REGISTER 5-8: MWSRFDATA: MAIN WRITE (SECONDARY READ) FIFO DATA REGISTER

R-0 R-0 R-0 R-0 R-0 R-0R-0R-0
MWSRFDATA[15:8]
bit 15 bit 8
R-0 R-0 R-0 R-0 R-0 R-0R-0R-0
MWSRFDATA[7:0]
bit 7 bit 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-0 MWSRFDATA[15:0]: Write FIFO Data Out Register bits

5.2 Secondary MSI Control Registers

The following registers are associated with the Secondary MSI module and are located in the Secondary SFR space.

  • Register 5-9: SI1CON
  • Register 5-10: SI1STAT
  • Register 5-11: SI1MBX
  • Register 5-12: SI1MBXnD
    • Register 5-13: SI1FIFOCS
    • Register 5-14: SWMRFDATA
  • Register 5-15: SRMWFDATA

REGISTER 5-9: SI1CON: MSI1 SECONDARY CONTROL REGISTER

U-0 U-0 U-0 U-0 R/W-0 R/W-0 R/W-0
RFITSEL1RFITSEL0STMIRQMTSIACK
bit 15 bit 8
R/W-0U-0U-0U-0U-0U-0U-0U-0
MRSTIE
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-12 Unimplemented: Read as '0'

bit 11-10 RFITSEL[1:0]: Read FIFO Interrupt Threshold Select bits

11 = Triggers data valid interrupt when FIFO is full after Secondary write
10 = Triggers data valid interrupt when FIFO is 75% full after Secondary write
01 = Triggers data valid interrupt when FIFO is 50% full after Secondary write
00 = Triggers data valid interrupt when 1st FIFO entry is written by Secondary

bit 9 STMIRQ: Secondary to Main Interrupt Request bit

1 = Interrupts the Main
0 = Does not interrupt the Main

bit 8 MTSIACK: Secondary to Acknowledge Main Interrupt bit

1 = If MTSIRQ = 1, Secondary Acknowledges Main interrupt request, else protocol error
0 = If MTSIRQ = 0, Secondary has not yet Acknowledged Main interrupt request, else no Main to Secondary interrupt request is pending

bit 7 MRSTIE: Main Reset Event Interrupt Enable bit

1 = Secondary Main Reset event interrupt occurs when Main enters Reset state
0 = Secondary Main Reset event interrupt does not occur when Main enters Reset state

bit 6-0 Unimplemented: Read as '0'

REGISTER 5-10: SI1STAT: MSI1 SECONDARY STATUS REGISTER

R-0 U-0 R-0 R-0 U-0 U-0 R-0 R-0
MSTRSTMSTPWR1MSTPWR0MTSIRQSTMIACK
bit 15 bit 8
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 MSTRST: Main Reset Status bit Indicates when the Main is in Reset as the result of any Reset source. Generates a Main Reset event interrupt to the Secondary on the leading edge of being set when STMIRQ (SI1CON[9]) = 1. 1 = Main is in Reset 0 = Main is not in Reset

bit 14 Unimplemented: Read as '0'

bit 13-12 MSTPWR[1:0]: Main Low-Power Operating Mode Status bits

11 = Reserved
10 = Main is in Sleep mode
01 = Main is in Idle mode
00 = Main is not in a Low-Power mode

bit 11-10 Unimplemented: Read as '0'

bit 9 MTSIRQ: Main interrupt Secondary bit

1 = Main has issued an interrupt request to the Secondary
0 = Main has not issued a Secondary interrupt request

bit 8 STMIACK: Main Acknowledgment Status bit

1 = If STMIRQ = 1, Main Acknowledges Secondary interrupt request, else protocol error
0 = If STMIRQ = 0, Main has not yet Acknowledged Secondary interrupt request, else no Secondary to Main interrupt request is pending

bit 7-0 Unimplemented: Read as '0'

REGISTER 5-11: SI1MBX: MSI1 SECONDARY MAILBOX DATA TRANSFER STATUS REGISTER

R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-8 Unimplemented: Read as '0'

bit 7-0 DTRDY[H:A]: Data Ready Status bits

1 = Data transmitter has indicated that data are available to be read by data receiver in MSI1MBXnD (DTRDYx is automatically set by a data transmitter processor write to assigned MSI1MBXnD) Meaning when configured as a:

- Transmitter: Data are written. Waiting for receiver to read.

- Receiver: New data are ready to read.

0 = No data are available to be read in receiver, MSI1MBXnD (or the handshake protocol logic block is disabled)

REGISTER 5-12: SI1MBXnD: MSI1 SECONDARY MAILBOX n DATA REGISTER (n = 0 TO 15)

R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
SIMBXnD[15:8]
bit 15bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
SIMBXnD[7:0]
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 cleared x = Bit is unknown

bit 15-0 SIMBXnD[15:0]: MSI1 Secondary Mailbox Data n bits

When Configuration bit, MBXMx = 1 (programmed):

Mailbox Data Direction: Main read, Secondary writes Main; SIMBXnD[15:0] bits become R-0 (a Main write to SIMBXnD[15:0] will have no effect).

When Configuration bit, MBXMx = 0 (programmed):

Mailbox Data Direction: Main write, Secondary reads Main; SIMBXnD[15:0] bits become R/W-0.

REGISTER 5-13: SI1FIFOCS: MSI1 SECONDARY FIFO STATUS REGISTER

R-0 U-0 U-0 U-0 R-0 R/C-0 R-0 R-1
SRFENSRFOFSRFUFSRFFULLSRFEMPTY
bit 15 bit 8
R-0 U-0 U-0 U-0R/C-0 R-0R-0 R-1
SWFENSWFOFSWFUFSWFFULLSWFEMPTY
bit 7 bit 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 15 SRFEN: Secondary Read (Main Write) FIFO Enable bit

1 = Enables Secondary Read (Main Write) FIFO
0 = Disables Secondary Read (Main Write) FIFO

bit 14-12 Unimplemented: Read as '0'

bit 11 SRFOF: Secondary Read (Main Write) FIFO Overflow bit

1 = Secondary Read FIFO overflow is detected
0 = No Secondary Read FIFO overflow is detected

bit 10 SRFUF: Secondary Read (Main Write) FIFO Underflow bit

1 = Secondary Read (Main Write) FIFO underflow is detected
0 = No Secondary Read (Main Write) FIFO underflow is detected

bit 9 SRFFULL: Secondary Read (Main Write) FIFO Full Status bit

1 = Secondary Read (Main Write) FIFO is full; last write by Main to Secondary Read FIFO (SRMWF-DATA) was into the last free location
0 = Secondary Read (Main Write) FIFO is not full

bit 8 SRFEMPTY: Secondary Read (Main Write) FIFO Empty Status bit

1 = Secondary Read (Main Write) FIFO is empty; last read by Secondary from Read FIFO (SRMWF-DATA) emptied the FIFO of all valid data or FIFO is disabled (and initialized to the empty state)
0 = Secondary Read (Main Write) FIFO contains valid data not yet read by the Secondary

bit 7 SWFEN: Secondary Write (Main Read) FIFO Enable bit

1 = Enables Secondary Write (Main Read) FIFO
0 = Disables Secondary Write (Main Read) FIFO

bit 6-4 Unimplemented: Read as '0'

bit 3 SWFOF: Secondary Write (Main Read) FIFO Overflow bit

1 = Secondary Write (Main Read) FIFO overflow is detected
0 = No Secondary Write (Main Read) FIFO overflow is detected

bit 2 SWFUF: Secondary Write (Main Read) FIFO Underflow bit

1 = Secondary Write (Main Read) FIFO underflow is detected
0 = No Secondary Write (Main Read) FIFO underflow is detected

bit 1 SWFFULL: Secondary Write (Main Read) FIFO Full Status bit

1 = Secondary Write (Main Read) FIFO is full; last write by Secondary to FIFO (SWMRFDATA) was into the last free location
0 = Secondary Write (Main Read) FIFO is not full

bit 0 SWFEMPTY: Secondary Write (Main Read) FIFO Empty Status bit

1 = Secondary Write (Main Read) FIFO is empty; last read by Main from Read FIFO emptied the FIFO of all valid data or FIFO is disabled (and initialized to the empty state)
0 = Secondary Write (Main Read) FIFO contains valid data not yet read by the Main

REGISTER 5-14: SWMRFDATA: SECONDARY WRITE (MAIN READ) FIFO DATA REGISTER

W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0
SWMRFDATA[15:8]
bit 15 bit 8
W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0
SWMRFDATA[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 SWMRFDATA[15:0]: Read FIFO Data Out Register bits

REGISTER 5-15: SRMWFDATA: SECONDARY READ (MAIN WRITE) FIFO DATA REGISTER

R-0R-0R-0R-0R-0R-0R-0R-0
SRMWFDATA[15:8]
bit 15 bit 8
R-0R-0R-0R-0R-0R-0R-0R-0
SRMWFDATA[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 SRMWFDATA[15:0]: Write FIFO Data Out Register bits

5.3 Secondary Processor Control

The MSI contains three control bits related to Secondary processor control within the MSI1CON register.

5.3.1 SECONDARY ENABLE (SLVEN) CONTROL

The SLVEN (MSI1CON[15]) control bit provides a means for the Main processor to enable or disable the Secondary processor.

The Secondary is disabled when SLVEN (MSI1CON[15]) = 0. In this state:

• The Secondary is held in the Reset state
- The Main has access to the Secondary PRAM (to load it out of a device Reset)
- The Secondary Reset status bit, SLVRST (MSI1STAT[15]) = 1

The Secondary is enabled when SLVEN (MSI1CON[15]) = 1. In this state:

  • The Secondary Reset is released and it will start to execute code in whatever mode it is configured to operate in
  • The Main processor will no longer have access to the Secondary PRAM
  • The Secondary Reset status bit, SLVRST (MSI1STAT[15]) = 0

Note: The SLVRST (MSI1STAT[15]) status bit indicates when the Secondary is in Reset. The associated interrupt only occurs when the Secondary enters the Reset state after having previously not been in Reset. That is, no interrupt can be generated until the Secondary is first enabled.

The SLVEN bit may only be modified after satisfying the hardware write interlock. The SLVEN bit is protected from unexpected writes through a software unlocking sequence that is based on the MSI1KEY register. Given the critical nature of the MSI control interface, the MSI macro unlock mechanism is independent from that of the Flash controller for added robustness.

Completing a predefined data write sequence to the MSI1KEY register will open a window. The SLVEN bit should be written on the first instruction that follows the unlock sequence. No other bits within the MSI1CON register are affected by the interlock. The MSI1KEY register is not a physical register. A read of the MSI1KEY register will read all '0's.

When the SLVEN bit lock is enabled (i.e., the bits are locked and cannot be modified), the instruction sequence shown in Example 5-1 must be executed to open the lock. The unlock sequence is a prerequisite to both setting and clearing the target control bit.

Note: It is recommended to enable SRSTIE (MSI1CON[7]) = 1 prior to enabling the SLVEN bit. This will make the design robust and will update the Main with the Reset state of the Secondary.

EXAMPLE 5-1: MSI ENABLE OPERATION

//Unlock Key to allow MSI Enable control
MOV.b #0x55, WO
MOV.b WREG, MSILKEY
MOV.b #0xAA, WO
MOV.b WREG, MSILKEY
// Enable MSI
BSET MSILCON, SLVEN

EXAMPLE 5-2: MSI ENABLE OPERATION IN C CODE

#include <libpic30.h>
_start_Secondary(); 

5.4 Secondary Reset Coupling Control

In all operating modes, the user may couple or decouple the Main Run-Time Resets to the Secondary Reset by using the Main Secondary Reset Enable (S1MSRE) fuse. The Resets are effectively coupled by directing the selected Reset source to the SLVEN bit Reset.

In all operating modes, the user may also choose whether the SLVEN bit is reset or not in the event of a Secondary Run-Time Reset by using the Secondary Reset Enable (S1SSRE) fuse.

A user may choose to reset SLVEN in the event of a Secondary Reset because that event could be an indicator of a problem with Secondary execution. The Secondary would be placed in Reset and the Main alerted (via the Secondary Reset event interrupt, need to make SRSTIE (MSI1CON[7] = 1) to attempt to rectify the problem. The Main must re-enable the Secondary by setting the SLVEN bit again.

Alternatively, the user may choose to not halt the Secondary in the event of a Secondary Reset, and just allow it to restart execution after a Reset and continue operation as soon as possible. The Secondary Reset event interrupt would still occur, but could be ignored by the Main.

TABLE 5-1: APPLICATION MODE SLVEN RESET CONTROL TRUTH TABLE

S1MSRES1SSRESLVEN Bit Reset SourceApplication Effect
00Main Resets^(1) Secondary is reset and disabled in the event of a POR, BOR or MCLR Reset. Main must re-enable Secondary.Secondary Run-Time Resets will not disable Secondary. Secondary will reset and continue execution (and may optionally interrupt Main).
10Main Resets^(1) Secondary is reset and disabled in the event of a POR, BOR or MCLR Reset. Main must re-enable Secondary.Secondary Run-Time Resets will not disable Secondary. Secondary will reset and continue execution (and may optionally interrupt Main).
01 Main Resets^(1) and Secondary Resets^(2) Secondary is reset and disabled in the event of any Secondary Run-Time Reset (and may optionally interrupt Main). Main must re-enable Secondary to execute the Secondary code.Main Run-Time Resets will not affect Secondary operation.
11 POR/BOR/MCLR Secondary Resets^(2) Secondary is reset and disabled in the event of any Secondary Run-Time Reset or Main Reset. Main must re-enable Secondary. This represents the default state (S1MSRE and S1SSRE are unprogrammed).

Note 1: Main Resets include any Main Reset, such as POR/BOR/MCLR Resets.
2: Secondary Resets include any Secondary Reset, plus POR/BOR/MCLR Resets (in Application mode).

5.4.1 INTER-PROCESSOR INTERRUPT REQUEST AND ACKNOWLEDGE

The Main and Secondary processors may interrupt each other directly. The Main may issue an interrupt request to the Secondary by asserting the MTSIRQ (MSI1CON[9]) control bit. Similarly, the Secondary may issue an interrupt request to the Main by asserting the STMIRQ (MSI1STAT[9]) control bit.

The interrupts are Acknowledged through the use of the Interrupt Acknowledge bits, MTSIACK (MSI1STAT[8]) for the Main to Secondary interrupt request and STMIACK (MSI1CON[8]) for the Secondary to Main interrupt request.

5.4.2 READ ADDRESS POINTERS FOR FIFOs

The MSI macro may also include a set of two FIFOs, one for data reads from the Secondary and the other for data writes to the Secondary. The Read Address Pointers for the Read and Write FIFOs are held in the RDPTR[6:0] bits (MSI1CON[6:0]) and WRPTR[6:0] bits (MSI1STAT[6:0]), respectively. These bits are accessible only from within Debug mode.

6.0 OSCILLATOR WITH HIGH-FREQUENCY PLL

Note 1: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive reference source. To complement the information in this data sheet, refer to "Oscillator Module with High-Speed PLL" (www.microchip.com/DS70005255), which is available from the Microchip website (www.microchip.com).

The dsPIC33CH128MP508 family oscillator with high-frequency PLL includes these characteristics:

• Main and Core Subsystems
- Internal and External Oscillator Sources Shared between Main and Secondary Cores

  • Main and Secondary Independent On-Chip Phase-Locked Loop (PLL) to Boost Internal Operating Frequency on Select Internal and External Oscillator Sources
  • Main and Secondary Independent Auxiliary PLL (APLL) Clock Generator to Boost Operating Frequency for Peripherals
  • Main and Secondary Independent Doze mode for System Power Savings
  • Main and Secondary Independent Scalable Reference Clock Output (REFCLKO)
  • On-the-Fly Clock Switching between Various Clock Sources
  • Fail-Safe Clock Monitoring (FSCM) that Detects Clock Failure and Permits Safe Application Recovery or Shutdown

A block diagram of the dsPIC33CH128MP508 oscillator system is shown in Figure 6-1.

FIGURE 6-1: MAIN AND SECONDARY CORE SHARED CLOCK SOURCES BLOCK DIAGRAM
Microchip dsPIC33CH64MP208 - OSCILLATOR WITH HIGH-FREQUENCY PLL - 1

flowchart
graph TD
    A["TUN[5:0"](1)] --> B["BFRC 8 MHz"]
    A --> C["FRC 8 MHz"]
    A --> D["POSC(2)"]
    A --> E["LPRC 32 kHz"]
    B --> F["Main Core Clock Selection and PLL/DIV Subsystem"]
    C --> F
    D --> F
    E --> F
    F --> G["Main FCY"]
    F --> H["Main FP"]
    F --> I["Main Fosc"]
    F --> J["Main VCO Outputs"]
    F --> K["Main APLL and AVCO Outputs"]
    F --> L["Main REFCLKO"]
    M["OSCO"] --> N["POS"]
    O["OSCI"] --> P["POS"]
    Q["BFC"] --> R["BFCCLK"]
    S["FRC"] --> T["FRCCLK"]
    U["POSC"] --> V["POSCCLK"]
    W["LPRC"] --> X["LPRCCLK"]
    Y["LPRC"] --> Z["LPRCCLK"]
    AA["Secondary Core Clock Selection and PLL/DIV Subsystem"] --> AB["Secondary FCY"]
    AA --> AC["Secondary FP"]
    AA --> AD["Secondary Fosc"]
    AA --> AE["Secondary VCO Outputs"]
    AA --> AF["Secondary APLL and AVCO Outputs"]
    AA --> AG["Secondary REFCLKO"]

Note 1: FRC Oscillator tuning bits are configured in the Main core OSCTUN register.
2: POSC is configured through the POSCMD[1:0] bits in the Main FOSC Configuration register.

FIGURE 6-2: MAIN CORE OSCILLATOR SUBSYSTEM
Microchip dsPIC33CH64MP208 - OSCILLATOR WITH HIGH-FREQUENCY PLL - 2

flowchart
graph TD
    subgraph_Main_Core["Main Core Shared Oscillator Source"]
        A["COSC[2:0"] --> S1]
        B["POSCCLK(1)"] --> S3
    end

    subgraph_PLL_Core["PLL Core"]
        C["FRCDIVN"] --> D["S1/S3"]
        E["FRCDIVN"] --> F["S2"]
        G["FRCDIVN"] --> H["S7"]
        I["FRCDIVN"] --> J["S6"]
        K["FRCDIVN"] --> L["S5"]
    end

    subgraph_Auxiliary_Core["Auxiliary PLL"]
        M["ROSEL[3:0"]] --> N["÷N"]
        O["REFCLKO"] --> P["RODIV[14:0"]]
        Q["AVCO Divider"] --> R["APLL"]
        S["AVCO Divider"] --> T["AFVCO(4)"]
        U["AVCO Divider"] --> V["AFVCO/2(6,8)"]
        W["AVCO Divider"] --> X["AFVCO/3"]
        Y["AVCO Divider"] --> Z["AFVCO/4"]
        AA["AVCO Divider"] --> AB["÷N"]
        AC["AVCO Divider"] --> AD["FCAN"]

    subgraph_CAN_Core["CAN Clock Generation"]
        AE["No Clock"] --> AF["Fvco"]
        AE --> AG["FpLLO"]
        AE --> AH["Fvco/2"]
        AE --> AI["Fvco/3"]
        AE --> AJ["Fvco/4"]
        AE --> AK["AFPLLO"]
        AE --> AL["AFVco"]
        AE --> AM["AFVco/2"]
        AE --> AN["AFVco/3"]
        AE --> AO["AFVco/4"]
        AE --> AP["CANDIV[6:0"]]
        AE --> AQ["CANDCLKSEL[3:0"]]
    end

    C -->|÷2| S1
    S1 --> S3
    S3 --> PLL["PLL(2)"]
    PLL -->|÷2| POSCCLK1
    POSCCLK1 --> S2
    S2 --> S1/S3
    S1/S3 --> FRCCLK
    FRCCLK --> S0
    S0 --> FRCDIVN
    FRCDIVN --> S7
    S7 --> LPRCCLK1
    LPRCCLK1 --> S5
    S5 --> ClockClock
    ClockClock --> SwitchFail
    SwitchFail --> Reset
    Reset --> S6
    CLK --> DOZE["DOZE"]
    DOZE --> FOY
    DOZE --> FP
    DOZE --> Fosc
    DOZE["DOZE[DOZE[DOZE[DOZE[DOZE[DOZE[DOZE[DOZE[DOZE[DOZE[DOZE[DOZE[DOZE[DOZE[DOZE[DOZE[DOZE[DOZE[DOZE[DOZE[DOZE[DOZE[DOZE[DOZE[DOZE[DOC-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,<br>    CLK --> NO<br>    CLK --> AF<br>    CLK --> AF<br>    CLK --> AF<br>    CLK --> AF<br>    CLK --> AF<br>    CLK --> AF<br>    CLK --> AF<br>    CLK --> AF<br>    CLK --> AF<br>    CLK --> AF<br>    CLK --> AF<br>    CLK --> AF<br>    CLK --> AF<br>    CLK --> AF<br>    CLK --> AF<br>    CLK --> AF<br>    CLK --> AF<br>    CLK --> AF<br>    CLK --> AF<br>    CLK --> AF<br>    CLK --> AVCODivider[Auxiliary Controller"]
    AVCODivider --> APOLA["APOLA"]
    APOLA --> AFPLLO["AFPLLO(6.8)"]
    APOLA --> AFVCO["AFVCO/2(6.8)"]
    APOLA --> AFVCO/3["AFVCO/3"]
    APOLA --> AFVCO/4["AFVCO/4"]
    APOLA --> AFVCO/5["AFVCO/5"]
    APOLA --> AFVCO/6["AFVCO/6"]
    APOLA --> AFVCO/7["AFVCO/7"]
    APOLA --> AFVCO/8["AFVCO/8"]
    APOLA --> AFVCO/9["AFVCO/9"]
    APOLA --> AFVCO/10["AFVCO/10"]
    APOLA --> AFVCO/11["AFVCO/11"]
    APOLA --> AFVCO/12["AFVCO/12"]
    APOLA --> AFVCO/13["AFVCO/13"]
    APOLA --> AFVCO/14["AFVCO/14"]
    APOLA --> AFVCO/15["AFVCO/15"]
    APOLA --> AFVCO/16["AFVCO/16"]
    APOLA --> AFVCO/17["AFVCO/17"]
    APOLA --> AFVCO/18["AFVCO/18"]
    APOLA --> AFVCO/19["AFVCO/19"]
    APOLA --> AFVCO/20["AFVCO/20"]
    APOLA --> AFVCO/21["AFVCO/21"]
    APOLA --> AFVCO/22["AFVCO/22"]
    APOLA --> AFVCO/23["AFVCO/23"]
    APOLA --> AFVCO/24["AFVCO/24"]
    APOLA --> AFVCO/25["AFVCO/25"]
    APOLA --> AFVCO/26["AFVCO/26"]
    APOLA --> AFVCO/27["AFVCO/27"]
    APOLA --> AFVCO/28["AFVCO/28"]
    APOLA --> AFVCO/29["AFVCO/29"]
    APOLA --> AFVCO/30["AFVCO/30"]
    APOLA --> AFVCO/31["AFVCO/31"]
    APOLA --> AFVCO/32["AFVCO/32"]
    APOLA --> AFVCO/33["AFVCO/33"]
    APOLA --> AFVCO/34["AFVCO/34"]
    APOLA --> AFVCO/35["AFVCO/35"]
    APOLA --> AFVCO/36["AFVCO/36"]
    APOLA --> AFVCO/37["AFVCO/37"]
    APOLA --> AFVCO/38["AFVCO/38"]
    APOLA --> AFVCO/39["AFVCO/39"]
    APOLA --> AFVCO/40["AFVCO/40"]

FIGURE 6-3: SECONDARY CORE OSCILLATOR SUBSYSTEM
Microchip dsPIC33CH64MP208 - OSCILLATOR WITH HIGH-FREQUENCY PLL - 3

flowchart
graph TD
    A["Main Core Shared Oscillator Source"] --> B["PLL(2)"]
    C["Secondary Core Shared Oscillator Source"] --> D["PLL(2)"]
    B --> E["+2"]
    D --> F["+2"]
    E --> G["DOZE"]
    F --> H["DOZE"]
    G --> I["FCY"]
    H --> J["FP"]
    I --> K["Fosc"]
    L["Clock Clock"] --> M["SwitchFail"]
    M --> N["Reset"]
    O["S6"] --> N
    P["FNOSC[2:0"]NOSC["2:0"]] --> Q["APLL"]
    Q --> R["AFPLLO(6,8)"]
    R --> S["AFVCO(4)"]
    S --> T["AVCO Divider"]
    T --> U["AFVCO/2(6,8)"]
    T --> V["AFVCO/3"]
    T --> W["AFVCO/4"]
    X["COSC[2:0"]] --> Y["S1"]
    Y --> Z["S3"]
    Z --> AA["S2"]
    AA --> AB["S1/S3"]
    AB --> AC["S0"]
    AC --> AD["S7"]
    AD --> AE["S6"]
    AE --> AF["S5"]
    AG["FRCCLK(1)"] --> AH["S1"]
    AH --> AI["S3"]
    AI --> AJ["S2"]
    AJ --> AK["S1/S3"]
    AL["FRCDIV(1)"] --> AM["FRCDIV"]
    AM --> AN["FRCDIV(2:0)"]
    AO["COSC[2:0"]] --> AP["S1"]
    AP --> AQ["S3"]
    AQ --> AR["S2"]
    AR --> AS["S1/S3"]
    AT["S6"] --> AU["SwitchFail"]
    AV["FNOSC[2:0"]NOSC["2:0"]] --> AW["S2"]
    AW --> AX["S1/S3"]
    AY["FRCCLK(1)"] --> AZ["S1"]
    AZ --> BA["S3"]
    BB["FRCDIV(1)"] --> BC["S2"]
    BC --> BD["S1/S3"]
    BE["FRCCLK(1)"] --> BF["S3"]
    BF --> BG["S2"]
    BH["FRCDIV(1)"] --> BI["S2"]
    BI --> BJ["S1/S3"]
    BK["FRCCLK(1)"] --> BL["S3"]
    BL --> BM["S2"]
    BN["FRCDIV(1)"] --> BO["S2"]
    BO --> BP["S1/S3"]
    BQ["FRCCLK(1)"] --> BR["S3"]
    BR --> BS["S2"]
    BT["FRCDIV(1)"] --> BU["S2"]
    BU --> BV["S1/S3"]
    BW["FRCCLK(1)"] --> BX["S3"]
    BX --> BY["S2"]
    BZ["FRCDIV(1)"] --> CA["S2"]
    CA --> CB["S1/S3"]
    CC["FRCCLK(1)"] --> CD["S3"]
    CD --> CE["S2"]
    CF["FRCDIV(1)"] --> CG["S2"]
    CG --> CH["S1/S3"]
    CI["FRCCLK(1)"] --> CJ["S3"]
    CJ --> CK["S2"]
    CL["FRCDIV(1)"] --> CD
    CM["FRCCLK(1)"] --> CN["S3"]
    CN --> CO["S2"]
    CP["FRCDIV(1)"] --> CR["S2"]
    CR --> CS["S1/S3"]
    CT["FRCCLK(1)"] --> CU["S3"]
    CU --> CV["S2"]
    CW["FRCDIV(1)"] --> CX["S2"]
    CX --> CY["S1/S3"]
    DD["FRCCLK(1)"] --> DE["S3"]
    DE --> DF["S2"]
    DG["FRCDIV(1)"] --> DH["S2"]
    DH --> DI["S1/S3"]
    DJ["FRCCLK(1)"] --> DK["S3"]
    DK --> DL["S2"]
    DV["FRCDIV(1)"] --> DW["S2"]
    DW --> DX["S1/S3"]
    DB["FRCCLK(1)"] --> DC["S3"]
    DC --> DV

Note 1: From Main and Secondary core shared oscillator source.
2: See Figure 6-4 for details of the PLL module.
3: See Figure 6-4 for the source of Fvco.
4: See Figure 6-4 for the source of AVCO.
5: XTPLL, HSPLL, ECPLL, FRCPLL (F PLLO).
6: Clock option for PWM.
7: Clock option for ADC.
8: Clock option for DAC.

6.1 Primary PLL

The Primary Oscillator and internal FRC Oscillator sources can optionally use an on-chip PLL to obtain higher operating speeds. There are two independent instantiations of PLL for the Main and Secondary clock subsystems. Figure 6-4 illustrates a block diagram of the Main/Secondary core PLL module.

For PLL operation, the following requirements must be met at all times without exception:

  • The PLL Input Frequency (F PLLI) must be in the range of 8 MHz to 64 MHz
  • The PFD Input Frequency (F PFD) must be in the range of 8 MHz to (Fvco/16) MHz

The VCO Output Frequency (Fvco) must be in the range of 400 MHz to 1600 MHz

FIGURE 6-4: MAIN/SECONDARY CORE PLL AND VCO DETAIL
Microchip dsPIC33CH64MP208 - Primary PLL - 1

flowchart
graph TD
    A["COSC[2:0"] --> S1]
    B["FRCCLK(1)"] --> S1
    C["POSCCLK(1)"] --> S3 --> D["DIV 1-8"] --> E["PFD"] --> F["Lock Detect"] --> G["VCO"] --> H["DIV 1-7"] --> I["DIV 1-7"] --> J["FPLLO(2,4)"]
    K["PLLPRE[3:0"]] --> D
    L["PLL Ready (LOCK)"] --> F
    M["POST1DIV[2:0"]] --> H
    N["POST2DIV[2:0"]] --> I
    O["Feedback Divider 16-200"] --> P["PLLFBDIV[7:0"]]
    Q["VCO Divider"] --> R["Fvco"]
    Q --> S["Fvco/2(4)"]
    Q --> T["Fvco/3"]
    Q --> U["Fvco/4(3)"]
    V["FCVCO"] --> W["FVCODIV"]
    X["FCVCO"] --> Y["FCVCO"]

Note 1: From Main and Secondary core shared oscillator source.
2: Clock option for PWM.
3: Clock option for ADC.
4: Clock option for DAC.

Equation 6-1 provides the relationship between the PLL Input Frequency (FPLLI) and VCO Output Frequency (Fvco).

EQUATION 6-1: MAIN/SECONDARY CORE Fvco CALCULATION

$$ F V C O = F P L L I \times \left(\frac {M}{N 1}\right) = F P L L I \times \left(\frac {P L L F B D I V [ 7 : 0 ]}{P L L P R E [ 3 : 0 ]}\right) $$

Equation 6-2 provides the relationship between the PLL Input Frequency (FPLLI) and PLL Output Frequency (FPLLO).

EQUATION 6-2: MAIN/SECONDARY CORE FPLLO CALCULATION

$$ F P L L O = F P L L I \times \left(\frac {M}{N 1 \times N 2 \times N 3}\right) = F P L L I \times \left(\frac {P L L F B D I V [ 7 : 0 ]}{P L L P R E [ 3 : 0 ] \times P O S T 1 D I V [ 2 : 0 ] \times P O S T 2 D I V [ 2 : 0 ]}\right) $$

Where:

$$ M = P L L F B D I V [ 7: 0 ] $$

$$ N 1 = P L L P R E [ 3: 0 ] $$

$$ N 2 = P O S T I D I V [ 2: 0 ] $$

$$ N 3 = P O S T 2 D I V [ 2: 0 ] $$

Note: The PLL Phase Detector Input Divider Select (PLLPREx) bits and the PLL Feedback Divider (PLLFBDIVx) bits should not be changed when operating in PLL mode. Therefore, the user must start on either a non-PLL source or clock switch to a non-PLL source (e.g., internal FRC Oscillator) to make any necessary changes and then clock switch to the desired PLL source.
Using Two-Speed Start-up (IESO, FOSCSEL[7]) with a PLL source will start the device on the FRC while preparing the PLL. Once the PLL is ready, the device will switch automatically to the new source. This mode should not be used if changes are needed to the PLLPREx and PLLFBDIVx bits because the PLL may be running before user code execution begins.
Also, it is not permitted to directly clock switch from one PLL clock source to a different PLL clock source. The user would need to transition between PLL clock sources with a clock switch to a non-PLL clock source.

EXAMPLE 6-1: CODE EXAMPLE FOR USING MAIN PRIMARY PLL WITH 8 MHz INTERNAL FRC

//code example for 50 MIPS system clock using 8MHz FRC
// Select FRC on POR
#pragma config FNOSC = FRC // Oscillator Source Selection (Internal Fast RC (FRC))
#pragma config IESO = OFF
// Enable Clock Switching
#pragma config FCKSM = CSECMD
int main()
{
    // Configure PLL prescaler, both PLL postscalers, and PLL feedback divider
CLKDIVbits.PLLPRE = 1; // N1=1
PLLFBDbits.PLLFBDIV = 125; // M = 125
PLLDIVbits.POST1DIV = 5; // N2=5
PLLDIVbits.POST2DIV = 1; // N3=1
// Initiate Clock Switch to FRC with PLL (NOSC=0b001)
__builtin_write_OSCCONH(0x01);
__builtin_write_OSCCONL(OSCCON | 0x01);
// Wait for Clock switch to occur
while (OSCCONbits.OSWEN!= 0);
}
Note: FPLLO = FPLLI * M/(N1 * N2 * N3); FPLLI = 8; M = 125; N1 = 1; N2 = 5; N3 = 1;
so FPLLO = 8 * 125/(1 * 5 * 1) = 200 MHz or 50 MIPS. 

EXAMPLE 6-2: CODE EXAMPLE FOR USING SECONDARY PRIMARY PLL WITH 8 MHz INTERNAL FRC

//code example for 60 MIPS system clock using 8MHz FRC
// Select Internal FRC at POR
// Select FRC on POR
#pragma config S1FNOSC = FRC    // Oscillator Source Selection (Internal Fast RC (FRC))
#pragma config S1IESO = OFF    // Two-speed Oscillator Start-up Enable bit (Start up with user-selected oscillator source)
// Enable Clock Switching
#pragma config S1FCKSM = CSECMD
int    main()
{
    // Configure PLL prescaler, both PLL postscalers, and PLL feedback divider
CLKDIVbits.PLLPRE = 1; // N1=1
PLLFBDbits.PLLFBDIV = 150; // M = 150
PLLDIVbits.POST1DIV = 5; // N2=5
PLLDIVbits.POST2DIV = 1; // N3=1
// Initiate Clock Switch to FRC with PLL (NOSC=0b001)
__builtin_write_OSCCONH(0x01);
__builtin_write_OSCCONL(OSCCON | 0x01);
// Wait for Clock switch to occur
while    (OSCCONbits.OSWEN!= 0);
}
Note: FPLLO = FPLLI * M/(N1 * N2 * N3); FPLLI = 8; M = 150; N1 = 1; N2 = 5; N3 = 1;
so FPLLO = 8 * 150/(1 * 5 * 1) = 240 MHz or 60 MIPS. 

6.2 Auxiliary PLL

The dsPIC33CH128MP508 device family implements an Auxiliary PLL (APLL) module for each core present. There are two independent instantiations of APLL for the Main and Secondary clock subsystems. The APLL is used to generate various peripheral clock sources independent of the system clock. Figure 6-5 shows a block diagram of the Main/Secondary core APLL module.

For APLL operation, the following requirements must be met at all times without exception:

  • The APLL Input Frequency (AF PLLI) must be in the range of 8 MHz to 64 MHz
    • The APFD Input Frequency (AF PFD) must be in the range of 8 MHz to (AFvco/16) MHz
    • The AVCO Output Frequency (AF vco) must be in the range of 400 MHz to 1600 MHz

FIGURE 6-5: MAIN/SECONDARY CORE APLL AND VCO DETAIL
Microchip dsPIC33CH64MP208 - Auxiliary PLL - 1

flowchart
graph TD
    A["FRCCLK(1)"] --> B["DIV 1-8"]
    C["POSCLK(1)"] --> B
    B --> D["APFD"]
    D --> E["Lock Detect"]
    E --> F["AVCO"]
    F --> G["DIV 1-7"]
    G --> H["DIV 1-7"]
    H --> I["0"]
    I --> J["APLLEN"]
    J --> K["AFPLLO(2,4)"]
    L["FRCSEL"] --> B
    M["APLLPRE[3:0"]] --> D
    N["APLL Ready (APLLCLK)"] --> E
    O["APOST1DIV[2:0"]] --> G
    P["APOST2DIV[2:0"]] --> H
    Q["Feedback Divider 16-200"] --> F
    R["APLLFBDIV[7:0"]] --> F
    S["AFVCO"] --> H
    T["AVCO Divider"] --> U["AFVCO/2(2,4)"]
    T --> V["AFVCO/3"]
    T --> W["AFVCO/4"]
    X["AVCODIV[1:0"]] --> Y["AFVCODIV(3)"]

Equation 6-3 provides the relationship between the APLL Input Frequency (AFPLLI) and the AVCO Output Frequency (AFvco).

EQUATION 6-3: MAIN/SECONDARY CORE AFvco CALCULATION

$$ A F V C O = A F P L L I \times \left(\frac {M}{N 1}\right) = A F P L L I \times \left(\frac {A P L L F B D I V [ 7 : 0 ]}{A P L L P R E [ 3 : 0 ]}\right) $$

Equation 6-4 provides the relationship between the APLL Input Frequency (AFPLLI) and APLL Output Frequency (AFPLLO).

EQUATION 6-4: MAIN/SECONDARY CORE AFPLLO CALCULATION

$$ A F P L L O - A F P L L I \times \left(\frac {M}{N 1 \times N 2 \times N 3}\right) - A F P L L I \times \left(\frac {A P L L F B D I V [ 7 : 0 ]}{A P L L P R E [ 3 : 0 ] \times A P O S T 1 D I V [ 2 : 0 ] \times A P O S T 2 D I V [ 2 : 0 ]}\right) $$

Where:

M = APLLFBDIV[7:0] N1 = APLLPRE[3:0] N2 = APOST1DIV[2:0] N3 = APOST2DIV[2:0]

EXAMPLE 6-3: CODE EXAMPLE FOR USING MAIN OR SECONDARY AUXILIARY PLL WITH THE INTERNAL FRC OSCILLATOR

//code example for AFVCO = 1 GHz and AFPLLO = 500 MHz using 8 MHz internal FRC
// Configure the source clock for the APLL
ACLKCON1bits.FRCSEL = 1; // Select internal FRC as the clock source
// Configure the APLL prescaler, APLL feedback divider, and both APLL postscalers.
ACLKCON1bits.APLLPRE = 1; // N1 = 1
APLLFBD1bits.APLLFBDIV = 125; // M = 125
APLLDIV1bits.APOST1DIV = 2; // N2 = 2
APLLDIV1bits.APOST2DIV = 1; // N3 = 1
// Enable APLL
ACLKCON1bits.APLLEN = 1; 

Note: Even with the APLLEN bit set, another peripheral must generate a clock request before the APLL will start.

6.3 CPU Clocking

While the Main and Secondary subsystems share access to a single set of oscillator sources, all other clocking logic is implemented individually. The Main and Secondary core can be configured independently to use any of the following clock configurations:

• Primary Oscillator (POSC) on the OSCI and OSCO pins
- Internal Fast RC Oscillator (FRC) with optional clock divider
- Internal Low-Power RC Oscillator (LPRC)
• Primary Oscillator with PLL (ECPLL, HSPLL, XTPLL)
- Internal Fast RC Oscillator with PLL (FRCPLL)
- Backup Internal Fast RC Oscillator (BFRC)

Each core's system clock source is divided by two to produce the internal instruction cycle clock. In this document, the instruction cycle clock is denoted by Fcy. The timing diagram in Figure 6-6 illustrates the relationship between the system clock (Fosc), the instruction cycle clock (Fcγ) and the Program Counter (PC).

The internal instruction cycle clock (FcY) can be output on the OSCO I/O pin if the Primary Oscillator mode (POSCMD[1:0]) is not configured as HS/XT. Refer to Table 6-3 for the dual core function of the OSCO pin.

FIGURE 6-6: CLOCK AND INSTRUCTION CYCLE TIMING
Microchip dsPIC33CH64MP208 - CPU Clocking - 1

text_image Fosc Tcy FcY PC PC + 2 PC + 4 Fetch INST (PC) Execute INST (PC - 2) Fetch INST (PC + 2) Execute INST (PC) Fetch INST (PC + 4) Execute INST (PC + 2)

6.4 Primary Oscillator (POSC)

The dsPIC33CH128MP508 family devices contain one instance of the Primary Oscillator (POSC), which is available to both the Main and Secondary clock subsystems. The Primary Oscillator is available on the OSCI and OSCO pins of the dsPIC33CH devices. This connection enables an external crystal (or ceramic resonator) to provide the clock to the device. The Primary Oscillator provides three modes of operation:

• Medium Speed Oscillator (XT Mode):
The XT mode is a Medium Gain, Medium Frequency mode used to work with crystal frequencies of 3.5 MHz to 10 MHz.
• High-Speed Oscillator (HS Mode):
The HS mode is a High-Gain, High-Frequency mode used to work with crystal frequencies of 10 MHz to 32 MHz.
- External Clock Source Operation (EC Mode): If the on-chip oscillator is not used, the EC mode allows the internal oscillator to be bypassed. The device clocks are generated from an external source (0 MHz to up to 64 MHz) and input on the OSCI pin.

Note: The Primary Oscillator (POSC) is shared between Main and Secondary.

6.5 Internal Fast RC (FRC) Oscillator

The dsPIC33CH128MP508 family devices contain one instance of the internal Fast RC (FRC) Oscillator, which is available to both the Main and Secondary clock subsystems. The FRC Oscillator provides a nominal 8 MHz clock without requiring an external crystal or ceramic resonator, which results in system cost savings for applications that do not require a precise clock reference.

The application software can tune the frequency of the oscillator using the FRC Oscillator Tuning bits (TUN[5:0]) in the FRC Oscillator Tuning register (OSCTUN[5:0]).

Note: The FRC is shared between Main and Secondary; the OSCTUN register is used to tune the FRC as a part of the Main oscillator configuration.

6.6 Low-Power RC (LPRC) Oscillator

The dsPIC33CH128MP508 family devices contain one instance of the Low-Power RC (LPRC) Oscillator that is available to both the Main and Secondary clock subsystems. The LPRC Oscillator provides a nominal clock frequency of 32 kHz and is the clock source for the Watchdog Timer (WDT) and Fail-Safe Clock Monitor (FSCM) circuits in each core clock subsystem.

The LPRC Oscillator is the clock source for the WDT and FSCM in both the Main and Secondary cores. The LPRC Oscillator is enabled at power-on.

The LPRC Oscillator remains enabled under these conditions:

• The Main or Secondary FSCM is enabled
• The Main or Secondary WDT is enabled
- The LPRC Oscillator is selected as the system clock

If none of these conditions are true, the LPRC is shut off in Sleep mode.

Note: The LPRC is shared between Main and Secondary.

6.7 Backup Internal Fast RC (BFRC) Oscillator

The oscillator block provides a stable reference clock source for the Fail-Safe Clock Monitor (FSCM). When FSCM is enabled in the FCKSM[1:0] Configuration bits (FOSC[7:6]), it constantly monitors the main clock source against a reference signal from the 8 MHz Backup Internal Fast RC (BFRC) Oscillator. In case of a clock failure, the Fail-Safe Clock Monitor switches the clock to the BFRC Oscillator, allowing for continued low-speed operation or a safe application shutdown.

6.8 Reference Clock Output

In addition to the CLKO output (Fosc/2), the dsPIC33CH128MP508 family devices can be configured to provide a reference clock output signal to a port pin. This feature is available in all oscillator configurations and allows the user to select a greater range of clock sub-

multiples to drive external devices in the application. CLKO is enabled by Configuration bit, OSCIOFNC, and is independent of the REFCLKO reference clock. REFCLKO is mappable to any I/O pin that has mapped output capability. The reference clock output module block diagram is shown in Figure 6-7.

FIGURE 6-7: REFERENCE CLOCK GENERATOR
Microchip dsPIC33CH64MP208 - Reference Clock Output - 1

flowchart
graph LR
    A["REFOI (PPS) Pin"] --> B["1000"]
    C["Fvco/4"] --> D["0110"]
    E["BFRC"] --> F["0101"]
    G["LPRC"] --> H["0100"]
    I["FRC"] --> J["0011"]
    K["POSC"] --> L["0010"]
    M["Peripheral Clock (FP)"] --> N["0001"]
    O["System Clock (Fosc)"] --> P["0000"]
    Q["ROSEL[3:0"]] --> R["Divider"]
    S["ROTRIM[8:0"]] --> R
    T["RODIV[14:0"]] --> R
    U["ROOUT"] --> V["REFCLKO (PPS)"]
    W["To SPI, CCP, CLC"] --> X["Output"]

This reference clock output is controlled by the REFOCONL and REFOCONH registers. Setting the ROEN bit (REFOCONL[15]) makes the clock signal available on the REFCLKO pin. The RODIV[14:0] bits (REFOCONH[14:0]) and ROTRIM[8:0] bits (REFOTRIMH[15:7]) enable the selection of different clock divider options. The formula for determining the final frequency output is shown in Equation 6-5. The ROSWEN bit (REFOCONL[9]) indicates that the clock divider has been successfully switched. In order to switch the REFCLKO divider, the user should ensure that this bit reads as '0'. Write the updated values to the RODIV[14:0] or ROTRIM[8:0] bits, set the ROSWEN bit and then wait until it is cleared before assuming that the REFCLKO clock is valid.

EQUATION 6-5: CALCULATING FREQUENCY OUTPUT

$$ F _ {R E F O U T} = \frac {F _ {R E F I N}}{2 \cdot (R O D I V [ 1 4 : 0 ] + R O T R I M [ 8 : 0 ] / 5 1 2)} $$

Where: FREFOUT = Output Frequency FREFIN = Input Frequency When RODIV[14:0] = 0, the output clock is the same as the input clock.

The ROSEL[3:0] bits (REFOCONL[3:0]) determine which clock source is used for the reference clock output. The ROSLP bit (REFOCONL[11]) determines if the reference source is available on REFCLKO when the device is in Sleep mode.

To use the reference clock output in Sleep mode, both the ROSLP bit must be set and the clock selected by the ROSEL[3:0] bits must be enabled for operation during Sleep mode, if possible. Clearing the ROSEL[3:0] bits allows the reference output frequency to change, as the system clock changes during any clock switches. The ROOUT bit enables/disables the reference clock output on the REFCLKO pin.

The ROACTIV bit (REFOCONL[8]) indicates that the module is active; it can be cleared by disabling the module (setting ROEN to '0'). The user must not change the reference clock source, or adjust the divider when the ROACTIV bit indicates that the module is active. To avoid glitches, the user should not disable the module until the ROACTIV bit is '1'.

6.9 OSCCON Unlock Sequence

The OSCCON register is protected against unintended writes through a lock mechanism. The upper and lower bytes of OSCCON have their own unlock sequence, and both must be used when writing to both bytes of the register. Before OSCCON can be written to, the following unlock sequence must be used:

  1. Execute the unlock sequence for the OSCCON high byte.

In two back-to-back instructions:

• Write 0x78 to OSCCON[15:8]
• Write 0x9A to OSCCON[15:8]

  1. In the instruction immediately following the unlock sequence, the OSCCON[15:8] bits can be modified.

  2. Execute the unlock sequence for the OSCCON low byte.

In two back-to-back instructions:
• Write 0x46 to OSCCON[7:0]
• Write 0x57 to OSCCON[7:0]

  1. In the instruction immediately following the unlock sequence, the OSCCON[7:0] bits can be modified.
Note: MPLAB XC16 provides a built-in C language function, including the unlocking sequence to modify high and low bytes in the OSCCON register:_builtin_write_OSCCONH(value)_builtin_write_OSCCONL(value)

Example 6-4 illustrates code for using the PLL

(50 MIPS) with the Primary Oscillator.

EXAMPLE 6-4: CODE EXAMPLE FOR USING MAIN PLL (50 MIPS) WITH PRIMARY OSCILLATOR (POSC)

//code example for 50 MIPS system clock using POSC with 10 MHz external crystal
// Select Internal FRC at POR
// Select FRC on POR
#pragma config FNOSC = FRC // Oscillator Source Selection (Internal Fast RC (FRC))
#pragma config IESO = OFF
/// Enable Clock Switching and Configure POSC in XT mode
#pragma config POSCMD = XT
#pragma config FCKSM = CSECMD

int main()
{
    // Configure PLL prescaler, both PLL postscalers, and PLL feedback divider
    CLKDIVbits.PLLPRE = 1;    // N1=1
    PLLFBDbits.PLLFBDIV = 100;    // M = 100
    PLLDIVbits.POST1DIV = 5;    // N2=5
    PLLDIVbits.POST2DIV = 1;    // N3=1

    // Initiate Clock Switch to Primary Oscillator with PLL (NOSC=0b011)
    __builtin_write_OSCCONH(0x03);
    __builtin_write_OSCCONL(OSCCON | 0x01);

    // Wait for Clock switch to occur
    while (OSCCONbits.OSWEN!= 0);

    // Wait for PLL to lock
    while (OSCCONbits.LOCK!= 1);
}

Note: FPLLO = FPLLI * M/(NI * N2 * N3); FPLLI = 10; M = 100; NI = 1; N2 = 5; N3 = 1;
so FPLLO = 10 * 100/(1 * 5 * 1) = 200 MHz or 50 MIPS. 

Example 6-5 illustrates code for using the PLL (60 MIPS) with the Primary Oscillator.

6.10 Primary Oscillator Pin Functionality

The Primary Oscillator pins (OSCI and OSCO) can be used for other functions when the primary oscillator is not being used. The POSCMD<1:0> Configuration bits in the Oscillator Configuration register (FOSC<1:0>)

determine the oscillator pin function. The OSCIOFNC bit (FOSC<2>) determines the OSCO/CLKO pin function. By default, the CLKO function is active and the pin will output a clock frequency of Fcy. A clock signal is present on the OSCO/CLKO pin when device is unprogrammed or during the programming sequence. Care should be taken when OSCO/CLKO pin is used to drive other circuitry.

EXAMPLE 6-5: CODE EXAMPLE FOR USING SECONDARY PLL (60 MIPS) WITH PRIMARY OSCILLATOR (POSC)

//code example for 60 MIPS system clock using POSC with 10 MHz external crystal
// Select Internal FRC at POR
// Select FRC on POR
#pragma config S1FNOSC = FRC // Oscillator Source Selection (Internal Fast RC (FRC))
#pragma config S1IESO = OFF    // Two-speed Oscillator Start-up Enable bit (Start up with user-selected oscillator source)
// Enable Clock Switching
#pragma config S1FCKSM = CSECMD

//Configure POSC in XT mode in Main core FOSC configuration register
#pragma config POSCMD = XT

int main()
{
    // Configure PLL prescaler, both PLL postscalers, and PLL feedback divider
    CLKDIVbits.PLLPRE = 1;    // N1=1
    PLLFBDBits.PLLFBDIV = 120;    // M = 120
    PLLDIVbits.POST1DIV = 5;    // N2=5
    PLLDIVbits.POST2DIV = 1;    // N3=1

    // Initiate Clock Switch to Primary Oscillator with PLL (NOSC=0b011)
    __builtin_write_OSCCONE(0x03);
    __builtin_write_OSCCONL(OSCCON | 0x01);

    // Wait for Clock switch to occur
    while (OSCCONbits.OSWEN!= 0);

    // Wait for PLL to lock
    while (OSCCONbits.LOCK!= 1);
} 

Example 6-6 illustrates code for using the Main PLL with an 8 MHz internal FRC.

EXAMPLE 6-6: CODE EXAMPLE FOR USING MAIN PLL (50 MIPS) WITH 8 MHz INTERNAL FRC

//code example for 50 MIPS system clock using 8MHz FRC

// Select FRC on POR
#pragma config FNOSC = FRC    // Oscillator Source Selection (Internal Fast RC (FRC))
#pragma config IESO = OFF
/// Enable Clock Switching
#pragma config FCKSM = CSECMD

int main()
{
    // Configure PLL prescaler, both PLL postscalers, and PLL feedback divider
    CLKDIVbits.PLLPRE = 1;    // N1=1
    PLLFBDbits.PLLFBDIV = 125;    // M = 125
    PLLDIVbits.POST1DIV = 5;    // N2=5
    PLLDIVbits.POST2DIV = 1;    // N3=1

    // Initiate Clock Switch to FRC with PLL (NOSC=0b001)
    __builtin_write_OSCCONH(0x01);
    __builtin_write_OSCCONL(OSCCON | 0x01);

    // Wait for Clock switch to occur
    while (OSCCONbits.OSWEN!= 0);

    // Wait for PLL to lock
    while (OSCCONbits.LOCK!= 1);
}

Note: FPLLO = FPLLI * M/(N1 * N2 * N3); FPLLI = 8; M = 125; N1 = 1; N2 = 5; N3 = 1;
so FPLLO = 8 * 125/(1 * 5 * 1) = 200 MHz or 50 MIPS. 

Example 6-7 illustrates code for using the Secondary

PLL with an 8 MHz internal FRC.

EXAMPLE 6-7: CODE EXAMPLE FOR USING SECONDARY PLL (60 MIPS) WITH 8 MHz INTERNAL FRC

//code example for 60 MIPS system clock using 8MHz FRC

// Select FRC on POR
#pragma config S1FNOSC = FRC // Oscillator Source Selection (Internal Fast RC (FRC))
#pragma config S1IESO = OFF // Two-speed Oscillator Start-up Enable bit (Start up with user-selected oscillator source)

// Enable Clock Switching
#pragma config S1FCKSM = CSECMD

int main()
{
    // Configure PLL prescaler, both PLL postscalers, and PLL feedback divider
    CLKDIVbits.PLLPRE = 1; // N1=1
    PLLFBDbits.PLLFBDIV = 150; // M = 150
    PLLDIVbits.POST1DIV = 5; // N2=5
    PLLDIVbits.POST2DIV = 1; // N3=1

    // Initiate Clock Switch to FRC with PLL (NOSC=0b001)
    __builtin_write_OSCCONH(0x01);
    __builtin_write_OSCCONL(OSCCON | 0x01);

    // Wait for Clock switch to occur
    while (OSCCONbits.OSWEN!= 0);
    // Wait for PLL to lock
    while (OSCCONbits.LOCK!= 1);
}

Note: FPLLO = FPLLI * M/(N1 * N2 * N3); FPLLI = 8; M = 150; N1 = 1; N2 = 5; N3 = 1;
so FPLLO = 8 * 150/(1 * 5 * 1) = 240 MHz or 60 MIPS. 

6.11 Main Oscillator Configuration Registers

Table 6-1 lists the configuration settings that select the device's Main core oscillator source and operating mode at a POR.

TABLE 6-1: CONFIGURATION BIT VALUES FOR CLOCK SELECTION FOR THE MAIN

Oscillator SourceOscillator ModeFNOSC[2:0] ValuePOSCMD[1:0] Value ^(3) Notes
S0 Fast RC Oscillator (FRC) 000 xx 1
S1 Fast RC Oscillator with PLL (FRCPLL) 001 xx 1
S2 Primary Oscillator (EC) 010 00 1
S2 Primary Oscillator (XT) 010 01
S2 Primary Oscillator (HS) 010 10
S3 Primary Oscillator with PLL (ECPLL)011001
S3 Primary Oscillator with PLL (XTPLL)011 01
S3 Primary Oscillator with PLL (HSPLL)011 10
S4 Reserved100 xx
S5Low-Power RC Oscillator (LPRC)101xx1
S6Backup FRC (BFRC)110xx1
S7Fast RC Oscillator with ÷ N Divider (FRCDIVN)111xx1, 2

Note 1: The OSCO pin function is determined by the OSCIOFNC Configuration bit.
2: This is the default oscillator mode for an unprogrammed (erased) device.
3: The POSCMDx bits are only available in the Main FOSC Configuration register.

6.12 Secondary Oscillator Configuration Registers

Table 6-2 lists the configuration settings that select the device's Secondary core oscillator source and operating mode at a POR.

TABLE 6-2: CONFIGURATION BIT VALUES FOR CLOCK SELECTION FOR THE SECONDARY

Oscillator SourceOscillator ModeS1FNOSC[2:0] ValuePOSCMD[1:0] Value (3)Notes
S0 FastRC Oscillator (FRC) 000 xx 1
S1 FastRC Oscillator with PLL (FRCPLL) 001 xx 1
S2 Primary Oscillator (EC) 010 00 1
S2 Primary Oscillator (XT) 010 01
S2 Primary Oscillator (HS) 010 10
S3Primary Oscillator with PLL (ECPLL)011001
S3 Primary Oscillator with PLL (XTPLL)011 01
S3 Primary Oscillator with PLL (HSPLL)011 10
S4 Reserved100 xx 1
S5Low-Power RC Oscillator (LPRC)101xx1
S6Backup FRC (BFRC)110xx1
S7Fast RC Oscillator with ÷ N Divider (FRCDIVN)111xx1, 2

Note 1: The OSCO pin function is determined by the S1OSCIOFNC Configuration bit. If both the Main core OSCIOFNC and Secondary core S1OSCIOFNC bits are set, the Main core OSCIOFNC bit has priority.
2: This is the default oscillator mode for an unprogrammed (erased) device.
3: The POSCMD[1:0] bits are only available in the Main Oscillator Configuration register, FOSC. This setting configures the Primary Oscillator for use by either core.

TABLE 6-3: OSCO FUNCTION FOR THE MAIN AND SECONDARY CORE (1)

[OSCIOFNC:S1OSCIOFNC]RB1 or OSCO pin function
1:1Main clock output on OSCO pin
1:0Main clock output on OSCO pin
0:1Secondary clock output on OSCO pin
0:0Clock out disabled, RB1 works as an I/O port; output function is based on pin ownership (CPRB1 = 1 or 0)

Note 1: The RB1 pin will toggle during programming or debugging time, irrespective of the OSCIOFNC or S1OSCIOFNC settings.

6.13 Main Special Function Registers

These Special Function Registers provide run-time control and status of the Main core's oscillator system.

6.13.1 MAIN OSCILLATOR CONTROL REGISTERS

REGISTER 6-1: OSCCON: OSCILLATOR CONTROL REGISTER (MAIN) ^(1)

U-0 R-0 R-0 R-0 U-0 R/W-y R/W-y R/W-y
— COSC2 COSC1 COSC0 —NOSC ^(2)_2 NOSC1 ^(2) NOSC0 ^(2)
bit 15bit 8
R/W-0 U-0 R-0 U-0R/C-0U-0 U-0 R/W-0
CLKLOCKLOCK CF^(3) OSWEN
bit 7 bit 0
Legend:y = Value set from Configuration bits on PORC = Clearable
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 Unimplemented: Read as '0'

bit 14-12 COSC[2:0]: Current Oscillator Selection bits (read-only)

111 = Fast RC Oscillator (FRC) with Divide-by-n (FRCDIVN)

110 = Backup FRC (BFRC)

101 = Low-Power RC Oscillator (LPRC)

100 = Reserved - default to FRC

011 = Primary Oscillator (XT, HS, EC) with PLL (XTPLL, HSPLL, ECPLL)

010 = Primary Oscillator (XT, HS, EC)

001 = Fast RC Oscillator (FRC) with PLL (FRCPLL)

000 = Fast RC Oscillator (FRC)

bit 11 Unimplemented: Read as '0'

bit 10-8 NOSC[2:0]: New Oscillator Selection bits ^(2)

111 = Fast RC Oscillator (FRC) with Divide-by-n (FRCDIVN)

110 = Backup FRC (BFRC)

101 = Low-Power RC Oscillator (LPRC)

100 = Reserved - default to FRC

011 = Primary Oscillator (XT, HS, EC) with PLL (XTPLL, HSPLL, ECPLL)

010 = Primary Oscillator (XT, HS, EC)

001 = Fast RC Oscillator (FRC) with PLL (FRCPLL)

000 = Fast RC Oscillator (FRC)

bit 7 CLKLOCK: Clock Lock Enable bit

1 = If (FCKSM0 = 1), then clock and PLL configurations are locked; if (FCKSM0 = 0), then clock and PLL configurations may be modified

0 = Clock and PLL selections are not locked, configurations may be modified

bit 6 Unimplemented: Read as '0'

Note 1: Writes to this register require an unlock sequence.

2: Direct clock switches between any Primary Oscillator mode with PLL and FRCPLL mode are not permitted. This applies to clock switches in either direction. In these instances, the application must switch to FRC mode as a transitional clock source between the two PLL modes.

3: This bit can only be cleared in software. Setting the bit in software (= 1) will have the same effect as an actual oscillator failure and will trigger an oscillator failure trap. Setting this bit will not cause an FSCM event.

REGISTER 6-1: OSCCON: OSCILLATOR CONTROL REGISTER (MAIN) ^(1) (CONTINUED)

bit 5 LOCK: PLL Lock Status bit (read-only)

1 = Indicates that PLL is in lock or PLL start-up timer is satisfied
0 = Indicates that PLL is out of lock, start-up timer is in progress or PLL is disabled

bit 4 Unimplemented: Read as '0'

bit 3 CF: Clock Fail Detect bit (3)

1 = FSCM has detected a clock failure
0 = FSCM has not detected a clock failure

bit 2-1 Unimplemented: Read as '0'

bit 0 OSWEN: Oscillator Switch Enable bit

1 = Requests oscillator switch to the selection specified by the NOSC[2:0] bits
0 = Oscillator switch is complete

Note 1: Writes to this register require an unlock sequence.

2: Direct clock switches between any Primary Oscillator mode with PLL and FRCPLL mode are not permitted. This applies to clock switches in either direction. In these instances, the application must switch to FRC mode as a transitional clock source between the two PLL modes.
3: This bit can only be cleared in software. Setting the bit in software (= 1) will have the same effect as an actual oscillator failure and will trigger an oscillator failure trap. Setting this bit will not cause an FSCM event.

REGISTER 6-2: CLKDIV: CLOCK DIVIDER REGISTER (MAIN)

R/W-0 R/W-0 R/W-1 R/W-1 R/W-0 R/W-0 R/W-0 R/W-0
ROI DOZE2 (1)DOZE1(1)DOZE0(1)DOZEN(2,3)FRCDIV2 FRFRCDIV1 FRCDIV0
bit 15 bit 8
U-0 U-0 r-0 r-0 R/W-0 R/W-0 R/W-0 R/W-1
— — —— PLLPRE[3:0](4)
bit 7 bit 0
Legend:r = Reserved 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 15 ROI: Recover on Interrupt bit 1 = Interrupts will clear the DOZEN bit and the processor clock, and the peripheral clock ratio is set to 1:1 0 = Interrupts have no effect on the DOZEN bit

bit 14-12 DOZE[2:0]: Processor Clock Reduction Select bits ^(1) 111 = FP divided by 128

110 = FP divided by 64

101 = FP divided by 32

100 = FP divided by 16

011 = FP divided by 8 (default)

010 = FP divided by 4

001 = FP divided by 2

000 = FP divided by 1

bit 11 DOZEN: Doze Mode Enable bit ^(2,3) 1 = DOZE[2:0] field specifies the ratio between the peripheral clocks and the processor clocks

0 = Processor clock and peripheral clock ratio is forced to 1:1

bit 10-8 FRCDIV[2:0]: Internal Fast RC Oscillator Postscaler bits 111 = FRC divided by 256 110 = FRC divided by 64 101 = FRC divided by 32 100 = FRC divided by 16 011 = FRC divided by 8 010 = FRC divided by 4 001 = FRC divided by 2 000 = FRC divided by 1 (default)

bit 7-6 Unimplemented: Read as '0' bit 5-4 Reserved: Read as '0'

Note 1: The DOZE[2:0] bits can only be written to when the DOZEN bit is clear. If DOZEN = 1, any writes to DOZE[2:0] are ignored.

2: This bit is cleared when the ROI bit is set and an interrupt occurs.

3: The DOZEN bit cannot be set if DOZE[2:0] = 000. If DOZE[2:0] = 000, any attempt by user software to set the DOZEN bit is ignored.

4: PLLPRE[3:0] may be updated while the PLL is operating, but the VCO may overshoot.

REGISTER 6-2: CLKDIV: CLOCK DIVIDER REGISTER (MAIN) (CONTINUED)
bit 3-0 PLLPRE[3:0]: PLL Phase Detector Input Divider Select bits (also denoted as 'N1', PLL prescaler) ^(4) 11111 = Reserved ... 1001 = Reserved 1000 = Input divided by 8 0111 = Input divided by 7 0110 = Input divided by 6 0101 = Input divided by 5 0100 = Input divided by 4 0011 = Input divided by 3 0010 = Input divided by 2 0001 = Input divided by 1 (power-on default selection) 0000 = Reserved

Note 1: The DOZE[2:0] bits can only be written to when the DOZEN bit is clear. If DOZEN = 1, any writes to DOZE[2:0] are ignored.

2: This bit is cleared when the ROI bit is set and an interrupt occurs. 

3: The DOZEN bit cannot be set if DOZE[2:0] = 000. If DOZE[2:0] = 000, any attempt by user software to set the DOZEN bit is ignored.
4: PLLPRE[3:0] may be updated while the PLL is operating, but the VCO may overshoot.

REGISTER 6-3: PLLFBD: PLL FEEDBACK DIVIDER REGISTER (MAIN)

U-0 U-0 U-0 U-0 r-0 r-0 r-0 r-0
——————
bit 15 bit 8
R/W-1R/W-0R/
PLLFBDIV[7:0]
bit 7 bit 0
Legend: r = Reserved bit
R = Readable bit W = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown

bit 15-12 Unimplemented: Read as '0'

bit 11-8 Reserved: Maintain as '0'

bit 7-0 PLLFBDIV[7:0]: PLL Feedback Divider bits (also denoted as 'M', PLL multiplier)

11111111 = Reserved ... 11001000 = 200 Maximum ^(1) ... 10010110 = 150 (default) ... 00010000 = 16 Minimum ^(1) ... 00000010 = Reserved 00000001 = Reserved 00000000 = Reserved

Note 1: The allowed range is 16-200 (decimal). The rest of the values are reserved and should be avoided. The power on the default feedback divider is 150 (decimal) with an 8 MHz FRC input clock. The VCO frequency is 1.2 GHz.

REGISTER 6-4: OSCTUN: FRC OSCILLATOR TUNING REGISTER (MAIN)

U-0 U-0 U-0 U-0 U-0 U-0 U-0 U-0
——————
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
— — TUN[5:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-6 Unimplemented: Read as '0'

bit 5-0 TUN[5:0]: FRC Oscillator Tuning bits

011111 = Maximum frequency deviation of 1.74% (MHz)

011110 = Center frequency + 1.693% (MHz)

* * *

000001 = Center frequency + 0.047% (MHz)

000000 = Center frequency (8.00 MHz nominal)

111111 = Center frequency - 0.047% (MHz)

* * *

100001 = Center frequency - 1.693% (MHz)

100000 = Minimum frequency deviation of -1.74% (MHz)

REGISTER 6-5: PLLDIV: PLL OUTPUT DIVIDER REGISTER (MAIN)

U-0 U-0 U-0 U-0 U-0 R/W-0 R/W-0
— — + — — — VCODIV[1:0]
bit 15 bit 8
U-0R/W-1R/W-0R/W-0U-0R/W-0R/W-0R/W-1
POST1DIV[2:0](1,2)POST2DIV[2:0](1,2)
bit 7 bit 0
Legend:
R = Readable bitW = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown

bit 15-10 Unimplemented: Read as '0'

bit 9-8 VCODIV[1:0]: PLL VCO Output Divider Select bits

11 = Fvco

10 = Fvco/2

01 = Fvco/3

00 = Fvco/4

bit 7 Unimplemented: Read as '0'

bit 6-4 POST1DIV[2:0]: PLL Output Divider #1 Ratio bits ^(1,2)

POST1DIV[2:0] can have a valid value, from 1 to 7 (POST1DIVx value should be greater than or equal to the POST2DIVx value). The POST1DIVx divider is designed to operate at higher clock rates than the POST2DIVx divider.

bit 3 Unimplemented: Read as '0'

bit 2-0 POST2DIV[2:0]: PLL Output Divider #2 Ratio bits ^(1,2)

POST2DIV[2:0] can have a valid value, from 1 to 7 (POST2DIVx value should be less than or equal to the POST1DIVx value). The POST1DIVx divider is designed to operate at higher clock rates than the POST2DIVx divider.

Note 1: The POST1DIVx and POST2DIVx divider values must not be changed while the PLL is operating.

2: The default values for POST1DIVx and POST2DIVx are 4 and 1, respectively, yielding a 150 MHz system source clock.

REGISTER 6-6: ACLKCON1: AUXILIARY CLOCK CONTROL REGISTER (MAIN)

R/W-0 R/W-0 U-0 U-0 U-0 U-0 R/W-0
APLLEN(1)APLLCK —— — — — FRCSEL
bit 15 bit 8
U-0 U-0 r-0 r-0 R/W-0 R/W-0 R/W-0 R/W-1
— — —— APLLPRE[3:0]
bit 7 bit 0
Legend:r = Reserved 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 15 APLLEN: Auxiliary PLL Enable/Bypass select bit ^(1) 1 = AFPLLO is connected to the APLL post-divider output (bypass disabled)

0 = AFPLLO is connected to the APLL input clock (bypass enabled)

bit 14 APLLCK: APLL Phase-Locked State Status bit

1 = Auxiliary PLL is in lock
0 = Auxiliary PLL is not in lock 

bit 13-9 Unimplemented: Read as '0'

bit 8 FRCSEL: FRC Clock Source Select bit 1 = FRC is the clock source for APLL 0 = Primary Oscillator is the clock source for APLL

bit 7-6 Unimplemented: Read as '0'

bit 5-4 Reserved: Maintain as '0'

bit 3-0 APLLPRE[3:0]: Auxiliary PLL Phase Detector Input Divider bits

1111 = Reserved
...
1001 = Reserved
1000 = Input divided by 8
0111 = Input divided by 7
0110 = Input divided by 6
0101 = Input divided by 5
0100 = Input divided by 4
0011 = Input divided by 3
0010 = Input divided by 2
0001 = Input divided by 1 (power-on default selection)
0000 = Reserved 

Note 1: Even with the APLLEN bit set, another peripheral must generate a clock request before the APLL will start.

REGISTER 6-7: APLLFBD1: APLL FEEDBACK DIVIDER REGISTER (MAIN)

Legend:r = Reserved bit
R = Readable bit W = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown

bit 15-12 Unimplemented: Read as '0'

bit 11-8 Reserved: Maintain as '0'

bit 7-0 APLLFBDIV[7:0]: APLL Feedback Divider bits

11111111 = Reserved

11001000 = 200 maximum ^(1)

10010110 = 150 (default)

00010000 = 16 minimum ^(1)

00000010 = Reserved 00000001 = Reserved 00000000 = Reserved

Note 1: The allowed range is 16-200 (decimal). The rest of the values are reserved and should be avoided. The power-on default feedback divider is 150 (decimal) with an 8 MHz FRC input clock; the VCO frequency is 1.2 GHz.

REGISTER 6-8: APLLDIV1: APLL OUTPUT DIVIDER REGISTER (MAIN)

U-0 U-0 U-0 U-0 U-0 R/W-0 R/W-0
—————— AVCODIV[1:0]
bit 15 bit 8
U-0R/W-1R/W-0R/W-0U-0R/W-0R/W-0R/W-1
APOST1DIV[2:0]^(1,2) APOST2DIV[2:0]^(1,2)
bit 7 bit 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-10 Unimplemented: Read as '0'

bit 9-8 AVCODIV[1:0]: APLL VCO Output Divider Select bits

11 = AFvco

10 = AFvco/2

01 = AFvco/3

00 = AFvco/4

bit 7 Unimplemented: Read as '0'

bit 6-4 APOST1DIV[2:0]: APLL Output Divider #1 Ratio bits ^(1,2)

APOST1DIV[2:0] can have a valid value, from 1 to 7 (the APOST1DIVx value should be greater than or equal to the APOST2DIVx value). The APOST1DIVx divider is designed to operate at higher clock rates than the APOST2DIVx divider.

bit 3 Unimplemented: Read as '0'

bit 2-0 APOST2DIV[2:0]: APLL Output Divider #2 Ratio bits ^(1,2)

APOST2DIV[2:0] can have a valid value, from 1 to 7 (the APOST2DIVx value should be less than or equal to the APOST1DIVx value). The APOST1DIVx divider is designed to operate at higher clock rates than the APOST2DIVx divider.

Note 1: The APOST1DIVx and APOST2DIVx values must not be changed while the PLL is operating.

2: The default values for APOST1DIVx and APOST2DIVx are 4 and 1, respectively, yielding a 150 MHz system source clock.

REGISTER 6-9: CANCLKCON: CAN CLOCK CONTROL REGISTER

R/W-0 U-0 U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0
CANCLKEN— — —CANCLKSEL[3:0](1)
bit 15 bit 8
U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
— CANCLKDIV[6:0](2,3)
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 CANCLKEN: Enables the CAN Clock Generator bit

1 = CAN clock generation circuitry is enabled

0 = CAN clock generation circuitry is disabled

bit 14-12 Unimplemented: Read as '0'

bit 11-8 CANCLKSEL[3:0]: CAN Clock Source Select bits ^(1)

1011-1111 = Reserved (no clock selected)

1010 = AFvco/4

1001 = AFvco/3

1000 = AFvco/2

0111 = AFvco

0110 = AFPLLO

0101 = Fvco/4

0100 = Fvco/3

0011 = Fvco/2

0010 = FPLLO

0001 = Fvco

0000 = 0 (no clock selected)

bit 7 Unimplemented: Read as '0'

bit 6-0 CANCLKDIV[6:0]: CAN Clock Divider Select bits ^(2,3)

1111111 = Divide-by-128

...

0000010 = Divide-by-3

0000001 = Divide-by-2

0000000 = Divide-by-1

Note 1: The user must ensure the input clock source is 640 MHz or less. Operation with input reference frequency above 640 MHz will result in unpredictable behavior.

2: The CANCLKDIVx divider value must not be changed during CAN module operation.

3: The user must ensure the maximum clock output frequency of the divider is 80 MHz or less.

REGISTER 6-10: REFOCONL: REFERENCE CLOCK CONTROL LOW REGISTER (MAIN)

R/W-0U-0R/W-0R/W-0R/W-0U-0HC/R/W-0
ROEN— ROSIDL ROOUT ROSLP — ROSWEN ROACTIV
bit 15 bit 8
U-0U-0U-0U-0R/W-0R/W-0R/W-0R/W-0
ROSEL[3:0]
bit 7bit 0
Legend:HC = Hardware Clearable bitHSC = Hardware Settable/Clearable bit
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15 ROEN: Reference Clock Enable bit

1 = Reference Oscillator is enabled on the REFCLKO pin

0 = Reference Oscillator is disabled

bit 14 Unimplemented: Read as '0'

bit 13 ROSIDL: Reference Clock Stop in Idle bit

1 = Reference Oscillator continues to run in Idle mode

0 = Reference Oscillator is disabled in Idle mode

bit 12 ROOUT: Reference Clock Output Enable bit

1 = Reference clock external output is enabled and available on the REFCLKO pin

0 = Reference clock external output is disabled

bit 11 ROSLP: Reference Clock Stop in Sleep bit

1 = Reference Oscillator continues to run in Sleep modes

0 = Reference Oscillator is disabled in Sleep modes

bit 10 Unimplemented: Read as '0'

bit 9 ROSWEN: Reference Clock Output Enable bit

1 = Clock divider change (requested by changes to RODIVx) is requested or is in progress (set in software, cleared by hardware upon completion)

0 = Clock divider change has completed or is not pending

bit 8 ROACTIV: Reference Clock Status bit

1 = Reference clock is active; do not change clock source

0 = Reference clock is stopped; clock source and configuration may be safely changed

bit 7-4 Unimplemented: Read as '0'

bit 3-0 ROSEL[3:0]: Reference Clock Source Select bits

1111 = Reserved

... = Reserved

1000 = Reserved

0111 = REFOI (PPS) pin

0110 = Fvco/4

0101 = BFRC

0100 = LPRC

0011 = FRC

0010 = Primary Oscillator

0001 = Peripheral clock (FP)

0000 = System clock (Fosc)

REGISTER 6-11: REFOCONH: REFERENCE CLOCK CONTROL HIGH REGISTER (MAIN)

U-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
— RODIV[14:8]
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
RODIV[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15 Unimplemented: Read as '0'

bit 14-0 RODIV[14:0]: Reference Clock Integer Divider Select bits

Divider for the selected input clock source is two times the selected value.

111 1111 1111 1111 = Base clock value divided by 65,534 (2 * 7FFFh)

111 1111 1111 1110 = Base clock value divided by 65,532 (2 * 7FFEh)

111 1111 1111 1101 = Base clock value divided by 65,530 (2 * 7FFDh)

...

000 0000 0000 0010 = Base clock value divided by 4 (2 * 2)

000 0000 0000 0001 = Base clock value divided by 2 (2 * 1)

000 0000 0000 0000 = Base clock value

REGISTER 6-12: REFOTRIMH: REFERENCE OSCILLATOR TRIM REGISTER (MAIN)

R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
ROTRIM[8:1]
bit 15 bit 8
R/W-0U-0U-0U-0U-0U-0U-0U-0
ROTRIMO
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-7 ROTRIM[8:0]: REFO Trim bits

These bits provide a fractional additive to the RODIV[14:0] value for the 1/2 period of the REFO clock.

000000000 = 0/512 (0.0 divisor added to the RODIV[14:0] value)

000000001 = 1/512 (0.001953125 divisor added to the RODIV[14:0] value)

000000010 = 2/512 (0.00390625 divisor added to the RODIV[14:0] value)

...

100000000 = 256/512 (0.5000 divisor added to the RODIV[14:0] value)

...

111111110 = 510/512 (0.99609375 divisor added to the RODIV[14:0] value)

111111111 = 511/512 (0.998046875 divisor added to the RODIV[14:0] value)

bit 6-0 Unimplemented: Read as '0'

6.14 Secondary Special Function Registers

These Special Function Registers provide run-time control and status of the Secondary core's oscillator system.

6.14.1 SECONDARY OSCILLATOR CONTROL REGISTERS

REGISTER 6-13: OSCCON: OSCILLATOR CONTROL REGISTER (SECONDARY) ^(1)

U-0 R-0 R-0 R-0 U-0 R/W-y R/W-y R/W-y
— COSC2 COSC1 COSC0 —NOSC ^(2)_2 NOSC1 ^(2)
bit 15bit 8
R/W-0 U-0 R-0 U-0R/C-0U-0 U-0 R/W-0
CLKLOCKLOCK CF^(3) OSWEN
bit 7 bit 0
Legend:y = Value Set from Configuration bits on PORC = Clearable
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 Unimplemented: Read as '0'

bit 14-12 COSC[2:0]: Current Oscillator Selection bits (read-only)

111 = Fast RC Oscillator (FRC) with Divide-by-n (FRCDIVN)

110 = Backup FRC (BFRC)

101 = Low-Power RC Oscillator (LPRC)

100 = Reserved

011 = Primary Oscillator (XT, HS, EC) with PLL (XTPLL, HSPLL, ECPLL)

010 = Primary Oscillator (XT, HS, EC)

001 = Fast RC Oscillator (FRC) with PLL (FRCPLL)

000 = Fast RC Oscillator (FRC)

bit 11 Unimplemented: Read as '0'

bit 10-8 NOSC[2:0]: New Oscillator Selection bits ^(2)

111 = Fast RC Oscillator (FRC) with Divide-by-n (FRCDIVN)

110 = Backup FRC (BFRC)

101 = Low-Power RC Oscillator (LPRC)

100 = Reserved

011 = Primary Oscillator (XT, HS, EC) with PLL (XTPLL, HSPLL, ECPLL)

010 = Primary Oscillator (XT, HS, EC)

001 = Fast RC Oscillator (FRC) with PLL (FRCPLL)

000 = Fast RC Oscillator (FRC)

Note 1: Writes to this register require an unlock sequence.

2: Direct clock switches between any Primary Oscillator mode with PLL and FRCPLL mode are not permitted. This applies to clock switches in either direction. In these instances, the application must switch to FRC mode as a transitional clock source between the two PLL modes.

3: This bit can only be cleared in software. Setting the bit in software (= 1) will have the same effect as an actual oscillator failure and will trigger an oscillator failure trap. Setting this bit will not cause an FSCM event.

REGISTER 6-13: OSCCON: OSCILLATOR CONTROL REGISTER (SECONDARY) ^(1) (CONTINUED)

bit 7 CLKLOCK: Clock Lock Enable bit

1 = If (FCKSM0 = 1), then clock and PLL configurations are locked; if (FCKSM0 = 0), then clock and PLL configurations may be modified
0 = Clock and PLL selections are not locked, configurations may be modified 

bit 6 Unimplemented: Read as '0'

bit 5 LOCK: PLL Lock Status bit (read-only)

1 = Indicates that PLL is in lock or PLL start-up timer is satisfied
0 = Indicates that PLL is out of lock, start-up timer is in progress or PLL is disabled 

bit 4 Unimplemented: Read as '0'

bit 3 CF: Clock Fail Detect bit (3)

1 = FSCM has detected a clock failure
0 = FSCM has not detected a clock failure 

bit 2-1 Unimplemented: Read as '0'

bit 0 OSWEN: Oscillator Switch Enable bit

1 = Requests oscillator switch to the selection specified by the NOSC[2:0] bits
0 = Oscillator switch is complete 

Note 1: Writes to this register require an unlock sequence.

2: Direct clock switches between any Primary Oscillator mode with PLL and FRCPLL mode are not permitted. This applies to clock switches in either direction. In these instances, the application must switch to FRC mode as a transitional clock source between the two PLL modes.
3: This bit can only be cleared in software. Setting the bit in software (= 1) will have the same effect as an actual oscillator failure and will trigger an oscillator failure trap. Setting this bit will not cause an FSCM event.

REGISTER 6-14: CLKDIV: CLOCK DIVIDER REGISTER (SECONDARY)

R/W-0 R/W-0 R/W-1 R/W-1 R/W-0 R/W-0 R/W-0 R/W-0
ROI DOZE2 (1)DOZE1(1)DOZE0(1)DOZEN(2,3)FRCDIV2 FRFRCDIV1 FRCDIV0
bit 15 bit 8
U-0 U-0 r-0 r-0 R/W-0 R/W-0 R/W-0 R/W-0
— — —— PLLPRE[3:0](4)
bit 7 bit 0
Legend:r = Reserved 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 15 ROI: Recover on Interrupt bit 1 = Interrupts will clear the DOZEN bit and the processor clock, and the peripheral clock ratio is set to 1:1 0 = Interrupts have no effect on the DOZEN bit

bit 14-12 DOZE[2:0]: Processor Clock Reduction Select bits ^(1) 111 = FP divided by 128

110 = FP divided by 64

101 = FP divided by 32

100 = FP divided by 16

011 = FP divided by 8 (default)

010 = FP divided by 4

001 = FP divided by 2

000 = FP divided by 1

bit 11 DOZEN: Doze Mode Enable bit ^(2,3) 1 = DOZE[2:0] field specifies the ratio between the peripheral clocks and the processor clocks

0 = Processor clock and peripheral clock ratio is forced to 1:1

bit 10-8 FRCDIV[2:0]: Internal Fast RC Oscillator Postscaler bits 111 = FRC divided by 256 110 = FRC divided by 64 101 = FRC divided by 32 100 = FRC divided by 16 011 = FRC divided by 8 010 = FRC divided by 4 001 = FRC divided by 2 000 = FRC divided by 1 (default)

bit 7-6 Unimplemented: Read as '0' bit 5-4 Reserved: Read as '0'

Note 1: The DOZE[2:0] bits can only be written to when the DOZEN bit is clear. If DOZEN = 1, any writes to DOZE[2:0] are ignored.

2: This bit is cleared when the ROI bit is set and an interrupt occurs.

3: The DOZEN bit cannot be set if DOZE[2:0] = 000. If DOZE[2:0] = 000, any attempt by user software to set the DOZEN bit is ignored.

4: PLLPRE[3:0] may be updated while the PLL is operating, but the VCO may overshoot.

REGISTER 6-14: CLKDIV: CLOCK DIVIDER REGISTER (SECONDARY) (CONTINUED)
bit 3-0 PLLPRE[3:0]: PLL Phase Detector Input Divider Select bits (also denoted as 'N1', PLL prescaler) ^(4) 11111 = Reserved ... 1001 = Reserved 1000 = Input divided by 8 0111 = Input divided by 7 0110 = Input divided by 6 0101 = Input divided by 5 0100 = Input divided by 4 0011 = Input divided by 3 0010 = Input divided by 2 0001 = Input divided by 1 (power-on default selection) 0000 = Reserved

Note 1: The DOZE[2:0] bits can only be written to when the DOZEN bit is clear. If DOZEN = 1, any writes to DOZE[2:0] are ignored.

2: This bit is cleared when the ROI bit is set and an interrupt occurs. 

3: The DOZEN bit cannot be set if DOZE[2:0] = 000. If DOZE[2:0] = 000, any attempt by user software to set the DOZEN bit is ignored.
4: PLLPRE[3:0] may be updated while the PLL is operating, but the VCO may overshoot.

REGISTER 6-15: PLLFBD: PLL FEEDBACK DIVIDER REGISTER (SECONDARY)

U-0 U-0 U-0 U-0 r-0 r-0 r-0 r-0
——————
bit 15 bit 8
R/W-1R/W-0R/
PLLFBDIV[7:0]
bit 7 bit 0
Legend: r = Reserved bit
R = Readable bit W = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown

bit 15-12 Unimplemented: Read as '0'

bit 11-8 Reserved: Maintain as '0'

bit 7-0 PLLFBDIV[7:0]: PLL Feedback Divider bits (also denoted as 'M', PLL multiplier)

11111111 = Reserved

11001000 = 200 maximum ^(1)

...

10010110 = 150 (default)

...

00010000 = 16 minimum ^(1)

...

00000010 = Reserved

00000001 = Reserved

00000000 = Reserved

Note 1: The allowed range is 16-200 (decimal). The rest of the values are reserved and should be avoided. The power on the default feedback divider is 150 (decimal) with an 8 MHz FRC input clock. The VCO frequency is 1.2 GHz.

REGISTER 6-16: PLLDIV: PLL OUTPUT DIVIDER REGISTER (SECONDARY)

U-0 U-0 U-0 U-0 U-0 R/W-0 R/W-0
— — —— — — VCODIV[1:0]
bit 15 bit 8
U-0R/W-1R/W-0R/W-0U-0R/W-0R/W-0R/W-1
POST1DIV[2:0](1,2)POST2DIV[2:0](1,2)
bit 7 bit 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-10 Unimplemented: Read as '0'

bit 9-8 VCODIV[1:0]: PLL VCO Output Divider Select bits

11 = Fvco

10 = Fvco/2

01 = Fvco/3

00 = Fvco/4

bit 7 Unimplemented: Read as '0'

bit 6-4 POST1DIV[2:0]: PLL Output Divider #1 Ratio bits ^(1,2)

POST1DIV[2:0] can have a valid value, from 1 to 7 (POST1DIVx value should be greater than or equal to the POST2DIVx value). The POST1DIVx divider is designed to operate at higher clock rates than the POST2DIVx divider.

bit 3 Unimplemented: Read as '0'

bit 2-0 POST2DIV[2:0]: PLL Output Divider #2 Ratio bits ^(1,2)

POST2DIV[2:0] can have a valid value, from 1 to 7 (POST2DIVx value should be less than or equal to the POST1DIVx value). The POST1DIVx divider is designed to operate at higher clock rates than the POST2DIVx divider.

Note 1: The POST1DIVx and POST2DIVx divider values must not be changed while the PLL is operating.

2: The default values for POST1DIVx and POST2DIVx are 4 and 1, respectively, yielding a 150 MHz system source clock.

REGISTER 6-17: ACLKCON1: AUXILIARY CLOCK CONTROL REGISTER (SECONDARY)

R/W-0 R/W-0 U-0 U-0 U-0 U-0 R/W-0
APLLEN(1)APLLCK —— — — — FRCSEL
bit 15 bit 8
U-0 U-0 r-0 r-0 R/W-0 R/W-0 R/W-0 R/W-0
— — —— APLLPRE[3:0]
bit 7 bit 0
Legend:r = Reserved 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 15 APLLEN: Auxiliary PLL Enable/Bypass Select bit ^(1) 1 = AFPLLO is connected to APLL post-divider output (bypass is disabled)

0 = AFPLLO is connected to APLL input clock (bypass is enabled)

bit 14 APLLCK: APLL Phase-Locked State Status bit 1 = Auxiliary PLL is in lock 0 = Auxiliary PLL is not in lock

bit 13-9 Unimplemented: Read as '0' bit 8 FRCSEL: FRC Clock Source Select bit

bit 7-6 Unimplemented: Read as '0' bit 5-4 Reserved: Read as '0'

bit 3-0 APLLPRE[3:0]: Auxiliary PLL Phase Detector Input Divider bits 111111 = Reserved

1001 = Reserved
1000 = Input divided by 8
0111 = Input divided by 7
0110 = Input divided by 6
0101 = Input divided by 5
0100 = Input divided by 4
0011 = Input divided by 3
0010 = Input divided by 2
0001 = Input divided by 1 (power-on default selection)
0000 = Reserved 

Note 1: Even with the APLLEN bit set, another peripheral must generate a clock request before the APLL will start.

REGISTER 6-18: APLLFBD1: APLL FEEDBACK DIVIDER REGISTER (SECONDARY)

U-0 U-0 U-0 U-0 r-0 r-0 r-0 r-0
—————— ——
bit 15 bit 8
R/W-1R/W-0R/W-0R/W-1R/W-0R/W-1R/W-1R/W-0
APLLFBDIV[7:0]
bit 7bit 0
Legend:r = Reserved 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 15-12 Unimplemented: Read as '0'

bit 11-8 Reserved: Maintain as '0'

bit 7-0 APLLFBDIV[7:0]: APLL Feedback Divider bits

11111111 = Reserved ... 11001000 = 200 maximum ^(1) ... 10010110 = 150 (default) ... 00010000 = 16 minimum ^(1) ... 00000010 = Reserved 00000001 = Reserved 00000000 = Reserved

Note 1: The allowed range is 16-200 (decimal). The rest of the values are reserved and should be avoided. The power-on default feedback divider is 150 (decimal) with an 8 MHz FRC input clock; the VCO frequency is 1.2 GHz.

REGISTER 6-19: APLLDIV: APLL OUTPUT DIVIDER REGISTER (SECONDARY)

U-0 U-0 U-0 U-0 U-0 R/W-0 R/W-0
— — —— —AVCODIV[1:0]
bit 15 bit 8
U-0R/W-1R/W-0R/W-0U-0R/W-0R/W-0 R/W-1
APOST1DIV[2:0]^(1,2) APOST2DIV[2:0]^(1,2)
bit 7 bit 0
Legend:
R = Readable bit W = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 15-10 Unimplemented: Read as '0'

bit 9-8 AVCODIV[1:0]: APLL VCO Output Divider Select bits

11 = AFvco

10 = AFvco/2

01 = AFvco/3

00 = AFvco/4

bit 7 Unimplemented: Read as '0'

bit 6-4 APOST1DIV[2:0]: APLL Output Divider #1 Ratio bits ^(1,2)

APOST1DIV[2:0] can have a valid value, from 1 to 7 (APOST1DIVx value should be greater than or equal to the APOST2DIVx value). The APOST1DIVx divider is designed to operate at higher clock rates than the APOST2DIVx divider.

bit 3 Unimplemented: Read as '0'

bit 2-0 APOST2DIV[2:0]: APLL Output Divider #2 Ratio bits ^(1,2)

APOST2DIV[2:0] can have a valid value, from 1 to 7 (APOST2DIVx value should be less than or equal to the APOST1DIVx value). The APOST1DIVx divider is designed to operate at higher clock rates than the APOST2DIVx divider.

Note 1: The APOST1DIVx and APOST2DIVx divider values must not be changed while the PLL is operating.

2: The default values for APOST1DIVx and APOST2DIVx are 1 and 1, respectively, yielding a 150 MHz system source clock.

REGISTER 6-20: REFOCONL: REFERENCE CLOCK CONTROL LOW REGISTER (SECONDARY)

R/W-0U-0R/W-0R/W-0R/W-0U-0HC/R/W-0
ROEN— ROSIDL ROOUT ROOSLP — ROSWEN ROACTIV
bit 15 bit 8
U-0U-0U-0U-0R/W-0R/W-0R/W-0R/W-0
ROSEL[3:0]
bit 7 bit 0
Legend:HC = Hardware Clearable bitHSC = Hardware Settable/Clearable bit
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15 ROEN: Reference Clock Enable bit

1 = Reference Oscillator is enabled on the REFCLKO pin

0 = Reference Oscillator is disabled

bit 14 Unimplemented: Read as '0'

bit 13 ROSIDL: Reference Clock Stop in Idle bit

1 = Reference Oscillator is disabled in Idle mode

0 = Reference Oscillator continues to run in Idle mode

bit 12 ROOUT: Reference Clock Output Enable bit

1 = Reference clock external output is enabled and available on the REFCLKO pin

0 = Reference clock external output is disabled

bit 11 ROSLP: Reference Clock Stop in Sleep bit

1 = Reference Oscillator continues to run in Sleep modes

0 = Reference Oscillator is disabled in Sleep modes

bit 10 Unimplemented: Read as '0'

bit 9 ROSWEN: Reference Clock Output Enable bit

1 = Clock divider change (requested by changes to RODIVx) is requested or is in progress (set in software, cleared by hardware upon completion)

0 = Clock divider change has completed or is not pending

bit 8 ROACTIV: Reference Clock Status bit

1 = Reference clock is active; do not change clock source

0 = Reference clock is stopped; clock source and configuration may be safely changed

bit 7-4 Unimplemented: Read as '0'

bit 3-0 ROSEL[3:0]: Reference Clock Source Select bits

1111 =

... = Reserved

1000 = Reserved

0111 = REFOI (PPS) pin

0110 = Fvco/4

0101 = BFRC

0100 = LPRC

0011 = FRC

0010 = Primary Oscillator

0001 = Peripheral clock (FP)

0000 = System clock (Fosc)

REGISTER 6-21: REFOCONH: REFERENCE CLOCK CONTROL HIGH REGISTER (SECONDARY)

U-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
— RODIV[14:8]
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
RODIV[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15 Unimplemented: Read as '0'

bit 14-0 RODIV[14:0]: Reference Clock Integer Divider Select bits

Divider for the selected input clock source is two times the selected value.

111 1111 1111 1111 = Base clock value divided by 65,534 (2 * 7FFFh)

111 1111 1111 1110 = Base clock value divided by 65,532 (2 * 7FFEh)

111 1111 1111 1101 = Base clock value divided by 65,530 (2 * 7FFDh)

...

000 0000 0000 0010 = Base clock value divided by 4 (2 * 2)

000 0000 0000 0001 = Base clock value divided by 2 (2 * 1)

000 0000 0000 0000 = Base clock value

7.0 POWER-SAVING FEATURES (MAIN AND SECONDARY)

Note 1: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive reference source. To complement the information in this data sheet, refer to “Watchdog Timer and Power-Saving Modes” (www.microchip.com DS70000615), which is available from the Microchip website (www.microchip.com). The power saving section is only relevant for this device. The WDT has its own family reference manual section.

2: This chapter is applicable to both the Main core and the Secondary core. There are registers associated with PMD that are listed separately for Main and Secondary at the end of this section. Other features related to power saving that are discussed are applicable to both the Main and Secondary core.

3: All associated register names are the same on the Main core and the Secondary core. The Secondary code will be developed in a separate project in MPLAB X IDE with the device selection, dsPIC33CH128MP508S1, where S1 indicates the Secondary device.

The dsPIC33CH128MP508 family devices provide the ability to manage power consumption by selectively managing clocking to the CPU and the peripherals. In general, a lower clock frequency and a reduction in the number of peripherals being clocked constitutes lower consumed power.

dsPIC33CH128MP508 family devices can manage power consumption in four ways:

  • Clock Frequency
  • Instruction-Based Sleep and Idle modes
  • Software-Controlled Doze mode
  • Selective Peripheral Control in Software

Combinations of these methods can be used to selectively tailor an application's power consumption while still maintaining critical application features, such as timing-sensitive communications.

7.1 Clock Frequency and Clock Switching

The dsPIC33CH128MP508 family devices allow a wide range of clock frequencies to be selected under application control. If the system clock configuration is not locked, users can choose low-power or high-precision oscillators by simply changing the NOSCx bits (OSCCON[10:8]). The process of changing a system clock during operation, as well as limitations to the process, are discussed in more detail in Section 6.0 "Oscillator with High-Frequency PLL".

7.2 Instruction-Based Power-Saving Modes

The dsPIC33CH128MP508 family devices have two special power-saving modes that are entered through the execution of a special PWRSAV instruction. Sleep mode stops clock operation and halts all code execution. Idle mode halts the CPU and code execution, but allows peripheral modules to continue operation. The assembler syntax of the PWRSAV instruction is shown in Example 7-1.

Note: SLEEP_MODE and IDLE_MODE are constants defined in the assembler include file for the selected device.

Sleep and Idle modes can be exited as a result of an enabled interrupt, WDT time-out or a device Reset. When the device exits these modes, it is said to "wake-up".

EXAMPLE 7-1: PWRSAV INSTRUCTION SYNTAX

PWRSAV #SLEEP_MODE ; Put the device into Sleep mode PWRSAV #IDLE_MODE ; Put the device into Idle mode

7.2.1 SLEEP MODE

The following occurs in Sleep mode:

  • The system clock source is shut down. If an on-chip oscillator is used, it is turned off.
  • The device current consumption is reduced to a minimum, provided that no I/O pin is sourcing current.
  • The Fail-Safe Clock Monitor does not operate, since the system clock source is disabled.
  • The LPRC clock continues to run in Sleep mode if the WDT is enabled.
  • The WDT, if enabled, is automatically cleared prior to entering Sleep mode.
  • Some device features or peripherals can continue to operate. This includes items such as the Input Change Notification on the I/O ports or peripherals that use an External Clock input.
  • Any peripheral that requires the system clock source for its operation is disabled.

The device wakes up from Sleep mode on any of the these events:

  • Any interrupt source that is individually enabled
  • Any form of device Reset
  • A WDT time-out

On wake-up from Sleep mode, the processor restarts with the same clock source that was active when Sleep mode was entered.

For optimal power savings, the internal regulator and the Flash regulator can be configured to go into standby when Sleep mode is entered by clearing the VREGS (RCON[8]) bit.

7.2.2 IDLE MODE

The following occurs in Idle mode:

• The CPU stops executing instructions.
• The WDT is automatically cleared.
- The system clock source remains active. By default, all peripheral modules continue to operate normally from the system clock source, but can also be selectively disabled (see Section 7.4 "Peripheral Module Disable").
- If the WDT or FSCM is enabled, the LPRC also remains active.

The device wakes from Idle mode on any of these events:

  • Any interrupt that is individually enabled
  • Any device Reset
  • A WDT time-out

On wake-up from Idle mode, the clock is reapplied to the CPU and instruction execution will begin (two-four clock cycles later), starting with the instruction following the PWRSAV instruction or the first instruction in the ISR.

All peripherals also have the option to discontinue operation when Idle mode is entered to allow for increased power savings. This option is selectable in the control register of each peripheral; for example, the SIDL bit in the Timer1 Control register (T1CON[13]).

7.2.3 INTERRUPTS COINCIDENT WITH POWER SAVE INSTRUCTIONS

Any interrupt that coincides with the execution of a PWRSAV instruction is held off until entry into Sleep or Idle mode has completed. The device then wakes up from Sleep or Idle mode.

7.3 Doze Mode

The preferred strategies for reducing power consumption are changing clock speed and invoking one of the power-saving modes. In some circumstances, this cannot be practical. For example, it may be necessary for an application to maintain uninterrupted synchronous communication, even while it is doing nothing else. Reducing system clock speed can introduce communication errors, while using a power-saving mode can stop communications completely.

Doze mode is a simple and effective alternative method to reduce power consumption while the device is still executing code. In this mode, the system clock continues to operate from the same source and at the same speed. Peripheral modules continue to be clocked at the same speed, while the CPU clock speed is reduced. Synchronization between the two clock domains is maintained, allowing the peripherals to access the SFRs while the CPU executes code at a slower rate.

Doze mode is enabled by setting the DOZEN bit (CLKDIV[11]). The ratio between peripheral and core clock speed is determined by the DOZE[2:0] bits (CLKDIV[14:12]). There are eight possible configurations, from 1:1 to 1:128, with 1:1 being the default setting.

Programs can use Doze mode to selectively reduce power consumption in event-driven applications. This allows clock-sensitive functions, such as synchronous communications, to continue without interruption while the CPU Idles, waiting for something to invoke an interrupt routine. An automatic return to full-speed CPU operation on interrupts can be enabled by setting the ROI bit (CLKDIV[15]). By default, interrupt events have no effect on Doze mode operation.

7.4 Peripheral Module Disable

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 using the appropriate PMD control bit, the peripheral is in a minimum power consumption state. The control and status registers associated with the peripheral are also disabled, so writes to those registers do not have any effect and read values are invalid.

A peripheral module is enabled only 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 1: If a PMD bit is set, the corresponding module is disabled after a delay of one instruction cycle. Similarly, if a PMD bit is cleared, the corresponding module is enabled after a delay of one instruction cycle (assuming the module control registers are already configured to enable module operation).

2: The PMD bits are different for the Main core and Secondary core. The Main has its own PMD bits which can be disabled/enabled independently of the Secondary peripherals. The Secondary has its own PMD bits which can be disabled/enabled independently of the Main peripherals. The register names are the same for the Main and the Secondary, but the PMD registers have different addresses in the Main and Secondary SFR.

7.5 Power-Saving Resources

Many useful resources are provided on the main product page of the Microchip website for the devices listed in this data sheet. This product page contains the latest updates and additional information.

7.5.1 KEY RESOURCES

  • "Watchdog Timer and Power-Saving Modes" (www.microchip.com/DS70000615)
  • Code Samples
  • Application Notes
  • Software Libraries
  • Webinars
  • All related "dsPIC33/PIC24 Family Reference Manual" Sections
  • Development Tools

7.6 PMD Control Registers

REGISTER 7-1: PMD1: MAIN PERIPHERAL MODULE DISABLE 1 CONTROL REGISTER LOW

U-0 U-0 U-0 U-0 R/W-0 R/W-0 R/W-0 U-0
— — —— T1MD QEIMD PWMMD —
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 U-0 R/W-0 R/W-0
I2C1MD U2MD U1MD SP2MDSP1MDC1MD ADC1MD
bit 7 bit 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-12 Unimplemented: Read as '0'

bit 11 T1MD: Timer1 Module Disable bit

1 = Timer1 module is disabled

0 = Timer1 module is enabled

bit 10 QEIMD: QEI Module Disable bit

1 = QEI module is disabled

0 = QEI module is enabled

bit 9 PWMMD: PWM Module Disable bit

1 = PWM module is disabled

0 = PWM module is enabled

bit 8 Unimplemented: Read as '0'

bit 7 I2C1MD: I2C1 Module Disable bit

1 = I2C1 module is disabled

0 = I2C1 module is enabled

bit 6 U2MD: UART2 Module Disable bit

1 = UART2 module is disabled

0 = UART2 module is enabled

bit 5 U1MD: UART1 Module Disable bit

1 = UART1 module is disabled

0 = UART1 module is enabled

bit 4 SPI2MD: SPI2 Module Disable bit

1 = SPI2 module is disabled

0 = SPI2 module is enabled

bit 3 SPI1MD: SPI1 Module Disable bit

1 = SPI1 module is disabled

0 = SPI1 module is enabled

bit 2 Unimplemented: Read as '0'

bit 1 C1MD: CAN1 Module Disable bit

1 = CAN1 module is disabled

0 = CAN1 module is enabled

bit 0 ADC1MD: ADC Module Disable bit

1 = ADC module is disabled

0 = ADC module is enabled

REGISTER 7-2: PMD2: MAIN PERIPHERAL MODULE DISABLE 2 CONTROL REGISTER HIGH

U-0 U-0 U-0 U-0 U-0 U-0 U-0 U-0
——————
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CCP8MDCCP7MDCCP6MDCCP5MDCCP4MDCCP3MDCCP2MDCCP1MD
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown 

bit 15-8 Unimplemented: Read as '0'

bit 7 CCP8MD: SCCP8 Module Disable bit

1 = SCCP8 module is disabled

0 = SCCP8 module is enabled

bit 6 CCP7MD: SCCP7 Module Disable bit

1 = SCCP7 module is disabled

0 = SCCP7 module is enabled

bit 5 CCP6MD: SCCP6 Module Disable bit

1 = SCCP6 module is disabled

0 = SCCP6 module is enabled

bit 4 CCP5MD: SCCP5 Module Disable bit

1 = SCCP5 module is disabled

0 = SCCP5 module is enabled

bit 3 CCP4MD: SCCP4 Module Disable bit

1 = SCCP4 module is disabled

0 = SCCP4 module is enabled

bit 2 CCP3MD: SCCP3 Module Disable bit

1 = SCCP3 module is disabled

0 = SCCP3 module is enabled

bit 1 CCP2MD: SCCP2 Module Disable bit

1 = SCCP2 module is disabled

0 = SCCP2 module is enabled

bit 0 CCP1MD: SCCP1 Module Disable bit

1 = SCCP1 module is disabled

0 = SCCP1 module is enabled

REGISTER 7-3: PMD3: MAIN PERIPHERAL MODULE DISABLE 3 CONTROL REGISTER LOW (1)

U-0 U-0 U-0 U-0 U-0 U-0 U-0 U-0
—————
bit 15 bit 8
R/W-0 U-0 U-0 U-0 U-0 R/W-0 U-0
CRCMD— — —— — I2C2MD
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-8 Unimplemented: Read as '0'

bit 7 CRCMD: CRC Module Disable bit

1 = CRC module is disabled

0 = CRC module is enabled

bit 6-2 Unimplemented: Read as '0'

bit 1 I2C2MD: I2C2 Module Disable bit

1 = I2C2 module is disabled

0 = I2C2 module is enabled

bit 0 Unimplemented: Read as '0'

Note 1: This register is only available in the Main core.

REGISTER 7-4: PMD4: MAIN PERIPHERAL MODULE DISABLE 4 CONTROL REGISTER

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 U-0 U-0 U-0
———REFOMD———
bit 7 bit 0

Legend:

R = Readable bit W = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 15-4 Unimplemented: Read as '0'

bit 3 REFOMD: Reference Clock Module Disable bit

1 = Reference clock module is disabled

0 = Reference clock module is enabled

bit 2-0 Unimplemented: Read as '0'

REGISTER 7-5: PMD6: MAIN PERIPHERAL MODULE DISABLE 6 CONTROL REGISTER HIGH

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
— — DMA5MD DMA41MD DMA3MD DMA2MD DMA1MD DMA0MD
bit 15 bit 8
U-0 U-0 U-0 U-0 U-0 U-0 U-0 U-0
——————
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-14 Unimplemented: Read as '0'

bit 13 DMA5MD: DMA5 Module Disable bit

1 = DMA5 module is disabled

0 = DMA5 module is enabled

bit 12 DMA4MD: DMA4 Module Disable bit

1 = DMA4 module is disabled

0 = DMA4 module is enabled

bit 11 DMA3MD: DMA3 Module Disable bit

1 = DMA3 module is disabled

0 = DMA3 module is enabled

bit 10 DMA2MD: DMA2 Module Disable bit

1 = DMA2 module is disabled

0 = DMA2 module is enabled

bit 9 DMA1MD: DMA1 Module Disable bit

1 = DMA1 module is disabled

0 = DMA1 module is enabled

bit 8 DMA0MD: DMA0 Module Disable bit

1 = DMA0 module is disabled

0 = DMA0 module is enabled

bit 7-0 Unimplemented: Read as '0'

REGISTER 7-6: PMD7: MAIN PERIPHERAL MODULE DISABLE 7 CONTROL REGISTER LOW

U-0 U-0 U-0 U-0 U-0 U-0 R/W-0
——————CMP1MD
bit 15 bit 8
U-0 U-0 U-0 U-0 R/W-0 U-0 U-0 U-0
———PTGMD———
bit 7 bit 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-9 Unimplemented: Read as '0'

bit 8 CMP1MD: Comparator 1 Module Disable bit

1 = Comparator 1 module is disabled

0 = Comparator 1 module is enabled

bit 7-4 Unimplemented: Read as '0'

bit 3 PTGMD: PTG Module Disable bit

1 = PTG module is disabled

0 = PTG module is enabled

bit 2-0 Unimplemented: Read as '0'

REGISTER 7-7: PMD8: MAIN PERIPHERAL MODULE DISABLE 8 CONTROL REGISTER (1)

U-0 U-0 U-0 R/W-0 R/W-0 U-0 U-0 U-0
— — —SENT2MD SENT1MD — —
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 U-0
— — CLC4MD CLC3MDCLC2MD CLC1MD BIASMD —
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-13 Unimplemented: Read as '0'

bit 12 SENT2MD: SENT2 Module Disable bit

1 = SENT2 module is disabled

0 = SENT2 module is enabled

bit 11 SENT1MD: SENT1 Module Disable bit

1 = SENT1 module is disabled

0 = SENT1 module is enabled

bit 10-6 Unimplemented: Read as '0'

bit 5 CLC4MD: CLC4 Module Disable bit

1 = CLC4 module is disabled

0 = CLC4 module is enabled

bit 4 CLC3MD: CLC3 Module Disable bit

1 = CLC3 module is disabled

0 = CLC3 module is enabled

bit 3 CLC2MD: CLC2 Module Disable bit

1 = CLC2 module is disabled

0 = CLC2 module is enabled

bit 2 CLC1MD: CLC1 Module Disable bit

1 = CLC1 module is disabled

0 = CLC1 module is enabled

bit 1 BIASMD: Constant-Current Source Module Disable bit

1 = Constant-current source module is disabled

0 = Constant-current source module is enabled

bit 0 Unimplemented: Read as '0'

Note 1: This register is only available in the Main core.

REGISTER 7-8: PMDCON: SECONDARY PMD CONTROL REGISTER

U-0 U-0 U-0 U-0 R/W-0 U-0 U-0 U-0
— — —PMDLOCK— — —
bit 15 bit 8
U-0 U-0 U-0 U-0 U-0 U-0 U-0 U-0
——————
bit 7 bit 0

Legend:

R = Readable bit W = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 15-12 Unimplemented: Read as '0'

bit 11 PMDLOCK: PMD Lock bit

1 = PMD bits can be written
0 = PMD bits are not allowed to be written

bit 10-0 Unimplemented: Read as '0'

REGISTER 7-9: PMD1: SECONDARY PERIPHERAL MODULE DISABLE 1 CONTROL REGISTER

U-0 U-0 U-0 U-0 R/W-0 R/W-0 R/W-0 U-0
— — —— T1MD QEIMD PWMMD —
bit 15 bit 8
R/W-0 U-0 R/W-0U-0 R/W-0 U-0 U-0 R/W-0
I2C1MDU1MDSPI1MDADC1MD
bit 7 bit 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-12 Unimplemented: Read as '0'

bit 11 T1MD: Timer1 Module Disable bit

1 = Timer1 module is disabled

0 = Timer1 module is enabled

bit 10 QEIMD: QEI Module Disable bit

1 = QEI module is disabled

0 = QEI module is enabled

bit 9 PWMMD: PWM Module Disable bit

1 = PWM module is disabled

0 = PWM module is enabled

bit 8 Unimplemented: Read as '0'

bit 7 I2C1MD: I2C1 Module Disable bit

1 = I2C1 module is disabled

0 = I2C1 module is enabled

bit 6 Unimplemented: Read as '0'

bit 5 U1MD: UART1 Module Disable bit

1 = UART1 module is disabled

0 = UART1 module is enabled

bit 4 Unimplemented: Read as '0'

bit 3 SPI1MD: SPI1 Module Disable bit

1 = SPI1 module is disabled

0 = SPI1 module is enabled

bit 2-1 Unimplemented: Read as '0'

bit 0 ADC1MD: ADC Module Disable bit

1 = ADC module is disabled

0 = ADC module is enabled

REGISTER 7-10: PMD2: SECONDARY PERIPHERAL MODULE DISABLE 2 CONTROL REGISTER

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
— — —— CCP4MDCCP3MDCCP2MDCCP1MD
bit 7 bit 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-4 Unimplemented: Read as '0'

bit 3 CCP4MD: SCCP4 Module Disable bit

1 = SCCP4 module is disabled

0 = SCCP4 module is enabled

bit 2 CCP3MD: SCCP3 Module Disable bit

1 = SCCP3 module is disabled

0 = SCCP3 module is enabled

bit 1 CCP2MD: SCCP2 Module Disable bit

1 = SCCP2 module is disabled

0 = SCCP2 module is enabled

bit 0 CCP1MD: SCCP1 Module Disable bit

1 = SCCP1 module is disabled

0 = SCCP1 module is enabled

REGISTER 7-11: PMD4: SECONDARY PERIPHERAL MODULE DISABLE 4 CONTROL REGISTER

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 U-0 U-0 U-0
— — —REFOMD— — —
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-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 REFOMD: Reference Clock Module Disable bit

1 = Reference clock module is disabled

0 = Reference clock module is enabled

bit 2-0 Unimplemented: Read as '0'

REGISTER 7-12: PMD6: SECONDARY PERIPHERAL MODULE DISABLE 6 CONTROL REGISTER HIGH

U-0 U-0 U-0 U-0 U-0 U-0 R/W-0 R/W-0
— — —— — — DMA1MDDMA0MD
bit 15 bit 8
U-0 U-0 U-0 U-0 U-0 U-0 U-0 U-0
——————
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-10 Unimplemented: Read as '0'

bit 9 DMA1MD: DMA1 Module Disable bit

1 = DMA1 module is disabled

0 = DMA1 module is enabled

bit 8 DMA0MD: DMA0 Module Disable bit

1 = DMA0 module is disabled

0 = DMA0 module is enabled

bit 7-0 Unimplemented: Read as '0'

REGISTER 7-13: PMD7: SECONDARY PERIPHERAL MODULE DISABLE 7 CONTROL REGISTER LOW

U-0 U-0 U-0 U-0 U-0 R/W-0 R/W-0 R/W-0
— — —— — CMP3MDCMP2MDCMP1MD
bit 15 bit 8
U-0 U-0 U-0 U-0 U-0 U-0 R/W-0 U-0
————PGA1MD
bit 7 bit 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-11 Unimplemented: Read as '0'

bit 10 CMP3MD: Comparator 3 disable bit

1 = Comparator 3 module is disabled

0 = Comparator 3 module is enabled

bit 9 CMP2MD: Comparator 2 disable bit

1 = Comparator 2 module is disabled

0 = Comparator 2 module is enabled

bit 8 CMP1MD: Comparator 1 disable bit

1 = Comparator 1 module is disabled

0 = Comparator 1 module is enabled

bit 7-2 Unimplemented: Read as '0'

bit 1 PGA1MD: PGA module disable bit

1 = PGA module is disabled

0 = PGA module is enabled

bit 0 Unimplemented: Read as '0'

REGISTER 7-14: PMD8: SECONDARY PERIPHERAL MODULE DISABLE 8 CONTROL REGISTER

U-0 R/W-0 U-0 U-0 U-0 R/W-0 U-0 U-0
PGA3MD———PG
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 U-0 U-0
— — CLC4MDCLC3MDCLC2MDCLC1MD — —
bit 7 bit 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 Unimplemented: Read as '0'

bit 14 PGA3MD: PGA3 Module Disable bit

1 = PGA3 module is disabled

0 = PGA3 module is enabled

bit 13-11 Unimplemented: Read as '0'

bit 10 PGA2MD: PGA2 Module Disable bit

1 = PGA2 module is disabled

0 = PGA2 module is enabled

bit 9-6 Unimplemented: Read as '0'

bit 5 CLC4MD: CLC4 Module Disable bit

1 = CLC4 module is disabled

0 = CLC4 module is enabled

bit 4 CLC3MD: CLC3 Module Disable bit

1 = CLC3 module is disabled

0 = CLC3 module is enabled

bit 3 CLC2MD: CLC2 Module Disable bit

1 = CLC2 module is disabled

0 = CLC2 module is enabled

bit 2 CLC1MD: CLC1 Module Disable bit

1 = CLC1 module is disabled

0 = CLC1 module is enabled

bit 1-0 Unimplemented: Read as '0'

TABLE 7-1: MAIN PMD REGISTERS

Note 1: This data sheet summarizes the features of this group of dsPIC33 devices. It is not intended to be a comprehensive reference source. For more information, refer to “Direct Memory Access Controller (DMA)” (chip.com/DS30009742), which is available from the Microchip website (www.micro-chip.com).

2: The DMA is identical for both Main core and Secondary core. The x is common for both Main and Secondary (where the x represents the number of the specific module being addressed).

3: All associated register names are the same on the Main core and the Secondary core. The Secondary code will be developed in a separate project in MPLAB X IDE with the device selection, dsPIC33CH128MP508S1, where S1 indicates the Secondary device.

Table 8-1 shows an overview of the DMA module.

TABLE 8-1: DMA MODULE OVERVIEW

Number of DMA ModulesIdentical (Modules)
Main Core 6Yes
Secondary Core2Yes

The Direct Memory Access (DMA) Controller is designed to service high data throughput peripherals operating on the SFR bus, allowing them to access data memory directly and alleviating the need for CPU-intensive management. By allowing these data-intensive peripherals to share their own data path, the main data bus is also deloaded, resulting in additional power savings.

The DMA Controller functions both as a peripheral and a direct extension of the CPU. It is located on the microcontroller data bus, between the CPU and DMA-enabled peripherals, with direct access to SRAM. This partitions the SFR bus into two buses, allowing the DMA Controller access to the DMA-capable peripherals located on the new DMA SFR bus. The controller serves as a Main device on the DMA SFR bus, controlling data flow from DMA-capable peripherals.

The controller also monitors CPU instruction processing directly, allowing it to be aware of when the CPU requires access to peripherals on the DMA bus and automatically relinquishing control to the CPU as needed. This increases the effective bandwidth for handling data without DMA operations, causing a processor Stall. This makes the controller essentially transparent to the user.

The DMA Controller has these features:

• A Total of Eight (Six Main, Two Secondary), Independently Programmable Channels
- Concurrent Operation with the CPU (no DMA caused Wait states)
- DMA Bus Arbitration
- Five Programmable Address modes
• Four Programmable Transfer modes
- Four Flexible Internal Data Transfer modes
- Byte or Word Support for Data Transfer
- 16-Bit Source and Destination Address Register for each Channel, Dynamically Updated and Reloadable
- 16-Bit Transaction Count Register, Dynamically Updated and Reloadable
• Upper and Lower Address Limit Registers
- Counter Half-Full Level Interrupt
- Software Triggered Transfer
- Null Write mode for Symmetric Buffer Operations

A simplified block diagram of the DMA Controller is shown if Figure 8-1.

FIGURE 8-1: DMA FUNCTIONAL BLOCK DIAGRAM
Microchip dsPIC33CH64MP208 - Legend: - 1

flowchart
graph TD
    A["CPU Execution Monitoring"] --> B["Control Logic"]
    B --> C["DMACON"]
    B --> D["DMAH"]
    B --> E["DMAL"]
    B --> F["DMABUF"]
    G["Data RAM"] --> H["Channel 0"]
    H --> I["Channel 1"]
    I --> J["Channel 4"]
    J --> K["Channel 5"]
    K --> L["Data RAM Address Generation"]
    M["To I/O Ports and Peripherals"] --> N["Data Bus"]
    O["To DMA-Enabled Peripherals"] --> P["Data RAM Address Generation"]
    style A fill:#f9f,stroke:#333
    style G fill:#ccf,stroke:#333
    style O fill:#cfc,stroke:#333

8.1 Summary of DMA Operations

The DMA Controller is capable of moving data between addresses according to a number of different parameters. Each of these parameters can be independently configured for any transaction. In addition, any or all of the DMA channels can independently perform a different transaction at the same time. Transactions are classified by these parameters:

  • Source and destination (SFRs and data RAM)
  • Data size (byte or word)
  • Trigger source
  • Transfer mode (One-Shot, Repeated or Continuous)
  • Addressing modes (Fixed Address or Address Blocks with or without Address Increment/Decrement)

In addition, the DMA Controller provides channel priority arbitration for all channels.

8.1.1 SOURCE AND DESTINATION

Using the DMA Controller, data may be moved between any two addresses in the Data Space. The SFR space (0000h to 0FFFh) or the data RAM space (Main is 1000h to 4FFFh and Secondary is 1000 to 1FFFh) can serve as either the source or the destination. Data can be moved between these areas in either direction or between addresses in either area. The four different combinations are shown in Figure 8-2.

If it is necessary to protect areas of data RAM, the DMA Controller allows the user to set upper and lower address boundaries for operations in the Data Space above the SFR space. The boundaries are set by the DMAH and DMAL Limit registers. If a DMA channel attempts an operation outside of the address boundaries, the transaction is terminated and an interrupt is generated.

8.1.2 DATA SIZE

The DMA Controller can handle both 8-bit and 16-bit transactions. Size is user-selectable using the SIZE bit (DMACHn[1]). By default, each channel is configured for word-size transactions. When byte-size transactions are chosen, the LSB of the source and/or destination address determines if the data represent the upper or lower byte of the data RAM location.

8.1.3 TRIGGER SOURCE

The DMA Controller can use 82 of the device's interrupt sources to initiate a transaction. The DMA trigger sources occur in reverse order from their natural interrupt priority and are shown in Table 8-2. Since the source and destination addresses for any transaction can be programmed independently of the trigger source, the DMA Controller can use any trigger to perform an operation on any peripheral. This also allows DMA channels to be cascaded to perform more complex transfer operations.

8.1.4 TRANSFER MODE

The DMA Controller supports four types of data transfers, based on the volume of data to be moved for each trigger.

  • One-Shot: A single transaction occurs for each trigger.
  • Continuous: A series of back-to-back transactions occur for each trigger; the number of transactions is determined by the DMACNTn transaction counter.
  • Repeated One-Shot: A single transaction is performed repeatedly, once per trigger, until the DMA channel is disabled.
  • Repeated Continuous: A series of transactions are performed repeatedly, one cycle per trigger, until the DMA channel is disabled.

All transfer modes allow the option to have the source and destination addresses, and counter value, automatically reloaded after the completion of a transaction.

8.1.5 ADDRESSING MODES

The DMA Controller also supports transfers between single addresses or address ranges. The four basic options are:

• Fixed-to-Fixed: Between two constant addresses
- Fixed-to-Block: From a constant source address to a range of destination addresses
- Block-to-Fixed: From a range of source addresses to a single, constant destination address
- Block-to-Block: From a range of source addresses to a range of destination addresses

The option to select auto-increment or auto-decrement of source and/or destination addresses is available for Block Addressing modes.

In addition to the four basic modes, the DMA Controller also supports Peripheral Indirect Addressing (PIA) mode, where the source or destination address is generated jointly by the DMA Controller and a PIA-capable peripheral. When enabled, the DMA channel provides a base source and/or destination address, while the peripheral provides a fixed range offset address.

FIGURE 8-2: TYPES OF DMA DATA TRANSFERS
Peripheral to Memory Memory to Peripheral
Microchip dsPIC33CH64MP208 - ADDRESSING MODES - 1

text_image SFR Area DMASRCn 0FFFh 1000h Data RAM DMA RAM Area DMAL DMADSTn DMAH

Microchip dsPIC33CH64MP208 - ADDRESSING MODES - 2

text_image SFR Area DMADSTn 0FFFh 1000h Data RAM DMA RAM Area DMAL DMASRCn DMAH

Peripheral to Peripheral Memory to Memory
Microchip dsPIC33CH64MP208 - ADDRESSING MODES - 3

text_image SFR Area DMASRCn DMADSTn 0FFFh 1000h Data RAM

Microchip dsPIC33CH64MP208 - ADDRESSING MODES - 4

text_image SFR Area Data RAM 0FFFh 1000h DMA RAM Area DMAL DMASRCn DMADSTn DMAH

Note: Relative sizes of memory areas are not shown to scale.

8.1.6 CHANNEL PRIORITY

Each DMA channel functions independently of the others, but also competes with the others for access to the data and DMA buses. When access collisions occur, the DMA Controller arbitrates between the channels using a user-selectable priority scheme. Two schemes are available:

  • Round Robin: When two or more channels collide, the lower numbered channel receives priority on the first collision. On subsequent collisions, the higher numbered channels each receive priority based on their channel number.
  • Fixed: When two or more channels collide, the lowest numbered channel always receives priority, regardless of past history; however, any channel being actively processed is not available for an immediate retrigger. If a higher priority channel is continually requesting service, it will be scheduled for service after the next lower priority channel with a pending request.

8.2 Typical Setup

To set up a DMA channel for a basic data transfer:

  1. Enable the DMA Controller (DMAEN = 1) and select an appropriate channel priority scheme by setting or clearing PRSSEL.
  2. Program DMAH and DMAL with appropriate upper and lower address boundaries for data RAM operations.
  3. Select the DMA channel to be used and disable its operation (CHEN = 0).
  4. Program the appropriate source and destination addresses for the transaction into the channel's DMASRCn and DMADSTn registers. For PIA mode addressing, use the base address value.
  5. Program the DMACNTn register for the number of triggers per transfer (One-Shot or Continuous modes) or the number of words (bytes) to be transferred (Repeated modes).
  6. Set or clear the SIZE bit to select the data size.
  7. Program the TRMODE[1:0] bits to select the Data Transfer mode.
  8. Program the SAMODE[1:0] and DAMODE[1:0] bits to select the addressing mode.
  9. Enable the DMA channel by setting CHEN.
  10. Enable the trigger source interrupt.

8.3 Peripheral Module Disable

The channels of the DMA Controller can be individually powered down using the Peripheral Module Disable (PMD) registers.

8.4 Registers

The DMA Controller uses a number of registers to control its operation. The number of registers depends on the number of channels implemented for a particular device.

There are always four module-level registers (one control and three buffer/address):

  • DMACON: DMA Engine Control Register (Register 8-1)
    • DMAH and DMAL: DMA High and Low Address Limit Registers
    • DMABUF: DMA Transfer Data Buffer

Each of the DMA channels implements five registers (two control and three buffer/address):

  • DMACHn: DMA Channel n Control Register (Register 8-2)
  • DMAINTn: DMA Channel n Interrupt Register (Register 8-3)
  • DMASRCn: DMA Data Source Address Pointer for Channel n Register
  • DMADSTn: DMA Data Destination Source for Channel n Register
  • DMACNTn: DMA Transaction Counter for Channel n Register

For dsPIC33CH128MP508 devices, there are a total of 34 registers.

8.5 DMA Control Registers

REGISTER 8-1: DMACON: DMA ENGINE CONTROL REGISTER

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR

'1' = Bit is set

'0' = Bit is cleared

x = Bit is unknown

bit 15

DMAEN: DMA Module Enable bit

1 = Enables module

0 = Disables module and terminates all active DMA operation(s)

bit 14-1

Unimplemented: Read as '0'

bit 0

PRSSEL: Channel Priority Scheme Selection bit

1 = Round robin scheme

0 = Fixed priority scheme

REGISTER 8-2: DMACHn: DMA CHANNEL n CONTROL REGISTER

U-0 U-0 U-0 r-0 R/W-0 R/W-0 R/W-0 R/W-0
— — —— — NULLWRELOAD(1)CHREQ(3)
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
SAMODE1SAMODE0DAMODE1DAMODE0TRMODE1TRMODE0SIZECHEN
bit 7 bit 0
Legend:r = Reserved 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 15-13 Unimplemented: Read as '0'

bit 12 Reserved: Maintain as '0'

bit 11 Unimplemented: Read as '0'

bit 10 NULLW: Null Write Mode bit

1 = A dummy write is initiated to DMASRCn for every write to DMADSTn

0 = No dummy write is initiated

bit 9 RELOAD: Address and Count Reload bit ^(1)

1 = DMASRCn, DMADSTn and DMACNTn registers are reloaded to their previous values upon the start of the next operation

0 = DMASRCn, DMADSTn and DMACNTn are not reloaded on the start of the next operation ^(2)

bit 8 CHREQ: DMA Channel Software Request bit ^(3)

1 = A DMA request is initiated by software; automatically cleared upon completion of a DMA transfer

0 = No DMA request is pending

bit 7-6 SAMODE[1:0]: Source Address Mode Selection bits

11 = DMASRCn is used in Peripheral Indirect Addressing and remains unchanged

10 = DMASRCn is decremented based on the SIZE bit after a transfer completion

01 = DMASRCn is incremented based on the SIZE bit after a transfer completion

00 = DMASRCn remains unchanged after a transfer completion

bit 5-4 DAMODE[1:0]: Destination Address Mode Selection bits

11 = DMADSTn is used in Peripheral Indirect Addressing and remains unchanged

10 = DMADSTn is decremented based on the SIZE bit after a transfer completion

01 = DMADSTn is incremented based on the SIZE bit after a transfer completion

00 = DMADSTn remains unchanged after a transfer completion

bit 3-2 TRMODE[1:0]: Transfer Mode Selection bits

11 = Repeated Continuous

10 = Continuous

01 = Repeated One-Shot

00 = One-Shot

bit 1 SIZE: Data Size Selection bit

1 = Byte (8-bit)

0 = Word (16-bit)

bit 0 CHEN: DMA Channel Enable bit

1 = The corresponding channel is enabled

0 = The corresponding channel is disabled

Note 1: Only the original DMACNTn is required to be stored to recover the original DMASRCn and DMADSTn values.

2: DMACNTn will always be reloaded in Repeated mode transfers, regardless of the state of the RELOAD bit.

3: The number of transfers executed while CHREQ is set depends on the configuration of TRMODE[1:0].

REGISTER 8-3: DMAINTn: DMA CHANNEL n INTERRUPT REGISTER

R-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
DBUFWF(1)CHSEL6 CHHSEL5 CHSEL4CHSEL3 CHSEL2 CHSEL1CHSEL0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 U-0 U-0 R/W-0
HIGHIF^(1,2) LOWIF^(1,2) DONEIF^(1) HALFIF^(1) OVRUNIF^(1) — —HA L
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15 DBUFWF: DMA Buffered Data Write Flag bit ^(1)

1 = The content of the DMA buffer has not been written to the location specified in DMADSTn or DMASRCn in Null Write mode 0 = The content of the DMA buffer has been written to the location specified in DMADSTn or DMASRCn in Null Write mode

bit 14-8 CHSEL[6:0]: DMA Channel Trigger Selection bits See Table 8-2 for a complete list.

bit 7 HIGHIF: DMA High Address Limit Interrupt Flag bit ^(1,2)

1 = The DMA channel has attempted to access an address higher than DMAH or the upper limit of the data RAM space 0 = The DMA channel has not invoked the high address limit interrupt

bit 6 LOWIF: DMA Low Address Limit Interrupt Flag bit ^(1,2)

1 = The DMA channel has attempted to access the DMA SFR address lower than DMAL, but above the SFR range (07FFh) 0 = The DMA channel has not invoked the low address limit interrupt

bit 5 DONEIF: DMA Complete Operation Interrupt Flag bit ^(1)

If CHEN = 1: 1 = The previous DMA session has ended with completion 0 = The current DMA session has not yet completed If CHEN = 0: 1 = The previous DMA session has ended with completion 0 = The previous DMA session has ended without completion

bit 4 HALFIF: DMA 50% Watermark Level Interrupt Flag bit ^(1)

1 = DMACNTn has reached the halfway point to 0000h 0 = DMACNTn has not reached the halfway point

bit 3 OVRUNIF: DMA Channel Overrun Flag bit ^(1)

1 = The DMA channel is triggered while it is still completing the operation based on the previous trigger 0 = The overrun condition has not occurred

bit 2-1 Unimplemented: Read as '0'

bit 0 HALFEN: Halfway Completion Watermark bit

1 = Interrupts are invoked when DMACNTn has reached its halfway point and at completion 0 = An interrupt is invoked only at the completion of the transfer

Note 1: Setting these flags in software does not generate an interrupt.

2: Testing for address limit violations (DMASRCn or DMADSTn is either greater than DMAH or less than DMAL) is NOT done before the actual access.

TABLE 8-2: DMA CHANNEL TRIGGER SOURCES (MAIN)

CHSEL[6:0]Trigger (Interrupt)CHSEL[6:0]Trigger (Interrupt)CHSEL[6:0]Trigger (Interrupt)
00h INTO - External Interrupt 0 23h (Reserved, do not use) 45h CLC2 Positive Edge Interrupt
01h SCCP1 IC/OC 24h PWM Event C 46hSPI1 - Fault Interrupt
02hSPI1 Receiver25hSENT1 TX/RX47hSPI2 - Fault Interrupt
03hSPI1 Transmitter26hSENT2 TX/RX48h(Reserved, do not use)
04hUART1 Receiver27hADC1 Group Convert Done49h(Reserved, do not use)
05hUART1 Transmitter28hADC Done AN04AhMSI Secondary Initiated Second-ary IRQ
06hECC Single Bit Error29hADC Done AN14BhMSI Protocol A
07hNVM Write Complete2AhADC Done AN24ChMSI Protocol B
08hINT1 - External Interrupt 12BhADC Done AN34DhMSI Protocol C
09hSI2C1 - I2C1 Secondary Event2ChADC Done AN44EhMSI Protocol D
0AhMI2C1 - I2C1 Main Event2DhADC Done AN54FhMSI Protocol E
0BhINT2 - External Interrupt 22EhADC Done AN650hMSI Protocol F
0ChSCCP2 IC/OC2FhADC Done AN751hMSI Protocol G
0DhINT3 - External Interrupt 330hADC Done AN852hMSI Protocol H
0EhUART2 Receiver31hADC Done AN953hMSI Main Read FIFO Data Ready IRQ
0FhUART2 Transmitter32hADC Done AN1054hMSI Main Write FIFO Empty IRQ
10hSPI2 Receiver33hADC Done AN1155hMSI Fault (Over/Underflow)
11hSPI2 Transmitter34hADC Done AN1256hMSI Main Reset IRQ
12hSCCP3 IC/OC35hADC Done AN1357hPWM Event D
13hSI2C2 - I2C2 Secondary Event36hADC Done AN1458hPWM Event E
14hMI2C2 - I2C1 Main Event37hADC Done AN1559hPWM Event F
15hSCCP4 IC/OC38hADC Done AN165AhSecondary ICD Breakpoint Inter-rupt
16hSCCP5 IC/OC39hADC Done AN175Bh(Reserved, do not use)
17hSCCP6 IC/OC3Ah(Reserved, do not use)5ChSCCP7 Interrupt
18hCRC Generator Interrupt3Bh(Reserved, do not use)5DhSCCP8 Interrupt
19hPWM Event A3Ch(Reserved, do not use)5EhSecondary Clock Fail Interrupt
1BhPWM Event B3Dh(Reserved, do not use)5FhADC FIFO Ready Interrupt
1ChPWM Generator 13Eh(Reserved, do not use)60hCLC3 Positive Edge Interrupt
1DhPWM Generator 23Fh(Reserved, do not use)61hCLC4 Positive Edge Interrupt
1EhPWM Generator 340hAD1FLTR1 - Oversample Filter 162h(Reserved, do not use)
1FhPWM Generator 441hAD1FLTR2 - Oversample Filter 2...
20h(Reserved, do not use)42hAD1FLTR3 - Oversample Filter 37Fh
21h(Reserved, do not use)43hAD1FLTR4 - Oversample Filter 4
22h(Reserved, do not use)44hCLC1 Positive Edge Interrupt

TABLE 8-3: DMA CHANNEL TRIGGER SOURCES (SECONDARY)

CHSEL[6:0]Trigger (Interrupt) CHSEL[6:0]Trigger (Interrupt) CHSEL[6:0]Trigger (Interrupt)
000000000hINT0 – External Interrupt 0010001022hPWM Generator 7100010044hCLC1 Positive Edge Interrupt
000000101hSCCP1 IC/OC010001123hPWM Generator 8100010145hCLC2 Positive Edge Interrupt
000001002hSPI1 Receiver010010024hPWM Event C100011046hSPI1 – Fault Interrupt
000001103hSPI1 Transmitter010010125h(Reserved, do not use)100011147h(Reserved, do not use)
000010004hUART1 Receiver010011026h(Reserved, do not use)100100048h(Reserved, do not use)
000010105hUART1 Transmitter010011127hADC1 Group Convert Done100100149h(Reserved, do not use)
000011006hECC Single Bit Error010100028hADC Done AN010010104AhMSI Main Initiated Secondary IRQ
000011107hNVM Write Complete010100129hADC Done AN110010114BhMSI Protocol A
000100008hINT1 – External Interrupt 101010102AhADC Done AN210011004ChMSI Protocol B
000100109hSI2C1 – I2C1 Secondary Event01010112BhADC Done AN310011014DhMSI Protocol C
00010100AhMI2C1 – I2C1 Main Event01011002ChADC Done AN410011104EhMSI Protocol D
00010100BhINT2 – External Interrupt 201011012DhADC Done AN510011114FhMSI Protocol E
00011000ChSCCP2 IC/OC01011102EhADC Done AN6101000050hMSI Protocol F
00011010DhINT3 – External Interrupt 301011112FhADC Done AN7101000151hMSI Protocol G
00011100Eh(Reserved, do not use)011000030hADC Done AN8101001052hMSI Protocol H
00011110Fh(Reserved, do not use)011000131hADC Done AN9101001153hMSI Secondary Read FIFO Data Ready IRQ
001000010h(Reserved, do not use)011001032hADC Done AN10101010054hMSI Secondary Write FIFO Empty IRQ
001000111h(Reserved, do not use)011001133hADC Done AN11101010155hMSI FIFO Fault (Over/Underflow)
001001012hSCCP3 IC/OC011010034hADC Done AN12101011056hMSI Main Reset IRQ
001001113h(Reserved, do not use)011010135hADC Done AN13101011157hPWM Event D
001010014h(Reserved, do not use)011011036hADC Done AN14101100058hPWM Event E
001010115hSCCP4 IC/OC011011137hADC Done AN15101100159hPWM Event F
001011016h(Reserved, do not use)011100038hADC Done AN1610110105AhMain ICD Breakpoint Interrupt
001011117h(Reserved, do not use)011100139hADC Done AN1710110115Bh(Reserved, do not use)
001100018h(Reserved, do not use)01110103Ah(Reserved, do not use)10111005Ch(Reserved, do not use)
001100119hPWM Event A01110103BhADC Done AN1910111015Dh(Reserved, do not use)
00110101Ah(Reserved, do not use)01111003Ch(Reserved, do not use)10111105EhMain Clock Fail Interrupt
00110111BhPWM Event B01111013Dh(Reserved, do not use)10111115FhADC FIFO Ready Interrupt
00111001ChPWM Generator 101111103Eh(Reserved, do not use)110000060hCLC3 Positive Edge Interrupt
00111011DhPWM Generator 201111113Fh(Reserved, do not use)110000161hCLC4 Positive Edge Interrupt
00111101EhPWM Generator 3100000040hAD1FLTR1 – Oversample Filter 1110000162h(Reserved, do not use)
00111111FhPWM Generator 4100000141hAD1FLTR2 – Oversample Filter 2......
010000020hPWM Generator 5100001042hAD1FLTR3 – Oversample Filter 311111117Fh(Reserved, do not use)
010000121hPWM Generator 6100001143hAD1FLTR4 – Oversample Filter 4

9.0 HIGH-RESOLUTION PWM (HSPWM) WITH FINE EDGE PLACEMENT

Note 1: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive reference source. To complement the information in this data sheet, refer to “High-Resolution PWM with Fine Edge Placement” (www.microchip.com/DS70005320), which is available from the Microchip website (www.microchip.com).

2: The PWM is identical for both Main core and Secondary core. The x is common for both Main core and Secondary core (where the x represents the number of the specific module being addressed). The number of HSPWM modules available on the Main core and Secondary core is different and they are located in different SFR locations.

3: All associated register names are the same on the Main core and the Secondary core. The Secondary code will be developed in a separate project in MPLAB X IDE with the device selection, dsPIC33CH128MP508S1, where the S1 indicates the Secondary device. The Main is PWM1 to PWM4 and the Secondary is PWM1 to PWM8.

Table 9-1 shows an overview of the PWM module.
TABLE 9-1: PWM MODULE OVERVIEW

Number of PWM ModulesIdentical (Modules)
Main Core 4 Yes
Secondary Core8Yes

The High-Speed PWM (HSPWM) module is a Pulse-Width Modulated (PWM) module to support both motor control and power supply applications. This flexible module provides features to support many types of Motor Control (MC) and Power Control (PC) applications, including:

  • AC-to-DC Converters
  • DC-to-DC Converters
    • AC and DC Motors: BLDC, PMSM, ACIM, SRM, etc.
    • Inverters
  • Battery Chargers
  • Digital Lighting
    • Power Factor Correction (PFC)

9.1 Features

  • Up to Eight Independent PWM Generators for Secondary Core, each with Dual Outputs
  • Up to Four Independent PWM Generators for Main Core, each with Dual Outputs
  • Operating modes:
  • Independent Edge mode
  • Variable Phase PWM mode
  • Center-Aligned mode
  • Double Update Center-Aligned mode
  • Dual Edge Center-Aligned mode
  • Dual PWM mode

- Output modes:

  • Complementary
  • Independent
  • Push-Pull

- Dead-Time Generator

- Leading-Edge Blanking (LEB)

- Output Override for Fault Handling

- Flexible Period/Duty Cycle Updating Options

• Programmable Control Inputs (PCI)

- Advanced Triggering Options

- Six Combinatorial Logic Outputs

- Six PWM Event Outputs

9.2 Architecture Overview

The PWM module consists of a common set of controls and features, and multiple instantiations of PWM Generators (PGs). Each PWM Generator can be independently configured or multiple PWM Generators can

be used to achieve complex multiphase systems. PWM Generators can also be used to implement sophisticated triggering, protection and logic functions. A high-level block diagram is shown in Figure 9-1.

FIGURE 9-1: PWM HIGH-LEVEL BLOCK DIAGRAM
Microchip dsPIC33CH64MP208 - Architecture Overview - 1

flowchart
graph TD
    A["Common PWM Controls and Data"] --> B["PG1"]
    A --> C["PG2"]
    A --> D["PGx"]
    B --> E["PWM1H"]
    B --> F["PWM1L"]
    C --> G["PWM2H"]
    C --> H["PWM2L"]
    D --> I["PWMxH"]
    D --> J["PWMxL"]

9.3 PWM4H/L Output on Peripheral Pin Select

All devices support the capability to output PWM4H and PWM4L signals via Peripheral Pin Select (PPS) onto any RPn pin. This feature is intended for lower pin count devices that do not have PWM4H/L on dedicated pins. If PWM4H/L PPS output functions are used on devices that also have fixed PWM4H/L pins, the output signal will be present on both dedicated and RPn pins. The output port enable bits, PENH and PENL (PGxIOCONH[3:2]), control both dedicated and PPS pins together; it is not possible to disable the dedicated pins and use only PPS.

Given the natural priority of the RPn functions above that of the PWM, it is possible to use the PPS output functions on the dedicated PWM4H/L pins while the PWM4 signals are routed to other pins via PPS. Any of the peripheral outputs listed in Table 3-32 and Table 4-28, with the exception of 'Default Port', can be used.

Input functions, including the ports and peripherals listed in Table 3-33 and Table 4-31, cannot be used through the RPn function on dedicated PWM4H/L pins when PWM4 is active.

9.4 PWM Control Registers

There are two categories of Special Function Registers (SFRs) used to control the operation of the PWM module:

• Common, shared by all PWM Generators
- PWM Generator-specific

An 'x' in the register name denotes an instance of a PWM Generator.

A 'y' in the register name denotes an instance of the common function.

REGISTER 9-1: PCLKCON: PWM CLOCK CONTROL REGISTER

R/W-0 R/W-0 U-0 U-0 U-0 U-0 R/W-0
HRRDYHRERR LOCK^(1)
bit 15 bit 8
U-0U-0R/W-0R/W-0U-0U-0R/W-0R/W-0
DIVSEL1DIVSEL0MCLKSEL1 ^(2) MCLKSEL0 ^(2)
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15 HRRDY: High-Resolution Ready bit

1 = The high-resolution circuitry is ready
0 = The high-resolution circuitry is not ready

bit 14 HRERR: High-Resolution Error bit

1 = An error has occurred; PWM signals will have limited resolution
0 = No error has occurred; PWM signals will have full resolution when HRRDY = 1

bit 13-9 Unimplemented: Read as '0'

bit 8 LOCK: Lock bit ^(1)

1 = Write-protected registers and bits are locked
0 = Write-protected registers and bits are unlocked

bit 7-6 Unimplemented: Read as '0'

bit 5-4 DIVSEL[1:0]: PWM Clock Divider Selection bits

11 = Divide ratio is 1:16
10 = Divide ratio is 1:8
01 = Divide ratio is 1:4
00 = Divide ratio is 1:2

bit 3-2 Unimplemented: Read as '0'

bit 1-0 MCLKSEL[1:0]: PWM Main Clock Selection bits (2)

11 = AFPLLO - Auxiliary PLL post-divider output
10 = FPLLO - Primary PLL post-divider output
01 = AFvco/2 - Auxiliary VCO/2
00 = Fosc

Note 1: A device-specific unlock sequence must be performed before this bit can be cleared.

2: Changing the MCLKSEL[1:0] bits while ON (PGxCONL[15]) = 1 is not recommended.

REGISTER 9-2: FSCL: FREQUENCY SCALE REGISTER

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
FSCL[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
FSCL[7:0]
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR‘1' = Bit is set‘0' = Bit is clearedx = Bit is unknown

bit 15-0 FSCL[15:0]: Frequency Scale Register bits

The value in this register is added to the frequency scaling accumulator at each pwm_clk. When the accumulated value exceeds the value of FSMINPER, a clock pulse is produced.

REGISTER 9-3: FSMINPER: FREQUENCY SCALING MINIMUM PERIOD REGISTER

R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
FSMINPER[15:8]
bit 15bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
FSMINPER[7:0]
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-0 FSMINPER[15:0]: Frequency Scaling Minimum Period Register bits

This register holds the minimum clock period (maximum clock frequency) that can be produced by the frequency scaling circuit.

REGISTER 9-4: MPHASE: MAIN PHASE REGISTER

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
MPHASE[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
MPHASE[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-0

MPHASE[15:0]: Main Phase Register bits

REGISTER 9-5: MDC: MAIN DUTY CYCLE REGISTER

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
MDC[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
MDC[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-0

MDC[15:0]: Main Duty Cycle Register bits

REGISTER 9-6: MPER: MAIN PERIOD REGISTER

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
MPER[15:8](1)
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
MPER[7:0](1)
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-0 MPER[15:0]: Main Period Register bits ^(1)

Note 1: Period values less than '0x0010' should not be selected.

REGISTER 9-7: CMBTRIGL: COMBINATIONAL TRIGGER REGISTER LOW

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-8 Unimplemented: Read as '0'

bit 7 CTA8EN: Enable Trigger Output from PWM Generator #8 as Source for Combinational Trigger A bit 1 = Enables specified trigger signal to be OR'd into the Combinatorial Trigger A signal 0 = Disabled

bit 6 CTA7EN: Enable Trigger Output from PWM Generator #7 as Source for Combinational Trigger A bit 1 = Enables specified trigger signal to be OR'd into the Combinatorial Trigger A signal 0 = Disabled

bit 5 CTA6EN: Enable Trigger Output from PWM Generator #6 as Source for Combinational Trigger A bit 1 = Enables specified trigger signal to be OR'd into the Combinatorial Trigger A signal 0 = Disabled

bit 4 CTA5EN: Enable Trigger Output from PWM Generator #5 as Source for Combinational Trigger A bit 1 = Enables specified trigger signal to be OR'd into the Combinatorial Trigger A signal 0 = Disabled

bit 3 CTA4EN: Enable Trigger Output from PWM Generator #4 as Source for Combinational Trigger A bit 1 = Enables specified trigger signal to be OR'd into the Combinatorial Trigger A signal 0 = Disabled

bit 2 CTA3EN: Enable Trigger Output from PWM Generator #3 as Source for Combinational Trigger A bit 1 = Enables specified trigger signal to be OR'd into the Combinatorial Trigger A signal 0 = Disabled

bit 1 CTA2EN: Enable Trigger Output from PWM Generator #2 as Source for Combinational Trigger A bit 1 = Enables specified trigger signal to be OR'd into the Combinatorial Trigger A signal 0 = Disabled

bit 0 CTA1EN: Enable Trigger Output from PWM Generator #1 as Source for Combinational Trigger A bit 1 = Enables specified trigger signal to be OR'd into the Combinatorial Trigger A signal 0 = Disabled

REGISTER 9-8: CMBTRIGH: COMBINATIONAL TRIGGER REGISTER HIGH

R = Readable bitW = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown

bit 15-8 Unimplemented: Read as '0'

bit 7 CTB8EN: Enable Trigger Output from PWM Generator #8 as Source for Combinational Trigger B bit 1 = Enables specified trigger signal to be OR'd into the Combinatorial Trigger B signal 0 = Disabled

bit 6 CTB7EN: Enable Trigger Output from PWM Generator #7 as Source for Combinational Trigger B bit 1 = Enables specified trigger signal to be OR'd into the Combinatorial Trigger B signal 0 = Disabled

bit 5 CTB6EN: Enable Trigger Output from PWM Generator #6 as Source for Combinational Trigger B bit 1 = Enables specified trigger signal to be OR'd into the Combinatorial Trigger B signal 0 = Disabled

bit 4 CTB5EN: Enable Trigger Output from PWM Generator #5 as Source for Combinational Trigger B bit 1 = Enables specified trigger signal to be OR'd into the Combinatorial Trigger B signal 0 = Disabled

bit 3 CTB4EN: Enable Trigger Output from PWM Generator #4 as Source for Combinational Trigger B bit 1 = Enables specified trigger signal to be OR'd into the Combinatorial Trigger B signal 0 = Disabled

bit 2 CTB3EN: Enable Trigger Output from PWM Generator #3 as Source for Combinational Trigger B bit 1 = Enables specified trigger signal to be OR'd into the Combinatorial Trigger B signal 0 = Disabled

bit 1 CTB2EN: Enable Trigger Output from PWM Generator #2 as Source for Combinational Trigger B bit 1 = Enables specified trigger signal to be OR'd into the Combinatorial Trigger B signal 0 = Disabled

bit 0 CTB1EN: Enable Trigger Output from PWM Generator #1 as Source for Combinational Trigger B bit 1 = Enables specified trigger signal to be OR'd into the Combinatorial Trigger B signal 0 = Disabled

REGISTER 9-9: LOGCONy: COMBINATORIAL PWM LOGIC CONTROL REGISTER y ^(2)

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PWMS1y3(1)PWMS1y2(1)PWMS1y1(1)PWMS1y0(1)PWMS2y3(1)PWMS2y2(1)PWMS2y1(1)PWMS2y0(1)
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 U-0 R/W-0 R/W-0 R/W-0
S1yPOLS2yPOLPWMLFy1PWMLFy0PWMLFyD2PWMLFyD1PWMLFyD0
bit 7 bit 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-12 PWMS1y[3:0]: Combinatorial PWM Logic Source #1 Selection bits ^(1)

1111 = PWM8L

1110 = PWM8H

1101 = PWM7L

1100 = PWM7H

1011 = PWM6L

1010 = PWM6H

1001 = PWM5L

1000 = PWM5H

0111 = PWM4L

0110 = PWM4H

0101 = PWM3L

0100 = PWM3H

0011 = PWM2L

0010 = PWM2H

0001 = PWM1L

0000 = PWM1H

bit 11-8 PWMS2y[3:0]: Combinatorial PWM Logic Source #2 Selection bits ^(1)

1111 = PWM8L

1110 = PWM8H

1101 = PWM7L

1100 = PWM7H

1011 = PWM6L

1010 = PWM6H

1001 = PWM5L

1000 = PWM5H

0111 = PWM4L

0110 = PWM4H

0101 = PWM3L

0100 = PWM3H

0011 = PWM2L

0010 = PWM2H

0001 = PWM1L

0000 = PWM1H

Note 1: Logic function input will be connected to '0' if the PWM channel is not present.

2: Instances of y = A, C, E of LOGCONy assign logic function output to the PWMxH pin. Instances of y = B, D, F of LOGCONy assign logic function to the PWMxL pin.

REGISTER 9-9: LOGCONy: COMBINATORIAL PWM LOGIC CONTROL REGISTER y ^(2) (CONTINUED)

bit 7S1yPOL: Combinatorial PWM Logic Source #1 Polarity bit1 = Input is inverted0 = Input is positive logic
bit 6S2yPOL: Combinatorial PWM Logic Source #2 Polarity bit1 = Input is inverted0 = Input is positive logic
bit 5-4PWMLFy[1:0]: Combinatorial PWM Logic Function Selection bits11 = Reserved10 = PWMS1 ^ PWMS2 (XOR)01 = PWMS1 & PWMS2 (AND)00 = PWMS1 | PWMS2 (OR)
bit 3Unimplemented: Read as ‘0’
bit 2-0PWMLFyD[2:0]: Combinatorial PWM Logic Destination Selection bits111 = Logic function is assigned to the PWM8H or PWM8L pin110 = Logic function is assigned to the PWM7H or PWM7L pin101 = Logic function is assigned to the PWM6H or PWM6L pin100 = Logic function is assigned to the PWM5H or PWM5Lpin011 = Logic function is assigned to the PWM4H or PWM4Lpin010 = Logic function is assigned to the PWM3H or PWM3Lpin001 = Logic function is assigned to the PWM2H or PWM2Lpin000 = No assignment, combinatorial PWM logic function is disabled

Note 1: Logic function input will be connected to '0' if the PWM channel is not present.
2: Instances of y = A, C, E of LOGCONy assign logic function output to the PWMxH pin. Instances of y = B, D, F of LOGCONy assign logic function to the PWMxL pin.

REGISTER 9-10: PWMEVTy: PWM EVENT OUTPUT CONTROL REGISTER y (5)

R/W-0 R/W-0 R/W-0 R/W-0 U-0 U-0 U-0 U-0
EVTyOEN EVTyPOL EVTySTRD EVTySYNC— —
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0U-0R/W-0R/W-0R/W-0
EVTySEL3EVTySEL2EVTySEL1EVTySEL0EVTyPGS2(2)EVTyPGS1(2)EVTyPGS0(2)
bit 7 bit 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 15EVTyOEN: PWM Event Output Enable bit1 = Event output signal is output on PWMEy pin0 = Event output signal is internal only
bit 14EVTyPOL: PWM Event Output Polarity bit1 = Event output signal is active-low0 = Event output signal is active-high
bit 13EVTySTRD: PWM Event Output Stretch Disable bit1 = Event output signal pulse width is not stretched0 = Event output signal is stretched to eight PWM clock cycles minimum ^(1)
bit 12EVTySYNC: PWM Event Output Sync bit1 = Event output signal is synchronized to the system clock0 = Event output is not synchronized to the system clockEvent output signal pulse will be two system clocks when this bit is set and EVTySTRD = 1.
bit 11-8Unimplemented: Read as '0'
bit 7-4EVTySEL[3:0]: PWM Event Selection bits1111 = High-resolution error event signal1110-1010 = Reserved1001 = ADC Trigger 2 signal1000 = ADC Trigger 1 signal0111 = STEER signal (available in Push-Pull Output modes only) ^(4) 0110 = CAHALF signal (available in Center-Aligned modes only) ^(4) 0101 = PCI Fault active output signal0100 = PCI current-limit active output signal0011 = PCI feed-forward active output signal0010 = PCI Sync active output signal0001 = PWM Generator output signal ^(3) 0000 = Source is selected by the PGTRGSEL[2:0] bits
bit 3Unimplemented: Read as '0'

Note 1: The event signal is stretched using the peripheral clock because different PGs may be operating from different clock sources. The leading edge of the event pulse is produced in the clock domain of the PWM Generator. The trailing edge of the stretched event pulse is produced in the peripheral clock domain.
2: No event will be produced if the selected PWM Generator is not present.
3: This is the PWM Generator output signal prior to output mode logic and any output override logic.
4: This signal should be the PGx_clk domain signal prior to any synchronization into the system clock domain.
5: 'y' denotes a common instance (A-F).

REGISTER 9-10: PWMEVTy: PWM EVENT OUTPUT CONTROL REGISTER y (5) (CONTINUED)

bit 2-0 EVTyPGS[2:0]: PWM Event Source Selection bits (2)

111 = P G 8
110 = P G 7
101 = P G 6
100 = P G 5
011 = P G 4
010 = P G 3
001 = P G 2
000 = P G 1 

Note 1: The event signal is stretched using the peripheral clock because different PGs may be operating from different clock sources. The leading edge of the event pulse is produced in the clock domain of the PWM Generator. The trailing edge of the stretched event pulse is produced in the peripheral clock domain.

2: No event will be produced if the selected PWM Generator is not present.

3: This is the PWM Generator output signal prior to output mode logic and any output override logic.

4: This signal should be the PGx_clk domain signal prior to any synchronization into the system clock domain.

5: 'y' denotes a common instance (A-F).

REGISTER 9-11: LFSR: LINEAR FEEDBACK SHIFT REGISTER

U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
— LFSR[14:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
LFSR[7:0]
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15 Unimplemented: Read as '0'

bit 14-0 LFSR[14:0]: Linear Feedback Shift Register bits

A read of this register will provide a 15-bit pseudorandom value.

REGISTER 9-12: PGxCONL: PWM GENERATOR x CONTROL REGISTER LOW

R/W-0 r-0 U-0 U-0 U-0 R/W-0 R/W-0 R/W-0
ON— — —— TRGCNT2TRGCNT1TRGCNT0
bit 15 bit 8
R/W-0 U-0 U-0R/W-0R/W-0 R/W-0 R/W-0 R/W-0
HRENCLKSEL1CLKSEL0MODSEL2MODSEL1MODSEL0
bit 7 bit 0
Legend:r = Reserved 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 15 ON: Enable bit

1 = PWM Generator is enabled

0 = PWM Generator is not enabled

bit 14 Reserved: Maintain as '0'

bit 13-11 Unimplemented: Read as '0'

bit 10-8 TRGCNT[2:0]: Trigger Count Select bits

111 = PWM Generator produces eight PWM cycles after triggered

110 = PWM Generator produces seven PWM cycles after triggered

101 = PWM Generator produces six PWM cycles after triggered

100 = PWM Generator produces five PWM cycles after triggered

011 = PWM Generator produces four PWM cycles after triggered

010 = PWM Generator produces three PWM cycles after triggered

001 = PWM Generator produces two PWM cycles after triggered

000 = PWM Generator produces one PWM cycle after triggered

bit 7 HREN: PWM Generator x High-Resolution Enable bit

1 = PWM Generator x operates in High-Resolution mode ^(2)

0 = PWM Generator x operates in standard resolution

bit 6-5 Unimplemented: Read as '0'

bit 4-3 CLKSEL[1:0]: Clock Selection bits

11 = PWM Generator uses Main clock scaled by frequency scaling circuit ^(1)

10 = PWM Generator uses Main clock divided by clock divider circuit(1)

01 = PWM Generator uses Main clock selected by the MCLKSEL[1:0] (PCLKCON[1:0]) control bits

00 = No clock selected, PWM Generator is in lowest power state (default)

bit 2-0 MODSEL[2:0]: Mode Selection bits

111 = Dual Edge Center-Aligned PWM mode (interrupt/register update twice per cycle)

110 = Dual Edge Center-Aligned PWM mode (interrupt/register update once per cycle)

101 = Double-Update Center-Aligned PWM mode

100 = Center-Aligned PWM mode

011 = Reserved

010 = Independent Edge PWM mode, dual output

001 = Variable Phase PWM mode

Note 1: The PWM Generator time base operates from the frequency scaling circuit clock, effectively scaling the duty cycle and period of the PWM Generator output.

2: Input frequency of 500 MHz must be used for High-Resolution mode.

REGISTER 9-13: PGxCONH: PWM GENERATOR x CONTROL REGISTER HIGH

R/W-0 R/W-0 R/W-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0
MDCSEL MPERSEL MPHSEL— MSTENUPDMOD2UPDMOD1UPDMOD0
bit 15bit 8
r-0R/W-0U-0U-0R/W-0R/W-0R/W-0R/W-0
TRGMOD SOCS3^(1,2,3) SOCS2^(1,2,3) SOCS1^(1,2,3) SOCS0^(1,2,3)
bit 7 bit 0
Legend:r = Reserved bit
R = Readable bit W = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 15 MDCSEL: Main Duty Cycle Register Select bit

1 = PWM Generator uses the MDC register instead of PGxDC

0 = PWM Generator uses the PGxDC register

bit 14 MPERSEL: Main Period Register Select bit

1 = PWM Generator uses the MPER register instead of PGxPER

0 = PWM Generator uses the PGxPER register

bit 13 MPHSEL: Main Phase Register Select bit

1 = PWM Generator uses the MPHASE register instead of PGxPHASE

0 = PWM Generator uses the PGxPHASE register

bit 12 Unimplemented: Read as '0'

bit 11 MSTEN: Main Update Enable bit

1 = PWM Generator broadcasts software set/clear of the UPDATE status bit and EOC signal to other PWM Generators

0 = PWM Generator does not broadcast the UPDATE status bit state or EOC signal

bit 10-8 UPDMOD[2:0]: PWM Buffer Update Mode Selection bits

011 = Secondaryd immediate update Data registers update immediately, or as soon as possible, when a Main update request is received. A Main update request will be transmitted if MSTEN = 1 and UPDREQ = 1 for the requesting PWM Generator.

010 = Secondaryd SOC update Data registers update at start of next cycle if a Main update request is received. A Main update request will be transmitted if MSTEN = 1 and UPDREQ = 1 for the requesting PWM Generator.

001 = Immediate update Data registers update immediately, or as soon as possible, if UPDREQ = 1. The UPDATE status bit will be cleared automatically after the update occurs.

000 = SOC update Data registers update at start of next PWM cycle if UPDREQ = 1. The UPDATE status bit will be cleared automatically after the update occurs.

bit 7 Reserved: Maintain as '0'

Note 1: The PCI selected Sync signal is always available to be OR'd with the selected SOC signal per the SOCS[3:0] bits if the PCI Sync function is enabled.

2: The source selected by the SOCS[3:0] bits MUST operate from the same clock source as the local PWM Generator. If not, the source must be routed through the PCI Sync logic so the trigger signal may be synchronized to the PWM Generator clock domain.

3: PWM Generators are grouped into groups of four: PG1-PG4 and PG5-PG8, if available. Any generator within a group of four may be used to trigger another generator within the same group.

REGISTER 9-13: PGxCONH: PWM GENERATOR x CONTROL REGISTER HIGH (CONTINUED)

bit 6 TRGMOD: PWM Generator Trigger Mode Selection bit

1 = PWM Generator operates in Retriggerable mode

0 = PWM Generator operates in Single Trigger mode

bit 5-4 Unimplemented: Read as '0'

bit 3-0 SOCS[3:0]: Start-of-Cycle Selection bits (1,2,3)

1111 = TRIG bit or PCI Sync function only (no hardware trigger source is selected)

1110-0101 = Reserved

0100 = PWM4(8) PG4 or PG8 trigger output selected by PGTRGSEL[2:0] (PGxEVT[2:0])

0011 = PWM3(7) PG3 or PG7 trigger output selected by PGTRGSEL[2:0] (PGxEVT[2:0])

0010 = PWM2(6) PG2 or PG6 trigger output selected by PGTRGSEL[2:0] (PGxEVT[2:0])

0001 = PWM1(5) PG1 or PG5 trigger output selected by PGTRGSEL[2:0] (PGxEVT[2:0])

0000 = Local EOC - PWM Generator is self-triggered

Note 1: The PCI selected Sync signal is always available to be OR'd with the selected SOC signal per the SOCS[3:0] bits if the PCI Sync function is enabled.

2: The source selected by the SOCS[3:0] bits MUST operate from the same clock source as the local PWM Generator. If not, the source must be routed through the PCI Sync logic so the trigger signal may be synchronized to the PWM Generator clock domain.

3: PWM Generators are grouped into groups of four: PG1-PG4 and PG5-PG8, if available. Any generator within a group of four may be used to trigger another generator within the same group.

REGISTER 9-14: PGxSTAT: PWM GENERATOR x STATUS REGISTER

HS/C-0 HS/C-0 HS/C-0 HS/C-0 R-0 R-0 R-0 R-0
SEVTFLTEVTCLEVTFFEVTSACTFLTACTCLACTFFACT
bit 15 bit 8
W-0W-0HS/R-0R-0W-0R-0R-0R-0
TRSET TRCLRCAP(1)UPDATEUPDREQSTEERCAHALF TRIG
bit 7 bit 0
Legend:C = Clearable bitHS = Hardware Settable bit
R = Readable bitW = Writable bit‘0’ = Bit is cleared x = Bit is unknown
-n = Value at POR‘1’ = Bit is setU = Unimplemented bit, read as ‘0’
bit 15SEVT: PCI Sync Event bit1 = A PCI Sync event has occurred (rising edge on PCI Sync output or PCI Sync output is high when module is enabled)0 = No PCI Sync event has occurred
bit 14FLTEVT: PCI Fault Active Status bit1 = A Fault event has occurred (rising edge on PCI Fault output or PCI Fault output is high when module is enabled)0 = No Fault event has occurred
bit 13CLEVT: PCI Current-Limit Status bit1 = A PCI current-limit event has occurred (rising edge on PCI current-limit output or PCI current-limit output is high when module is enabled)0 = No PCI current-limit event has occurred
bit 12FFEVT: PCI Feed-Forward Active Status bit1 = A PCI feed-forward event has occurred (rising edge on PCI feed-forward output or PCI feed-forward output is high when module is enabled)0 = No PCI feed-forward event has occurred
bit 11SACT: PCI Sync Status bit1 = PCI Sync output is active0 = PCI Sync output is inactive
bit 10FLTACT: PCI Fault Active Status bit1 = PCI Fault output is active0 = PCI Fault output is inactive
bit 9CLACT: PCI Current-Limit Status bit1 = PCI current-limit output is active0 = PCI current-limit output is inactive
bit 8FFACT: PCI Feed-Forward Active Status bit1 = PCI feed-forward output is active0 = PCI feed-forward output is inactive
bit 7TRSET: PWM Generator Software Trigger Set bitUser software writes a '1' to this bit location to trigger a PWM Generator cycle. The bit location always reads as '0'. The TRIG bit will indicate '1' when the PWM Generator is triggered.
bit 6TRCLR: PWM Generator Software Trigger Clear bitUser software writes a '1' to this bit location to stop a PWM Generator cycle. The bit location always reads as '0'. The TRIG bit will indicate '0' when the PWM Generator is not triggered.

Note 1: The CAP status bit will be set when the capture event has occurred. No further captures will occur until CAP is cleared by software.

REGISTER 9-14: PGxSTAT: PWM GENERATOR x STATUS REGISTER (CONTINUED)

bit 5 CAP: Capture Status bit (1)

1 = PWM Generator time base value has been captured in PGxCAP
0 = No capture has occurred

bit 4 UPDATE: PWM Data Register Update Status bit

1 = PWM Data register update is pending – user Data registers are not writable

0 = No PWM Data register update is pending

bit 3 UPDREQ: PWM Data Register Update Request bit

User software writes a '1' to this bit location to request a PWM Data register update. The bit location always reads as '0'. The UPDATE status bit will indicate '1' when an update is pending.

bit 2 STEER: Output Steering Status bit (Push-Pull Output mode only)

1 = PWM Generator is in 2nd cycle of Push-Pull mode
0 = PWM Generator is in 1st cycle of Push-Pull mode

bit 1 CAHALF: Half Cycle Status bit (Center-Aligned modes only)

1 = PWM Generator is in 2nd half of time base cycle

0 = PWM Generator is in 1st half of time base cycle

bit 0 TRIG: PWM Trigger Status bit

1 = PWM Generator is triggered and PWM cycle is in progress
0 = No PWM cycle is in progress

Note 1: The CAP status bit will be set when the capture event has occurred. No further captures will occur until CAP is cleared by software.

REGISTER 9-15: PGxIOCONL: PWM GENERATOR x I/O CONTROL REGISTER LOW

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CLMODSWAPOVRENHOVRENLOVRDAT1OVRDAT0OSYNC1OSYNC0
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
FLTDAT1FLTDAT0CLDAT1CLDAT0FFDAT1FFDAT0DBDAT1DBDAT0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15 CLMOD: Current-Limit Mode Select bit

1 = If PCI current limit is active, then the PWMxH and PWMxL output signals are inverted (bit flipping), and the CLDAT[1:0] bits are not used 0 = If PCI current limit is active, then the CLDAT[1:0] bits define the PWM output levels

bit 14 SWAP: Swap PWM Signals to PWMxH and PWMxL Device Pins bit

1 = The PWMxH signal is connected to the PWMxL pin and the PWMxL signal is connected to the PWMxH pin 0 = PWMxH/L signals are mapped to their respective pins

bit 13 OVRENH: User Override Enable for PWMxH Pin bit

1 = OVRDAT1 provides data for output on the PWMxH pin 0 = PWM Generator provides data for the PWMxH pin

bit 12 OVRENL: User Override Enable for PWMxL Pin bit

1 = OVRDAT0 provides data for output on the PWMxL pin 0 = PWM Generator provides data for the PWMxL pin

bit 11-10 OVRDAT[1:0]: Data for PWMxH/PWMxL Pins if Override is Enabled bits

If OVERENH = 1, then OVRDAT1 provides data for PWMxH. If OVERENL = 1, then OVRDAT0 provides data for PWMxL.

bit 9-8 OSYNC[1:0]: User Output Override Synchronization Control bits

11 = Reserved 10 = User output overrides via the OVRENH/L and OVRDAT[1:0] bits occur when specified by the UPDMOD[2:0] bits in the PGxCONH register 01 = User output overrides via the OVRENH/L and OVRDAT[1:0] bits occur immediately (as soon as possible) 00 = User output overrides via the OVRENH/L and OVRDAT[1:0] bits are synchronized to the local PWM time base (next Start-of-Cycle)

bit 7-6 FLTDAT[1:0]: Data for PWMxH/PWMxL Pins if Fault Event is Active bits

If Fault is active, then FLTDAT1 provides data for PWMxH. If Fault is active, then FLTDAT0 provides data for PWMxL.

bit 5-4 CLDAT[1:0]: Data for PWMxH/PWMxL Pins if Current-Limit Event is Active bits

If current limit is active, then CLDAT1 provides data for PWMxH. If current limit is active, then CLDAT0 provides data for PWMxL.

bit 3-2 FFDAT[1:0]: Data for PWMxH/PWMxL Pins if Feed-Forward Event is Active bits

If feed-forward is active, then FFDAT1 provides data for PWMxH. If feed-forward is active, then FFDAT0 provides data for PWMxL.

bit 1-0 DBDAT[1:0]: Data for PWMxH/PWMxL Pins if Debug Mode is Active bits

If Debug mode is active and PTFRZ = 1, then DBDAT1 provides data for PWMxH. If Debug mode is active and PTFRZ = 1, then DBDAT0 provides data for PWMxL.

REGISTER 9-16: PGxIOCONH: PWM GENERATOR x I/O CONTROL REGISTER HIGH

U-0 R/W-0 R/W-0 R/W-0 U-0 U-0 U-0 R/W-0
— CAPSRC2 (1)CAPSRC1(1)CAPSRC0(1)— — —DTCMPSEL
bit 15 bit 8
U-0U-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
PMOD1PMOD0PENHPENLPOLHPOLL
bit 7 bit 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 15Unimplemented: Read as ‘0’
bit 14-12CAPSRC[2:0]: Time Base Capture Source Selection bits(1)
111 = Reserved
110 = Reserved
101 = Reserved
100 = Capture time base value at assertion of selected PCI Fault signal
011 = Capture time base value at assertion of selected PCI current-limit signal
010 = Capture time base value at assertion of selected PCI feed-forward signal
001 = Capture time base value at assertion of selected PCI Sync signal
000 = No hardware source selected for time base capture – software only
bit 11-9Unimplemented: Read as ‘0’
bit 8DTCMPSEL: Dead-Time Compensation Select bit
1 = Dead-time compensation is controlled by PCI feed-forward limit logic
0 = Dead-time compensation is controlled by PCI Sync logic
bit 7-6Unimplemented: Read as ‘0’
bit 5-4PMOD[1:0]: PWM Generator Output Mode Selection bits
11 = Reserved
10 = PWM Generator outputs operate in Push-Pull mode
01 = PWM Generator outputs operate in Independent mode
00 = PWM Generator outputs operate in Complementary mode
bit 3PENH: PWMxH Output Port Enable bit
1 = PWM Generator controls the PWMxH output pin
0 = PWM Generator does not control the PWMxH output pin
bit 2PENL: PWMxL Output Port Enable bit
1 = PWM Generator controls the PWMxL output pin
0 = PWM Generator does not control the PWMxL output pin
bit 1POLH: PWMxH Output Polarity bit
1 = Output pin is active-low
0 = Output pin is active-high
bit 0POLL: PWMxL Output Polarity bit
1 = Output pin is active-low
0 = Output pin is active-high

Note 1: A capture may be initiated in software at any time by writing a '1' to CAP (PGxSTAT[5]).

REGISTER 9-17: PGxyPCIL: PWM GENERATOR xy PCI REGISTER LOW (x = PWM GENERATOR #; y = F, CL, FF OR S)

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
TSYNCDISTERM2TERM1TERM0AQPSAQSS2AQSS1AQSS0
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
SWTERMPSYNCPPSPSS4PSS3PSS2PSS1PSS0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15 TSYNCDIS: Termination Synchronization Disable bit

1 = Termination of latched PCI occurs immediately
0 = Termination of latched PCI occurs at PWM EOC

bit 14-12 TERM[2:0]: Termination Event Selection bits

111 = Selects PCI Source #9
110 = Selects PCI Source #8
101 = Selects PCI Source #1 (PWM Generator output selected by the PWMPCI[2:0] bits)
100 = PGxTRIGC trigger event
011 = PGxTRIGB trigger event
010 = PGxTRIGA trigger event
001 = Auto-Terminate: Terminate when PCI source transitions from active to inactive
000 = Manual Terminate: Terminate on a write of '1' to the SWTERM bit location

bit 11 AQPS: Acceptance Qualifier Polarity Select bit

1 = Inverted
0 = Not inverted

bit 10-8 AQSS[2:0]: Acceptance Qualifier Source Selection bits

111 = SWPCI control bit only (qualifier forced to '0')
110 = Selects PCI Source #9
101 = Selects PCI Source #8
100 = Selects PCI Source #1 (PWM Generator output selected by the PWMPCI[2:0] bits)
011 = PWM Generator is triggered
010 = LEB is active
001 = Duty cycle is active (base PWM Generator signal)
000 = No acceptance qualifier is used (qualifier forced to '1')

bit 7 SWTERM: PCI Software Termination bit

A write of '1' to this location will produce a termination event. This bit location always reads as '0'.

bit 6 PSYNC: PCI Synchronization Control bit

1 = PCI source is synchronized to PWM EOC
0 = PCI source is not synchronized to PWM EOC

bit 5 PPS: PCI Polarity Select bit

1 = Inverted
0 = Not inverted

REGISTER 9-17: PGxyPCIL: PWM GENERATOR xy PCI REGISTER LOW

(x = PWM GENERATOR #; y = F, CL, FF OR S) (CONTINUED)

bit 4-0 PSS[4:0]: PCI Source Selection bits

For Main:

11111 = Main CLC1
11110 = Secondary Comparator 3 output
11101 = Secondary Comparator 2 output
11100 = Secondary Comparator 1 output
11011 = Main Comparator 1 output
11010 = Secondary PWM Event F
11001 = Secondary PWM Event E
11000 = Secondary PWM Event D
10111 = Secondary PWM Event C
10110 = Device pin, PCI[22]
10101 = Device pin, PCI[21]
10100 = Device pin, PCI[20]
10011 = Device pin, PCI[19]
10010 = Main RPn input, Main PCI18R
10001 = Main RPn input, Main PCI17R
10000 = Main RPn input, Main PCI16R
01111 = Main RPn input, Main PCI15R
01110 = Main RPn input, Main PCI14R
01101 = Main RPn input, Main PCI13R
01100 = Main RPn input, Main PCI12R
01011 = Main RPn input, Main PCI11R
01010 = Main RPn input, Main PCI10R
01001 = Main RPn input, Main PCI9R
01000 = Main RPn input, Main PCI8R
00111 = Reserved
00110 = Reserved
00101 = Reserved
00100 = Reserved
00011 = Internally connected to Combo Trigger B
00010 = Internally connected to Combo Trigger A
00001 = Internally connected to the output of PWMPCI[2:0] MUX
00000 = Tied to '0' 

REGISTER 9-17: PGxyPCIL: PWM GENERATOR xy PCI REGISTER LOW

(x = PWM GENERATOR #; y = F, CL, FF OR S) (CONTINUED)

For Secondary:

PWM_PCI[n] Source

00111 = Reserved

00110 = Reserved

00101 = Reserved

00100 = Reserved

00011 = Internally connected to Combo Trigger B

00010 = Internally connected to Combo Trigger A

00001 = Internally connected to the output of PWMPCI[2:0] MUX

00000 = Internally connect to '1'b0

11111 = Secondary CLC1

11110 = Secondary Comparator Output 3

11101 = Secondary Comparator Output 2

11100 = Secondary Comparator Output 1

11011 = Main Comparator Output 1

11010 = Main PWM Event F

11001 = Main PWM Event E

11000 = Main PWM Event D

10111 = Main PWM Event C

10110 = PCI[22] device pin device none PCI[22]

10101 = PCI[21] device pin device none PCI[21]

10100 = PCI[20] device pin device none PCI[20]

10011 = Device pin device none PCI[19]

10010 = Secondary S1RPn input Secondary PCI18R

10001 = Secondary S1RPn input Secondary PCI17R

10000 = Secondary S1RPn input Secondary PCI16R

01111 = Secondary S1RPn input Secondary PCI15R

01110 = Secondary S1RPn input Secondary PCI14R

01101 = Secondary S1RPn input Secondary PCI13R

01100 = Secondary S1RPn input Secondary PCI12R

01011 = Secondary S1RPn input Secondary PCI11R

01010 = Secondary S1RPn input Secondary PCI10R

01001 = Secondary S1RPn input Secondary PCI9R

01000 = Secondary S1RPn input Secondary PCI8R

REGISTER 9-18: PGxyPCIH: PWM GENERATOR xy PCI REGISTER HIGH (x = PWM GENERATOR #; y = F, CL, FF OR S)

R/W-0 R/W-0 R/W-0 R/W-0 U-0 R/W-0 R/W-0 R/W-0
BPEN BRSEL2(1)BPSEL1(1)BPSEL0(1)— ACP2ACP1ACP0
bit 15bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
SWPCISWPCIM1SWPCIM0LATMODTQPSTQSS2TQSS1TQSS0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15 BPEN: PCI Bypass Enable bit

1 = PCI function is enabled and local PCI logic is bypassed; PWM Generator will be controlled by PCI function in the PWM Generator selected by the BPSEL[2:0] bits 0 = PCI function is not bypassed

bit 14-12 BPSEL[2:0]: PCI Bypass Source Selection bits ^(1)

111 = PCI control is sourced from PWM Generator 8 PCI logic when BPEN = 1 110 = PCI control is sourced from PWM Generator 7 PCI logic when BPEN = 1 101 = PCI control is sourced from PWM Generator 6 PCI logic when BPEN = 1 100 = PCI control is sourced from PWM Generator 5 PCI logic when BPEN = 1 011 = PCI control is sourced from PWM Generator 4 PCI logic when BPEN = 1 010 = PCI control is sourced from PWM Generator 3 PCI logic when BPEN = 1 001 = PCI control is sourced from PWM Generator 2 PCI logic when BPEN = 1 000 = PCI control is sourced from PWM Generator 1 PCI logic when BPEN = 1

bit 11 Unimplemented: Read as '0'

bit 10-8 ACP[2:0]: PCI Acceptance Criteria Selection bits

111 = Reserved 110 = Reserved 101 = Latched any edge 100 = Latched rising edge 011 = Latched 010 = Any edge 001 = Rising edge 000 = Level-sensitive

bit 7 SWPCI: Software PCI Control bit

1 = Drives a '1' to PCI logic assigned to by the SWPCIM[1:0] control bits 0 = Drives a '0' to PCI logic assigned to by the SWPCIM[1:0] control bits

bit 6-5 SWPCIM[1:0]: Software PCI Control Mode bits

11 = Reserved 10 = SWPCI bit is assigned to termination qualifier logic 01 = SWPCI bit is assigned to acceptance qualifier logic 00 = SWPCI bit is assigned to PCI acceptance logic

bit 4 LATMOD: PCI SR Latch Mode bit

1 = SR latch is Reset-dominant in Latched Acceptance modes 0 = SR latch is Set-dominant in Latched Acceptance modes

Note 1: Selects '0' if selected PWM Generator is not present.

REGISTER 9-18: PGxyPCIH: PWM GENERATOR xy PCI REGISTER HIGH

(x = PWM GENERATOR #; y = F, CL, FF OR S) (CONTINUED)

bit 3 TQPS: Termination Qualifier Polarity Select bit

1 = Inverted
0 = Not inverted 

bit 2-0 TQSS[2:0]: Termination Qualifier Source Selection bits

111 = SWPCI control bit only (qualifier forced to '0')
110 = Selects PCI Source #9
101 = Selects PCI Source #8
100 = Selects PCI Source #1 (PWM Generator output selected by the PWMPCI[2:0] bits)
011 = PWM Generator is triggered
010 = LEB is active
001 = Duty cycle is active (base PWM Generator signal)
000 = No termination qualifier used (qualifier forced to '1') 

Note 1: Selects '0' if selected PWM Generator is not present.

REGISTER 9-19: PGxEVTL: PWM GENERATOR x EVENT REGISTER LOW

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
ADTR1PS4ADTR1PS3ADTR1PS2ADTR1PS1ADTR1PS0ADTR1EN3ADTR1EN2ADTR1EN1
bit 15 bit 8
U-0U-0U-0R/W-0R/W-0R/W-0R/W-0R/W-0
UPDTRG1UPDTRG0PGTRGSEL2 ^(1) PGTRGSEL1 ^(1) PGTRGSEL0 ^(1)
bit 7 bit 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-11 ADTR1PS[4:0]: ADC Trigger 1 Postscaler Selection bits

11111 = 1:32

...

00010 = 1:3

00001 = 1:2

00000 = 1:1

bit 10 ADTR1EN3: ADC Trigger 1 Source is PGxTRIGC Compare Event Enable bit

1 = PGxTRIGC register compare event is enabled as trigger source for ADC Trigger 1

0 = PGxTRIGC register compare event is disabled as trigger source for ADC Trigger 1

bit 9 ADTR1EN2: ADC Trigger 1 Source is PGxTRIGB Compare Event Enable bit

1 = PGxTRIGB register compare event is enabled as trigger source for ADC Trigger 1

0 = PGxTRIGB register compare event is disabled as trigger source for ADC Trigger 1

bit 8 ADTR1EN1: ADC Trigger 1 Source is PGxTRIGA Compare Event Enable bit

1 = PGxTRIGA register compare event is enabled as trigger source for ADC Trigger 1

0 = PGxTRIGA register compare event is disabled as trigger source for ADC Trigger 1

bit 7-5 Unimplemented: Read as '0'

bit 4-3 UPDTRG[1:0]: Update Trigger Select bits

11 = A write of the PGxTRIGA register automatically sets the UPDATE bit

10 = A write of the PGxPHASE register automatically sets the UPDATE bit

01 = A write of the PGxDC register automatically sets the UPDATE bit

00 = User must set the UPDREQ bit (PGxSTAT[4]) manually

bit 2-0 PGTRGSEL[2:0]: PWM Generator Trigger Output Selection bits ^(1)

111 = Reserved

110 = Reserved

101 = Reserved

100 = Reserved

011 = PGxTRIGC compare event is the PWM Generator trigger

010 = PGxTRIGB compare event is the PWM Generator trigger

001 = PGxTRIGA compare event is the PWM Generator trigger

000 = EOC event is the PWM Generator trigger

Note 1: These events are derived from the internal PWM Generator time base comparison events.

REGISTER 9-20: PGxEVTH: PWM GENERATOR x EVENT REGISTER HIGH

R/W-0 R/W-0 R/W-0 R/W-0 U-0 U-0 R/W-0 R/W-0
FLTIEN^(1) CLIEN^(2) FFIEN^(3) SIEN^(4) — — IEVTSEL1 IEVTSEL0
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
ADTR2EN3ADTR2EN2ADTR2EN1ADTR1OFS4ADTR1OFS3ADTR1OFS2ADTR1OFS1ADTR1OFS0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15 FLTIEN: PCI Fault Interrupt Enable bit ^(1)

1 = Fault interrupt is enabled

0 = Fault interrupt is disabled

bit 14 CLIEN: PCI Current-Limit Interrupt Enable bit ^(2)

1 = Current-limit interrupt is enabled

0 = Current-limit interrupt is disabled

bit 13 FFIEN: PCI Feed-Forward Interrupt Enable bit ^(3)

1 = Feed-forward interrupt is enabled

0 = Feed-forward interrupt is disabled

bit 12 SIEN: PCI Sync Interrupt Enable bit ^(4)

1 = Sync interrupt is enabled

0 = Sync interrupt is disabled

bit 11-10 Unimplemented: Read as '0'

bit 9-8 IEVTSEL[1:0]: Interrupt Event Selection bits

11 = Time base interrupts are disabled (Sync, Fault, current-limit and feed-forward events can be independently enabled)

10 = Interrupts CPU at ADC Trigger 1 event

01 = Interrupts CPU at TRIGA compare event

00 = Interrupts CPU at EOC

bit 7 ADTR2EN3: ADC Trigger 2 Source is PGxTRIGC Compare Event Enable bit

1 = PGxTRIGC register compare event is enabled as trigger source for ADC Trigger 2

0 = PGxTRIGC register compare event is disabled as trigger source for ADC Trigger 2

bit 6 ADTR2EN2: ADC Trigger 2 Source is PGxTRIGB Compare Event Enable bit

1 = PGxTRIGB register compare event is enabled as trigger source for ADC Trigger 2

0 = PGxTRIGB register compare event is disabled as trigger source for ADC Trigger 2

bit 5 ADTR2EN1: ADC Trigger 2 Source is PGxTRIGA Compare Event Enable bit

1 = PGxTRIGA register compare event is enabled as trigger source for ADC Trigger 2

0 = PGxTRIGA register compare event is disabled as trigger source for ADC Trigger 2

Note 1: An interrupt is only generated on the rising edge of the PCI Fault active signal.

2: An interrupt is only generated on the rising edge of the PCI current-limit active signal.

3: An interrupt is only generated on the rising edge of the PCI feed-forward active signal.

4: An interrupt is only generated on the rising edge of the PCI Sync active signal.

REGISTER 9-20: PGxEVTH: PWM GENERATOR x EVENT REGISTER HIGH (CONTINUED)

bit 4-0 ADTR1OFS[4:0]: ADC Trigger 1 Offset Selection bits

11111 = Offset by 31 trigger events

...

00010 = Offset by 2 trigger events

00001 = Offset by 1 trigger event

00000 = No offset

Note 1: An interrupt is only generated on the rising edge of the PCI Fault active signal.

2: An interrupt is only generated on the rising edge of the PCI current-limit active signal.

3: An interrupt is only generated on the rising edge of the PCI feed-forward active signal.

4: An interrupt is only generated on the rising edge of the PCI Sync active signal.

REGISTER 9-21: PGxLEBL: PWM GENERATOR x LEADING-EDGE BLANKING REGISTER LOW

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
LEB[15:8]
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R-0R-0R-0
LEB[7:0]^(1)
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 cleared x = Bit is unknown

bit 15-0 LEB[15:0]: Leading-Edge Blanking Period bits ^(1)

Note 1: Bits[2:0] are read-only and always remain as '0'.

REGISTER 9-22: PGxLEBH: PWM GENERATOR x LEADING-EDGE BLANKING REGISTER HIGH

U-0 U-0 U-0 U-0 U-0 R/W-0 R/W-0 R/W-0
— — —— — PWMPCI[2:0](1)
bit 15 bit 8
U-0U-0U-0U-0R/W-0R/W-0R/W-0R/W-0
— — —— PHR PHFPLRPLF
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-11 Unimplemented: Read as '0'

bit 10-8 PWMPCI[2:0]: PWM Source for PCI Selection bits ^(1)

111 = PWM Generator #8 output is made available to PCI logic
110 = PWM Generator #7 output is made available to PCI logic
101 = PWM Generator #6 output is made available to PCI logic
100 = PWM Generator #5 output is made available to PCI logic
011 = PWM Generator #4 output is made available to PCI logic
010 = PWM Generator #3 output is made available to PCI logic
001 = PWM Generator #2 output is made available to PCI logic
000 = PWM Generator #1 output is made available to PCI logic

bit 7-4 Unimplemented: Read as '0'

bit 3 PHR: PWMxH Rising bit

1 = Rising edge of PWMxH will trigger the LEB duration counter
0 = LEB ignores the rising edge of PWMxH

bit 2 PHF: PWMxH Falling bit

1 = Falling edge of PWMxH will trigger the LEB duration counter
0 = LEB ignores the falling edge of PWMxH

bit 1 PLR: PWMxL Rising bit

1 = Rising edge of PWMxL will trigger the LEB duration counter
0 = LEB ignores the rising edge of PWMxL

bit 0 PLF: PWMxL Falling bit

1 = Falling edge of PWMxL will trigger the LEB duration counter
0 = LEB ignores the falling edge of PWMxL

Note 1: The selected PWM Generator source does not affect the LEB counter. This source can be optionally used as a PCI input, PCI qualifier, PCI terminator or PCI terminator qualifier (see the description in Register 9-17 and Register 9-18 for more information).

REGISTER 9-23: PGxPHASE: PWM GENERATOR x PHASE REGISTER

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PGxPHASE[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PGxPHASE[7:0]
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown

bit 15-0 PGxPHASE[15:0]: PWM Generator x Phase Register bits

REGISTER 9-24: PGxDC: PWM GENERATOR x DUTY CYCLE REGISTER

R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
PGxDC[15:8]
bit 15bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
PGxDC[7:0]
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-0 PGxDC[15:0]: PWM Generator x Duty Cycle Register bits

REGISTER 9-25: PGxDCA: PWM GENERATOR x DUTY CYCLE ADJUSTMENT REGISTER

U-0 U-0 U-0 U-0 U-0 U-0 U-0
————
bit 15bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
PGxDCA[7:0]
bit 7bit 0

Legend:

R = Readable bit W = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 15-8 Unimplemented: Read as '0'

bit 7-0 PGxDCA[7:0]: PWM Generator x Duty Cycle Adjustment Value bits

Depending on the state of the selected PCI source, the PGxDCA value will be added to the value in the PGxDC register to create the effective duty cycle. When the PCI source is active, PGxDCA is added. When the PCI source is inactive, no adjustment is made. Duty cycle adjustment is disabled when PGxDCA[7:0] = 0. The PCI source is selected using the DTCMPSEL bit.

REGISTER 9-26: PGxPER: PWM GENERATOR x PERIOD REGISTER

R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
PGxPER[15:8](1)
bit 15bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
PGxPER[7:0](1)
bit 7bit 0

Legend:

R = Readable bit W = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 15-0 PGxPER[15:0]: PWM Generator x Period Register bits ^(1)

Note 1: Period values less than '0x0010' should not be selected.

REGISTER 9-27: PGxTRIGA: PWM GENERATOR x TRIGGER A REGISTER

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PGxTRIGA[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PGxTRIGA[7:0]
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 15-0 PGxTRIGA[15:0]: PWM Generator x Trigger A Register bits

REGISTER 9-28: PGxTRIGB: PWM GENERATOR x TRIGGER B REGISTER

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PGxTRIGB[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PGxTRIGB[7:0]
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown

bit 15-0 PGxTRIGB[15:0]: PWM Generator x Trigger B Register bits

REGISTER 9-29: PGxTRIGC: PWM GENERATOR x TRIGGER C REGISTER

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PGxTRIGC[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PGxTRIGC[7:0]
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown

bit 15-0 PGxTRIGC[15:0]: PWM Generator x Trigger C Register bits

REGISTER 9-30: PGxDTL: PWM GENERATOR x DEAD-TIME REGISTER LOW

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
— — DTL[13:8](1)
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
DTL[7:0]
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 cleared x = Bit is unknown

bit 15-14 Unimplemented: Read as '0'

bit 13-0 DTL[13:0]: PWMxL Dead-Time Delay bits ^(1)

Note 1: DTL[13:11] bits are not available when HREN (PGxCONL[7]) = 0.

REGISTER 9-31: PGxDTH: PWM GENERATOR x DEAD-TIME REGISTER HIGH

U-0 U-0 R/W-0 R/W-0 R/W-0R/W-0 R/W-0 R/W-0
DTH[13:8]^(1)
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
DTH[7:0]
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 cleared x = Bit is unknown

bit 15-14 Unimplemented: Read as '0'

bit 13-0 DTH[13:0]: PWMxH Dead-Time Delay bits ^(1)

Note 1: DTH[13:11] bits are not available when HREN (PGxCONL[7]) = 0.

REGISTER 9-32: PGxCAP: PWM GENERATOR x CAPTURE REGISTER

R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
PGxCAP[15:8]
bit 15 bit 8
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
PGxCAP[7:0](1)
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR

'1' = Bit is set

'0' = Bit is cleared

x = Bit is unknown

bit 15-0 PGxCAP[15:0]: PGx Time Base Capture bits ^(1)

Note 1: A capture event can be manually initiated in software by writing a '1' to PGxCAP[0]. The CAP bit (PGxSTAT[5]) will indicate when a new capture value is available. A read of PGxCAP will automatically clear the CAP bit and allow a new capture event to occur. PGxCAP[1:0] will always read as '0'. In High-Resolution mode, PGxCAP[4:0] will always read as '0'.

10.0 CAPTURE/COMPARE/PWM/TIMER MODULES (SCCP)

Note 1: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive reference source. For more information on the MCCP/SCCP modules, refer to “Capture/Compare/PWM/Timer (MCCP and SCCP)” (www.microchip.com/DS30003035).

2: The SCCP is identical for both Main core and Secondary core. The x is common for both Main and Secondary (where the x represents the number of the specific module being addressed).

3: All associated register names are the same on the Main core and the Secondary core. The Secondary code will be developed in a separate project in MPLAB X IDE with the device selection dsPIC33CH128MP508S1, where S1 indicates the Secondary device. The Main SCCP modules are SCCP1, SCCP2, SCCP3, SCCP4, SSCCP5, SCCP6, SCCP7 and SCCP8. The Secondary SCCP modules are SCCP1, SCCP2, SCCP3 and SCCP4.

Table 10-1 shows an overview of the SCCP module.
TABLE 10-1: SCCP MODULE OVERVIEW

Number of SCCP ModulesIdentical (Modules)
Main Core 8 Yes
Secondary Core 4Yes

dsPIC33CH128MP508 family devices include several Capture/Compare/PWM/Timer base modules, which provide the functionality of three different peripherals from earlier PIC24F devices. The module can operate in one of three major modes:

  • General Purpose Timer
  • Input Capture
  • Output Compare/PWM

Single CCP (SCCP) output modules provide only one PWM output.

The SCCP module can be operated only in one of the three major modes at any time. The other modes are not available unless the module is reconfigured for the new mode.

A conceptual block diagram for the module is shown in Figure 10-1. All three modes share a time base generator and a common Timer register pair (CCPxTMRH/L); other shared hardware components are added as a particular mode requires.

Each module has a total of six control and status registers:

  • CCPxCON1L (Register 10-1)
  • CCPxCON1H (Register 10-2)
  • CCPxCON2L (Register 10-3)
    • CCPxCON2H (Register 10-4)
    • CCPxCON3H (Register 10-5)
    • CCPxSTATL (Register 10-6)

Each module also includes eight buffer/counter registers that serve as Timer Value registers or data holding buffers:

  • CCPxTMRH/CCPxTMRL (CCPx Timer High/Low Counters)
  • CCPxPRH/CCPxPRL (CCPx Timer Period High/Low)
  • CCPxRA (CCPx Primary Output Compare Data Buffer)
  • CCPxRB (CCPx Secondary Output Compare Data Buffer)
  • CCPxBUFH/CCPxBUFL (CCPx Input Capture High/Low Buffers)

FIGURE 10-1: SCCPx CONCEPTUAL BLOCK DIAGRAM
Microchip dsPIC33CH64MP208 - CAPTURE/COMPARE/PWM/TIMER MODULES (SCCP) - 1

flowchart
graph TD
    A["Clock Sources"] --> B["Time Base Generator"]
    C["External Capture Input"] --> D["Input Capture"]
    D --> E["CCPS TMRH/L"]
    E --> F["Output Compare/PWM"]
    F --> G["Compare/PWM Output(s)"]
    G --> H["OCFA/OCFB"]
    H --> I["Output Compare/PWM"]
    I --> J["16/32-Bit Timer"]
    J --> K["Clock Sources"]
    style A fill:#f9f,stroke:#333
    style C fill:#f9f,stroke:#333
    style D fill:#ccf,stroke:#333
    style E fill:#cfc,stroke:#333
    style F fill:#fcc,stroke:#333
    style G fill:#cff,stroke:#333
    style H fill:#ffc,stroke:#333
    style I fill:#fcf,stroke:#333
    style J fill:#cff,stroke:#333
    style K fill:#ffc,stroke:#333

10.1 Time Base Generator

The Timer Clock Generator (TCG) generates a clock for the module's internal time base, using one of the clock signals already available on the microcontroller. This is used as the time reference for the module in its three major modes. The internal time base is shown in Figure 10-2.

There are eight inputs available to the clock generator, which are selected using the CLKSEL[2:0] bits (CCPxCON1L[10:8]). Available sources include the FRC and LPRC, the Secondary Oscillator and the TCLKI External Clock inputs. The system clock is the default source (CLKSEL[2:0] = 000).

FIGURE 10-2: TIMER CLOCK GENERATOR
Microchip dsPIC33CH64MP208 - Time Base Generator - 1

flowchart
graph LR
    A["Clock Sources"] --> B["Prescaler"]
    C["CLKSEL[2:0"]] --> B
    B --> D["Clock Synchronizer"]
    E["TMRPS[1:0"]] --> B
    F["TMRSYNC"] --> D
    G["SSDG"] --> D
    D --> H["Gate(1)"]
    H --> I["To Rest of Module"]

10.2 General Purpose Timer

Timer mode is selected when CCSEL = 0 and MOD[3:0] = 0000. The timer can function as a 32-bit timer or a dual 16-bit timer, depending on the setting of the T32 bit (Table 10-2).

Dual 16-Bit Timer mode provides a simple timer function with two independent 16-bit timer/counters. The primary timer uses CCPxTMRL and CCPxPRL. Only the primary timer can interact with other modules on the device. It generates the SCCPx sync out signals for use by other SCCP modules. It can also use the SYNC[4:0] bits signal generated by other modules.

The secondary timer uses CCPxTMRH and CCPxPRH. It is intended to be used only as a periodic interrupt source for scheduling CPU events. It does not generate an output sync/trigger signal like the primary time base. In Dual Timer mode, the CCPx Secondary Timer Period register, CCPxPRH, generates the SCCP compare event (CCPxIF) used by many other modules on the device.

The 32-Bit Timer mode uses the CCPxTMRL and CCPxTMRH registers, together, as a single 32-bit timer. When CCPxTMRL overflows, CCPxTMRH increments by one. This mode provides a simple timer function when it is important to track long time periods. Note that the T32 bit (CCPxCON1L[5]) should be set before the CCPxTMRL or CCPxPRH registers are written to initialize the 32-bit timer.

In both 16-bit and 32-bit modes, the timer can also function in either synchronization ("sync") or trigger operation. Both use the SYNC[4:0] bits (CCPxCON1H[4:0]) to determine the input signal source. The difference is how that signal affects the timer.

In sync operation, the timer Reset or clear occurs when the input selected by SYNC[4:0] is asserted. The timer immediately begins to count again from zero unless it is held for some other reason. Sync operation is used whenever the TRIGEN bit (CCPxCON1H[7]) is cleared. SYNC[4:0] can have any value, except '11111'.

In trigger operation, the timer is held in Reset until the input selected by SYNC[4:0] is asserted; when it occurs, the timer starts counting. Trigger operation is used whenever the TRIGEN bit is set. In Trigger mode, the timer will continue running after a trigger event as long as the CCPTRIG bit (CCPxSTATL[7]) is set. To clear CCPTRIG, the TRCLR bit (CCPxSTATL[5]) must be set to clear the trigger event, reset the timer and hold it at zero until another trigger event occurs. On dsPIC33CH128MP508 family devices, trigger operation can only be used when the system clock is the time base source (CLKSEL[2:0] = 000).

FIGURE 10-3: DUAL 16-BIT TIMER MODE
Microchip dsPIC33CH64MP208 - General Purpose Timer - 1

flowchart
graph TD
    A["SYNC[4:0"]] --> B["Sync/Trigger Control"]
    C["Clock Sources"] --> D["Time Base Generator"]
    B --> E["Comparator"]
    D --> F["Comparator"]
    E --> G["CCPxTMRL"]
    F --> H["CCPxRB"]
    G --> I["CCPxTMRH"]
    H --> J["Comparator"]
    I --> K["CCPxPRH"]
    L["CCPxPRL"] --> M["Comparator"]
    N["CCPxTRM"] --> O["Comparator"]
    P["CCPxRB"] --> Q["Comparator"]
    R["CCPxIF"] --> S["Set CCTxIF"]

FIGURE 10-4: 32-BIT TIMER MODE
Microchip dsPIC33CH64MP208 - General Purpose Timer - 2

flowchart
graph TD
    A["SYNC[4:0"]] --> B["Sync/ Trigger Control"]
    C["Clock Sources"] --> D["Time Base Generator"]
    D --> E["CCPxTMRH"]
    D --> F["CCPxTMRL"]
    E --> G["Comparator"]
    F --> G
    G --> H["Set CCTxIF"]
    I["CCPxPRH"] --> G
    J["CCPxPRL"] --> G

10.3 Output Compare Mode

Output Compare mode compares the Timer register value with the value of one or two Compare registers, depending on its mode of operation. The Output Compare x module, on compare match events, has the ability to generate a single output transition or a train of

output pulses. Like most PIC ^® MCU peripherals, the Output Compare x module can also generate interrupts on a compare match event.

Table 10-3 shows the various modes available in Output Compare modes.

TABLE 10-3: OUTPUT COMPARE x/PWMx MODES

MOD[3:0](CCPxCON1L[3:0])T32(CCPxCON1L[5])Operating Mode
0001 0 Output High on Compare (16-bit)Single Edge Mode
0001 1 Output High on Compare (32-bit)
0010 0 Output Low on Compare (16-bit)
0010 1 Output Low on Compare (32-bit)
0011 0 Output Toggle on Compare (16-bit)
0011 1 Output Toggle on Compare (32-bit)
0100 0 Dual Edge Compare (16-bit) Dual Edge Mode
01010Dual Edge Compare (16-bit buffered)PWM Mode

FIGURE 10-5: OUTPUT COMPARE x BLOCK DIAGRAM
Microchip dsPIC33CH64MP208 - Output Compare Mode - 1

flowchart
graph TD
    A["CCPxCON1H/L"] --> B["Comparator"]
    C["CCPxCON2H/L"] --> B
    D["CCPxCON3H"] --> B
    B --> E["CCPxPRL"]
    E --> F["Comparator"]
    G["CCPxRA"] --> H["CCPxRA Buffer"]
    H --> I["Comparator"]
    I --> J["CCPxTMRH/L"]
    J --> K["Comparator"]
    K --> L["CCPxRB Buffer"]
    L --> M["CCPxRB"]
    M --> N["Fault Logic"]
    O["OCx Clock Sources"] --> P["Time Base Generator"]
    Q["Trigger and Sync Sources"] --> R["Trigger and Sync Logic"]
    S["Reset"] --> R
    T["Reset"] --> R
    U["Match Event"] --> J
    V["Match Event"] --> K
    W["Edge Detect"] --> J
    X["Output Compare Interrupt"] --> N
    Y["OCFA/OCFB"] --> N
    Z["CCPx Pin(s)"] --> AA["Fault Logic"]
    AB["Rollover/Reset"] --> I
    AC["Lollover"] --> J

10.4 Input Capture Mode

Input Capture mode is used to capture a timer value from an independent timer base, upon an event, on an input pin or other internal trigger source. The input capture features are useful in applications requiring frequency (time period) and pulse measurement. Figure 10-6 depicts a simplified block diagram of Input Capture mode.

Input Capture mode uses a dedicated 16/32-bit, synchronous, up counting timer for the capture function. The timer value is written to the FIFO when a capture event occurs. The internal value may be read (with a synchronization delay) using the CCPxTMRH/L register.

To use Input Capture mode, the CCSEL bit (CCPxCON1L[4]) must be set. The T32 and the MOD[3:0] bits are used to select the proper Capture mode, as shown in Table 10-4.

TABLE 10-4: INPUT CAPTURE x MODES

MOD[3:0](CCPxCON1L[3:0])T32(CCPxCON1L[5])Operating Mode
0000 0 Edge Detect (16-bit capture)
0000 1 Edge Detect (32-bit capture)
0001 0 Every Rising (16-bit capture)
0001 1 Every Rising (32-bit capture)
0010 0 Every Falling (16-bit capture)
0010 1 Every Falling (32-bit capture)
0011 0Every Rising/Falling (16-bit capture)
0011 1Every Rising/Falling (32-bit capture)
0100 0Every 4th Rising (16-bit capture)
0100 1Every 4th Rising (32-bit capture)
0101 0Every 16th Rising (16-bit capture)
0101 1Every 16th Rising (32-bit capture)

FIGURE 10-6: INPUT CAPTURE x BLOCK DIAGRAM
Microchip dsPIC33CH64MP208 - Input Capture Mode - 1

flowchart
graph TD
    A["ICx Clock Sources"] --> B["Clock Select"]
    C["Trigger and Sync Sources"] --> D["Trigger and Sync Logic"]
    B --> E["Edge Detect Logic and Clock Synchronizer"]
    D --> F["Reset"]
    E --> G["Increment"]
    F --> H["CCPxTMRH/L"]
    H --> I["T32"]
    I --> J["4-Level FIFO Buffer"]
    J --> K["CCPxBUFx"]
    K --> L["System Bus"]
    M["ICS[2:0"]] --> B
    N["MOD[3:0"]] --> E
    O["OPS[3:0"]] --> G
    P["Set CCPxIF"] --> J
    Q["16"] --> J
    R["16"] --> K

10.5 Auxiliary Output

The SCCPx modules have an auxiliary (secondary) output that provides other peripherals access to internal module signals. The auxiliary output is intended to connect to other SCCP modules, or other digital peripherals, to provide these types of functions:

• Time Base Synchronization
• Peripheral Trigger and Clock Inputs
- Signal Gating

The type of output signal is selected using the AUXOUT[1:0] control bits (CCPxCON2H[4:3]). The type of output signal is also dependent on the module operating mode.

TABLE 10-5: AUXILIARY OUTPUT

AUXOUT[1:0] CCSEL MOD[3:0] Comments Signal Description
00xxxxxAuxiliary output disabledNo Output
0100000Time Base modesTime Base Period Reset or Rollover
10Special Event Trigger Output
11No Output
01 0 0001through 1111Output Compare modesTime Base Period Reset or Rollover
10Output Compare Event Signal
11Output Compare Signal
011xxxxInput Capture modesTime Base Period Reset or Rollover
10Reflects the Value of the ICDIS bit
11Input Capture Event Signal

10.6 SCCP Control/Status Registers

REGISTER 10-1: CCPxCON1L: CCPx CONTROL 1 LOW REGISTERS

R/W-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CCPON— CCPSIDL CCPSLPTMRSYNC CLKKSEL2(1)CLKSEL1(1)CLKSEL0(1)
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
TMRPS1 TMRPS0 T32 CCSEL MOD3 MOD2 MOD1 MOD0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15 CCPON: CCPx Module Enable bit

1 = Module is enabled with an operating mode specified by the MOD[3:0] control bits 0 = Module is disabled

bit 14 Unimplemented: Read as '0'

bit 13 CCPSIDL: CCPx Stop in Idle Mode bit

1 = Discontinues module operation when device enters Idle mode 0 = Continues module operation in Idle mode

bit 12 CCPSLP: CCPx Sleep Mode Enable bit

1 = Module continues to operate in Sleep modes 0 = Module does not operate in Sleep modes

bit 11 TMRSYNC: Time Base Clock Synchronization bit

1 = Asynchronous module time base clock is selected and synchronized to the internal system clocks (CLKSEL[2:0] ≠ 000) 0 = Synchronous module time base clock is selected and does not require synchronization (CLKSEL[2:0] = 000)

bit 10-8 CLKSEL[2:0]: CCPx Time Base Clock Select bits ^(1)

111 = External T1CK input 110 = Secondary CLC2 101 = Secondary CLC1 100 = Main CLC2 011 = Main CLC1 010 = Fosc 001 = Reference Clock (RB) 000 = Fosc/2 (FP)

bit 7-6 TMRPS[1:0]: Time Base Prescale Select bits

11 = 1:64 Prescaler 10 = 1:16 Prescaler 01 = 1:4 Prescaler 00 = 1:1 Prescaler

bit 5 T32: 32-Bit Time Base Select bit

1 = Uses 32-bit time base for timer, single edge output compare or input capture function 0 = Uses 16-bit time base for timer, single edge output compare or input capture function

Note 1: Clock selection is the same for the Main and the Secondary.

2: Not available in SCCP instances 1-8.

REGISTER 10-1: CCPxCON1L: CCPx CONTROL 1 LOW REGISTERS (CONTINUED)

bit 4 CCSEL: Capture/Compare Mode Select bit

1 = Input Capture peripheral
0 = Output Compare/PWM/Timer peripheral (exact function is selected by the MOD[3:0] bits)

bit 3-0 MOD[3:0]: CCPx Mode Select bits

For CCSEL = 1 (Input Capture modes):

1xxx = Reserved

011x = Reserved

0101 = Capture every 16th rising edge

0100 = Capture every 4th rising edge

0011 = Capture every rising and falling edge

0010 = Capture every falling edge

0001 = Capture every rising edge

0000 = Capture every rising and falling edge (Edge Detect mode)

For CCSEL = 0 (Output Compare/Timer modes):

1111 = External Input mode: Pulse generator is disabled, source is selected by ICS[2:0]

1110 = Reserved

110x = Reserved

10xx = Reserved

0111 = Reserved

0110 = Center-aligned PWM mode ^(2)

0101 = Dual Edge Compare mode, buffered

0001 = 16-Bit/32-Bit Single Edge mode, drives output high on compare match

0000 = 16-Bit/32-Bit Timer mode, output functions are disabled

Note 1: Clock selection is the same for the Main and the Secondary.

2: Not available in SCCP instances 1-8.

REGISTER 10-2: CCPxCON1H: CCPx CONTROL 1 HIGH REGISTERS

R/W-0 R/W-0 U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0
OPSSRC(1)RTRGEN(2)— — OPS3(3)OPS2(3)OPS1(3)OPS0(3)
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
TRIGENONESHOTALTSYNCSYNC4SYNC3SYNC2SYNC1SYNC0
bit 7 bit 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 OPSSRC: Output Postscaler Source Select bit ^(1) 1 = Output postscaler scales module trigger output events

0 = Output postscaler scales time base interrupt events

bit 14 RTRGEN: Retrigger Enable bit ^(2) 1 = Time base can be retriggered when TRIGEN bit = 1 0 = Time base may not be retriggered when TRIGEN bit = 1

bit 13-12 Unimplemented: Read as '0'

bit 11-8 OPS3[3:0]: CCPx Interrupt Output Postscale Select bits ^(3) 1111 = Interrupt every 16th time base period match

1110 = Interrupt every 15th time base period match

...

0100 = Interrupt every 5th time base period match

0011 = Interrupt every 4th time base period match or 4th in

0010 = Interrupt every 3rd time base period match or 3rd in

0001 = Interrupt every 2nd time base period match or 2nd

0000 = Interrupt after each time base period match or input

bit 7 TRIGEN: CCPx Trigger Enable bit 1 = Trigger operation of time base is enabled 0 = Trigger operation of time base is disabled

bit 6 ONESHOT: One-Shot Trigger Mode Enable bit 1 = One-Shot Trigger mode is enabled; trigger duration is set by OSCNT[2:0] 0 = One-Shot Trigger mode is disabled

bit 5 ALTSYNC: CCPx Alternate Synchronization Output Signal Select bit 1 = An alternate signal is used as the module synchronization output signal 0 = The module synchronization output signal is the Time Base Reset/rollover event

bit 4-0 SYNC[4:0]: CCPx Synchronization Source Select bits See Table 10-6 and Table 10-7 for the definition of inputs.

Note 1: This control bit has no function in Input Capture modes.

2: This control bit has no function when TRIGEN = 0.

3: Output postscale settings, from 1:5 to 1:16 (0100-1111), will result in a FIFO buffer overflow for Input Capture modes.

TABLE 10-6: SYNCHRONIZATION SOURCES (MAIN)

SYNC[4:0] Synchronization Source
00000 None; Timer with Rollover on CCPxPR Match or FFFFh
00001 Module's Own Timer Sync Out
00010 Sync Output SCCP1
00011 Sync Output SCCP2
00100 Sync Output SCCP3
00101 Sync Output SCCP4
00110 Sync Output SCCP5
00111 Sync Output SCCP6
01000 Sync Output SCCP7
01001 INT0
01010 INT1
01011 INT2
01100-01111 Reserved
10000 Main CLC1 Output
10001 Main CLC2 Output
10010 Secondary CLC1 Output
10011 Secondary CLC2 Output
10100-10110 Reserved
10111 Comparator 1 Output
11000 Secondary Comparator 1 Output
11001 Secondary Comparator 2 Output
11010 Secondary Comparator 3 Output
11011-11110 Reserved
11111None; Timer with Auto-Rollover (FFFFh → 0000h)

TABLE 10-7: SYNCHRONIZATION SOURCES (SECONDARY)

SYNC[4:0] Synchronization Source
00000 None; Timer with Rollover on CCPxPR Match or FFFFh
00001 Module's Own Timer Sync Out
00010 Sync Output SCCP1
00011 Sync Output SCCP2
00100 Sync Output SCCP3
00101 Sync Output SCCP4
00110-01000 Reserved
01001 INT0
01010 INT1
01011 INT2
01100-01111 Reserved
10000 Main CLC1 Output
10001 Main CLC2 Output
10010 Secondary CLC1 Output
10011 Secondary CLC2 Output
10100-10110 Reserved
10111 Main Comparator 1 Output
11000 Secondary Comparator 1 Output
11001 Secondary Comparator 2 Output
11010 Secondary Comparator 3 Output
11011-11110 Reserved
11111None; Timer with Auto-Rollover (FFFFh → 0000h)

REGISTER 10-3: CCPxCON2L: CCPx CONTROL 2 LOW REGISTERS

R/W-0 R/W-0 U-0 R/W-0 U-0 U-0 U-0 U-0
PWMRSEN ASDGM— SSDG — — — —
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
ASDG[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15 PWMRSEN: CCPx PWM Restart Enable bit

1 = ASEVT bit clears automatically at the beginning of the next PWM period, after the shutdown input has ended
0 = ASEVT bit must be cleared in software to resume PWM activity on output pins

bit 14 ASDGM: CCPx Auto-Shutdown Gate Mode Enable bit

1 = Waits until the next Time Base Reset or rollover for shutdown to occur
0 = Shutdown event occurs immediately

bit 13 Unimplemented: Read as '0'

bit 12SSDG: CCPx Software Shutdown/Gate Control bit
1 = Manually forces auto-shutdown, timer clock gate or input capture signal gate event (setting of ASDGM bit still applies)
0 = Normal module operation

bit 11-8 Unimplemented: Read as '0'

bit 7-0ASDG[7:0]: CCPx Auto-Shutdown/Gating Source Enable bits1 = ASDGx Source n is enabled (see Table 10-8 and Table 10-9 for auto-shutdown/gating sources)0 = ASDGx Source n is disabled

TABLE 10-8: AUTO-SHUTDOWN AND GATING SOURCES (MAIN)

ASDG[x]BitAuto-Shutdown/Gating Source
SCCP1 SCCP2 SCCP3 SCCP4 SCCP5 SCCP6 SCCP7 SCCP8
0 MainComparator 1 Output
1 Secondary Comparator 1 Output
2 Secondary Comparator 2 Output
3 Secondary Comparator 3 Output
4MICM1(1)aMainICM2(1)i Main nICM3(1)MainICM4(1)MainICM5(1)MainICM6(1)MainICM7(1)MainICM8(1)
5 MainCLC1 (1)
6M (1) a
7M (1) a

Note 1: Selected by Peripheral Pin Select (PPS).

TABLE 10-9: AUTO-SHUTDOWN AND GATING SOURCES (SECONDARY)

ASDG[x] BitAuto-Shutdown/Gating Source
SCCP1SCCP2SCCP3SCCP4
0 MainComparator 1 Output
1 Secondary Comparator 1 Output
2 Secondary Comparator 2 Output
3 Secondary Comparator 3 Output
4Secondary ICM1(1)Secondary ICM2(1)Secondary ICM3(1)Secondary ICM4(1)
5Secondary CLC1(1)
6Secondary OCFA(1)
7Secondary OCFB(1)

Note 1: Selected by Peripheral Pin Select (PPS).

REGISTER 10-4: CCPxCON2H: CCPx CONTROL 2 HIGH REGISTERS

R/W-0 U-0 U-0 U-0 U-0 U-0 R/W-0
OENSYNC———— OCAEN
bit 15 bit 8
R/W-0 R/W-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
ICGSM1 ICGSM0— AUXOUT1 AUXOUT0 ICS2(1)ICS1(1)ICS0(1)
bit 7 bit 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 15OENSYNC: Output Enable Synchronization bit1 = Update by output enable bits occurs on the next Time Base Reset or rollover0 = Update by output enable bits occurs immediately
bit 14-9Unimplemented: Read as '0'
bit 8OCAEN: Output Enable/Steering Control bit1 = OCx pin is controlled by the CCPx module and produces an output compare or PWM signal0 = OCx pin is not controlled by the CCPx module; the pin is available to the port logic or another peripheral multiplexed on the pin
bit 7-6ICGSM[1:0]: Input Capture Gating Source Mode Control bits11 = Reserved10 = One-Shot mode: Falling edge from gating source disables future capture events (ICDIS = 1)01 = One-Shot mode: Rising edge from gating source enables future capture events (ICDIS = 0)00 = Level-Sensitive mode: A high level from gating source will enable future capture events; a low level will disable future capture events
bit 5Unimplemented: Read as '0'
bit 4-3AUXOUT[1:0]: Auxiliary Output Signal on Event Selection bits11 = Input capture or output compare event; no signal in Timer mode10 = Signal output is defined by module operating mode (see Table 10-5)01 = Time base rollover event (all modes)00 = Disabled
bit 2-0ICS[2:0]: Input Capture Source Select bits(1)111 = Secondary CLC2 output110 = Secondary CLC1 output101 = Main CLC2 output100 = Main CLC1 output011 = Secondary Comparator 2 output010 = Secondary Comparator 1 output001 = Main Comparator 1 output000 = SCCP Input Capture x (ICx) pin (PPS)

Note 1: Common for both the Main and the Secondary.

REGISTER 10-5: CCPxCON3H: CCPx CONTROL 3 HIGH REGISTERS

R/W-0 R/W-0 R/W-0 R/W-0 U-0 U-0 U-0 U-0
OETRIG O$CNT2 OSCNT1 OSCNT0— — —
bit 15 bit 8
U-0 U-0 R/W-0 U-0 R/W-0 R/W-0 U-0 U-0
— —POLACE— PSSACE1 PSSACE0 — —
bit 7 bit 0
Legend:
R = Readable bit W = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 15 OETRIG: Output Enable on Trigger Control bit 1 = For Triggered mode (TRIGEN = 1): Module does not drive enabled output pins until triggered 0 = Normal output pin operation

bit 14-12 OSCNT[2:0]: One-Shot Event Count bits 111 = Extends one-shot event by seven time base periods (eight time base periods total) 110 = Extends one-shot event by six time base periods (seven time base periods total) 101 = Extends one-shot event by five time base periods (six time base periods total) 100 = Extends one-shot event by four time base periods (five time base periods total) 011 = Extends one-shot event by three time base periods (four time base periods total) 010 = Extends one-shot event by two time base periods (three time base periods total) 001 = Extends one-shot event by one time base period (two time base periods total) 000 = Does not extend one-shot trigger event

bit 11-6 Unimplemented: Read as '0' bit 5 POLACE: CCPx Output Pin OCxA Polarity Control bit 1 = Output pin polarity is active low 0 = Output pin polarity is active high

bit 4 Unimplemented: Read as '0' bit 3-2 PSSACE[1:0]: PWMx Output Pin OCxA Shutdown State Control bits 11 = Pin is driven active when a shutdown event occurs 10 = Pin is driven inactive when a shutdown event occurs 0x = Pin is in high-impedance state when a shutdown event occurs

bit 1-0 Unimplemented: Read as '0'

REGISTER 10-6: CCPxSTATL: CCPx STATUS REGISTER

U-0 U-0 U-0 U-0 U-0 U-0 U-0 U-0
——————
bit 15 bit 8
R-0 W1-0 W1-0 R/C-0 R/C-0 R/C-0 R/C-0 R/C-0
CCPTRIGTRSETTRCLRASEVTSCEVTICDISICOVICBNE
bit 7 bit 0
Legend:C = Clearable bit
R = Readable bitW1 = Write ‘1’ Only bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown

bit 15-8 Unimplemented: Read as '0'

bit 7 CCPTRIG: CCPx Trigger Status bit

1 = Timer has been triggered and is running
0 = Timer has not been triggered and is held in Reset

bit 6 TRSET: CCPx Trigger Set Request bit

Writes '1' to this location to trigger the timer when TRIGEN = 1 (location always reads as '0').

bit 5 TRCLR: CCPx Trigger Clear Request bit

Writes '1' to this location to cancel the timer trigger when TRIGEN = 1 (location always reads as '0').

bit 4 ASEVT: CCPx Auto-Shutdown Event Status/Control bit

1 = A shutdown event is in progress; CCPx outputs are in the shutdown state
0 = CCPx outputs operate normally

bit 3 SCEVT: Single Edge Compare Event Status bit

1 = A single edge compare event has occurred
0 = A single edge compare event has not occurred

bit 2 ICDIS: Input Capture x Disable bit

1 = Event on Input Capture x pin (ICx) does not generate a capture event
0 = Event on Input Capture x pin will generate a capture event

bit 1 ICOV: Input Capture x Buffer Overflow Status bit

1 = The Input Capture x FIFO buffer has overflowed
0 = The Input Capture x FIFO buffer has not overflowed

bit 0 ICBNE: Input Capture x Buffer Status bit

1 = Input Capture x buffer has data available
0 = Input Capture x buffer is empty

NOTES:

11.0 HIGH-SPEED ANALOG COMPARATOR WITH SLOPE COMPENSATION DAC

Note 1: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive reference source. To complement the information in this data sheet, refer to “High-Speed Analog Comparator Module” (www.microchip.com, DS70005280), which is available from the Microchip website (www.microchip.com).
2: Some registers and associated bits described in this section may not be available on all devices. Refer to Section 3.2 "Main Memory Organization" in this data sheet for device-specific register and bit information.
3: The comparator and DAC are identical for both Main core and Secondary core. The module is similar for both Main core and Secondary core (where the x represents the number of the specific modules being addressed in Main or Secondary).

The high-speed analog comparator module provides a method to monitor voltage, current and other critical signals in a power conversion application that may be too fast for the CPU and ADC to capture. There are a total of four comparator modules, one of which is controlled by the Main core and the remaining three by the Secondary core. The analog comparator module can be used to implement Peak Current mode control, Critical Conduction mode (variable frequency) and Hysteretic Control mode. Table 11-1 shows an overview of the comparator/DAC module.

TABLE 11-1: COMPARATOR/DAC MODULE OVERVIEW

Number of Comparator ModulesIdentical (Modules)
Main Core 1 Yes
Secondary Core3 Yes

11.1 Overview

The high-speed analog comparator module is comprised of a high-speed comparator, Pulse Density Modulation (PDM) DAC and a slope compensation unit. The slope compensation unit provides a user-defined slope which can be used to alter the DAC output. This feature is useful in applications, such as Peak Current mode control, where slope compensation is required to maintain the stability of the power supply. The user simply specifies the direction and rate of change for the slope compensation and the output of the DAC is modified accordingly.

The DAC consists of a PDM unit, followed by a digitally controlled multiphase RC filter. The PDM unit uses a phase accumulator circuit to generate an output stream of pulses. The density of the pulse stream is proportional to the input data value, relative to the maximum value supported by the bit width of the accumulator. The output pulse density is representative of the desired output voltage. The pulse stream is filtered with an RC filter to yield an analog voltage. The output of the DAC is connected to the negative input of the comparator. The positive input of the comparator can be selected using a MUX from either of the input pins or the output of the PGAs. The comparator provides a high-speed operation with a typical delay of 15 ns.

The output of the comparator is processed by the pulse stretcher and the digital filter blocks, which prevent comparator response to unintended fast transients in the inputs. Figure 11-1 shows a block diagram of the high-speed analog comparator module. The DAC module can be operated in one of three modes: Slope Generation mode, Hysteretic mode and Triangle Wave mode. Each of these modes can be used in a variety of power supply applications.

Note: The DACOUT1 pin can only be associated with a single DAC or PGA output at any given time. If more than one DACOEN bit is set, or the PGA Output Enable bit (PGAOEN) and the DACOEN bit are set, the DACOUT1 pin will be a combination of the signals.

Note: DAC input frequency needs to be 500 MHz.

FIGURE 11-1: HIGH-SPEED ANALOG COMPARATOR MODULE BLOCK DIAGRAM
Microchip dsPIC33CH64MP208 - Overview - 1

flowchart
graph TD
    A["INSEL[2:0"]] --> B["CMPx"]
    C["SPGA3"] --> B
    D["SPGA2"] --> B
    E["SPGA1"] --> B
    F["CMPxD/S1CMPxD"] --> B
    G["CMPxB/S1CMPxB"] --> B
    H["CMPxA/S1CMPxA"] --> B
    B --> I["+"]
    I --> J["0"]
    J --> K["Pulse Stretcher and Digital Filter"]
    K --> L["Status"]
    K --> M["IRQ"]
    N["Slope Generator"] --> O["n"]
    P["DACxDATL"] --> Q["n"]
    R["DACx"] --> S["4"]
    T["DACOUT1"] --> U["×"]
    V["SLPxDAT"] --> W["n"]
    X["DACxDATH"] --> Y["n"]
    Z["CMPPOL"] --> I
    style A fill:#f9f,stroke:#333
    style C fill:#f9f,stroke:#333
    style E fill:#f9f,stroke:#333
    style F fill:#f9f,stroke:#333
    style G fill:#f9f,stroke:#333
    style H fill:#f9f,stroke:#333
    style N fill:#ccf,stroke:#333
    style P fill:#ccf,stroke:#333
    style Q fill:#ccf,stroke:#333
    style R fill:#ccf,stroke:#333
    style S fill:#ccf,stroke:#333
    style T fill:#ccf,stroke:#333
    style U fill:#ccf,stroke:#333

Note: n = 16

11.2 Features Overview

- Four Rail-to-Rail Analog Comparators - Up to Five Selectable Input Sources per Comparator:

  • Three external inputs
  • Two internal inputs from PGA module

- Programmable Comparator Hysteresis

- Programmable Output Polarity

- Interrupt Generation Capability

• Dedicated Pulse Density Modulation DAC for each Analog Comparator:

- PDM unit followed by a digitally controlled multimode multipole RC filter

- Multimode Multipole RC Output Filter:

- Transition mode: Provides the fastest response

- Fast mode: For tracking DAC slopes

- Steady-State mode: Provides 12-bit resolution

- Slope Compensation along with each DAC:

- Slope Generation mode

- Hysteretic Control mode

- Triangle Wave mode

- Functional Support for the High-Speed PWM module which Includes:

- PWM duty cycle control

- PWM period control

- PWM Fault detect

11.3 DAC Control Registers

The DACCTRL1L and DACCTRL2H/L registers are common configuration registers for Main and Secondary DAC modules. The Main and Secondary DAC modules are controlled by separate sets of DACCTRL1/2 registers. The DACxCON, DACxDAT, SLPxCON and SLPxDAT registers specify the operation of individual modules. Note that x = 1 for the Main module and x = 1-3 for the Secondary modules.

REGISTER 11-1: DACCTRL1L: DAC CONTROL 1 LOW REGISTER

R/W-0U-0R/W-0U-0U-0U-0U-0U-0
DACONDACSIDL
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0U-0R/W-0R/W-0R/W-0
CLKSEL1(1)CLKSEL0(1)CLKDIV1(1)CLKDIV0(1)FCLKDIV2(2)FCLKDIV1(2)FCLKDIV0(2)
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared

bit 15 DACON: Common DAC Module Enable bit

1 = Enables DAC modules
0 = Disables DAC modules and disables FSCM clocks to reduce power consumption; any pending Slope mode and/or underflow conditions are cleared

bit 14 Unimplemented: Read as '0'

bit 13 DACSIDL: DAC Stop in Idle Mode bit

1 = Discontinues module operation when device enters Idle mode
0 = Continues module operation in Idle mode

bit 12-8 Unimplemented: Read as '0'

bit 7-6 CLKSEL[1:0]: DAC Clock Source Select bits ^(1)

11 = FPLLO
10 = AFPLLO
01 = Fvco/2
00 = AFvco/2

bit 5-4 CLKDIV[1:0]: DAC Clock Divider bits (DAC should be operated at 500 MHz) ^(1,3)

11 = Divide-by-4
10 = Divide-by-3 (non-uniform duty cycle)
01 = Divide-by-2
00 = 1x

bit 3 Unimplemented: Read as '0'

bit 2-0 FCLKDIV[2:0]: Comparator Filter Clock Divider bits ^(2)

111 = Divide-by-8
110 = Divide-by-7
101 = Divide-by-6
100 = Divide-by-5
011 = Divide-by-4
010 = Divide-by-3
001 = Divide-by-2
000 = 1x

Note 1: These bits should only be changed when DACON = 0 to avoid unpredictable behavior.

2: The input clock to this divider is the selected clock input, CLKSEL[1:0], and then divided by two.
3: Clock source and dividers should yield an effective DAC clock input of 500 MHz.

REGISTER 11-2: DACCTRL2H: DAC CONTROL 2 HIGH REGISTER

U-0 U-0 U-0 U-0 U-0 R/W-0 R/W-0
— — —— — —SSTIME[9:8](1)
bit 15 bit 8
R/W-1R/W-0R/W-0R/W-0R/W-1R/W-0R/W-1R/W-0
SSTIME[7:0](1)
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 cleared

bit 15-10 Unimplemented: Read as '0'

bit 9-0 SSTIME[9:0]: Time from Start of Transition Mode until Steady-State Filter is Enabled bits ^(1)

Note 1: The value for SSTIME[9:0] should be greater than the TMODTIME[9:0] value.

REGISTER 11-3: DACCTRL2L: DAC CONTROL 2 LOW REGISTER

U-0 U-0 U-0U-0U-0 U-0R/W-0 R/W-0
TMODTIME[9:8](1)
bit 15 bit 8
R/W-0R/W-1R/W-0R/W-1R/W-0R/W-1R/W-0R/W-1
TMODTIME[7:0](1)
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 cleared

bit 15-10 Unimplemented: Read as '0'

bit 9-0 TMODTIME[9:0]: Transition Mode Duration bits ^(1)

Note 1: The value for TMODTIME[9:0] should be less than the SSTIME[9:0] value.

REGISTER 11-4: DACxCONH: DACx CONTROL HIGH REGISTER

U-0 U-0 U-0 U-0 U-0 R/W-0 R/W-0
— — —— —TMCB[9:8]
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
TMCB[7:0]
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 cleared

bit 15-10 Unimplemented: Read as '0'

bit 9-0 TMCB[9:0]: DACx Leading-Edge Blanking bits

These register bits specify the blanking period for the comparator, following changes to the DAC output during Change-of-State (COS), for the input signal selected by the HCFSEL[3:0] bits in Register 11-9.

REGISTER 11-5: DACxCONL: DACx CONTROL LOW REGISTER

R/W-0R/W-0R/W-0U-0U-0R/W-0R/W-0R/W-0
DACEN IRQM1^(1,2) IRQM0^(1,2) CBEDACOENFLTREN
bit 15bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
CMPSTATCMPPOLINSEL2INSEL1INSEL0HYSPOLHYSSEL1HYSSEL0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared

bit 15 DACEN: Individual DACx Module Enable bit

1 = Enables DACx module
0 = Disables DACx module to reduce power consumption; any pending Slope mode and/or underflow conditions are cleared

bit 14-13 IRQM[1:0]: Interrupt Mode select bits ^(1,2)

11 = Generates an interrupt on either a rising or falling edge detect
10 = Generates an interrupt on a falling edge detect
01 = Generates an interrupt on a rising edge detect
00 = Interrupts are disabled

bit 12-11 Unimplemented: Read as '0'

Note 1: Changing these bits during operation may generate a spurious interrupt.

2: The edge selection is a post-polarity selection via the CMPPOL bit.

REGISTER 11-5: DACxCONL: DACx CONTROL LOW REGISTER (CONTINUED)

bit 10 CBE: Comparator Blank Enable bit

1 = Enables the analog comparator output to be blanked (gated off) during the recovery transition following the completion of a slope operation
0 = Disables the blanking signal to the analog comparator; therefore, the analog comparator output is always active

bit 9 DACOEN: DACx Output Buffer Enable bit

1 = DACx analog voltage is connected to the DACOUT1 pin
0 = DACx analog voltage is not connected to the DACOUT1 pin

bit 8 FLTREN: Comparator Digital Filter Enable bit

1 = Digital filter is enabled
0 = Digital filter is disabled

bit 7 CMPSTAT: Comparator Status bits

The current state of the comparator output including the CMPPOL selection.

bit 6 CMPPOL: Comparator Output Polarity Control bit

1 = Output is inverted
0 = Output is noninverted

bit 5-3 INSEL[2:0]: Comparator Input Source Select bits

Main

111 = Reserved
110 = Reserved
101 = SPGA2 output
100 = SPGA1 output
011 = CMPxD input pin
010 = SPGA3 output
001 = CMPxB input pin
000 = CMPxA input pin

Secondary

111 = Reserved
110 = Reserved
101 = SPGA2 output
100 = SPGA1 output
011 = S1CMPxD input pin
010 = SPGA3 output
001 = S1CMPxB input pin
000 = S1CMPxA input pin

bit 2 HYSPOL: Comparator Hysteresis Polarity Select bit

1 = Hysteresis is applied to the falling edge of the comparator input
0 = Hysteresis is applied to the rising edge of the comparator input

bit 1-0 HYSSEL[1:0]: Comparator Hysteresis Select bits

11 = 45 mv hysteresis
10 = 30 mv hysteresis
01 = 15 mv hysteresis
00 = No hysteresis is selected

Note 1: Changing these bits during operation may generate a spurious interrupt.

2: The edge selection is a post-polarity selection via the CMPPOL bit.

REGISTER 11-6: DACxDATH: DACx DATA HIGH REGISTER

U-0U-0U-0U-0R/W-0R/W-0R/W-0R/W-0
— — —— DACDAT[1:8]
bit 15bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
DACDAT[7:0]
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 cleared

bit 15-12 Unimplemented: Read as '0'

bit 11-0 DACDAT[11:0]: DACx Data bits

This register specifies the high DACx data value. Valid values are from 205 to 3890.

REGISTER 11-7: DACxDATL: DACx DATA LOW REGISTER

U-0 U-0 U-0 U-0 R/W-0R/W-0R/W-0R/W-0
— — —DACLOW[11:8]
bit 15bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
DACLOW[7:0]
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 cleared

bit 15-12 Unimplemented: Read as '0'

bit 11-0 DACLOW[11:0]: DACx Low Data bits

In Hysteretic mode, Slope Generator mode and Triangle mode, this register specifies the low data value and/or limit for the DACx module. Valid values are from 205 to 3890.

REGISTER 11-8: SLPxCONH: DACx SLOPE CONTROL HIGH REGISTER

R/W-0 U-0 U-0 U-0 R/W-0 R/W-0 R/W-0 U-0
SLOPEN —HME(1)TWME(2)PSE
bit 15 bit 8
Legend:
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared

bit 15 SLOPEN: Slope Function Enable/On bit

1 = Enables slope function
0 = Disables slope function; slope accumulator is disabled to reduce power consumption

bit 14-12 Unimplemented: Read as '0'

bit 11 HME: Hysteretic Mode Enable bit ^(1)

1 = Enables Hysteretic mode for DACx
0 = Disables Hysteretic mode for DACx

bit 10 TWME: Triangle Wave Mode Enable bit ^(2)

1 = Enables Triangle Wave mode for DACx
0 = Disables Triangle Wave mode for DACx

bit 9 PSE: Positive Slope Mode Enable bit

1 = Slope mode is positive (increasing)
0 = Slope mode is negative (decreasing)

bit 8-0 Unimplemented: Read as '0'

Note 1: HME mode requires the user to disable the slope function (SLOPEN = 0).
2: TWME mode requires the user to enable the slope function (SLOPEN = 1).

REGISTER 11-9: SLPxCONL: DACx SLOPE CONTROL LOW REGISTER

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
HCFSEL3HCFSEL2HCFSEL1HCFSEL0SLPSTOPA3SLPSTOPA2SLPSTOPA1SLPSTOPA0
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
SLPSTOPB3SLPSTOPB2SLPSTOPB1SLPSTOPB0SLPSTRT3SLPSTRT2SLPSTRT1SLPSTRT0
bit 7 bit 0
Legend:
R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set0'0' = Bit is cleared

bit 15-12 HCFSEL[3:0]: Hysteretic Comparator Function Input Select bits

The selected input signal controls the switching between the DACx high limit (DACxDATH) and the DACx low limit (DACxDATL) as the data source for the PDM DAC. It modifies the polarity of the comparator, and the rising and falling edges initiate the start of the LEB counter (TMCB[9:0] bits in Register 11-4).

Input SelectionMainSecondary
111111
11000PWM4H
10110PWM3H
10100PWM2H
10010PWM1H
1000S1PWM4HS1PWM8H
0111S1PWM3HS1PWM7H
0110S1PWM2HS1PWM6H
0101S1PWM1HS1PWM5H
0100PWM4HS1PWM4H
0011PWM3HS1PWM3H
0010PWM2HS1PWM2H
0001PWM1HS1PWM1H
000000

REGISTER 11-9: SLPxCONL: DACx SLOPE CONTROL LOW REGISTER (CONTINUED)

bit 11-8

SLPSTOPA[3:0]: Slope Stop A Signal Select bits

The selected Slope Stop A signal is logically OR'd with the selected Slope Stop B signal to terminate the slope function.

Slope Stop A Signal SelectionMain Secondary
1111 1 1
1110 Secondary PWM2 Trigger 2 Main PWM2 Trigger 2
1101 Secondary PWM1 Trigger 2 Main PWM1 Trigger 2
1000 Main PWM4 Trigger 2 Secondary PWM8 Trigger 2
0111 Main PWM3 Trigger 2 Secondary PWM7 Trigger 2
0110 Main PWM2 Trigger 2 Secondary PWM6 Trigger 2
0101 Main PWM1 Trigger 2 Secondary PWM5 Trigger 2
0100 Main PWM4 Trigger 1 Secondary PWM4 Trigger 2
0011 Main PWM3 Trigger 1 Secondary PWM3 Trigger 2
0010 Main PWM2 Trigger 1 Secondary PWM2 Trigger 2
0001 Main PWM1 Trigger 1 Secondary PWM1 Trigger 2
0000 0 0

bit 7-4 SLPSTOPB[3:0]: Slope Stop B Signal Select bits

The selected Slope Stop B signal is logically OR'd with the selected Slope Stop A signal to terminate the slope function.

Slope Start B Signal SelectionMainSecondary
111111
0100S1CMP3 OutCMP1 Out
0011S1CMP2 OutS1CMP3 Out
0010S1CMP1 OutS1CMP2 Out
0001CMP1 OutS1CMP1 Out
000000

bit 3-0 SLPSTRT[3:0]: Slope Start Signal Select bits

Slope Start Signal SelectionMainSecondary
111111
1110Secondary PWM2 Trigger 1Main PWM2 Trigger 1
1101Secondary PWM1 Trigger 1Main PWM1 Trigger 1
1000Main PWM4 Trigger 2Secondary PWM8 Trigger 1
0111Main PWM3 Trigger 2Secondary PWM7 Trigger 1
0110Main PWM2 Trigger 2Secondary PWM6 Trigger 1
0101Main PWM1 Trigger 2Secondary PWM5 Trigger 1
0100Main PWM4 Trigger 1Secondary PWM4 Trigger 1
0011Main PWM3 Trigger 1Secondary PWM3 Trigger 1
0010Main PWM2 Trigger 1Secondary PWM2 Trigger 1
0001Main PWM1 Trigger 1Secondary PWM1 Trigger 1
000000

REGISTER 11-10: SLPxDAT: DACx SLOPE DATA REGISTER ^(1)

R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
SLPDAT[15:8]
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
SLPDAT[7:0]
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared

bit 15-0 SLPDAT[15:0]: Slope Ramp Rate Value bits

The SLPDATx value is in 12.4 format.

Note 1: Register data are left justified.

12.0 QUADRATURE ENCODER INTERFACE (QEI) (MAIN/SECONDARY)

Note 1: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive resource. For more information, refer to the “Quadra-ture Encoder Interface (QEI)” (www.microchip.com/DS70000601), which is available from the Microchip website (www.microchip.com).
2: The QEI is identical for both Main core and Secondary core (the x represents the number of the specific module being addressed in Main or Secondary).
3: Some registers and associated bits described in this section may not be available on all devices. Refer to Section 3.2 "Main Memory Organization" in this data sheet for device-specific register and bit information.

The Quadrature Encoder Interface (QEI) module provides the interface to incremental encoders for obtaining mechanical position data. Quadrature Encoders, also known as incremental encoders or optical encoders, detect position and speed of rotating motion systems. Quadrature Encoders enable closed-loop control of motor control applications, such as Switched Reluctance (SR) and AC Induction Motors (ACIM).

A typical Quadrature Encoder includes a slotted wheel attached to the shaft of the motor and an emitter/ detector module that senses the slots in the wheel. Typically, three output channels, Phase A (QEAx),

Phase B (QEBx) and Index (INDXx), provide information on the movement of the motor shaft, including distance and direction.

The two channels, Phase A (QEAX) and Phase B (QEBx), are typically 90 degrees out of phase with respect to each other. The Phase A and Phase B channels have a unique relationship. If Phase A leads Phase B, the direction of the motor is deemed positive or forward. If Phase A lags Phase B, the direction of the motor is deemed negative or reverse. The Index pulse occurs once per mechanical revolution and is used as a reference to indicate an absolute position. Figure 12-1 illustrates the Quadrature Encoder Interface signals.

The Quadrature signals from the encoder can have four unique states ('01', '00', '10' and '11') that reflect the relationship between QEAX and QEBx. Figure 12-1 illustrates these states for one count cycle. The order of the states get reversed when the direction of travel changes.

The Quadrature Decoder increments or decrements the 32-bit up/down Position x Counter (POSxCNTH/L) registers for each Change-of-State (COS). The counter increments when QEAX leads QEBx and decrements when QEBx leads QEAX. Table 12-1 shows an overview of the QEI module.

TABLE 12-1: QEI MODULE OVERVIEW

Number of QEI ModulesIdentical (Modules)
Main Core 1 Yes
Secondary Core 1Yes

FIGURE 12-1: QUADRATURE ENCODER INTERFACE SIGNALS
Microchip dsPIC33CH64MP208 - QUADRATURE ENCODER INTERFACE (QEI) (MAIN/SECONDARY) - 1

line | Signal | Value | |------------|-------| | QEAX | 0 | | QEBx | 0 | | POSxCNT | +1 | | Up/Down | 0 |

Table 12-2 shows the truth table that describes how the Quadrature signals are decoded.
TABLE 12-2: TRUTH TABLE FOR QUADRATURE ENCODER

Current Quadrature StatePrevious Quadrature StateAction
QAQB QAQB
1111No count or direction change
1110Count up
1101Count down
1100Invalid state change; ignore
1011Count down
1010No count or direction change
1001Invalid state change; ignore
1000Count up
0111Count up
0110Invalid state change; ignore
0101No count or direction change
0100Count down
0011Invalid state change; ignore
0010Count down
0001Count up
0000No count or direction change

Figure 12-2 illustrates the simplified block diagram of the QEI module. The QEI module consists of decoder logic to interpret the Phase A (QEAx) and Phase B (QEBx) signals, and an up/down counter to accumulate the count. The counter pulses are generated when the Quadrature state changes. The count direction information must be maintained in a register until a direction change is detected. The module also includes digital noise filters, which condition the input signal.

The QEI module consists of the following major features:

  • Four Input Pins: Two Phase Signals, an Index Pulse and a Home Pulse
  • Programmable Digital Noise Filters on Inputs
  • Quadrature Decoder providing Counter Pulses and Count Direction
  • Count Direction Status
  • 4x Count Resolution
  • Index (INDXx) Pulse to Reset the Position Counter
  • General Purpose 32-Bit Timer/Counter mode
  • Interrupts generated by QEI or Counter Events
    • 32-Bit Velocity Counter
    • 32-Bit Position Counter
    • 32-Bit Index Pulse Counter
    • 32-Bit Interval Timer
    • 32-Bit Position Initialization/Capture Register
    • 32-Bit Compare Less Than and Greater Than Registers
  • External Up/Down Count mode
  • External Gated Count mode
  • External Gated Timer mode
  • Interval Timer mode

FIGURE 12-2: QUADRATURE ENCODER INTERFACE (QEI) MODULE BLOCK DIAGRAM
Microchip dsPIC33CH64MP208 - QUADRATURE ENCODER INTERFACE (QEI) (MAIN/SECONDARY) - 2

flowchart
graph TD
    A["FLTREN"] --> B["Digital Filter"]
    C["HomEx"] --> B
    D["INDXx"] --> B
    E["QEBx"] --> B
    F["QEAX"] --> B
    B --> G["FHOMEx"]
    G --> H["÷QFDIV"]
    H --> I["PBCLK"]
    I --> J["Quadrature Decoder Logic"]
    J --> K["COUNT DIR"]
    J --> L["EXTCNT DIR_GATE"]
    M["CCMPx"] --> N["PCHGE PCLLE PCHGE"]
    O["OUTFNC[1:0"]] --> N
    N --> P["PCLLE PCHGE"]
    Q["INDEX Counter Register (INDXxCNT)"] --> R["÷INTDIV"]
    S["Interval Timer Register (INTxTMR)"] --> T["DIVCLK COUNT_EN"]
    U["Velocity Counter Register (VELxCNT)"] --> V["LEVELxCNT"]
    W["Index Counter Hold Register (INDXxHLD)"] --> X["Data Bus"]
    Y["Interval Timer Hold Register (INTxHLD)"] --> Z["Data Bus"]
    AA["Velocity Counter Hold Register (VELxHLD)"] --> AB["Data Bus"]
    AC["Counter"] --> AD["PCLEQ PCLLE"]
    AE["Less Than or Equal Compare Register (QEIXLEC)"] --> AF["DIR DIR"]
    AG["Position Counter Register (POSxCNT)"] --> AH["POST DIR"]
    AI["Position Counter Hold Register (POSxHLD)"] --> AJ["POST DIR"]
    AK["Initialization and Capture Register (QEIXC)(1)"] --> AL["Data Bus"]
    AM["GATEN"] --> AN["1"]
    AO["COUNT_GATE 0"] --> AP["CNT_DIR"]
    AQ["CNTPOL"] --> AR["CNT_DIR"]
    AS["PERVolume DIAMETER"] --> AT["1"]
    AU["CONTINENT DIAMETER"] --> AV["0"]
    AW["CONTINENT DIAMETER"] --> AX["0"]
    AY["GATEN"] --> AZ["1"]
    BA["GATEN"] --> BB["0"]
    BC["GATEN"] --> BD["1"]
    BE["GATEN"] --> BF["0"]
    BG["GATEN"] --> BH["1"]
    BI["GATEN"] --> BJ["0"]

Note 1: These registers map to the same memory location.
2: Shaded registers are not used in 32-bit devices. They are provided to maintain uniformity with 16-bit architecture.

12.1 QEI Control and Status Registers

REGISTER 12-1: QEIXCON: QEIX CONTROL REGISTER

R/W-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
QEEN— QEISDL PIMOD2 PMOD1 PIMOD0 IMV1 IMV0
bit 15 bit 8
U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
— INTDV2INTDIV1INTDIV0CNTPOLGATENCCM1CCMO
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15 QEIEN: Quadrature Encoder Interface Module Enable bit

1 = QEI module is enabled

0 = QEI module is disabled; however, SFRs can be read or written

bit 14 Unimplemented: Read as '0'

bit 13 QEISIDL: QEI Stop in Idle Mode bit

1 = Discontinues module operation when device enters Idle mode

0 = Continues module operation in Idle mode

bit 12-10 PIMOD[2:0]: Position Counter Initialization Mode Select bits

111 = Modulo Count mode for position counter and every Index event resets the position counter

110 = Modulo Count mode for position counter

101 = Resets the position counter when the position counter equals the QEIxGEC register

100 = Second Index event after Home event initializes the position counter with the contents of the QEIXIC register

011 = First Index event after Home event initializes the position counter with the contents of the QEIXIC register

010 = Next Index input event initializes the position counter with the contents of the QEIXIC register

001 = Every Index input event resets the position counter

000 = Index input event does not affect the position counter

bit 9-8 IMV[1:0]: Index Match Value bits

11 = Index match occurs when QEBx = 1 and QEAX = 1

10 = Index match occurs when QEBx = 1 and QEAX = 0

01 = Index match occurs when QEBx = 0 and QEAX = 1

00 = Index match occurs when QEBx = 0 and QEAX = 0

bit 7 Unimplemented: Read as '0'

bit 6-4 INTDIV[2:0]: Timer Input Clock Prescale Select bits (interval timer, main timer (position counter), velocity counter and Index counter internal clock divider select)

111 = 1:128 prescale value

110 = 1:64 prescale value

101 = 1:32 prescale value

100 = 1:16 prescale value

011 = 1:8 prescale value

010 = 1:4 prescale value

001 = 1:2 prescale value

000 = 1:1 prescale value

bit 3 CNTPOL: Position, Velocity and Index Counter/Timer Direction Select bit

1 = Counter direction is negative unless modified by an external up/down signal

0 = Counter direction is positive unless modified by an external up/down signal

REGISTER 12-1: QEIXCON: QEIX CONTROL REGISTER (CONTINUED)

bit 2 GATEN: External Count Gate Enable bit

1 = External gate signal controls the position counter/timer operation
0 = External gate signal does not affect the position counter/timer operation

bit 1-0 CCM[1:0]: Counter Control Mode Selection bits

11 = Internal timer with External Gate mode
10 = External Clock count with External Gate mode
01 = External Clock count with External Up/Down mode
00 = Quadrature Encoder mode

REGISTER 12-2: QEIXIOCL: QEIX I/O CONTROL LOW REGISTER

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
QCAPENFLTRENQFDIV2QFDIV1QFDIV0OUTFNC1OUTFNC0SWPAB
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0R-xR-xR-xR-x
HOMPOLIDXPOLQEBPOLQEAPOLHOMEINDEXQEBQEA
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15 QCAPEN: QElx Position Counter Input Capture by Index Event Enable bit

1 = Index match event (positive edge) triggers a position capture event
0 = Index match event (positive edge) does not trigger a position capture event

bit 14 FLTREN: QEAx/QEBx/INDXx/HOMEx Digital Filter Enable bit

1 = Input pin digital filter is enabled
0 = Input pin digital filter is disabled (bypassed)

bit 13-11 QFDIV[2:0]: QEAx/QEBx/INDXx/HOMEx Digital Input Filter Clock Divide Select bits

111 = 1:128 clock divide
110 = 1:64 clock divide
101 = 1:32 clock divide
100 = 1:16 clock divide
011 = 1:8 clock divide
010 = 1:4 clock divide
001 = 1:2 clock divide
000 = 1:1 clock divide

bit 10-9 OUTFNC[1:0]: QElx Module Output Function Mode Select bits

11 = The QEICMP pin goes high when POSxCNT ≤ QEIxLEC or POSxCNT ≥ QEIxGEC
10 = The QEICMP pin goes high when POSxCNT ≤ QEIxLEC
01 = The QEICMP pin goes high when POSxCNT ≥ QEIxGEC
00 = Output is disabled

bit 8 SWPAB: Swap QEAx and QEBx Inputs bit

1 = QEAx and QEBx are swapped prior to Quadrature Decoder logic
0 = QEAx and QEBx are not swapped

bit 7 HOMPOL: HOMEx Input Polarity Select bit

1 = Input is inverted
0 = Input is not inverted

REGISTER 12-2: QEIXIOCL: QEIX I/O CONTROL LOW REGISTER (CONTINUED)

bit 6 IDXPOL: INDXx Input Polarity Select bit

1 = Input is inverted

0 = Input is not inverted

bit 5 QEBPOL: QEBx Input Polarity Select bit

1 = Input is inverted

0 = Input is not inverted

bit 4 QEAPOL: QEAX Input Polarity Select bit

1 = Input is inverted

0 = Input is not inverted

bit 3 HOME: Status of HOMEx Input Pin after Polarity Control bit (read-only)

1 = Pin is at logic '1' if the HOMPOL bit is set to '0'; pin is at logic '0' if the HOMPOL bit is set to '1'

0 = Pin is at logic '0' if the HOMPOL bit is set to '0'; pin is at logic '1' if the HOMPOL bit is set to '1'

bit 2 INDEX: Status of INDXx Input Pin After Polarity Control bit (read-only)

1 = Pin is at logic '1' if the IDXPOL bit is set to '0'; pin is at logic '0' if the IDXPOL bit is set to '1'

0 = Pin is at logic '0' if the IDXPOL bit is set to '0'; pin is at logic '1' if the IDXPOL bit is set to '1'

bit 1 QEB: Status of QEBx Input Pin After Polarity Control and SWPAB Pin Swapping bit (read-only)

1 = Physical pin, QEBx, is at logic '1' if the QEBPOL bit is set to '0' and the SWPAB bit is set to '0'; physical pin, QEBx, is at logic '0' if the QEBPOL bit is set to '1' and the SWPAB bit is set to '0'; physical pin, QEAx, is at logic '1' if the QEBPOL bit is set to '0' and the SWPAB bit is set to '1'; physical pin, QEAx, is at logic '0' if the QEBPOL bit is set to '1' and the SWPAB bit is set to '1'

0 = Physical pin, QEBx, is at logic '0' if the QEBPOL bit is set to '0' and the SWPAB bit is set to '0'; physical pin, QEBx, is at logic '1' if the QEBPOL bit is set to '1' and the SWPAB bit is set to '0'; physical pin, QEAx, is at logic '0' if the QEBPOL bit is set to '0' and the SWPAB bit is set to '1'; physical pin, QEAx, is at logic '1' if the QEBPOL bit is set to '1' and the SWPAB bit is set to '1'

bit 0 QEA: Status of QEAx Input Pin After Polarity Control and SWPAB Pin Swapping bit (read-only)

1 = Physical pin, QEAx, is at logic '1' if the QEAPOL bit is set to '0' and the SWPAB bit is set to '0'; physical pin, QEAx, is at logic '0' if the QEAPOL bit is set to '1' and the SWPAB bit is set to '0'; physical pin, QEBx, is at logic '1' if the QEAPOL bit is set to '0' and the SWPAB bit is set to '1'; physical pin, QEBx, is at logic '0' if the QEAPOL bit is set to '1' and the SWPAB bit is set to '1'

0 = Physical pin, QEAx, is at logic '0' if the QEAPOL bit is set to '0' and the SWPAB bit is set to '0'; physical pin, QEAx, is at logic '1' if the QEAPOL bit is set to '1' and the SWPAB bit is set to '0'; physical pin, QEBx, is at logic '0' if the QEAPOL bit is set to '0' and the SWPAB bit is set to '1'

REGISTER 12-3: QEIXIOCH: QEIX I/O CONTROL HIGH REGISTER

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 U-0 U-0 R/W-0
———— —— HCAPEN
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-1 Unimplemented: Read as '0'

bit 0 HCAPEN: Position Counter Input Capture by Home Event Enable bit

1 = HOMEx input event (positive edge) triggers a position capture event
0 = HOMEx input event (positive edge) does not trigger a position capture event

REGISTER 12-4: QEIXSTAT: QEIX STATUS REGISTER

U-0 U-0 HS/R/C-0 R/W-0 HS/R/C-0 R/W-0 HS/R/C-0 R/W-0
— — PCHEQIRQ PCHEQIEN PCLEQRQ PCLEQIENPOSOVIRQPOSOVIEN
bit 15 bit 8
HS/R/C-0 R/W-0 HS/R/C-0 R/W-0 HS/R/C-0 R/W-0 HS/R/C-0 R/W-0
PCIIRQ^(1) PCIIENVELOVIRQVELOVIENHOMIRQHOMIENIDXIRQIDXIEN
bit 7 bit 0
Legend:C = Clearable bitHS = Hardware Settable bit
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-14 Unimplemented: Read as '0'

bit 13 PCHEQIRQ: Position Counter Greater Than Compare Status bit

1 = POSxCNT ≥ QEIxGEC

0 = POSxCNT < QEIXGEC

bit 12 PCHEQIEN: Position Counter Greater Than Compare Interrupt Enable bit

1 = Interrupt is enabled

0 = Interrupt is disabled

bit 11 PCLEQIRQ: Position Counter Less Than Compare Status bit

1 = POSxCNT ≤ QEIXLEC

0 = POSxCNT > QEIXLEC

bit 10 PCLEQIEN: Position Counter Less Than Compare Interrupt Enable bit

1 = Interrupt is enabled

0 = Interrupt is disabled

bit 9 POSOVIRQ: Position Counter Overflow Status bit

1 = Overflow has occurred

0 = No overflow has occurred

bit 8 POSOVIEN: Position Counter Overflow Interrupt Enable bit

1 = Interrupt is enabled

0 = Interrupt is disabled

bit 7 PCIIRQ: Position Counter (Homing) Initialization Process Complete Status bit ^(1)

1 = POSxCNT was reinitialized

0 = POSxCNT was not reinitialized

bit 6 PCIEN: Position Counter (Homing) Initialization Process Complete Interrupt Enable bit

1 = Interrupt is enabled

0 = Interrupt is disabled

bit 5 VELOVIRQ: Velocity Counter Overflow Status bit

1 = Overflow has occurred

0 = No overflow has occurred

bit 4 VELOVIEN: Velocity Counter Overflow Interrupt Enable bit

1 = Interrupt is enabled

0 = Interrupt is disabled

bit 3 HOMIRQ: Status Flag for Home Event Status bit

1 = Home event has occurred

0 = No Home event has occurred

Note 1: This status bit is only applicable to PIMOD[2:0] modes, '011' and '100'.

REGISTER 12-4: QEIXSTAT: QEIX STATUS REGISTER (CONTINUED)

bit 2 HOMIEN: Home Input Event Interrupt Enable bit

1 = Interrupt is enabled
0 = Interrupt is disabled 

bit 1 IDXIRQ: Status Flag for Index Event Status bit

1 = Index event has occurred
0 = No Index event has occurred 

bit 0 IDXIEN: Index Input Event Interrupt Enable bit

1 = Interrupt is enabled
0 = Interrupt is disabled 

Note 1: This status bit is only applicable to PIMOD[2:0] modes, '011' and '100'.

REGISTER 12-5: POSxCNTL: POSITION x COUNTER REGISTER LOW

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
POSCNT[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
POSCNT[7:0]
bit 7 bit 0
Legend:
R = Readable bit W = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown

bit 15-0 POSCNT[15:0]: Position Counter Value bits

REGISTER 12-6: POSxCNTH: POSITION x COUNTER REGISTER HIGH

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
POSCNT[31:24]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
POSCNT[23:16]
bit 7 bit 0
Legend:
R = Readable bit W = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown

bit 15-0 POSCNT[31:16]: Position Counter Value bits

REGISTER 12-7: POSxHLD: POSITION x COUNTER HOLD REGISTER

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
POSHLD[31:24]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
POSHLD[23:16]
bit 7 bit 0
Legend:R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 POSHLD[31:16]: Position Counter Hold for Reading/Writing Position x Counter Register (POSxCNT) bits

REGISTER 12-8: VELxCNTL: VELOCITY x COUNTER REGISTER LOW

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
VELCNT[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
VELCNT[7:0]
bit 7 bit 0
Legend:R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 VELCNT[15:0]: Velocity Counter Value bits

REGISTER 12-9: VELxCNTH: VELOCITY x COUNTER REGISTER HIGH

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
VELCNT[31:24]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
VELCNT[23:16]
bit 7 bit 0
Legend:R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 VELCNT[31:16]: Velocity Counter Value bits

REGISTER 12-10: VELxHLD: VELOCITY x COUNTER HOLD REGISTER

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
VELHLD[31:24]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
VELHLD[23:16]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 VELHLD[31:16]: Velocity Counter Hold Value bits

REGISTER 12-11: INTxTMRL: INTERVAL x TIMER REGISTER LOW

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
INTTMR[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
INTTMR[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 INTTMR[15:0]: Interval Timer Value bits

REGISTER 12-12: INTxTMRH: INTERVAL x TIMER REGISTER HIGH

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
INTTMR[31:24]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
INTTMR[23:16]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 INTTMR[31:16]: Interval Timer Value bits

REGISTER 12-13: INTxHLDL: INTERVAL x TIMER HOLD REGISTER LOW

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
INTHLD[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
INTHLD[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown 

bit 15-0 INTXHLD[15:0]: Hold for Reading/Writing Interval Timer Value Register (INTxHLD) bits

REGISTER 12-14: INTxHLDH: INTERVAL x TIMER HOLD REGISTER HIGH

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
INTHLD[31:24]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
INTHLD[23:16]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown 

bit 15-0 INTHLD[31:16]: Hold for Reading/Writing Interval Timer Value Register (INTxHLD) bits

REGISTER 12-15: INDXxCNTL: INDEX x COUNTER REGISTER LOW

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
INDXCNT[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
INDXCNT[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 INDXCNT[15:0]: Index Counter Value bits

REGISTER 12-16: INDXxCNTH: INDEX x COUNTER REGISTER HIGH

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
INDXCNT[31:24]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
INDXCNT[23:16]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 INDXCNT[31:16]: Index Counter Value bits

REGISTER 12-17: INDXxHLD: INDEX x COUNTER HOLD REGISTER

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
INDXHLD[31:24]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
INDXHLD[23:16]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 INDXHLD[31:16]: Hold for Reading/Writing Index x Counter Register (INDXCNT) bits

REGISTER 12-18: QEIXGECL: QEIX GREATER THAN OR EQUAL COMPARE REGISTER LOW

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
QEIGEC[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
QEIGEC[7:0]
bit 7 bit 0
Legend:R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 QEIGEC[15:0]: QEIx Greater Than or Equal Compare bits

REGISTER 12-19: QEIXGECH: QEIX GREATER THAN OR EQUAL COMPARE REGISTER HIGH

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
QEIGEC[31:24]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
QEIGEC[23:16]
bit 7 bit 0
Legend:R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 QEIGEC[31:16]: QEIx Greater Than or Equal Compare bits

REGISTER 12-20: QEIXLECL: QEIX LESS THAN OR EQUAL COMPARE REGISTER LOW

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
QEIIC[31:24]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
QEIIC[23:16]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 QEIIC[31:16]: QEIx Less Than or Equal Compare bits

REGISTER 12-21: QEIXLECH: QEIX LESS THAN OR EQUAL COMPARE REGISTER HIGH

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
QEIIC[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
QEIIC[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 QEIIC[15:0]: QEIx Less Than or Equal Compare bits

NOTES:

13.0 UNIVERSAL ASYNCHRONOUS RECEIVER TRANSMITTER (UART)

Note 1: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive reference source. To complement the information in this data sheet, refer to "Multiprotocol Universal Asynchronous Receiver Transmitter (UART) Module" (www.microchip.com/DS70005288), which is available from the Microchip website (www.microchip.com).

2: The UART is identical for both Main core and Secondary core. The x is common for both Main core and Secondary core (where the x represents the number of the specific module being addressed). The number of UART modules available on the Main core and Secondary core is different and they are located in different SFR locations.

3: All associated register names are the same on the Main core and the Secondary core. The Secondary code will be developed in a separate project in MPLAB X IDE with the device selection, dsPIC33CH128MP508S1, where the S1 indicates the Secondary device. The Main UART is UART1 and UART2, and the Secondary UART is UART1.

Table 13-1 shows an overview of the module.
TABLE 13-1: UART MODULE OVERVIEW

Number of UART ModulesIdentical (Modules)
Main Core 2 Yes
Secondary Core 1 Yes

The Universal Asynchronous Receiver Transmitter (UART) is a flexible serial communication peripheral used to interface dsPIC microcontrollers with other equipment, including computers and peripherals. The UART is a full-duplex, asynchronous communication channel that can be used to implement protocols, such as RS-232 and RS-485. The UART also supports the following hardware extensions:

• LIN/J2602
- Smart Card

The primary features of the UART are:

• Full or Half-Duplex Operation
- Up to 8-Deep TX and RX First In, First Out (FIFO) Buffers
• 8-Bit or 9-Bit Data Width
- Configurable Stop Bit Length
- Flow Control
• Auto-Baud Calibration
- Parity, Framing and Buffer Overrun Error Detection
- Address Detect
- Break Transmission
• Transmit and Receive Polarity Control
• Manchester Encoder/Decoder
• Operation in Sleep mode
- Wake from Sleep on Sync Break Received Interrupt

13.1 Architectural Overview

The UART transfers bytes of data, to and from device pins, using First-In First-Out (FIFO) buffers up to eight bytes deep. The status of the buffers and data is made available to user software through Special Function

Registers (SFRs). The UART implements multiple interrupt channels for handling transmit, receive and error events. A simplified block diagram of the UART is shown in Figure 13-1.

FIGURE 13-1: SIMPLIFIED UARTx BLOCK DIAGRAM
Microchip dsPIC33CH64MP208 - Architectural Overview - 1

flowchart
graph TD
    A["Clock Inputs"] --> B["Baud Rate Generator"]
    C["Data Bus"] --> D["SFRs"]
    E["Interrupts"] --> F["Interrupt Generation"]
    G["Error and Event Detection"] --> H["Hardware Flow Control"]
    I["TX Buffer, UxTXREG"] --> J["TX"]
    K["RX Buffer, UxRXREG"] --> L["RX"]
    M["UxDSR"] --> N["UxDSR"]
    O["UxRTS"] --> P["UxRTS"]
    Q["UxCTS"] --> R["UxCTS"]
    S["UxDTR"] --> T["UxDTR"]

13.2 Character Frame

A typical UART character frame is shown in Figure 13-2. The Idle state is high with a 'Start' condition indicated by a falling edge. The Start bit is followed by the number of data, parity/address detect and Stop bits defined by the MOD[3:0] (UxMODE[3:0]) bits selected.

FIGURE 13-2: UART CHARACTER FRAME
Microchip dsPIC33CH64MP208 - Character Frame - 1

flowchart
graph LR
    A["Start Bit"] --> B["D0 D1"]
    B --> C["D2 D3"]
    C --> D["D5D4"]
    D --> E["..."]
    E --> F["D6 D7"]
    F --> G["Parity/Address Detect"]
    G --> H["Stop Bit(s)"]
    H --> I["Idle"]

13.3 Data Buffers

Both transmit and receive functions use buffers to store data shifted to/from the pins. These buffers are FIFOs and are accessed by reading the SFRs, UxTXREG and UxRXREG, respectively. Each data buffer has multiple flags associated with its operation to allow software to read the status. Interrupts can also be configured based on the space available in the buffers. The transmit and receive buffers can be cleared and their pointers reset using the associated TX/RX Buffer Empty Status bits, UTXBE (UxSTAH[5]) and URXBE (UxSTAH[1]).

13.4 Protocol Extensions

The UART provides hardware support for LIN/J2602 and smart card protocol extensions to reduce software overhead. A protocol extension is enabled by writing a value to the MOD[3:0] (UxMODE[3:0]) selection bits and further configured using the UARTx Timing Parameter registers, UxP1 (Register 13-9), UxP2 (Register 13-10), UxP3 (Register 13-11) and UxP3H (Register 13-12). Details regarding operation and usage are discussed in their respective chapters. Not all protocols are available on all devices.

13.5 UART Control/Status Registers

REGISTER 13-1: UxMODE: UARTx CONFIGURATION REGISTER

R/W-0 U-0 R/W-0 R/W-0 R/W-0 U-0 R/W-0 HC/R/W-0
UARTEN —USIDL WAKERXBIMD — BRKOVR UTXBRK
bit 15bit 8
R/W-0HC/R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
BRGHABAUDUTXENURXENMOD3MOD2MOD1MOD0
bit 7 bit 0
Legend:HC = Hardware 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 15UARTEN: UART Enable bit1 = UART is ready to transmit and receive0 = UART state machine, FIFO Buffer Pointers and counters are reset; registers are readable and writable
bit 14Unimplemented: Read as '0'
bit 13USIDL: UART Stop in Idle Mode bit1 = Discontinues module operation when device enters Idle mode0 = Continues module operation in Idle mode
bit 12WAKE: Wake-up Enable bit1 = Module will continue to sample the RX pin – interrupt generated on falling edge, bit cleared in hardware on following rising edge; if ABAUD is set, Auto-Baud Detection (ABD) will begin immediately0 = RX pin is not monitored nor rising edge detected
bit 11RXBIMD: Receive Break Interrupt Mode bit1 = RXBKIF flag when a minimum of 23 (asynchronous or LIN/J2602) low bit periods are detected0 = RXBKIF flag when the Break makes a low-to-high transition after being low for at least 23/11 bit periods
bit 10Unimplemented: Read as '0'
bit 9BRKOVR: Send Break Software Override bitOverrides the TX Data Line:1 = Makes the TX line active (Output 0 when UTXINV = 0, Output 1 when UTXINV = 1)0 = TX line is driven by the shifter
bit 8UTXBRK: UART Transmit Break bit(1)1 = Sends Sync Break on next transmission; cleared by hardware upon completion0 = Sync Break transmission is disabled or has completed
bit 7BRGH: High Baud Rate Select bit1 = High Speed: Baud rate is baudclk/40 = Low Speed: Baud rate is baudclk/16
bit 6ABAUD: Auto-Baud Detect Enable bit (read-only when MOD[3:0] = 1xxx)1 = Enables baud rate measurement on the next character – requires reception of a Sync field (55h); cleared in hardware upon completion0 = Baud rate measurement is disabled or has completed

Note 1: R/HS/HC in LIN mode.

2: These modes are not available on all devices.

REGISTER 13-1: UxMODE: UARTx CONFIGURATION REGISTER (CONTINUED)

bit 5 UTXEN: UART Transmit Enable bit

1 = Transmit enabled - except during Auto-Baud Detection
0 = Transmit disabled – all transmit counters, pointers and state machines are reset; TX buffer is not flushed, status bits are not reset

bit 4 URXEN: UART Receive Enable bit

1 = Receive enabled - except during Auto-Baud Detection
0 = Receive disabled – all receive counters, pointers and state machines are reset; RX buffer is not flushed, status bits are not reset

bit 3-0 MOD[3:0]: UART Mode bits

Other = Reserved 1111 = Smart card ^(2) 1110 = Reserved 1101 = Reserved 1100 = LIN Commander/Responder 1011 = LIN Responder only 1010 = Reserved 1001 = Reserved 1000 = Reserved 0111 = Reserved 0110 = Reserved 0101 = Reserved 0100 = Asynchronous 9-bit UART with address detect, ninth bit = 1 signals address 0011 = Asynchronous 8-bit UART without address detect, ninth bit is used as an even parity bit 0010 = Asynchronous 8-bit UART without address detect, ninth bit is used as an odd parity bit 0001 = Asynchronous 7-bit UART 0000 = Asynchronous 8-bit UART

Note 1: R/HS/HC in LIN mode.

2: These modes are not available on all devices.

REGISTER 13-2: UxMODEH: UARTx CONFIGURATION REGISTER HIGH

R/W-0 R-0 U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0
SLPEN ACTIVE— — BCLKMOD BCLKSEL1 BCLKSEL0 HALFDPLX
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
RUNOVFURXINVSTSEL1STSEL0C0ENUTXINVFLO1FLO0
bit 7 bit 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 15SLPEN: Run During Sleep Enable bit1 = UART BRG clock runs during Sleep0 = UART BRG clock is turned off during Sleep
bit 14ACTIVE: UART Running Status bit1 = UART clock request is active (user can not update the UxMODE/UxMODEH registers)0 = UART clock request is not active (user can update the UxMODE/UxMODEH registers)
bit 13-12Unimplemented: Read as '0'
bit 11BCLKMOD: Baud Clock Generation Mode Select bit1 = Uses fractional Baud Rate Generation0 = Uses legacy divide-by-x counter for baud clock generation (x = 4 or 16 depending on the BRGH bit)
bit 10-9 BCLKSEL[1:0]: Baud Clock Source Selection bits
11 = Reserved
10 = Fosc
01 = Reserved
00 = Fosc/2 (FP)
bit 8HALFDPLX: UART Half-Duplex Selection Mode bit1 = Half-Duplex mode: UxTX is driven as an output when transmitting and tri-stated when TX is Idle0 = Full-Duplex mode: UxTX is driven as an output at all times when both UARTEN and UTXEN are set
bit 7RUNOVF: Run During Overflow Condition Mode bit1 = When an Overflow Error (OERR) condition is detected, the RX shifter continues to run so as to remain synchronized with incoming RX data; data are not transferred to UxRXREG when it is full (i.e., no UxRXREG data are overwritten)0 = When an Overflow Error (OERR) condition is detected, the RX shifter stops accepting new data (Legacy mode)
bit 6URXINV: UART Receive Polarity bit1 = Inverts RX polarity; Idle state is low0 = Input is not inverted; Idle state is high
bit 5-4STSEL[1:0]: Number of Stop Bits Selection bits11 = 2 Stop bits sent, 1 checked at receive10 = 2 Stop bits sent, 2 checked at receive01 = 1.5 Stop bits sent, 1.5 checked at receive00 = 1 Stop bit sent, 1 checked at receive
bit 3C0EN: Enable Legacy Checksum (C0) Transmit and Receive bit1 = Checksum Mode 1 (enhanced LIN checksum in LIN mode; add all TX/RX words in all other modes)0 = Checksum Mode 0 (legacy LIN checksum in LIN mode; not used in all other modes)

REGISTER 13-2: UxMODEH: UARTx CONFIGURATION REGISTER HIGH (CONTINUED)

bit 2 UTXINV: UART Transmit Polarity bit

1 = Inverts TX polarity; TX is low in Idle state
0 = Output data are not inverted; TX output is high in Idle state

bit 1-0 FLO[1:0]: Flow Control Enable bits (only valid when MOD[3:0] = 0xxx)

11 = Reserved
10 = RTS-DSR (for TX side)/CTS-DTR (for RX side) hardware flow control
01 = XON/XOFF software flow control
00 = Flow control off

REGISTER 13-3: UxSTA: UARTx STATUS REGISTER

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
TXMTIE PERIE ABDOVECERIE FERIERXBKIE OERIETXCIE
bit 15bit 8
R-1R-0HS/R/W-0HS/R/W-0R-0HS/R/W-0HS/R/W-0HS/R/W-0
TRMTPERRABDOVFCERIFFERRRXBKIFOERRTXCIF
bit 7 bit 0
Legend:HS = Hardware Settable 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 15 TXMTIE: Transmit Shifter Empty Interrupt Enable bit

1 = Interrupt is enabled

0 = Interrupt is disabled

bit 14 PERIE: Parity Error Interrupt Enable bit

1 = Interrupt is enabled

0 = Interrupt is disabled

bit 13 ABDOVE: Auto-Baud Rate Acquisition Interrupt Enable bit

1 = Interrupt is enabled

0 = Interrupt is disabled

bit 12 CERIE: Checksum Error Interrupt Enable bit

1 = Interrupt is enabled

0 = Interrupt is disabled

bit 11 FERIE: Framing Error Interrupt Enable bit

1 = Interrupt is enabled

0 = Interrupt is disabled

bit 10 RXBKIE: Receive Break Interrupt Enable bit

1 = Interrupt is enabled

0 = Interrupt is disabled

bit 9 OERIE: Receive Buffer Overflow Interrupt Enable bit

1 = Interrupt is enabled

0 = Interrupt is disabled

bit 8 TXCIE: Transmit Collision Interrupt Enable bit

1 = Interrupt is enabled

0 = Interrupt is disabled

bit 7 TRMT: Transmit Shifter Empty Interrupt Flag bit (read-only)

1 = Transmit Shift Register (TSR) is empty

0 = Transmit Shift Register is not empty

Note 1: In the event of an overflow, the checksum may be corrupted. The checksum value after an overflow event is not meaningful.

REGISTER 13-3: UxSTA: UARTx STATUS REGISTER (CONTINUED)

bit 6PERR: Parity Error/Address Received/Forward Frame Interrupt Flag bitLIN and Parity Modes:1 = Parity error detected0 = No parity error detectedAddress Mode:1 = Address received0 = No address detectedAll Other Modes:Not used.
bit 5ABDOVF: Auto-Baud Rate Acquisition Interrupt Flag bit (must be cleared by software)1 = BRG rolled over during the auto-baud rate acquisition sequence (must be cleared in software)0 = BRG has not rolled over during the auto-baud rate acquisition sequence
bit 4CERIF: Checksum Error Interrupt Flag bit (must be cleared by software)1 = Checksum error0 = No checksum error
bit 3 FERR: Framing Error Interrupt Flag bit
1 = Framing Error: Inverted level of the Stop bit corresponding to the topmost character in the buffer; propagates through the buffer with the received character0 = No framing error
bit 2RXBKIF: Receive Break Interrupt Flag bit (must be cleared by software)1 = A Break was received0 = No Break was detected
bit 1OERR:Receive Buffer Overflow Interrupt Flag bit (must be cleared by software)(1)1 = Receive buffer has overflowed0 = Receive buffer has not overflowed
bit 0TXCIF: Transmit Collision Interrupt Flag bit (must be cleared by software)1 = Transmitted word is not equal to the received word0 = Transmitted word is equal to the received word

Note 1: In the event of an overflow, the checksum may be corrupted. The checksum value after an overflow event is not meaningful.

REGISTER 13-4: UxSTAH: UARTx STATUS REGISTER HIGH

U-0 R/W-0 R/W-0 R/W-0 U-0 R/W-0 R/W-0 R/W-0
— UTXI SEL2 UTXISEL1 UTXISEL0 — URXISEL2(1)URXISEL1(1)URXISEL0(1)
bit 15 bit 8
HS/R/W-0R/W-0R/S-1R-0R-1R-1R/S-1R-0
TXWRESTPMDUTXBEUTXBFRIDLEXONURXBEURXBF
bit 7 bit 0
Legend:HS = Hardware Settable bit S = Settable 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 15 Unimplemented: Read as '0'

bit 14-12 UTXISEL[2:0]: UART Transmit Interrupt Select bits

111 = Sets transmit interrupt when there is one empty slot left in the buffer
• • •
010 = Sets transmit interrupt when there are six empty slots or more in the buffer
001 = Sets transmit interrupt when there are seven empty slots or more in the buffer
000 = Sets transmit interrupt when there are eight empty slots in the buffer; TX buffer is empty

bit 11 Unimplemented: Read as '0'

bit 10-8 URXISEL[2:0]: UART Receive Interrupt Select bits ^(1)

111 = Triggers receive interrupt when there are eight words in the buffer; RX buffer is full
...
001 = Triggers receive interrupt when there are two words or more in the buffer
000 = Triggers receive interrupt when there is one word or more in the buffer

bit 7 TXWRE: TX Write Transmit Error Status bit

LIN and Parity Modes:

1 = A new byte was written when the buffer was full or when P2[8:0] = 0 (must be cleared by software)

0 = No error

Address Detect Mode:

1 = A new byte was written when the buffer was full or to P1[8:0] when P1x was full (must be cleared by software)

0 = No error

Other Modes:

1 = A new byte was written when the buffer was full (must be cleared by software)
0 = No error

bit 6 STPMD: Stop Bit Detection Mode bit

1 = Triggers RXIF at the end of the last Stop bit
0 = Triggers RXIF in the middle of the first (or second, depending on the STSEL[1:0] setting) Stop bit

bit 5 UTXBE: UART TX Buffer Empty Status bit

1 = Transmit buffer is empty; writing '1' when UTXEN = 0 will reset the TX FIFO Pointers and counters
0 = Transmit buffer is not empty

bit 4 UTXBF: UART TX Buffer Full Status bit

1 = Transmit buffer is full
0 = Transmit buffer is not full

bit 3 RIDLE: Receive Idle bit

1 = UART RX line is in the Idle state
0 = UART RX line is receiving something

Note 1: The receive watermark interrupt is not set if PERR or FERR is set and the corresponding IE bit is set.

REGISTER 13-4: UxSTAH: UARTx STATUS REGISTER HIGH (CONTINUED)

bit 2 XON: UART in XON Mode bit

Only valid when FLO[1:0] control bits are set to XON/XOFF mode.

1 = UART has received XON

0 = UART has not received XON or XOFF was received

bit 1 URXBE: UART RX Buffer Empty Status bit

1 = Receive buffer is empty; writing '1' when URXEN = 0 will reset the RX FIFO Pointers and counters

0 = Receive buffer is not empty

bit 0 URXBF: UART RX Buffer Full Status bit

1 = Receive buffer is full

0 = Receive buffer is not full

Note 1: The receive watermark interrupt is not set if PERR or FERR is set and the corresponding IE bit is set.

REGISTER 13-5: UxBRG: UARTx BAUD RATE REGISTER

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
BRG[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
BRG[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0' -n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15

BRG[15:0]: Baud Rate Divisor bits

REGISTER 13-6: UxBRGH: UARTx BAUD RATE REGISTER HIGH

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0' -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 BRG[19:16]: Baud Rate Divisor bits

REGISTER 13-7: UxRXREG: UARTx RECEIVE BUFFER REGISTER

U-0 U-0 U-0 U-0 U-0 U-0 U-0 U-0
——————
bit 15 bit 8
R-x R-x R-x R-x R-x R-x R-xR-x
RXREG[7:0]
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 cleared x = Bit is unknown

bit 15-8 Unimplemented: Read as '0'

bit 7-0 RXREG[7:0]: Received Character Data bits 7-0

REGISTER 13-8: UxTXREG: UARTx TRANSMIT BUFFER REGISTER

W-xW-xW-xW-xW-xW-xW-xW-x
TXREG[7:0]
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 cleared x = Bit is unknown

bit 15 LAST: Last Byte Indicator for Smart Card Support bit

bit 14-8 Unimplemented: Read as '0'

bit 7-0 TXREG[7:0]: Transmitted Character Data bits 7-0

If the buffer is full, further writes to the buffer are ignored.

REGISTER 13-9: UxP1: UARTx TIMING PARAMETER 1 REGISTER

U-0 U-0 U-0 U-0 U-0 U-0 R/W-0
—————— — P1[8]
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
P1[7:0]
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-9 Unimplemented: Read as '0'

bit 8-0 P1[8:0]: Parameter 1 bits

LIN Commander TX:

PID to transmit (bits[5:0]).

Asynchronous TX with Address Detect:

Address to transmit. A '1' is automatically inserted into bit 9 (bits[7:0]).

Smart Card Mode:

Guard Time Counter bits. This counter is operated on the bit clock whose period is always equal to one ETU (bits[8:0]).

Other Modes:

Not used.

REGISTER 13-10: UxP2: UARTx TIMING PARAMETER 2 REGISTER

U-0 U-0 U-0 U-0 U-0 U-0 R/W-0
— — —— — — — P2[8]
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
P2[7:0]
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 cleared x = Bit is unknown

bit 15-9 Unimplemented: Read as '0'

bit 8-0 P2[8:0]: Parameter 2 bits

LIN Responder TX:

Number of bytes to transmit (bits[7:0]).

Asynchronous RX with Address Detect:

Address to start matching (bits[7:0]).

Smart Card Mode:

Block Time Counter bits. This counter is operated on the bit clock whose period is always equal to one ETU (bits[8:0]).

Other Modes:

Not used.

REGISTER 13-11: UxP3: UARTx TIMING PARAMETER 3 REGISTER

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
P3[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
P3[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 P3[15:0]: Parameter 3 bits

LIN Responder RX:

Number of bytes to receive (bits[7:0]).

Asynchronous RX:

Used to mask the UxP2 address bits; 1 = P2 address bit is used, 0 = P2 address bit is masked off (bits[7:0]).

Smart Card Mode:

Waiting Time Counter bits (bits[15:0]).

Other Modes:

Not used.

REGISTER 13-12: UxP3H: UARTx TIMING PARAMETER 3 REGISTER HIGH

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-8 Unimplemented: Read as '0'

bit 7-0 P3[23:16]: Parameter 3 High bits

Smart Card Mode:

Waiting Time Counter bits (bits[23:16]).

Other Modes:

Not used.

REGISTER 13-13: UxTXCHK: UARTx TRANSMIT CHECKSUM REGISTER

U-0 U-0 U-0 U-0 U-0 U-0 U-0 U-0
—————— — —
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
TXCHK[7:0]
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 cleared x = Bit is unknown

bit 15-8 Unimplemented: Read as '0'

bit 7-0 TXCHK[7:0]: Transmit Checksum bits (calculated from TX words)

LIN Modes:

C0EN = 1: Sum of all transmitted data + addition carries, including PID.

C0EN = 0: Sum of all transmitted data + addition carries, excluding PID.

LIN Responder:

Cleared when Break is detected.

LIN Commander/Responder:

Cleared when Break is detected.

Other Modes:

COEN = 1: Sum of every byte transmitted + addition carries.

C0EN = 0: Value remains unchanged.

REGISTER 13-14: UxRXCHK: UARTx RECEIVE CHECKSUM REGISTER

U-0 U-0 U-0 U-0 U-0 U-0 U-0 U-0
—————— — —
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
RXCHK[7:0]
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-8 Unimplemented: Read as '0'

bit 7-0 RXCHK[7:0]: Receive Checksum bits (calculated from RX words)

LIN Modes:

C0EN = 1: Sum of all received data + addition carries, including PID.

C0EN = 0: Sum of all received data + addition carries, excluding PID.

LIN Responder:

Cleared when Break is detected.

LIN Commander/Responder:

Cleared when Break is detected.

Other Modes:

COEN = 1: Sum of every byte received + addition carries.

COEN = 0: Value remains unchanged.

REGISTER 13-15: UxSCCON: UARTx SMART CARD CONFIGURATION REGISTER

U-0 U-0 U-0 U-0 U-0 U-0 U-0 U-0
——————
bit 15 bit 8
U-0U-0R/W-0R/W-0R/W-0R/W-0R/W-0U-0
TXRPT1TXRPT0CONVT0PDPRTCL
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-6 Unimplemented: Read as '0'

bit 5-4 TXRPT[1:0]: Transmit Repeat Selection bits

11 = Retransmit the error byte four times

10 = Retransmit the error byte three times

01 = Retransmit the error byte twice

00 = Retransmit the error byte once

bit 3 CONV: Logic Convention Selection bit

1 = Inverse logic convention

0 = Direct logic convention

bit 2 T0PD: Pull-Down Duration for T = 0 Error Handling bit

1 = 2 ETU

0 = 1 ETU

bit 1 PRTCL: Smart Card Protocol Selection bit

1 = T = 1

0 = T = 0

bit 0 Unimplemented: Read as '0'

REGISTER 13-16: UxSCINT: UARTx SMART CARD INTERRUPT REGISTER

U-0 U-0 HS/R/W-0 HS/R/W-0 U-0 HS/R/W-0 HS/R/W-0 HS/R/W-0
RXRPTIFTXRPTIFBTCIFWTCIFGTCIF
bit 15 bit 8
U-0U-0R/W-0R/W-0U-0R/W-0R/W-0R/W-0
RXRPTIETXRPTIEBTCIEWTCIEGTCIE
bit 7 bit 0
Legend:HS = Hardware Settable 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 15-14 Unimplemented: Read as '0'

bit 13 RXRPTIF: Receive Repeat Interrupt Flag bit

1 = Parity error has persisted after the same character has been received five times (four retransmits) 0 = Flag is cleared

bit 12 TXRPTIF: Transmit Repeat Interrupt Flag bit

1 = Line error has been detected after the last retransmit per TXRPT[1:0] 0 = Flag is cleared

bit 11 Unimplemented: Read as '0'

bit 10 BTCIF: Block Time Counter Interrupt Flag bit

1 = Block Time Counter has reached 0

0 = Block Time Counter has not reached 0

bit 9 WTCIF: Waiting Time Counter Interrupt Flag bit

1 = Waiting Time Counter has reached 0

0 = Waiting Time Counter has not reached 0

bit 8 GTCIF: Guard Time Counter Interrupt Flag bit

1 = Guard Time Counter has reached 0

0 = Guard Time Counter has not reached 0

bit 7-6 Unimplemented: Read as '0'

bit 5 RXRPTIE: Receive Repeat Interrupt Enable bit

1 = An interrupt is invoked when a parity error has persisted after the same character has been received five times (four retransmits) 0 = Interrupt is disabled

bit 4 TXRPTIE: Transmit Repeat Interrupt Enable bit

1 = An interrupt is invoked when a line error is detected after the last retransmit per TXRPT[1:0] has been completed 0 = Interrupt is disabled

bit 3 Unimplemented: Read as '0'

bit 2 BTCIE: Block Time Counter Interrupt Enable bit

1 = Block Time Counter interrupt is enabled

0 = Block Time Counter interrupt is disabled

bit 1 WTCIE: Waiting Time Counter Interrupt Enable bit

1 = Waiting Time Counter interrupt is enabled

0 = Waiting Time Counter Interrupt is disabled

bit 0 GTCIE: Guard Time Counter interrupt enable bit

1 = Guard Time Counter interrupt is enabled

0 = Guard Time Counter interrupt is disabled

REGISTER 13-17: UxINT: UARTx INTERRUPT REGISTER

U-0 U-0 U-0 U-0 U-0 U-0 U-0 U-0
——————
bit 15 bit 8
HS/R/W-0HS/R/W-0U-0U-0U-0R/W-0U-0U-0
WUIFABDIF— — —ABDIE— —
bit 7 bit 0
Legend:HS = Hardware Settable 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 15-8 Unimplemented: Read as '0'

bit 7 WUIF: Wake-up Interrupt Flag bit

1 = Sets when WAKE = 1 and RX makes a '1'-to-'0' transition; triggers event interrupt (must be cleared by software) 0 = WAKE is not enabled or WAKE is enabled, but no wake-up event has occurred

bit 6 ABDIF: Auto-Baud Completed Interrupt Flag bit

1 = Sets when ABD sequence makes the final '1'-to-'0' transition; triggers event interrupt (must be cleared by software) 0 = ABAUD is not enabled or ABAUD is enabled but auto-baud has not completed

bit 5-3 Unimplemented: Read as '0'

bit 2 ABDIE: Auto-Baud Completed Interrupt Enable Flag bit

1 = Allows ABDIF to set an event interrupt 0 = ABDIF does not set an event interrupt

bit 1-0 Unimplemented: Read as '0'

NOTES:

14.0 SERIAL PERIPHERAL INTERFACE (SPI)

Note 1: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive reference source. To complement the information in this data sheet, refer to “Serial Peripheral Interface (SPI) with Audio Codec Support” (www.microchip.com/DS70005136), which is available from the Microchip website (www.microchip.com).

2: The SPI is Identical for both Main core and Secondary core. The x is common for both Main and Secondary (where the x represents the number of the specific module being addressed). The number of SPI modules available on the Main and Secondary is different and they are located in different SFR locations.

3: All associated register names are the same on the Main core and the Secondary core. The Secondary code will be developed in a separate project in MPLAB X IDE with the device selection, dsPIC33CH128MP508S1, where the S1 indicates the Secondary device. The Main is SPI1 and SPI2, and the Secondary is SPI1.

Table 14-1 shows an overview of the SPI module.
TABLE 14-1: SPI MODULE OVERVIEW

Number of SPI ModulesIdentical (Modules)
Main Core 2 Yes
Secondary Core1Yes

The Serial Peripheral Interface (SPI) module is a synchronous serial interface, useful for communicating with other peripheral or microcontroller devices. These peripheral devices may be serial EEPROMs, shift registers, display drivers, A/D Converters, etc. The SPI module is compatible with the Motorola® SPI and SIOP interfaces. All devices in the dsPIC33CH128MP508 family include three SPI modules; two SPIs for the Main core and one for the Secondary core. On 48, 64 and 80-pin devices, one of the SPI modules can operate at higher speeds when selected as a non-PPS pin. For the Main core, it will be SPI2 and for the Secondary core, it will be SPI1. The selection is done using the SPI2PIN bit (FDEVOPT[13]) for the Main and the S1SPI1PIN bit (FS1DEVOPT[13]) for the Secondary. If the bit for SPI2PIN/S1SPI1PIN is '1', the PPS pin will be used. If the SPI2PIN/S1SPI1PIN is '0', it will use the dedicated SPI pads.

The module supports operation in two Buffer modes. In Standard mode, data are shifted through a single serial buffer. In Enhanced Buffer mode, data are shifted through a FIFO buffer. The FIFO level depends on the configured mode.

Note: FIFO depth for this device is four (in 8-Bit Data mode).

Variable length data can be transmitted and received, from 2 to 32 bits.

Note: Do not perform Read-Modify-Write operations (such as bit-oriented instructions) on the SPIxBUF register in either Standard or Enhanced Buffer mode.

The module also supports a basic framed SPI protocol while operating in either Main or Secondary mode. A total of four framed SPI configurations are supported.

The module also supports Audio modes. Four different Audio modes are available.

  • I^2S mode
  • Left Justified mode
    • Right Justified mode
  • PCM/DSP mode

In each of these modes, the serial clock is free-running and audio data are always transferred.

If an audio protocol data transfer takes place between two devices, then usually one device is the Main and the other is the Secondary. However, audio data can be transferred between two Secondarys. Because the audio protocols require free-running clocks, the Main can be a third-party controller. In either case, the Main generates two free-running clocks: SCKx and LRC (Left, Right Channel Clock/SSx/FSYNC).

The SPI serial interface consists of four pins:

  • SDIx/S1SDIx: Serial Data Input
  • SDOx/S1SDOx: Serial Data Output
    • SCKx/S1SCKx: Shift Clock Input or Output
  • SSx /S1SSx: Active-Low Secondary Select or Frame Synchronization I/O Pulse

The SPI module can be configured to operate using two, three or four pins. In the 3-pin mode, SSx/S1SSx is not used. In the 2-pin mode, both SDOx/S1SDOx and SSx/S1SSx are not used.

The SPI module has the ability to generate three interrupts reflecting the events that occur during the data communication. The following types of interrupts can be generated:

  1. Receive interrupts are signalled by SPIxRXIF.

This event occurs when:

  • RX watermark interrupt
  • SPIROV = 1
  • SPIRBF = 1
  • SPIRBE = 1

provided the respective mask bits are enabled in SPIxIMSKL/H.

  1. Transmit interrupts are signalled by SPIxTXIF.

This event occurs when:

  • TX watermark interrupt
  • SPITUR = 1
  • SPITBF = 1
  • SPITBE = 1

provided the respective mask bits are enabled in SPIxIMSKL/H.

  1. General interrupts are signalled by SPIxGIF.

This event occurs when:

  • FRMERR = 1
  • SPIBUSY = 1
  • SRMT = 1

provided the respective mask bits are enabled in SPIxIMSKL/H.

Block diagrams of the module in Standard and Enhanced modes are shown in Figure 14-1 and Figure 14-2.

Note: In this section, the SPI modules are referred to together as SPIx, or separately as SPI1, SPI2 or SPI3. Special Function Registers will follow a similar notation. For example, SPIxCON1 and SPIxCON2 refer to the control registers for any of the three SPI modules.

To set up the SPIx module for the Standard Main mode of operation:

  1. If using interrupts:

a) Clear the interrupt flag bits in the respective IFSx register.
b) Set the interrupt enable bits in the respective IECx register.
c) Write the SPIxIP bits in the respective IPCx register to set the interrupt priority.

  1. Write the desired settings to the SPIxCON1L and SPIxCON1H registers with the MSTEN bit (SPIxCON1L[5]) = 1.
  2. Clear the SPIROV bit (SPIxSTATL[6]).
  3. Enable SPIx operation by setting the SPIEN bit (SPIxCON1L[15]).
  4. Write the data to be transmitted to the SPIxBUFL and SPIxBUFH registers. Transmission (and reception) will start as soon as data are written to the SPIxBUFL and SPIxBUFH registers.

To set up the SPIx module for the Standard Secondary mode of operation:

  1. Clear the SPIxBUF registers.
  2. If using interrupts:

a) Clear the SPIxBUFL and SPIxBUFH registers.
b) Set the interrupt enable bits in the respective IECx register.
c) Write the SPIxIP bits in the respective IPCx register to set the interrupt priority.

  1. Write the desired settings to the SPIxCON1L, SPIxCON1H and SPIxCON2L registers with the MSTEN bit (SPIxCON1L[5]) = 0.

  2. Clear the SMP bit.

  3. If the CKE bit (SPIxCON1L[8]) is set, then the SSEN bit (SPIxCON1L[7]) must be set to enable the SSx pin.
  4. Clear the SPIROV bit (SPIxSTATL[6]).
  5. Enable SPIx operation by setting the SPIEN bit (SPIxCON1L[15]).

FIGURE 14-1: SPIx MODULE BLOCK DIAGRAM (STANDARD MODE)
Microchip dsPIC33CH64MP208 - SERIAL PERIPHERAL INTERFACE (SPI) - 1

flowchart
graph TD
    A["Read"] --> B["SPIxRXB"]
    B --> C["SPIxTXB"]
    C --> D["SPIxURDT"]
    D --> E["MSB"]
    E --> F["SPIxTXSR"]
    F --> G["Shift Control"]
    G --> H["Clock Control"]
    H --> I["Edge Select"]
    I --> J["Baud Rate Generator"]
    J --> K["Enable Main Clock"]
    K --> L["SSx & FSYNC Control"]
    L --> M["SSx/FSYNC"]
    M --> N["SCKx"]
    N --> O["Edge Select"]
    O --> P["Clock Control"]
    P --> Q["Shift Control"]
    Q --> R["Clock Control"]
    R --> S["Shift Control"]
    S --> T["Shift Control"]
    T --> U["Shift Control"]
    U --> V["Shift Control"]
    V --> W["Shift Control"]
    W --> X["Shift Control"]
    X --> Y["Shift Control"]
    Y --> Z["Shift Control"]
    Z --> AA["Shift Control"]
    AA --> AB["Shift Control"]
    AB --> AC["Shift Control"]
    AC --> AD["Shift Control"]
    AD --> AE["Shift Control"]
    AE --> AF["Shift Control"]
    AF --> AG["Shift Control"]
    AG --> AH["Shift Control"]
    AH --> AI["Shift Control"]
    AI --> AJ["Shift Control"]
    AJ --> AK["Shift Control"]
    AK --> AL["Shift Control"]
    AL --> AM["Shift Control"]
    AM --> AN["Shift Control"]
    AN --> AO["Shift Control"]
    AO --> AP["Shift Control"]
    AP --> AQ["Shift Control"]
    AQ --> AR["Shift Control"]
    AR --> AS["Shift Control"]
    AS --> AT["Shift Control"]
    AT --> AU["Shift Control"]
    AU --> AV["Shift Control"]
    AV --> AW["Shift Control"]
    AW --> AX["Shift Control"]
    AX --> AY["Shift Control"]
    AY --> AZ["Shift Control"]
    AZ --> BA["Shift Control"]
    BA --> BB["Shift Control"]
    BB --> BC["Shift Control"]
    BC --> BD["Shift Control"]
    BD --> BE["Shift Control"]
    BE --> BF["Shift Control"]
    BF --> BG["Shift Control"]
    BG --> BH["Shift Control"]
    BH --> BI["Shift Control"]
    BI --> BJ["Shift Control"]
    BJ --> BK["Shift Control"]
    BK --> BL["Shift Control"]
    BL --> BM["Shift Control"]
    BM --> BN["Shift Control"]
    BN --> BO["Shift Control"]
    BO --> BP["Shift Control"]
    BP --> BQ["Shift Control"]
    BQ --> BR["Shift Control"]
    BR --> BS["Shift Control"]
    BS --> BT["Shift Control"]
    BT --> BU["Shift Control"]
    BU --> BV["Shift Control"]
    BV --> BW["Shift Control"]
    BW --> BX["Shift Control"]
    BX --> BY["Shift Control"]
    BY --> BZ["Shift Control"]
    BZ --> CA["Shift Control"]
    CA --> CB["Shift Control"]
    CB --> CC["Shift Control"]
    CC --> CD["Shift Control"]
    CD --> CE["Shift Control"]
    CE --> CF["Shift Control"]
    CF --> CG["Shift Control"]
    CG --> CH["Shift Control"]
    CH --> CI["Shift Control"]
    CI --> CJ["Shift Control"]
    CJ --> CK["Shift Control"]
    CK --> CL["Shift Control"]
    CL --> CM["Shift Control"]
    CM --> CN["Shift Control"]
    CN --> CO["Shift Control"]
    CO --> CP["Shift Control"]
    CP --> CQ["Shift Control"]
    CQ --> CR["Shift Control"]
    CR --> CS["Shift Control"]
    CS --> CT["Shift Control"]
    CT --> CU["Shift Control"]
    CU --> CV["Shift Control"]
    CV --> CW["Shift Control"]
    CW --> CX["Shift Control"]
    CX --> CY["Shift Control"]
    CY --> CZ["Shift Control"]
    CZ --> DA["Shift Control"]
    DA --> DB["Shift Control"]
    DB --> DC["Shift Control"]
    DC --> DD["Shift Control"]
    DD --> DE["Shift Control"]
    DE --> DF["Shift Control"]
    DF --> DG["Shift Control"]
    DG --> DH["Shift Control"]
    DH --> DI["Shift Control"]
    DI --> DJ["Shift Control"]
    DJ --> DK["Shift Control"]
    DK --> DL["Shift Control"]
    DL --> DV["Shift Control"]
    DV --> DW["Shift Control"]
    DW --> DX["Shift Control"]
    DX --> DXA["MCLKEN"]
    DXA --> DXB["MCLK"]
    DXB --> DXC["PBCLK"]

To set up the SPIx module for the Enhanced Buffer Main mode of operation:

  1. If using interrupts:

a) Clear the interrupt flag bits in the respective IFSx register.
b) Set the interrupt enable bits in the respective IECx register.
c) Write the SPIxIP bits in the respective IPCx register.

  1. Write the desired settings to the SPIxCON1L, SPIxCON1H and SPIxCON2L registers with MSTEN (SPIxCON1L[5]) = 1.
  2. Clear the SPIROV bit (SPIxSTATL[6]).
  3. Select Enhanced Buffer mode by setting the ENHBUF bit (SPIxCON1L[0]).
  4. Enable SPIx operation by setting the SPIEN bit (SPIxCON1L[15]).
  5. Write the data to be transmitted to the SPIxBUFL and SPIxBUFH registers. Transmission (and reception) will start as soon as data are written to the SPIxBUFL and SPIxBUFH registers.

To set up the SPIx module for the Enhanced Buffer Secondary mode of operation:

  1. Clear the SPIxBUFL and SPIxBUFH registers.
  2. If using interrupts:

a) Clear the interrupt flag bits in the respective IFSx register.
b) Set the interrupt enable bits in the respective IECx register.
c) Write the SPIxIP bits in the respective IPCx register to set the interrupt priority.

  1. Write the desired settings to the SPIxCON1L, SPIxCON1H and SPIxCON2L registers with the MSTEN bit (SPIxCON1L[5]) = 0.

  2. Clear the SMP bit.

  3. If the CKE bit is set, then the SSEN bit must be set, thus enabling the pin.
  4. Clear the SPIROV bit (SPIxSTATL[6]).
  5. Select Enhanced Buffer mode by setting the ENHBUF bit (SPIxCON1L[0]).
  6. Enable SPIx operation by setting the SPIEN bit (SPIxCON1L[15]).

FIGURE 14-2: SPIx MODULE BLOCK DIAGRAM (ENHANCED MODE)
Microchip dsPIC33CH64MP208 - SERIAL PERIPHERAL INTERFACE (SPI) - 2

flowchart
graph TD
    A["Read"] --> B["SPIxRXB"]
    C["Write"] --> D["SPIxTXB"]
    E["Internal Data Bus"] --> B
    B --> F["SPIxRXSR"]
    D --> G["SPIxTXSR"]
    F --> H["Shift Control"]
    H --> I["Clock Control"]
    I --> J["Edge Select"]
    J --> K["Baud Rate Generator"]
    K --> L["Enable Main Clock"]
    M["SDIx"] --> N["->"]
    O["SDOx"] --> P["->"]
    Q["SSx/FSYNC"] --> R["SSx and FSYNC Control"]
    S["SCKx"] --> T["Edge Select"]
    T --> U["Clock Control"]
    V["TXELM[5:0"] = 6' b0] --> K
    W["MCLKEN"] --> K
    X["MCLK"] --> K
    Y["PBCLK"] --> K
    Z["MSB"] --> F
    style A fill:#f9f,stroke:#333
    style C fill:#f9f,stroke:#333
    style E fill:#f9f,stroke:#333
    style M fill:#ccf,stroke:#333
    style O fill:#ccf,stroke:#333
    style Q fill:#ccf,stroke:#333
    style S fill:#ccf,stroke:#333
    style T fill:#ccf,stroke:#333
    style U fill:#ccf,stroke:#333
    style V fill:#ccf,stroke:#333
    style W fill:#ccf,stroke:#333

To set up the SPIx module for Audio mode:

  1. Clear the SPIxBUFL and SPIxBUFH registers.
  2. If using interrupts:

a) Clear the interrupt flag bits in the respective IFSx register.
b) Set the interrupt enable bits in the respective IECx register.
a) Write the SPIxIP bits in the respective IPCx register to set the interrupt priority.

  1. Write the desired settings to the SPIxCON1L, SPIxCON1H and SPIxCON2L registers with AUDEN (SPIxCON1H[15]) = 1.
  2. Clear the SPIROV bit (SPIxSTATL[6]).
  3. Enable SPIx operation by setting the SPIEN bit (SPIxCON1L[15]).
  4. Write the data to be transmitted to the SPIxBUFL and SPIxBUFH registers. Transmission (and reception) will start as soon as data are written to the SPIxBUFL and SPIxBUFH registers.

14.1 SPI Control/Status Registers

REGISTER 14-1: SPIxCON1L: SPIx CONTROL REGISTER 1 LOW

R/W-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
SPIENSPISIDLDIS$DOMODE32(1,4)MODE16(1,4)SMP CKE(1)
bit 15 bit 8
R / W - 0 R / W - 0 R /
SSEN(2)CKP MSTEN DISSDIDISSCKMCLKEN(3)SPIFEENHBUF
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

0 = Turns off and resets module, disables clocks, disables interrupt event generation, allows SFR modifications

bit 14 Unimplemented: Read as '0'

bit 13 SPISIDL: SPIx Stop in Idle Mode bit

1 = Halts in CPU Idle mode

0 = Continues to operate in CPU Idle mode

bit 12 DISSDO: Disable SDOx Output Port bit

1 = SDOx pin is not used by the module; pin is controlled by port function

0 = SDOx pin is controlled by the module

bit 11-10 MODE32 and MODE16: Serial Word Length Select bits ^(1,4)

MODE32MODE16 AUDENCommunication
1x032-Bit
0116-Bit
008-Bit
11124-Bit Data, 32-Bit FIFO, 32-Bit Channel/64-Bit Frame
1032-Bit Data, 32-Bit FIFO, 32-Bit Channel/64-Bit Frame
0116-Bit Data, 16-Bit FIFO, 32-Bit Channel/64-Bit Frame
0016-Bit FIFO, 16-Bit Channel/32-Bit Frame

bit 9 SMP: SPIx Data Input Sample Phase bit

Main Mode:

1 = Input data are sampled at the end of data output time

0 = Input data are sampled at the middle of data output time

Secondary Mode:

Input data are always sampled at the middle of data output time, regardless of the SMP setting.

bit 8 CKE: SPIx Clock Edge Select bit ^(1)

1 = Transmit happens on transition from active clock state to Idle clock state

0 = Transmit happens on transition from Idle clock state to active clock state

Note 1: When AUDEN (SPIxCON1H[15]) = 1, this module functions as if CKE = 0, regardless of its actual value.

2: When FRMEN = 1, SSEN is not used.

3: MCLKEN can only be written when the SPIEN bit = 0.

4: This channel is not meaningful for DSP/PCM mode as LRC follows FRMSYPW.

REGISTER 14-1: SPIxCON1L: SPIx CONTROL REGISTER 1 LOW (CONTINUED)

bit 7 SSEN: Secondary Select Enable bit (Secondary mode) (2)

1 = SSx pin is used by the macro in Secondary mode; SSx pin is used as the Secondary select input
0 = SSx pin is not used by the macro (SSx pin will be controlled by the port I/O) 

bit 6 CKP: Clock Polarity Select bit

1 = Idle state for clock is a high level; active state is a low level
0 = Idle state for clock is a low level; active state is a high level 

bit 5 MSTEN: Main Mode Enable bit

1 = Main mode
0 = Secondary mode 

bit 4 DISSDI: Disable SDIx Input Port bit

1 = SDIx pin is not used by the module; pin is controlled by port function
0 = SDIx pin is controlled by the module 

bit 3 DISSCK: Disable SCKx Output Port bit

1 = SCKx pin is not used by the module; pin is controlled by port function
0 = SCKx pin is controlled by the module 

bit 2 MCLKEN: Main Clock Enable bit (3)

1 = MCLK is used by the BRG
0 = PBCLK is used by the BRG 

bit 1 SPIFE: Frame Sync Pulse Edge Select bit

1 = Frame Sync pulse (Idle-to-active edge) coincides with the first bit clock
0 = Frame Sync pulse (Idle-to-active edge) precedes the first bit clock 

bit 0 ENHBUF: Enhanced Buffer Enable bit

1 = Enhanced Buffer mode is enabled
0 = Enhanced Buffer mode is disabled 

Note 1: When AUDEN (SPIxCON1H[15]) = 1, this module functions as if CKE = 0, regardless of its actual value.

2: When FRMEN = 1, SSEN is not used.

3: MCLKEN can only be written when the SPIEN bit = 0.

4: This channel is not meaningful for DSP/PCM mode as LRC follows FRMSYPW.

REGISTER 14-2: SPIxCON1H: SPIx CONTROL REGISTER 1 HIGH

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
AUDEN(1)SPISGNEXTIGNROVIGNTURAUDMONO (2)URDTEN(3)AUDMOD1(4)AUDMOD0(4)
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
FRMEN FRMSYNC FRMPPOL MSSEN FRRMSYPW FRMMCNT2 FRMCNT1 FRMCNT0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15 AUDEN: Audio Codec Support Enable bit ^(1)

1 = Audio protocol is enabled; MSTEN controls the direction of both SCKx and frame (a.k.a. LRC), and this module functions as if FRMEN = 1, FRMSYNC = MSTEN, FRMCNT[2:0] = 0.01 and SMP = 0, regardless of their actual values 0 = Audio protocol is disabled

bit 14 SPISGNEXT: SPIx Sign-Extend RX FIFO Read Data Enable bit

1 = Data from RX FIFO are sign-extended 0 = Data from RX FIFO are not sign-extended

bit 13 IGNROV: Ignore Receive Overflow bit

1 = A Receive Overflow (ROV) is NOT a critical error; during ROV, data in the FIFO are not overwritten by the receive data 0 = A ROV is a critical error that stops SPI operation

bit 12 IGNTUR: Ignore Transmit Underrun bit

1 = A Transmit Underrun (TUR) is NOT a critical error and data indicated by URDTEN are transmitted until the SPIxTXB is not empty 0 = A TUR is a critical error that stops SPI operation

bit 11 AUDMONO: Audio Data Format Transmit bit ^(2)

1 = Audio data are mono (i.e., each data word is transmitted on both left and right channels) 0 = Audio data are stereo

bit 10 URDTEN: Transmit Underrun Data Enable bit ^(3)

1 = Transmits data out of SPIxURDT register during Transmit Underrun conditions 0 = Transmits the last received data during Transmit Underrun conditions

bit 9-8 AUDMOD[1:0]: Audio Protocol Mode Selection bits ^(4)

11 = PCM/DSP mode 10 = Right Justified mode: This module functions as if SPIFE = 1, regardless of its actual value 01 = Left Justified mode: This module functions as if SPIFE = 1, regardless of its actual value 00 = I²S mode: This module functions as if SPIFE = 0, regardless of its actual value

bit 7 FRMEN: Framed SPIx Support bit

1 = Framed SPIx support is enabled (SSx pin is used as the FSYNC input/output) 0 = Framed SPIx support is disabled

Note 1: AUDEN can only be written when the SPIEN bit = 0.

2: AUDMONO can only be written when the SPIEN bit = 0 and is only valid for AUDEN = 1.

3: URDTEN is only valid when IGNTUR = 1.

4: AUDMOD[1:0] can only be written when the SPIEN bit = 0 and is only valid when AUDEN = 1. When NOT in PCM/DSP mode, this module functions as if FRMSYPW = 1, regardless of its actual value.

REGISTER 14-2: SPIxCON1H: SPIx CONTROL REGISTER 1 HIGH (CONTINUED)

bit 6 FRMSYNC: Frame Sync Pulse Direction Control bit

1 = Frame Sync pulse input (Secondary)

0 = Frame Sync pulse output (Main)

bit 5 FRMPOL: Frame Sync/Secondary Select Polarity bit

1 = Frame Sync pulse/Secondary select is active-high

0 = Frame Sync pulse/Secondary select is active-low

bit 4 MSSEN: Main Mode Secondary Select Enable bit

1 = SPIx Secondary select support is enabled with polarity determined by FRMPOL (SSx pin is automatically driven during transmission in Main mode)

0 = Secondary select SPIx support is disabled (SSx pin will be controlled by port I/O)

bit 3 FRMSYPW: Frame Sync Pulse-Width bit

1 = Frame Sync pulse is one serial word length wide (as defined by MODE[32,16]/WLENGTH[4:0])

0 = Frame Sync pulse is one clock (SCKx) wide

bit 2-0 FRMCNT[2:0]: Frame Sync Pulse Counter bits

Controls the number of serial words transmitted per Sync pulse.

111 = Reserved

110 = Reserved

101 = Generates a Frame Sync pulse on every 32 serial words

100 = Generates a Frame Sync pulse on every 16 serial words

011 = Generates a Frame Sync pulse on every 8 serial words

010 = Generates a Frame Sync pulse on every 4 serial words

001 = Generates a Frame Sync pulse on every 2 serial words (value used by audio protocols)

000 = Generates a Frame Sync pulse on each serial word

Note 1: AUDEN can only be written when the SPIEN bit = 0.

2: AUDMONO can only be written when the SPIEN bit = 0 and is only valid for AUDEN = 1.

3: URDTEN is only valid when IGNTUR = 1.

4: AUDMOD[1:0] can only be written when the SPIEN bit = 0 and is only valid when AUDEN = 1. When NOT in PCM/DSP mode, this module functions as if FRMSYPW = 1, regardless of its actual value.

REGISTER 14-3: SPIxCON2L: SPIx CONTROL REGISTER 2 LOW

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 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
— — —WLENGTH[4:0](1,2)
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-5 Unimplemented: Read as '0' bit 4-0 WLENGTH[4:0]: Variable Word Length bits ^(1,2) 11111 = 32-bit data 11110 = 31-bit data 11101 = 30-bit data 11100 = 29-bit data 11011 = 28-bit data 11010 = 27-bit data 11001 = 26-bit data 11000 = 25-bit data 10111 = 24-bit data 10110 = 23-bit data 10101 = 22-bit data 10100 = 21-bit data 10011 = 20-bit data 10010 = 19-bit data 10001 = 18-bit data 10000 = 17-bit data 01111 = 16-bit data 01110 = 15-bit data 01101 = 14-bit data 01100 = 13-bit data 01011 = 12-bit data 01010 = 11-bit data 01001 = 10-bit data 01000 = 9-bit data 00111 = 8-bit data 00110 = 7-bit data 00101 = 6-bit data 00100 = 5-bit data 00011 = 4-bit data 00010 = 3-bit data 00001 = 2-bit data 00000 = See MODE[32,16] bits in SPIxCON1L[11:10]

Note 1: These bits are effective when AUDEN = 0 only.

2: Varying the length by changing these bits does not affect the depth of the TX/RX FIFO.

Legend:C = Clearable bitU = Unimplemented, read as ‘0’
R = Readable bitW = Writable bitHSC = Hardware Settable/Clearable bit
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared HS = Hardware Settable bit

bit 15-13 Unimplemented: Read as '0'

bit 12 FRMERR: SPIx Frame Error Status bit

1 = Frame error is detected

0 = No frame error is detected

bit 11 SPIBUSY: SPIx Activity Status bit

1 = Module is currently busy with some transactions

0 = No ongoing transactions (at time of read)

bit 10-9 Unimplemented: Read as '0'

bit 8 SPITUR: SPIx Transmit Underrun Status bit ^(1)

1 = Transmit buffer has encountered a Transmit Underrun condition

0 = Transmit buffer does not have a Transmit Underrun condition

bit 7 SRMT: Shift Register Empty Status bit

1 = No current or pending transactions (i.e., neither SPIxTXB or SPIxTXSR contains data to transmit)

0 = Current or pending transactions

bit 6 SPIROV: SPIx Receive Overflow Status bit

1 = A new byte/half-word/word has been completely received when the SPIxRXB was full

0 = No overflow

bit 5 SPIRBE: SPIx RX Buffer Empty Status bit

1 = RX buffer is empty

0 = RX buffer is not empty

Standard Buffer Mode:

Automatically set in hardware when SPIxBUF is read from, reading SPIxRXB. Automatically cleared in hardware when SPIx transfers data from SPIxRXSR to SPIxRXB.

Enhanced Buffer Mode:

Indicates RXELM[5:0] = 000000.

bit 4 Unimplemented: Read as '0'

Note 1: SPITUR is cleared when SPIEN = 0. When IGNTUR = 1, SPITUR provides dynamic status of the Transmit Underrun condition, but does not stop RX/TX operation and does not need to be cleared by software.

REGISTER 14-4: SPIxSTATL: SPIx STATUS REGISTER LOW (CONTINUED)
bit 3 SPITBE: SPIx Transmit Buffer Empty Status bit 1 = SPIxTXB is empty 0 = SPIxTXB is not empty Standard Buffer Mode: Automatically set in hardware when SPIx transfers data from SPIxTXB to SPIxTXSR. Automatically cleared in hardware when SPIxBUF is written, loading SPIxTXB. Enhanced Buffer Mode: Indicates TXELM[5:0] = 000000. bit 2 Unimplemented: Read as '0' bit 1 SPITBF: SPIx Transmit Buffer Full Status bit 1 = SPIxTXB is full 0 = SPIxTXB not full Standard Buffer Mode: Automatically set in hardware when SPIxBUF is written, loading SPIxTXB. Automatically cleared in hardware when SPIx transfers data from SPIxTXB to SPIxTXSR. Enhanced Buffer Mode: Indicates TXELM[5:0] = 111111. bit 0 SPIRBF: SPIx Receive Buffer Full Status bit 1 = SPIxRXB is full 0 = SPIxRXB is not full Standard Buffer Mode: Automatically set in hardware when SPIx transfers data from SPIxRXSR to SPIxRXB. Automatically cleared in hardware when SPIxBUF is read from, reading SPIxRXB. Enhanced Buffer Mode: Indicates RXELM[5:0] = 111111.

Note 1: SPITUR is cleared when SPIEN = 0. When IGNTUR = 1, SPITUR provides dynamic status of the Transmit Underrun condition, but does not stop RX/TX operation and does not need to be cleared by software.

U-0 U-0 HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0
— — RXELM5(3)RXELM4(2)RXELM3(1)RXELM2 RXELM1 RXELM0
bit 15 bit 8
U-0 U-0 HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0
— — TXELM5(3)TXELM4(2)TXELM3(1)TXELM2 TXELM1 TXELM0
bit 7bit 0
Legend:HSC = Hardware Settable/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 15-14 Unimplemented: Read as '0'

bit 13-8 RXELM[5:0]: Receive Buffer Element Count bits (valid in Enhanced Buffer mode) ^(1,2,3)

bit 7-6 Unimplemented: Read as '0'

bit 5-0 TXELM[5:0]: Transmit Buffer Element Count bits (valid in Enhanced Buffer mode) ^(1,2,3)

Note 1: RXELM3 and TXELM3 bits are only present when FIFODEPTH = 8 or higher.

2: RXELM4 and TXELM4 bits are only present when FIFODEPTH = 16 or higher.

3: RXELM5 and TXELM5 bits are only present when FIFODEPTH = 32.

REGISTER 14-6: SPIxIMSKL: SPIx INTERRUPT MASK REGISTER LOW

U-0 U-0 U-0 R/W-0 R/W-0 U-0 U-0 R/W-0
— — —FRMERREN BUSYEN — —SPITUREN
bit 15 bit 8
R/W-0 R/W-0 R/W-0 U-0 R/W-0 U-0 R/W-0 R/W-0
SRMTEN SPIROVEN SPIRBENSPITBENSPITBFENSPIRBFEN
bit 7 bit 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-13 Unimplemented: Read as '0'

bit 12 FRMERREN: Enable Interrupt Events via FRMERR bit

1 = Frame error generates an interrupt event

0 = Frame error does not generate an interrupt event

bit 11 BUSYEN: Enable Interrupt Events via SPIBUSY bit

1 = SPIBUSY generates an interrupt event

0 = SPIBUSY does not generate an interrupt event

bit 10-9 Unimplemented: Read as '0'

bit 8 SPITUREN: Enable Interrupt Events via SPITUR bit

1 = Transmit Underrun (TUR) generates an interrupt event

0 = Transmit Underrun does not generate an interrupt event

bit 7 SRMTEN: Enable Interrupt Events via SRMT bit

1 = Shift Register Empty (SRMT) generates interrupt events

0 = Shift Register Empty does not generate interrupt events

bit 6 SPIROVEN: Enable Interrupt Events via SPIROV bit

1 = SPIx Receive Overflow (ROV) generates an interrupt event

0 = SPIx Receive Overflow does not generate an interrupt event

bit 5 SPIRBEN: Enable Interrupt Events via SPIRBE bit

1 = SPIx RX buffer empty generates an interrupt event

0 = SPIx RX buffer empty does not generate an interrupt event

bit 4 Unimplemented: Read as '0'

bit 3 SPITBEN: Enable Interrupt Events via SPITBE bit

1 = SPIx transmit buffer empty generates an interrupt event

0 = SPIx transmit buffer empty does not generate an interrupt event

bit 2 Unimplemented: Read as '0'

bit 1 SPITBFEN: Enable Interrupt Events via SPITBF bit

1 = SPIx transmit buffer full generates an interrupt event

0 = SPIx transmit buffer full does not generate an interrupt event

bit 0 SPIRBFEN: Enable Interrupt Events via SPIRBF bit

1 = SPIx receive buffer full generates an interrupt event

0 = SPIx receive buffer full does not generate an interrupt event

REGISTER 14-7: SPIxIMSKH: SPIx INTERRUPT MASK REGISTER HIGH

R/W-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
RXWIEN— RXMSK5(1)RXMSK4(1,4)RXMSK3(1,3)RXMSK2(1,2)RXMSK1(1)RXMSK0(1)
bit 15 bit 8
R/W-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
TXWIENT(1)TXMSK4(1,4)TXMSK3(1,3)TXMSK2(1,2)TXMSK1(1)TXMSK0(1)
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15 RXWIEN: Receive Watermark Interrupt Enable bit

1 = Triggers receive buffer element watermark interrupt when RXMSK[5:0] ≤ RXELM[5:0]

0 = Disables receive buffer element watermark interrupt

bit 14 Unimplemented: Read as '0'

bit 13-8 RXMSK[5:0]: RX Buffer Mask bits ^(1,2,3,4)

RX mask bits; used in conjunction with the RXWIEN bit.

bit 7 TXWIEN: Transmit Watermark Interrupt Enable bit

1 = Triggers transmit buffer element watermark interrupt when TXMSK[5:0] = TXELM[5:0]

0 = Disables transmit buffer element watermark interrupt

bit 6 Unimplemented: Read as '0'

bit 5-0 TXMSK[5:0]: TX Buffer Mask bits ^(1,2,3,4)

TX mask bits; used in conjunction with the TXWIEN bit.

Note 1: Mask values higher than FIFODEPTH are not valid. The module will not trigger a match for any value in this case.

2: RXMSK2 and TXMSK2 bits are only present when FIFODEPTH = 8 or higher.

3: RXMSK3 and TXMSK3 bits are only present when FIFODEPTH = 16 or higher.

4: RXMSK4 and TXMSK4 bits are only present when FIFODEPTH = 32.

FIGURE 14-3: SPIx HOST/CLIENT CONNECTION (STANDARD MODE)
Microchip dsPIC33CH64MP208 - REGISTER 14-2: SPIxCON1H: SPIx CONTROL REGISTER 1 HIGH (CONTINUED) - 1

flowchart
graph TD
    subgraph Processor 1 (SPIx Host)
        A["Serial Receive Buffer (SPIxRXB)²"] --> B["Shift Register (SPIxRXSR)"]
        B --> C["MSb"]
        B --> D["LSb"]
        E["Shift Register (SPIxTXSR)"] --> F["MSb"]
        E --> G["LSb"]
        H["Serial Transmit Buffer (SPIxTXB)²"] --> I["MSb"]
        H --> J["LSb"]
        K["SPIx Buffer (SPIxBUF)²"] --> L["MSb"]
        K --> M["LSb"]
    end

    subgraph Processor 2 (SPIx Client)
        N["Serial Transmit Buffer (SPIxTXB)²"] --> O["Shift Register (SPIxTXSR)"]
        O --> P["MSb"]
        O --> Q["LSb"]
        R["Shift Register (SPIxRXSR)"] --> S["MSb"]
        R --> T["LSb"]
        U["Serial Receive Buffer (SPIxRXB)²"] --> V["SSx¹"]
        W["SPIx Buffer (SPIxBUF)²"] --> X["MSb"]
        W --> Y["LSb"]
        Z["Serial Clock"] --> AA["SCKx"]
        AB["SCKx"] --> AC["SSx¹"]
    end

    A --> B
    B --> C
    C --> D
    D --> E
    E --> F
    F --> G
    G --> H
    H --> I
    I --> J
    J --> K
    K --> L
    L --> M
    M --> N
    N --> O
    O --> P
    P --> Q
    Q --> V
    V --> X
    X --> Y
    Y --> Z
    Z --> AA
    AA --> AB
    AB --> AC
    AC --> V
    V --> W

Note 1: Using the SSx pin in Secondary mode of operation is optional.
2: User must write transmit data to read the received data from SPIxBUF. The SPIxTXB and SPIxRXB registers are memory-mapped to SPIxBUF.

FIGURE 14-4: SPIx HOST/CLIENT CONNECTION (ENHANCED BUFFER MODES)
Microchip dsPIC33CH64MP208 - REGISTER 14-2: SPIxCON1H: SPIx CONTROL REGISTER 1 HIGH (CONTINUED) - 2

flowchart
graph TD
    subgraph Processor 1 (SPIx Main)
        A["Serial Receive FIFO (SPIxRXB)(2)"] --> B["Shift Register (SPIxRXSR)"]
        B --> C["MSb"]
        B --> D["LSb"]
        E["Shift Register (SPIxTXSR)"] --> F["Serial Transmit FIFO (SPIxTXB)(2)"]
        F --> G["MSb"]
        F --> H["LSb"]
        I["SPIx Buffer (SPIxBUF)(2)"] --> J["MSb"]
        J --> K["LSb"]
    end

    subgraph Processor 2 (SPIx Secondary)
        L["Serial Transmit FIFO (SPIxTXB)(2)"] --> M["Shift Register (SPIxTXSR)"]
        M --> N["MSb"]
        M --> O["LSb"]
        P["Shift Register (SPIxRXSR)"] --> Q["Serial Receive FIFO (SPIxRXB)(2)"]
        Q --> R["MSb"]
        Q --> S["LSb"]
        T["SSx(1)"] --> U["Serial Clock"]
        U --> V["SCKx"]
        V --> W["SCKx"]
        X["SDIx"] --> Y["SDOx"]
        Z["SDIx"] --> AA["SDIx"]
    end

    style Processor 1 fill:#f9f,stroke:#333
    style Processor 2 fill:#f9f,stroke:#333

Note 1: Using the pin in Secondary mode of operation is optional.
2: User must write transmit data to read the received data from SPIxBUF. The SPIxTXB and SPIxRXB registers are memory-mapped to SPIxBUF.

FIGURE 14-5: SPIx HOST, FRAME HOST CONNECTION DIAGRAM
Microchip dsPIC33CH64MP208 - REGISTER 14-2: SPIxCON1H: SPIx CONTROL REGISTER 1 HIGH (CONTINUED) - 3

flowchart
graph LR
    A["dsPIC33CH (SPIx Host, Frame Host)"] --> B["SDOx"]
    A --> C["SDIx"]
    A --> D["SCKx"]
    A --> E["SSx"]
    B --> F["Serial Clock"]
    C --> F
    D --> G["Frame Sync Pulse"]
    H["Processor 2"] --> I["SDIx"]
    H --> J["SDOx"]
    H --> K["SCKx"]
    H --> L["SSx"]

FIGURE 14-6: SPIx HOST, FRAME CLIENT CONNECTION DIAGRAM
Microchip dsPIC33CH64MP208 - REGISTER 14-2: SPIxCON1H: SPIx CONTROL REGISTER 1 HIGH (CONTINUED) - 4

flowchart
graph LR
    subgraph dsPIC33CH
        A["SDOx"] --> B["SDIx"]
        C["SDIx"] --> D["Serial Clock"]
        E["SCKx"] --> F["SCKx"]
        G["SSx"] --> H["Frame Sync Pulse"]
    end
    subgraph Processor 2
        I["SDIx"] --> J["SDOx"]
        K["SCKx"] --> L["SSx"]
    end

FIGURE 14-7: SPIx CLIENT, FRAME HOST CONNECTION DIAGRAM
Microchip dsPIC33CH64MP208 - REGISTER 14-2: SPIxCON1H: SPIx CONTROL REGISTER 1 HIGH (CONTINUED) - 5

flowchart
graph LR
    subgraph dsPIC33CH (SPIx Client, Frame Host)
        A["SDOx"] --> B["SDIx"]
        C["SDIx"] --> D["Serial Clock"]
        E["SCKx"] --> F["SCKx"]
        G["SSx"] --> H["SSx"]
        I["Frame Sync Pulse"] --> J["SSx"]
    end
    subgraph Processor 2
        K["SDIx"] --> L["SDOx"]
        M["SCKx"] --> N["SSx"]
    end

FIGURE 14-8: SPIx CLIENT, FRAME CLIENT CONNECTION DIAGRAM
Microchip dsPIC33CH64MP208 - REGISTER 14-2: SPIxCON1H: SPIx CONTROL REGISTER 1 HIGH (CONTINUED) - 6

flowchart
graph LR
    subgraph dsPIC33CH (SPIx Client, Frame Client)
        A["SDOx"] --> B["SDIx"]
        C["SDIx"] --> D["Serial Clock"]
        E["SCKx"] --> F["SCKx"]
        G["SSx"] --> H["Frame Sync Pulse"]
    end
    subgraph Processor 2
        I["SDIx"] --> J["SDOx"]
        K["SCKx"] --> L["SSx"]
    end

EQUATION 14-1: RELATIONSHIP BETWEEN DEVICE AND SPIx CLOCK SPEED

$$ B a u d R a t e = \frac {F P B}{(2 * (S P I x B R G + 1))} $$

Where:

FPB is the Peripheral Bus Clock Frequency.

15.0 INTER-INTEGRATED CIRCUIT (I²C)

Note 1: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive reference source. For more information, refer to “Inter-Integrated Circuit (I²C)” (www.microchip.com/DS70000199) which is available from the Microchip website (www.microchip.com).

2: The I ^2 C is identical for both Main core and Secondary core. The x is common for both Host and Client (where the x represents the number of the specific module being addressed). The number of I ^2 C modules available on the Host and Client is different and they are located in different SFR locations.

3: All associated register names are the same on the Main core and the Secondary core. The Secondary code will be developed in a separate project in MPLAB X IDE with the device selection, dsPIC33CH128MP508S1, where the S1 indicates the Secondary device. The Host I²C is I2C1 and I2C2, and the Client is I2C1.

The Inter-Integrated Circuit (I²C) module is a serial interface useful for communicating with other peripheral or microcontroller devices. These peripheral devices may be serial EEPROMs, display drivers, A/D Converters, etc.

The I ^2 C module supports these features:

• Independent Host and Client Logic
- 7-Bit and 10-Bit Device Addresses
- General Call Address as Defined in the I²C Protocol
- Clock Stretching to Provide Delays for the Processor to Respond to a Client Data Request
- Both 100 kHz and 400 kHz Bus Specifications
- Configurable Address Masking
- Multi-Host modes to Prevent Loss of Messages in Arbitration
- Bus Repeater mode, Allowing the Acceptance of All Messages as a Client, regardless of the Address
- Automatic SCL

A block diagram of the module is shown in Figure 15-1.

15.1 Communicating as a Host in a Single Host Environment

The details of sending a message in Host mode depends on the communication protocol for the device being communicated with. Typically, the sequence of events is as follows:

  1. Assert a Start condition on SDAx and SCLx.
  2. Send the I ^2 C device address byte to the Client with a write indication.

  3. Wait for and verify an Acknowledge from the Client.

  4. Send the first data byte (sometimes known as the command) to the Client.

  5. Wait for and verify an Acknowledge from the Client.

  6. Send the serial memory address low byte to the Client.

  7. Repeat Steps 4 and 5 until all data bytes are sent.

  8. Assert a Repeated Start condition on SDAx and SCLx.

  9. Send the device address byte to the Client with a read indication.

  10. Wait for and verify an Acknowledge from the Client.

  11. Enable Host reception to receive serial memory data.

  12. Generate an ACK or NACK condition at the end of a received byte of data.

  13. Generate a Stop condition on SDAx and SCLx.

FIGURE 15-1: I2Cx BLOCK DIAGRAM
Microchip dsPIC33CH64MP208 - Communicating as a Host in a Single Host Environment - 1

flowchart
graph TD
    A["SCLx"] --> B["Shift Clock"]
    C["SDAx"] --> D["Match Detect"]
    B --> E["I2CxRCV"]
    D --> F["I2CxRSR"]
    F --> G["LSB"]
    G --> H["Address Match"]
    H --> I["I2CxMSK"]
    I --> J["Write"]
    I --> K["Read"]
    L["Start and Stop Bit Detect"] --> M["Control Logic"]
    N["Start and Stop Bit Generation"] --> M
    O["Collision Detect"] --> M
    P["Acknowledge Generation"] --> M
    Q["Clock Stretching"] --> M
    R["I2CxTRN"] --> S["LSB"]
    T["Shift Clock"] --> U["BRG Down Counter"]
    V["Reload Control"] --> U
    W["I2CxBRG"] --> X["Write"]
    Y["TcY/2"] --> U
    M --> Z["I2CxSTAT"]
    M --> AA["I2CxCONL/H"]
    Z --> AB["Write"]
    Z --> AC["Read"]
    AD["Internal Data Bus"] --> AE["Read"]

15.2 Setting Baud Rate When Operating as a Bus Host

To compute the Baud Rate Generator reload value, use Equation 15-1.

EQUATION 15-1: COMPUTING BAUD RATE RELOAD VALUE ^(1,2,3)

$$ I 2 C x B R G = ((1 / F S C L - D e l a y) \cdot F P / 2) - 2 $$

Note 1: These clock rate values are for guidance only. The actual clock rate should be measured in its intended application.

2: Typical value of delay varies from 110 ns to 150 ns.

3: I2CxBRG values of 0 to 3 are expressly forbidden. The user should never program the I2CxBRG with a value of 0x0, 0x1, 0x2 or 0x3 as indeterminate results may occur.

15.3 Client Address Masking

The I2CxMSK register (Register 15-4) designates address bit positions as "don't care" for both 7-Bit and 10-Bit Addressing modes. Setting a particular bit location (= 1) in the I2CxMSK register causes the Client module to respond, whether the corresponding address bit value is a '0' or a '1'. For example, when I2CxMSK is set to '0010000000', the Client module will detect both addresses, '0000000000' and '0010000000'.

To enable address masking, the Intelligent Peripheral Management Interface (IPMI) must be disabled by clearing the STRICT bit (I2CxCONL[11]).

Note: As a result of changes in the I ^2 C protocol, the addresses in Table 15-2 are reserved and will not be Acknowledged in Client mode. This includes any address mask settings that include any of these addresses.

TABLE 15-1: I2Cx CLOCK RATES (1,2)

FcY FsCLI2CxBRG Value
DecimalHexadecimal
100 MHz1 MHz4129
100 MHz400 kHz11674
100 MHz100 kHz4911EB
80 MHz1 MHz3220
80 MHz400 kHz925C
80 MHz100 kHz392188
60 MHz1 MHz2418
60 MHz400 kHz6945
60 MHz100 kHz294126
40 MHz1 MHz150F
40 MHz400 kHz452D
40 MHz100 kHz195C3
20 MHz1 MHz77
20 MHz400 kHz2216
20 MHz100 kHz9761

Note 1: Based on F cy = Fosc/2; Doze mode and PLL are disabled.
2: These clock rate values are for guidance only. The actual clock rate can be affected by various system-level parameters. The actual clock rate should be measured in its intended application.

TABLE 15-2: I2Cx RESERVED ADDRESSES (1)

Client Address R/W Bit Description
0000 000 0General Call Address(2)
0000 000 1Start Byte
0000 001 xCbus Address
0000 01x xReserved
0000 1xx xHS Mode Host Code
1111 0xx x10-Bit Client Upper Byte(3)
1111 1xx xReserved

Note 1: The address bits listed here will never cause an address match independent of address mask settings.
2: This address will be Acknowledged only if GCEN = 1.
3: A match on this address can only occur on the upper byte in 10-Bit Addressing mode.

15.4 SMBus Support

The dsPIC33CH128MP508 family devices have support for SMBus through options in the input voltage thresholds. There are two control bits to select one of three options: SMEN (I2CxCONL[8]) and Configuration bit, SMBEN (FDEVOPT[10]). Table 15-3 details the setting of these control bits.

TABLE 15-3: I ^2 C PIN VOLTAGE THRESHOLD

SMEN SFR Bit (I2CxCONL[8])SMBEN Configuration Bit (FDEVOPT[10])
I^2C (default)0x
SMBus 2.010
SMBus 3.011

15.5 I ^2 C Control/Status Registers

REGISTER 15-1: I2CxCONL: I2Cx CONTROL REGISTER LOW

R/W-0 U-0 HC/R/W-0 R/W-1 R/W-0 R/W-0 R/W-0 R/W-0
I2CEN— I2CSIDL SCLREL(1)STRICT A10MDISSLWSMEN
bit 15bit 8
R/W-0R/W-0R/W-0HC/R/W-0HC/R/W-0HC/R/W-0HC/R/W-0HC/R/W-0
GCENSTRENACKDTACKENRCENPENRSENSEN
bit 7 bit 0
Legend:HC = Hardware 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 15I2CEN: I2Cx Enable bit (writable from software only)1 = Enables the I2Cx module, and configures the SDAx and SCLx pins as serial port pins0 = Disables the I2Cx module; all I^2C pins are controlled by port functions
bit 14Unimplemented: Read as '0'
bit 13I2CSIDL: I2Cx Stop in Idle Mode bit1 = Discontinues module operation when device enters Idle mode0 = Continues module operation in Idle mode
bit 12SCLREL: SCLx Release Control bit ( I^2C Client mode only) ^(1) 1 = Releases the SCLx clock0 = Holds the SCLx clock low (clock stretch)If STREN = 1: ^(2) User software may write '0' to initiate a clock stretch and write '1' to release the clock. Hardware clears at the beginning of every Client data byte transmission. Hardware clears at the end of every Client address byte reception. Hardware clears at the end of every Client data byte reception.If STREN = 0::User software may only write '1' to release the clock. Hardware clears at the beginning of every Client data byte transmission. Hardware clears at the end of every Client address byte reception.
bit 11STRICT: I2Cx Strict Reserved Address Rule Enable bit1 = Strict Reserved Addressing is enforced; for reserved addresses, refer to Table 15-2.(In Client Mode) – The device doesn't respond to reserved address space and addresses falling in that category are NACKed.(In Host Mode) – The device is allowed to generate addresses with reserved address space.0 = Reserved Addressing would be Acknowledged.(In Client Mode) – The device will respond to an address falling in the reserved address space.When there is a match with any of the reserved addresses, the device will generate an ACK.(In Host Mode) – Reserved.
bit 10A10M: 10-Bit Client Address Flag bit1 = I2CxADD is a 10-bit Client address0 = I2CxADD is a 7-bit Client address
bit 9DISSLW: Slew Rate Control Disable bit1 = Slew rate control is disabled for Standard Speed mode (100 kHz, also disabled for 1 MHz mode)0 = Slew rate control is enabled for High-Speed mode (400 kHz)
Note 1: Automatically cleared to '0' at the beginning of Client transmission; automatically cleared to '0' at the end of Client reception.2: Automatically cleared to '0' at the beginning of Client transmission.

REGISTER 15-1: I2CxCONL: I2Cx CONTROL REGISTER LOW (CONTINUED)

bit 8 SMEN: SMBus Input Levels Enable bit

1 = Enables input logic so thresholds are compliant with the SMBus specification
0 = Disables SMBus-specific inputs

bit 7 GCEN: General Call Enable bit (I ^2 C Client mode only)

1 = Enables interrupt when a general call address is received in I2CxRSR; module is enabled for reception
0 = General call address is disabled.

bit 6 STREN: SCLx Clock Stretch Enable bit

In I²C Client mode only; used in conjunction with the SCLREL bit.

1 = Enables clock stretching
0 = Disables clock stretching

bit 5 ACKDT: Acknowledge Data bit

In I ^2 C Host mode during Host Receive mode. The value that will be transmitted when the user initiates an Acknowledge sequence at the end of a receive.

In I²C Client mode when AHEN = 1 or DHEN = 1. The value that the Client will transmit when it initiates an Acknowledge sequence at the end of an address or data reception.

1 = NACK is sent
0 = ACK is sent

bit 4 ACKEN: Acknowledge Sequence Enable bit

In I²C Host mode only; applicable during Host Receive mode.
1 = Initiates Acknowledge sequence on SDAx and SCLx pins, and transmits ACKDT data bit
0 = Acknowledge sequence is Idle

bit 3 RCEN: Receive Enable bit (I ^2 C Host mode only)

1 = Enables Receive mode for I²C; automatically cleared by hardware at end of 8-bit receive data byte
0 = Receive sequence is not in progress

bit 2 PEN: Stop Condition Enable bit (I ^2 C Host mode only)

1 = Initiates Stop condition on SDAx and SCLx pins
0 = Stop condition is Idle

bit 1 RSEN: Restart Condition Enable bit (I ^2 C Host mode only)

1 = Initiates Restart condition on SDAx and SCLx pins
0 = Restart condition is Idle

bit 0 SEN: Start Condition Enable bit (I ^2 C Host mode only)

1 = Initiates Start condition on SDAx and SCLx pins
0 = Start condition is Idle

Note 1: Automatically cleared to '0' at the beginning of Client transmission; automatically cleared to '0' at the end of Client reception.

2: Automatically cleared to '0' at the beginning of Client transmission.

REGISTER 15-2: I2CxCONH: I2Cx CONTROL REGISTER HIGH

U-0 U-0 U-0 U-0 U-0 U-0 U-0 U-0
——————
bit 15 bit 8
U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
— PCIESCIE BOEN SDAHTSBCDE AHEN DHEN
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-7 Unimplemented: Read as '0'

bit 6 PCIE: Stop Condition Interrupt Enable bit (I²C Client mode only).

1 = Enables interrupt on detection of Stop condition

0 = Stop detection interrupts are disabled

bit 5 SCIE: Start Condition Interrupt Enable bit ( ^2 C Client mode only)

1 = Enables interrupt on detection of Start or Restart conditions

0 = Start detection interrupts are disabled

bit 4 BOEN: Buffer Overwrite Enable bit (I²C Client mode only)

1 = I2CxRCV is updated and an ACK is generated for a received address/data byte, ignoring the state of the I2COV bit only if RBF bit = 0

0 = I2CxRCV is only updated when I2COV is clear

bit 3 SDAHT: SDAx Hold Time Selection bit

1 = Minimum of 300 ns hold time on SDAx after the falling edge of SCLx

0 = Minimum of 100 ns hold time on SDAx after the falling edge of SCLx

bit 2 SBCDE: Client Mode Bus Collision Detect Enable bit (I²C Client mode only)

If, on the rising edge of SCLx, SDAx is sampled low when the module is outputting a high state, the BCL bit is set and the bus goes Idle. This Detection mode is only valid during data and ACK transmit sequences.

1 = Enables Client bus collision interrupts

0 = Client bus collision interrupts are disabled

bit 1 AHEN: Address Hold Enable bit (I²C Client mode only)

1 = Following the 8th falling edge of SCLx for a matching received address byte; SCLREL bit (I2CxCONL[12]) will be cleared and the SCLx will be held low

0 = Address holding is disabled

bit 0 DHEN: Data Hold Enable bit (I²C Client mode only)

1 = Following the 8th falling edge of SCLx for a received data byte; Client hardware clears the SCLREL bit (I2CxCONL[12]) and SCLx is held low

0 = Data holding is disabled

REGISTER 15-3: I2CxSTAT: I2Cx STATUS REGISTER

HSC/R-0 HSC/R-0 HSC/R-0 U-0 U-0 HSC/R/C-0 HSC/R-0 HSC/R-0
ACKSTATTRSTATACKTIMBCLGCSTATADD10
bit 15 bit 8
HS/R/C-0HS/R/C-0HSC/R-0HSC/R-0HSC/R-0HSC/R-0HSC/R-0HSC/R-0
IWCOLI2COVD/ PSR/ RBFTBF
bit 7 bit 0
Legend:C = Clearable bitHSC = Hardware Settable/Clearable bit
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared HS = Hardware Settable bit

bit 15 ACKSTAT: Acknowledge Status bit (updated in all Host and Client modes)

1 = Acknowledge was not received from Client

0 = Acknowledge was received from Client

bit 14 TRSTAT: Transmit Status bit (when operating as I²C Host; applicable to Host transmit operation)

1 = Host transmit is in progress (8 bits + ACK)

0 = Host transmit is not in progress

bit 13 ACKTIM: Acknowledge Time Status bit (valid in I²C Client mode only)

1 = Indicates I²C bus is in an Acknowledge sequence, set on 8th falling edge of SCLx clock

0 = Not an Acknowledge sequence, cleared on 9th rising edge of SCLx clock

bit 12-11 Unimplemented: Read as '0'

bit 10 BCL: Bus Collision Detect bit (Host/Client mode; cleared when I²C module is disabled, I2CEN = 0)

1 = A bus collision has been detected during a Host or Client transmit operation

0 = No bus collision has been detected

bit 9 GCSTAT: General Call Status bit (cleared after Stop detection)

1 = General call address was received

0 = General call address was not received

bit 8 ADD10: 10-Bit Address Status bit (cleared after Stop detection)

1 = 10-bit address was matched

0 = 10-bit address was not matched

bit 7 IWCOL: I2Cx Write Collision Detect bit

1 = An attempt to write to the I2CxTRN register failed because the I²C module is busy; must be cleared in software

0 = No collision

bit 6 I2COV: I2Cx Receive Overflow Flag bit

1 = A byte was received while the I2CxRCV register is still holding the previous byte; I2COV is a "don't care" in Transmit mode, must be cleared in software

0 = No overflow

bit 5 D/A: Data/Address bit (when operating as I²C Client)

1 = Indicates that the last byte received was data

0 = Indicates that the last byte received or transmitted was an address

bit 4 P: I2Cx Stop bit

Updated when Start, Reset or Stop is detected; cleared when the I²C module is disabled, I2CEN = 0.

1 = Indicates that a Stop bit has been detected last

0 = Stop bit was not detected last

REGISTER 15-3: I2CxSTAT: I2Cx STATUS REGISTER (CONTINUED)

bit 3 S: I2Cx Start bit

Updated when Start, Reset or Stop is detected; cleared when the I²C module is disabled, I2CEN = 0.

1 = Indicates that a Start (or Repeated Start) bit has been detected last
0 = Start bit was not detected last

-

bit 2 R/W : Read/Write Information bit (when operating as I²C Client)

1 = Read: Indicates the data transfer is output from the Client
0 = Write: Indicates the data transfer is input to the Client

bit 1 RBF: Receive Buffer Full Status bit

1 = Receive is complete, I2CxRCV is full
0 = Receive is not complete, I2CxRCV is empty

bit 0 TBF: Transmit Buffer Full Status bit

1 = Transmit is in progress, I2CxTRN is full (eight bits of data)
0 = Transmit is complete, I2CxTRN is empty

REGISTER 15-4: I2CxMSK: I2Cx CLIENT MODE ADDRESS MASK REGISTER

U-0 U-0 U-0 U-0 U-0 U-0 R/W-0 R/W-0
— — —— — — MSK[9:8]
bit 15 bit 8
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
MSK[7:0]
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 cleared x = Bit is unknown

bit 15-10 Unimplemented: Read as '0'

bit 9-0 MSK[9:0]: I2Cx Mask for Address Bit x Select bits

1 = Enables masking for bit x of the incoming message address; bit match is not required in this position
0 = Disables masking for bit x; bit match is required in this position

NOTES:

16.0 SINGLE-EDGE NIBBLE TRANSMISSION (SENT)

Note 1: This data sheet summarizes the features of this group of dsPIC33CH128MP508 family devices. It is not intended to be a comprehensive reference source. To complement the information in this data sheet, refer to “Single-Edge Nibble Transmission (SENT) Module” (www.microchip.com/DS70005145), which is available from the Microchip website (www.microchip.com).

2: Some registers and associated bits described in this section may not be available on all devices. Refer to Section 3.2 "Main Memory Organization" in this data sheet for device-specific register and bit information.

3: This SENT module is available only on the Main.

Table 16-1 shows an overview of the SENT module.
TABLE 16-1: SENT MODULE OVERVIEW

Number of SENT ModulesIdentical (Modules)
Main Core 2 Yes
Secondary CoreNoneNA

16.1 Module Introduction

The Single-Edge Nibble Transmission (SENT) module is based on the SAE J2716, "SENT – Single-Edge Nibble Transmission for Automotive Applications". The SENT protocol is a one-way, single wire time modulated serial communication, based on successive falling edges. It is intended for use in applications where high-resolution sensor data need to be communicated from a sensor to an Engine Control Unit (ECU).

The SENTx module has the following major features:

  • Selectable Transmit or Receive mode
  • Synchronous or Asynchronous Transmit modes
    • Automatic Data Rate Synchronization
  • Optional Automatic Detection of CRC Errors in Receive mode
  • Optional Hardware Calculation of CRC in Transmit mode
    • Support for Optional Pause Pulse Period
    • Data Buffering for One Message Frame
  • Selectable Data Length for Transmit/Receive from Three to Six Nibbles
    • Automatic Detection of Framing Errors

SENT protocol timing is based on a predetermined time unit, TTICK. Both the transmitter and receiver must be preconfigured for TTICK, which can vary from 3 to 90 μs. A SENT message frame starts with a Sync pulse. The purpose of the Sync pulse is to allow the receiver to calculate the data rate of the message encoded by the transmitter. The SENT specification allows messages to be validated with up to a 20% variation in TTICK. This allows for the transmitter and receiver to run from different clocks that may be inaccurate, and drift with time and temperature. The data nibbles are four bits in length and are encoded as the data value + 12 ticks. This yields a 0 value of 12 ticks and the maximum value, 0xF, of 27 ticks.

A SENT message consists of the following:

  • A synchronization/calibration period of 56 tick times
    • A status nibble of 12-27 tick times
  • Up to six data nibbles of 12-27 tick times
    • A CRC nibble of 12-27 tick times
  • An optional pause pulse period of 12-768 tick times

Figure 16-1 shows a block diagram of the SENTx module.

Figure 16-2 shows the construction of a typical 6-nibble data frame, with the numbers representing the minimum or maximum number of tick times for each section.

FIGURE 16-1: SENTx MODULE BLOCK DIAGRAM
Microchip dsPIC33CH64MP208 - Module Introduction - 1

flowchart
graph TD
    A["SENTx TX"] --> B["Output Driver"]
    B --> C["SENTx Edge Control"]
    C --> D["Edge Timing"]
    D --> E["Sync Period Detector"]
    E --> F["Edge Detect"]
    F --> G["SENTx RX"]
    G --> H["Nibble Period Detector"]
    H --> I["Tick Period Generator"]
    I --> J["Output Driver"]
    J --> K["SENTx CON1"]
    K --> L["SENTxSTATSENxCON1"]
    style A fill:#f9f,stroke:#333
    style G fill:#f9f,stroke:#333
    style H fill:#ccc,stroke:#333
    style I fill:#ccc,stroke:#333
    style J fill:#ccc,stroke:#333
    style K fill:#ccc,stroke:#333
    style L fill:#ccc,stroke:#333

FIGURE 16-2: SENTx PROTOCOL DATA FRAMES
Microchip dsPIC33CH64MP208 - Module Introduction - 2

flowchart
graph TD
    A["Sync Period"] --> B["56"]
    C["Status"] --> D["12-27"]
    E["Data 1"] --> F["12-27"]
    G["Data 2"] --> H["12-27"]
    I["Data 3"] --> J["12-27"]
    K["Data 4"] --> L["12-27"]
    M["Data 5"] --> N["12-27"]
    O["Data 6"] --> P["12-27"]
    Q["CRC"] --> R["12-27"]
    S["Pause (optional)"] --> T["12-768"]

16.2 Transmit Mode

By default, the SENTx module is configured for transmit operation. The module can be configured for continuous asynchronous message frame transmission, or alternatively, for Synchronous mode triggered by software. When enabled, the transmitter will send a Sync, followed by the appropriate number of data nibbles, an optional CRC and optional pause pulse. The tick period used by the SENTx transmitter is set by writing a value to the TICKTIME[15:0] (SENTxCON2[15:0]) bits. The tick period calculations are shown in Equation 16-1.

EQUATION 16-1: TICK PERIOD CALCULATION

$$ T I C K T I M E [ 1 5: 0 ] = \frac {T T I C K}{T C L K} - 1 $$

An optional pause pulse can be used in Asynchronous mode to provide a fixed message frame time period. The frame period used by the SENTx transmitter is set by writing a value to the FRAMETIME[15:0] (SENTxCON3[15:0]) bits. The formulas used to calculate the value of frame time are shown in Equation 16-2.

EQUATION 16-2: FRAME TIME CALCULATIONS

$$ F R A M E T I M E [ 1 5: 0 ] = T T I C K / T F R A M E $$

$$ F R A M E T I M E [ 1 5: 0 ] \geq 1 2 2 + 2 7 N $$

$$ F R A M E T I M E [ 1 5: 0 ] \geq 8 4 8 + 1 2 N $$

Where:

T_FRAME = Total time of the message from ms

N = The number of data nibbles in message, 1-6

Note: The module will not produce a pause period with less than 12 ticks, regardless of the FRAMETIME[15:0] value. FRAMETIME[15:0] values beyond 2047 will have no effect on the length of a data frame.

16.2.1 TRANSMIT MODE CONFIGURATION

16.2.1.1 Initializing the SENTx Module

Perform the following steps to initialize the module:

  1. Write RCVEN (SENTxCON1[11]) = 0 for Transmit mode.
  2. Write TXM (SENTxCON1[10]) = 0 for Asynchronous Transmit mode or TXM = 1 for Synchronous mode.
  3. Write NIBCNT[2:0] (SENTxCON1[2:0]) for the desired data frame length.
  4. Write CRCEN (SENTxCON1[8]) for hardware or software CRC calculation.
  5. Write PPP (SENTxCON1[7]) for optional pause pulse.
  6. If PPP = 1, write T FRAME to SENTxCON3.
  7. Write SENTxCON2 with the appropriate value for the desired tick period.
  8. Enable interrupts and set interrupt priority.
  9. Write initial status and data values to SENTxDATH/L.
  10. If CRCEN = 0, calculate CRC and write the value to CRC[3:0] (SENTxDATL[3:0]).
  11. Set the SNTEN (SENTxCON1[15]) bit to enable the module.

User software updates to SENTxDATH/L must be performed after the completion of the CRC and before the next message frame's status nibble. The recommended method is to use the message frame completion interrupt to trigger data writes.

16.3 Receive Mode

The module can be configured for receive operation by setting the RCVEN (SENTxCON1[11]) bit. The time between each falling edge is compared to SYNCMIN[15:0] (SENTxCON3[15:0]) and SYNCMAX[15:0] (SENTxCON2[15:0]), and if the measured time lies between the minimum and maximum limits, the module begins to receive data. The validated Sync time is captured in the SENTxSYNC register and the tick time is calculated. Subsequent falling edges are verified to be within the valid data width and the data are stored in the SENTxDATL/H registers. An interrupt event is generated at the completion of the message and the user software should read the SENTx Data registers before the reception of the next nibble. The equation for SYNCMIN[15:0] and SYNCMAX[15:0] is shown in Equation 16-3.

EQUATION 16-3: SYNCMIN[15:0] AND SYNCMAX[15:0] CALCULATIONS

$$ T T I C K = T C L K \cdot (T I C K T I M E [ 1 5: 0 ] + 1) $$

$$ F R A M E T I M E [ 1 5: 0 ] = T T I C K / T F R A M E $$

$$ \text { SyncCount } = 8 \times F R C V \times T T I C K $$

$$ \text { SYNCMIN } [ 1 5: 0 ] = 0. 8 \times \text { SyncCount } $$

$$ \text { SYNCMAX } [ 1 5: 0 ] = 1. 2 \times \text { SyncCount } $$

$$ F R A M E T I M E [ 1 5: 0 ] \geq 1 2 2 + 2 7 N $$

$$ F R A M E T I M E [ 1 5: 0 ] \geq 8 4 8 + 1 2 N $$

Where:

T_FRAME = Total time of the message from ms

N = The number of data nibbles in message, 1-6

FRCV = FCY × Prescaler

T_CLK = F_CY/Prescaler

For TTICK = 3.0 μs and FCLK = 4 MHz, SYNCMIN[15:0] = 76.

Note: To ensure a Sync period can be identified, the value written to SYNCMIN[15:0] must be less than the value written to SYNCMAX[15:0].

16.3.1 RECEIVE MODE CONFIGURATION

16.3.1.1 Initializing the SENTx Module

Perform the following steps to initialize the module:

  1. Write RCVEN (SENTxCON1[11]) = 1 for Receive mode.
  2. Write NIBCNT[2:0] (SENTxCON1[2:0]) for the desired data frame length.
  3. Write CRCEN (SENTxCON1[8]) for hardware or software CRC validation.
  4. Write PPP (SENTxCON1[7]) = 1 if pause pulse is present.
  5. Write SENTxCON2 with the value of SYNCMAXx (Nominal Sync Period + 20%).
  6. Write SENTxCON3 with the value of SYNCMINx (Nominal Sync Period - 20%).
  7. Enable interrupts and set interrupt priority.
  8. Set the SNTEN (SENTxCON1[15]) bit to enable the module.

The data should be read from the SENTxDATL/H registers after the completion of the CRC and before the next message frame's status nibble. The recommended method is to use the message frame completion interrupt trigger.

16.4 SENT Control/Status Registers

REGISTER 16-1: SENTxCON1: SENTx CONTROL REGISTER 1

R/W-0 U-0 R/W-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0
SNTEN — $NTSIDL — RCVEN TXM(1)TXPOL(1)CRCEN
bit 15 bit 8
R/W-0 R/W-0 U-0 R/W-0 U-0 R/W-0 R/W-0 R/W-0
PPP SPCEN (2)PSNIBCNT2NIBCNT1NIBCNT0
bit 7 bit 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 15SNTEN: SENTx Enable bit1 = SENTx is enabled0 = SENTx is disabled
bit 14Unimplemented: Read as ‘0’
bit 13SNTSIDL: SENTx Stop in Idle Mode bit1 = Discontinues module operation when the device enters Idle mode0 = Continues module operation in Idle mode
bit 12Unimplemented: Read as ‘0’
bit 11RCVEN: SENTx Receive Enable bit1 = SENTx operates as a receiver0 = SENTx operates as a transmitter (sensor)
bit 10TXM: SENTx Transmit Mode bit(1)1 = SENTx transmits data frame only when triggered using the SYNCTXEN status bit0 = SENTx transmits data frames continuously while SNTEN = 1
bit 9TXPOL: SENTx Transmit Polarity bit(1)1 = SENTx data output pin is low in the Idle state0 = SENTx data output pin is high in the Idle state
bit 8CRCEN: CRC Enable bitModule in Receive Mode (RCVEN = 1):1 = SENTx performs CRC verification on received data using the preferred J2716 method0 = SENTx does not perform CRC verification on received dataModule in Transmit Mode (RCVEN = 1):1 = SENTx automatically calculates CRC using the preferred J2716 method0 = SENTx does not calculate CRC
bit 7PPP: Pause Pulse Present bit1 = SENTx is configured to transmit/receive SENT messages with pause pulse0 = SENTx is configured to transmit/receive SENT messages without pause pulse
bit 6SPCEN: Short PWM Code Enable bit(2)1 = SPC control from external source is enabled0 = SPC control from external source is disabled
bit 5Unimplemented: Read as ‘0’

Note 1: This bit has no function in Receive mode (RCVEN = 1).

2: This bit has no function in Transmit mode (RCVEN = 0).

REGISTER 16-1: SENTxCON1: SENTx CONTROL REGISTER 1 (CONTINUED)

bit 4 PS: SENTx Module Clock Prescaler (divider) bits

1 = Divide-by-4

0 = Divide-by-1

bit 3 Unimplemented: Read as '0'

bit 2-0 NIBCNT[2:0]: Nibble Count Control bits

111 = Reserved; do not use

110 = Module transmits/receives six data nibbles in a SENT data pocket

101 = Module transmits/receives five data nibbles in a SENT data pocket

100 = Module transmits/receives four data nibbles in a SENT data pocket

011 = Module transmits/receives three data nibbles in a SENT data pocket

010 = Module transmits/receives two data nibbles in a SENT data pocket

001 = Module transmits/receives one data nibble in a SENT data pocket

000 = Reserved; do not use

Note 1: This bit has no function in Receive mode (RCVEN = 1).

2: This bit has no function in Transmit mode (RCVEN = 0).

REGISTER 16-2: SENTxSTAT: SENTx STATUS REGISTER

Legend:C = Clearable bitHC = Hardware Clearable bit
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15-8 Unimplemented: Read as '0'

bit 7 PAUSE: Pause Period Status bit

1 = The module is transmitting/receiving a pause period
0 = The module is not transmitting/receiving a pause period

bit 6-4 NIB[2:0]: Nibble Status bits

Module in Transmit Mode (RCVEN = 0):

111 = Module is transmitting a CRC nibble
110 = Module is transmitting Data Nibble 6
101 = Module is transmitting Data Nibble 5
100 = Module is transmitting Data Nibble 4
011 = Module is transmitting Data Nibble 3
010 = Module is transmitting Data Nibble 2
001 = Module is transmitting Data Nibble 1
000 = Module is transmitting a status nibble or pause period, or is not transmitting

Module in Receive Mode (RCVEN = 1):

111 = Module is receiving a CRC nibble or was receiving this nibble when an error occurred
110 = Module is receiving Data Nibble 6 or was receiving this nibble when an error occurred
101 = Module is receiving Data Nibble 5 or was receiving this nibble when an error occurred
100 = Module is receiving Data Nibble 4 or was receiving this nibble when an error occurred
011 = Module is receiving Data Nibble 3 or was receiving this nibble when an error occurred
010 = Module is receiving Data Nibble 2 or was receiving this nibble when an error occurred
001 = Module is receiving Data Nibble 1 or was receiving this nibble when an error occurred
000 = Module is receiving a status nibble or waiting for Sync

bit 3 CRCERR: CRC Status bit (Receive mode only)

1 = A CRC error has occurred for the 1-6 data nibbles in SENTxDATL/H
0 = A CRC error has not occurred

bit 2 FRMERR: Framing Error Status bit (Receive mode only)

1 = A data nibble was received with less than 12 tick periods or greater than 27 tick periods
0 = Framing error has not occurred

bit 1 RXIDLE: SENTx Receiver Idle Status bit (Receive mode only)

1 = The SENTx data bus has been Idle (high) for a period of SYNCMAX[15:0] or greater
0 = The SENTx data bus is not Idle

Note 1: In Receive mode (RCVEN = 1), the SYNCTXEN bit is read-only.

REGISTER 16-2: SENTxSTAT: SENTx STATUS REGISTER (CONTINUED)

bit 0 SYNCTXEN: SENTx Synchronization Period Status/Transmit Enable bit ^(1)

Module in Receive Mode (RCVEN = 1):

1 = A valid synchronization period was detected; the module is receiving nibble data
0 = No synchronization period has been detected; the module is not receiving nibble data

Module in Asynchronous Transmit Mode (RCVEN = 0, TXM = 0):

The bit always reads as '1' when the module is enabled, indicating the module transmits SENTx data frames continuously. The bit reads '0' when the module is disabled.

Module in Synchronous Transmit Mode (RCVEN = 0, TXM = 1):

1 = The module is transmitting a SENTx data frame
0 = The module is not transmitting a data frame, user software may set SYNCTXEN to start another data frame transmission

Note 1: In Receive mode (RCVEN = 1), the SYNCTXEN bit is read-only.

REGISTER 16-3: SENTxDATL: SENTx RECEIVE DATA REGISTER LOW (1)

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
DATA4[3:0] DATA5[3:0]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
DATA6[3:0]CRC[3:0]
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 cleared x = Bit is unknown

bit 15-12 DATA4[3:0]: Data Nibble 4 Data bits

bit 11-8 DATA5[3:0]: Data Nibble 5 Data bits

bit 7-4 DATA6[3:0]: Data Nibble 6 Data bits

bit 3-0 CRC[3:0]: CRC Nibble Data bits

Note 1: Register bits are read-only in Receive mode (RCVEN = 1). In Transmit mode, the CRC[3:0] bits are read-only when automatic CRC calculation is enabled (RCVEN = 0, CRCEN = 1).

REGISTER 16-4: SENTxDATH: SENTx RECEIVE DATA REGISTER HIGH (1)

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
STAT[3:0]DATA1[3:0]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
DATA2[3:0] DATA3[3:0]
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 cleared x = Bit is unknown

bit 15-12 STAT[3:0]: Status Nibble Data bits

bit 11-8 DATA1[3:0]: Data Nibble 1 Data bits

bit 7-4 DATA2[3:0]: Data Nibble 2 Data bits

bit 3-0 DATA3[3:0]: Data Nibble 3 Data bits

Note 1: Register bits are read-only in Receive mode (RCVEN = 1). In Transmit mode, the CRC[3:0] bits are read-only when automatic CRC calculation is enabled (RCVEN = 0, CRCEN = 1).

NOTES:

17.0 TIMER1

Note 1: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive reference source. To complement the information in this data sheet, refer to "Timer1 Module" (www.microchip.com/DS70005279), which is available from the Microchip website (www.microchip.com).

2: The timer is identical for both Main core and Secondary core. The x is common for both Main core and Secondary core (where the x represents the number of the specific module being addressed).

3: All associated register names are the same on the Main core and the Secondary core. The Secondary code will be developed in a separate project in MPLAB X IDE with the device selection, dsPIC33CH128MP508S1, where S1 indicates the Secondary device.

The Timer1 module is a 16-bit timer that can operate as a free-running interval timer/counter.

The Timer1 module has the following unique features over other timers:

  • Can be Operated in Asynchronous Counter mode
  • Asynchronous Timer
    • Operational during CPU Sleep mode
  • Software Selectable Prescalers 1:1, 1:8, 1:64 and 1:256
    • External Clock Selection Control
  • The Timer1 External Clock Input (T1CK) can Optionally be Synchronized to the Internal Device Clock and the Clock Synchronization is Performed after the Prescaler

If Timer1 is used for SCCP, the timer should be running in Synchronous mode.

The Timer1 module can operate in one of the following modes:

  • Timer mode
  • Gated Timer mode
    • Synchronous Counter mode
    • Asynchronous Counter mode

Table 17-1 shows an overview of the Timer1 module.
TABLE 17-1: TIMER1 MODULE OVERVIEW

Number of Timer1 ModulesIdentical (Modules)
Main Core 1 Yes
Secondary Core1 Yes

A block diagram of Timer1 is shown in Figure 17-1.

FIGURE 17-1: 16-BIT TIMER1 MODULE BLOCK DIAGRAM
Microchip dsPIC33CH64MP208 - TIMER1 - 1

flowchart
graph LR
    A["T1CK (External Clock)"] --> B["0"]
    C["TCY"] --> D["1"]
    E["2 TCY"] --> F["2"]
    G["FRC"] --> H["3"]
    B --> I["Sync"]
    D --> J["0"]
    F --> K["2"]
    H --> L["1"]
    I --> M["1"]
    J --> N["TGATE"]
    K --> O["TCS TGATE"]
    L --> P["TCR"]
    M --> Q["TCR"]
    N --> R["0.0"]
    O --> S["0.1"]
    P --> T["1.0"]
    Q --> U["1.1"]
    R --> V["Prescaler"]
    S --> V
    T --> V
    U --> V
    V --> W["tmr_clk"]
    W --> X["TMRx"]
    X --> Y["Comparator"]
    Y --> Z["PRx"]
    Z --> AA["TGATE"]
    AA --> AB["0"]
    AB --> AC["TGATE Interrupt"]
    AD["TCKPS[1:0"]] --> AE["2"]

17.1 Timer1 Control Register

REGISTER 17-1: T1CON: TIMER1 CONTROL REGISTER

R/W-0 U-0 R/W-0 R/W-0 R-0 R-0 R/W-0 R/W-0
TON^(1) — SIDLTMWDIS TMWIP PRWIPTECS1TECS0
bit 15bit 8
R/W-0U-0R/W-0R/W-0U-0R/W-0R/W-0U-0
TGATETCKPS1TCKPS0 TSYNC^(1) TCS^(1)
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15 TON: Timer1 On bit ^(1)

1 = Starts 16-bit Timer1
0 = Stops 16-bit Timer1

bit 14 Unimplemented: Read as '0'

bit 13 SIDL: Timer1 Stop in Idle Mode bit

1 = Discontinues module operation when device enters Idle mode
0 = Continues module operation in Idle mode

bit 12 TMWDIS: Asynchronous Timer1 Write Disable bit

1 = Timer writes are ignored while a posted write to TMR1 or PR1 is synchronized to the asynchronous clock domain
0 = Back-to-back writes are enabled in Asynchronous mode

bit 11 TMWIP: Asynchronous Timer1 Write in Progress bit

1 = Write to the timer in Asynchronous mode is pending
0 = Write to the timer in Asynchronous mode is complete

bit 10 PRWIP: Asynchronous Period Write in Progress bit

1 = Write to the Period register in Asynchronous mode is pending
0 = Write to the Period register in Asynchronous mode is complete

bit 9-8 TECS[1:0]: Timer1 Extended Clock Select bits

11 = FRC clock
10 = 2 TCY
01 = TcY
00 = External Clock comes from the T1CK pin

bit 7 TGATE: Timer1 Gated Time Accumulation Enable bit

When TCS = 1:

This bit is ignored.

When TCS = 0:

1 = Gated time accumulation is enabled
0 = Gated time accumulation is disabled

bit 6 Unimplemented: Read as '0'

Note 1: When Timer1 is enabled in External Synchronous Counter mode (TCS = 1, TSYNC = 1, TON = 1), any attempts by user software to write to the TMR1 register are ignored.

REGISTER 17-1: T1CON: TIMER1 CONTROL REGISTER (CONTINUED)
bit 5-4 TCKPS[1:0]: Timer1 Input Clock Prescale Select bits 11 = 1:256 10 = 1:64 01 = 1:8 00 = 1:1

bit 3 Unimplemented: Read as '0'

bit 2 TSYNC: Timer1 External Clock Input Synchronization Select bit(1) When TCS = 1: 1 = Synchronizes the External Clock input 0 = Does not synchronize the External Clock input When TCS = 0: This bit is ignored.

bit 1 TCS: Timer1 Clock Source Select bit (1) 1 = External Clock source selected by TECS[1:0] 0 = Internal peripheral clock (FP)

bit 0 Unimplemented: Read as '0'

Note 1: When Timer1 is enabled in External Synchronous Counter mode (TCS = 1, TSYNC = 1, TON = 1), any attempts by user software to write to the TMR1 register are ignored.

NOTES:

18.0 CONFIGURABLE LOGIC CELL (CLC)

Note 1: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive reference source. For more information, refer to “Configurable Logic Cell (CLC)” (www.microchip.com/DS70005298), which is available from the Microchip website (www.microchip.com). The information in this data sheet supersedes the information in the FRM.

2: The CLC is identical for both Main core and Secondary core (where the x represents the number of the specific module being addressed in Main or Secondary).
3: All associated register names are the same on the Main core and the Secondary core. The Secondary code will be developed in a separate project in MPLAB X IDE with the device selection, dsPIC33CH128MP508S1, where the S1 indicates the Secondary device. The Main and Secondary are CLC1 and CLC2.

The Configurable Logic Cell (CLC) module allows the user to specify combinations of signals as inputs to a logic function and to use the logic output to control other peripherals or I/O pins. This provides greater flexibility and potential in embedded designs, since the CLC module can operate outside the limitations of software execution, and supports a vast amount of output designs.

There are four input gates to the selected logic function. These four input gates select from a pool of up to 32 signals that are selected using four data source selection multiplexers. Table 18-1 shows an overview of the module.

TABLE 18-1: CLC MODULE OVERVIEW

Number of CLC ModulesIdentical (Modules)
Main Core 4 Yes
Secondary Core4 Yes

Figure 18-3 shows the details of the data source multiplexers and Figure 18-2 shows the logic input gate connections.

FIGURE 18-1: CLCx MODULE
Microchip dsPIC33CH64MP208 - CONFIGURABLE LOGIC CELL (CLC) - 1

flowchart
graph LR
    A["CLC Inputs (32)"] --> B["Input Data Selection Gates"]
    B --> C["See Figure 18-3"]
    C --> D["Logic Function"]
    D --> E["LCEN"]
    D --> F["Logic Output"]
    E --> G["CLCx Output"]
    F --> G
    G --> H["Interrupt det"]
    G --> I["INTP"]
    G --> J["INTN"]
    G --> K["Interrupt det"]
    H --> L["Set CLCxIF"]
    I --> L
    J --> L
    K --> L
    L --> M["TRISx Control"]
    M --> N["CLCx"]
    O["DS1[2:0"] G1POL] --> P["Gate 1"]
    Q["DS2[2:0"] G2POL] --> P
    R["DS3[2:0"] G3POL] --> P
    S["DS4[2:0"] G4POL] --> P
    T["FcY"] --> U["D CLK"]
    U --> V["LCOE"]
    V --> W["CLCx"]

FIGURE 18-2: CLCx LOGIC FUNCTION COMBINATORIAL OPTIONS

AND - ORMicrochip dsPIC33CH64MP208 - CONFIGURABLE LOGIC CELL (CLC) - 2MODE[2:0] = 000OR - XORMicrochip dsPIC33CH64MP208 - CONFIGURABLE LOGIC CELL (CLC) - 3MODE[2:0] = 001
4-Input ANDMicrochip dsPIC33CH64MP208 - CONFIGURABLE LOGIC CELL (CLC) - 4MODE[2:0] = 010S-R LatchMicrochip dsPIC33CH64MP208 - CONFIGURABLE LOGIC CELL (CLC) - 5MODE[2:0] = 011
1-Input D Flip-Flop with S and RMicrochip dsPIC33CH64MP208 - CONFIGURABLE LOGIC CELL (CLC) - 6MODE[2:0] = 1002-Input D Flip-Flop with RMicrochip dsPIC33CH64MP208 - CONFIGURABLE LOGIC CELL (CLC) - 7MODE[2:0] = 101
J-K Flip-Flop with RMicrochip dsPIC33CH64MP208 - CONFIGURABLE LOGIC CELL (CLC) - 8MODE[2:0] = 1101-Input Transparent Latch with S and RMicrochip dsPIC33CH64MP208 - CONFIGURABLE LOGIC CELL (CLC) - 9MODE[2:0] = 111

FIGURE 18-3: CLCx INPUT SOURCE SELECTION DIAGRAM
(1,2)
Microchip dsPIC33CH64MP208 - CONFIGURABLE LOGIC CELL (CLC) - 10

flowchart
graph TD
    subgraph Inputs
        A["Input 0"] --> B["Data Selection"]
        C["Input 1"] --> B
        D["Input 2"] --> B
        E["Input 3"] --> B
        F["Input 4"] --> B
        G["Input 5"] --> B
        H["Input 6"] --> B
        I["Input 7"] --> B
        J["DS1x (CLCxSEL[2:0"])] --> B
        K["Input 8"] --> L["Data Selection"]
        M["Input 9"] --> L
        N["Input 10"] --> L
        O["Input 11"] --> L
        P["Input 12"] --> L
        Q["Input 13"] --> L
        R["Input 14"] --> L
        S["Input 15"] --> L
        T["DS2x (CLCxSEL[6:4"])] --> L
    end

    subgraph Inputs
        U["Input 16"] --> V["Data Selection"]
        W["Input 17"] --> V
        X["Input 18"] --> V
        Y["Input 19"] --> V
        Z["Input 20"] --> V
        AA["Input 21"] --> V
        AB["Input 22"] --> V
        AC["Input 23"] --> V
        AD["DS3x (CLCxSEL[10:8"])] --> V
    end

    subgraph Inputs
        AE["Input 24"] --> AF["Data Selection"]
        AG["Input 25"] --> AF
        AH["Input 26"] --> AF
        AI["Input 27"] --> AF
        AJ["Input 28"] --> AF
        AK["Input 29"] --> AF
        AL["Input 30"] --> AF
        AM["Input 31"] --> AF
        AN["DS4x (CLCxSEL[14:12"])] --> AF

    end

    B -->|Data 1 Noninverted| B
    B -->|Data 1 Inverted| B
    B -->|G1D1T| B
    B -->|G1D1N| B
    B -->|G1D2T| B
    B -->|G1D2N| B
    B -->|G1D3T| B
    B -->|G1D3N| B
    B -->|G1D4T| B
    B -->|G1D4N| B

    G1D1T --> G1D1N
    G1D2T --> G1D2N
    G1D3T --> G1D3N
    G1D4T --> G1D4T
    G1D4N --> G1D4N

    Gate1["G1POL (CLCxCONH[0"])] --> Gate1
    Gate2["Gate 2"] --> Gate3["Gate 3"]
    Gate3 --> Gate4["Gate 4"]
    Note: Data Gate 2, Gate 3, Gate 4 are same as Gate 1. The diagram shows a multi-gate selection flow with alternating noninverted and inverted inputs.

Note 1: All controls are undefined at power-up.
2: CLC that have unused/unassigned inputs are a logic '0', and through polarity control, they can be changed to a '1'.

18.1 Control Registers

The CLCx module is controlled by the following registers:

  • CLCxCONL
  • CLCxCONH
  • CLCxSEL
  • CLCxGLSL
  • CLCxGLSH

The CLCx Control registers (CLCxCONL and CLCxCONH) are used to enable the module and interrupts, control the output enable bit, select output polarity and select the logic function. The CLCx Control registers also allow the user to control the logic polarity of not only the cell output, but also some intermediate variables.

The CLCx Input MUX Select register (CLCxSEL) allows the user to select up to four data input sources using the four data input selection multiplexers. Each multiplexer has a list of eight data sources available.

The CLCx Gate Logic Input Select registers (CLCxGLSL and CLCxGLSH) allow the user to select which outputs from each of the selection MUXes are used as inputs to the input gates of the logic cell. Each data source MUX outputs both a true and a negated version of its output. All of these eight signals are enabled, ORed together by the logic cell input gates.

If no gate inputs are selected, the input to the gate will be zero or one, depending on the GxPOL bits.

REGISTER 18-1: CLCxCONL: CLCx CONTROL REGISTER (LOW)

R/W-0 U-0 U-0 U-0 R/W-0 R/W-0 U-0 U-0
LCEN — + — INTP INTN — —
bit 15 bit 8
R-0 R-0 R/W-0 U-0 U-0R/W-0 R/W-0 R/W-0
LCOELCOUTLCPOLMODE2MODE1MODE0
bit 7 bit 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 15LCEN: CLCx Enable bit1 = CLCx is enabled and mixing input signals0 = CLCx is disabled and has logic zero outputs
bit 14-12Unimplemented: Read as '0'
bit 11INTP: CLCx Positive Edge Interrupt Enable bit1 = Interrupt will be generated when a rising edge occurs on LCOUT0 = Interrupt will not be generated
bit 10INTN: CLCx Negative Edge Interrupt Enable bit1 = Interrupt will be generated when a falling edge occurs on LCOUT0 = Interrupt will not be generated
bit 9-8Unimplemented: Read as '0'
bit 7LCOE: CLCx Port Enable bit1 = CLCx port pin output is enabled0 = CLCx port pin output is disabled
bit 6LCOUT: CLCx Data Output Status bit1 = CLCx output high0 = CLCx output low
bit 5LCPOL: CLCx Output Polarity Control bit1 = The output of the module is inverted0 = The output of the module is not inverted

Note 1: The CLC SR latch has no default reset value, meaning it could be initialized to either 1 or 0. In SR latch mode, the CLC output state should be considered unknown and up to the user to initialize.

REGISTER 18-1: CLCxCONL: CLCx CONTROL REGISTER (LOW) (CONTINUED)

bit 4-3 Unimplemented: Read as '0'

bit 2-0 MODE[2:0]: CLCx Mode bits

111 = Single input transparent latch with S and R 110 = JK flip-flop with R 101 = Two-input D flip-flop with R 100 = Single input D flip-flop with S and R 011 = SR latch ^(1) 010 = Four-input AND 001 = Four-input OR-XOR 000 = Four-input AND-OR

Note 1: The CLC SR latch has no default reset value, meaning it could be initialized to either 1 or 0. In SR latch mode, the CLC output state should be considered unknown and up to the user to initialize.

REGISTER 18-2: CLCxCONH: CLCx CONTROL REGISTER (HIGH)

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-0R/W-0R/W-0R/W-0
G4POLG3POLG2POLG1POL
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-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 G4POL: Gate 4 Polarity Control bit

1 = Channel 4 logic output is inverted when applied to the logic cell
0 = Channel 4 logic output is not inverted 

bit 2 G3POL: Gate 3 Polarity Control bit

1 = Channel 3 logic output is inverted when applied to the logic cell
0 = Channel 3 logic output is not inverted 

bit 1 G2POL: Gate 2 Polarity Control bit

1 = Channel 2 logic output is inverted when applied to the logic cell
0 = Channel 2 logic output is not inverted 

bit 0 G1POL: Gate 1 Polarity Control bit

1 = Channel 1 logic output is inverted when applied to the logic cell
0 = Channel 1 logic output is not inverted 

REGISTER 18-3: CLCxSEL: CLCx INPUT MUX SELECT REGISTER

U-0 R/W-0 R/W-0 R/W-0 U-0 R/W-0 R/W-0 R/W-0
— DS4[2:0] — DS3[2:0]
bit 15 bit 8
U-0 R/W-0 R/W-0 R/W-0 U-0 R/W-0 R/W-0 R/W-0
— DS2[2:0] — DS1[2:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-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 DS4[2:0]: Data Selection MUX 4 Signal Selection bits (Main)

111 = Main SCCP3 auxiliary out

110 = Main SCCP1 auxiliary out

101 = Main core CLCIND I/O pin

100 = Reserved

011 = Main SPI1 Input (SDIx) ^(1)

010 = Secondary Comparator 2 out

001 = Main CLC2 output

000 = Main PWM event A

DS4[2:0]: Data Selection MUX 4 Signal Selection bits (Secondary)

111 = Secondary SCCP3 auxiliary out

110 = Secondary SCCP1 auxiliary out

101 = Secondary core CLCIND I/O pin

100 = Reserved

011 = Secondary SPI1 Input (SDIx) ^(1)

010 = Secondary Comparator 2 out

001 = Secondary CLC2 out

000 = Secondary PWM event A

bit 11 Unimplemented: Read as '0'

bit 10-8 DS3[2:0]: Data Selection MUX 3 Signal Selection bits (Main)

111 = Main SCCP4 (CCP4IF) OCMP out

110 = Main SCCP3 (CCP3IF) OCMP out

101 = Main core CLC4 out

100 = Main UART1 RX output corresponding to CLCx module

011 = Main SPI1 Output (SDOx) corresponding to CLCx module

010 = Secondary Comparator 1 output

001 = Main CLC1 output

000 = Main CLCINC I/O pin

DS3[2:0]: Data Selection MUX 3 Signal Selection bits (Secondary)

111 = Secondary SCCP4 Compare Event Flag (CCP4IF)

110 = Secondary SCCP3 Compare Event Flag (CCP3IF)

101 = Secondary CLC4 out

100 = Secondary UART1 RX output corresponding to CLCx module

011 = Secondary SPI1 Output (SDOx) corresponding to CLCx module

010 = Secondary Comparator 1 output

001 = Secondary CLC1 output

000 = Secondary CLCINC I/O pin

Note 1: Valid only for the SPI with PPS selection.

REGISTER 18-3: CLCxSEL: CLCx INPUT MUX SELECT REGISTER (CONTINUED)

bit 7Unimplemented: Read as ‘0’
bit 6-4DS2[2:0]: Data Selection MUX 2 Signal Selection bits (Main)111 = Main SCCP2 OC (CCP2IF) out110 = Main SCCP1 OC (CCP1IF) out101 = Reserved100 = Reserved011 = Main UART1 TX input corresponding to CLCx module010 = Main Comparator 1 output001 = Secondary CLC2 output000 = Main CLCINB I/O pinDS2[2:0]: Data Selection MUX 2 Signal Selection bits (Secondary)111 = Secondary SCCP2 OC (CCP2IF) out110 = Secondary SCCP1 OC (CCP1IF) out101 = Reserved100 = Reserved011 = Secondary UART1 TX input corresponding to CLCx module010 = Main Comparator 1 output001 = Main CLC2 output000 = Secondary CLCINB I/O pin
bit 3Unimplemented: Read as ‘0’
bit 2-0DS1[2:0]: Data Selection MUX 1 Signal Selection bits (Main)111 = Main SCCP4 auxiliary out110 = Main SCCP2 auxiliary out101 = Secondary Comparator 3100 = Main REFCLKO output011 = Main INTRC/LPRC clock source010 = Main core CLC3 out001 = Main system clock (Fcy)000 = Main CLCINA I/O pinDS1[2:0]: Data Selection MUX 1 Signal Selection bits (Secondary)111 = Secondary SCCP4 auxiliary out110 = Secondary SCCP2 auxiliary out101 = Secondary Comparator 3100 = Secondary REFCLKO output011 = Secondary INTRC/LPRC clock source010 = Secondary CLC3 out001 = Secondary system clock (Fcy)000 = Secondary CLCINA I/O pin

Note 1: Valid only for the SPI with PPS selection.

REGISTER 18-4: CLCxGLSL: CLCx GATE LOGIC INPUT SELECT LOW REGISTER

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
G2D4T G2D4N G2D3T G2D3N G2D2TG2D2N G2D1TG2D1N
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
G1D4T G1D4N G1D3T G1D3N G1D2TG1D2N G1D1TG1D1N
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR '1' = Bit is set '0' = Bit is clearedx = Bit is unknown
bit 15G2D4T: Gate 2 Data Source 4 True Enable bit1 = Data Source 4 signal is enabled for Gate 20 = Data Source 4 signal is disabled for Gate 2
bit 14G2D4N: Gate 2 Data Source 4 Negated Enable bit1 = Data Source 4 inverted signal is enabled for Gate 20 = Data Source 4 inverted signal is disabled for Gate 2
bit 13G2D3T: Gate 2 Data Source 3 True Enable bit1 = Data Source 3 signal is enabled for Gate 20 = Data Source 3 signal is disabled for Gate 2
bit 12G2D3N: Gate 2 Data Source 3 Negated Enable bit1 = Data Source 3 inverted signal is enabled for Gate 20 = Data Source 3 inverted signal is disabled for Gate 2
bit 11G2D2T: Gate 2 Data Source 2 True Enable bit1 = Data Source 2 signal is enabled for Gate 20 = Data Source 2 signal is disabled for Gate 2
bit 10G2D2N: Gate 2 Data Source 2 Negated Enable bit1 = Data Source 2 inverted signal is enabled for Gate 20 = Data Source 2 inverted signal is disabled for Gate 2
bit 9G2D1T: Gate 2 Data Source 1 True Enable bit1 = Data Source 1 signal is enabled for Gate 20 = Data Source 1 signal is disabled for Gate 2
bit 8G2D1N: Gate 2 Data Source 1 Negated Enable bit1 = Data Source 1 inverted signal is enabled for Gate 20 = Data Source 1 inverted signal is disabled for Gate 2
bit 7G1D4T: Gate 1 Data Source 4 True Enable bit1 = Data Source 4 signal is enabled for Gate 10 = Data Source 4 signal is disabled for Gate 1
bit 6G1D4N: Gate 1 Data Source 4 Negated Enable bit1 = Data Source 4 inverted signal is enabled for Gate 10 = Data Source 4 inverted signal is disabled for Gate 1
bit 5G1D3T: Gate 1 Data Source 3 True Enable bit1 = Data Source 3 signal is enabled for Gate 10 = Data Source 3 signal is disabled for Gate 1
bit 4G1D3N: Gate 1 Data Source 3 Negated Enable bit1 = Data Source 3 inverted signal is enabled for Gate 10 = Data Source 3 inverted signal is disabled for Gate 1

REGISTER 18-4: CLCxGLSL: CLCx GATE LOGIC INPUT SELECT LOW REGISTER (CONTINUED)

bit 3 G1D2T: Gate 1 Data Source 2 True Enable bit

1 = Data Source 2 signal is enabled for Gate 1
0 = Data Source 2 signal is disabled for Gate 1

bit 2 G1D2N: Gate 1 Data Source 2 Negated Enable bit

1 = Data Source 2 inverted signal is enabled for Gate 1
0 = Data Source 2 inverted signal is disabled for Gate 1

bit 1 G1D1T: Gate 1 Data Source 1 True Enable bit

1 = Data Source 1 signal is enabled for Gate 1
0 = Data Source 1 signal is disabled for Gate 1

bit 0 G1D1N: Gate 1 Data Source 1 Negated Enable bit

1 = Data Source 1 inverted signal is enabled for Gate 1
0 = Data Source 1 inverted signal is disabled for Gate 1

REGISTER 18-5: CLCxGLSH: CLCx GATE LOGIC INPUT SELECT HIGH REGISTER

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
G4D4T G4D4N G4D3T G4D3N G4D2TG4D2N G4D1TG4D1N
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
G3D4T G3D4N G3D3T G3D3N G3D2TG3D2N G3D1TG3D1N
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR '1' = Bit is set '0' = Bit is clearedx = Bit is unknown
bit 15G4D4T: Gate 4 Data Source 4 True Enable bit1 = Data Source 4 signal is enabled for Gate 40 = Data Source 4 signal is disabled for Gate 4
bit 14G4D4N: Gate 4 Data Source 4 Negated Enable bit1 = Data Source 4 inverted signal is enabled for Gate 40 = Data Source 4 inverted signal is disabled for Gate 4
bit 13G4D3T: Gate 4 Data Source 3 True Enable bit1 = Data Source 3 signal is enabled for Gate 40 = Data Source 3 signal is disabled for Gate 4
bit 12G4D3N: Gate 4 Data Source 3 Negated Enable bit1 = Data Source 3 inverted signal is enabled for Gate 40 = Data Source 3 inverted signal is disabled for Gate 4
bit 11G4D2T: Gate 4 Data Source 2 True Enable bit1 = Data Source 2 signal is enabled for Gate 40 = Data Source 2 signal is disabled for Gate 4
bit 10G4D2N: Gate 4 Data Source 2 Negated Enable bit1 = Data Source 2 inverted signal is enabled for Gate 40 = Data Source 2 inverted signal is disabled for Gate 4
bit 9G4D1T: Gate 4 Data Source 1 True Enable bit1 = Data Source 1 signal is enabled for Gate 40 = Data Source 1 signal is disabled for Gate 4
bit 8G4D1N: Gate 4 Data Source 1 Negated Enable bit1 = Data Source 1 inverted signal is enabled for Gate 40 = Data Source 1 inverted signal is disabled for Gate 4
bit 7G3D4T: Gate 3 Data Source 4 True Enable bit1 = Data Source 4 signal is enabled for Gate 30 = Data Source 4 signal is disabled for Gate 3
bit 6G3D4N: Gate 3 Data Source 4 Negated Enable bit1 = Data Source 4 inverted signal is enabled for Gate 30 = Data Source 4 inverted signal is disabled for Gate 3
bit 5G3D3T: Gate 3 Data Source 3 True Enable bit1 = Data Source 3 signal is enabled for Gate 30 = Data Source 3 signal is disabled for Gate 3
bit 4G3D3N: Gate 3 Data Source 3 Negated Enable bit1 = Data Source 3 inverted signal is enabled for Gate 30 = Data Source 3 inverted signal is disabled for Gate 3

REGISTER 18-5: CLCxGLSH: CLCx GATE LOGIC INPUT SELECT HIGH REGISTER (CONTINUED)

bit 3 G3D2T: Gate 3 Data Source 2 True Enable bit

1 = Data Source 2 signal is enabled for Gate 3
0 = Data Source 2 signal is disabled for Gate 3

bit 2 G3D2N: Gate 3 Data Source 2 Negated Enable bit

1 = Data Source 2 inverted signal is enabled for Gate 3
0 = Data Source 2 inverted signal is disabled for Gate 3

bit 1 G3D1T: Gate 3 Data Source 1 True Enable bit

1 = Data Source 1 signal is enabled for Gate 3
0 = Data Source 1 signal is disabled for Gate 3

bit 0 G3D1N: Gate 3 Data Source 1 Negated Enable bit

1 = Data Source 1 inverted signal is enabled for Gate 3
0 = Data Source 1 inverted signal is disabled for Gate 3

NOTES:

19.0 32-BIT PROGRAMMABLE CYCLIC REDUNDANCY CHECK (CRC) GENERATOR

Note 1: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive reference source. For more information, refer to "32-Bit Programmable Cyclic Redundancy Check (CRC)" (www.microchip.com/DS30009729), which is available from the Microchip website (www.microchip.com).

2: The CRC module is available only on the Main.

The 32-bit programmable CRC generator provides a hardware implemented method of quickly generating checksums for various networking and security applications. It offers the following features:

  • User-Programmable CRC Polynomial Equation, up to 32 Bits
  • Programmable Shift Direction (little or big-endian)
  • Independent Data and Polynomial Lengths
  • Configurable Interrupt Output
  • Data FIFO

A simple version of the CRC shift engine is displayed in Figure 19-1. Table 19-1 displays a simplified block diagram of the CRC generator.

TABLE 19-1: CRC MODULE OVERVIEW

Number of CRC ModulesIdentical (Modules)
Main Core 1Yes
Secondary CoreNoneNA

FIGURE 19-1: CRC MODULE BLOCK DIAGRAM
Microchip dsPIC33CH64MP208 - 32-BIT PROGRAMMABLE CYCLIC REDUNDANCY CHECK (CRC) GENERATOR - 1

flowchart
graph TD
    A["CRCDATH"] --> B["Variable FIFO (4x32, 8x16 or 16x8)"]
    C["CRCDATL"] --> B
    B --> D["Shift Buffer"]
    D --> E["1"]
    E --> F["0"]
    F --> G["CRC Shift Engine"]
    G --> H["Shifter Clock 2 * FCY"]
    H --> D
    I["FIFO Empty"] --> J["CRCISEL"]
    J --> K["1"]
    K --> L["CRC Interrupt"]
    M["SHIF Complete"] --> G
    N["LENDIAN"] --> E

19.1 CRC Control Registers

REGISTER 19-1: CRCCONL: CRC CONTROL REGISTER LOW

R/W-0 U-0 R/W-0 HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0 HSC/R-0
CRCEN —CSIDL VWORD4 VWORD3VWORD2 VWORDRD1 VWORD0
bit 15 bit 8
HSC/R-0HSC/R-1R/W-0HC/R/W-0R/W-0R/W-0U-0U-0
CRCFULCRCMPTCRCISELCRCGOLENDIANMOD
bit 7 bit 0
Legend:HC = Hardware Clearable bitHSC = Hardware Settable/Clearable bit
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is cleared x = Bit is unknown

bit 15 CRCEN: CRC Enable bit

1 = Enables module
0 = Disables module

bit 14 Unimplemented: Read as '0'

bit 13 CSIDL: CRC Stop in Idle Mode bit

1 = Discontinues module operation when device enters Idle mode
0 = Continues module operation in Idle mode

bit 12-8 VWORD[4:0]: Pointer Value bits

Indicates the number of valid words in the FIFO. Has a maximum value of 8 when PLEN[4:0] ≥ 7 or 16 when PLEN[4:0] ≤ 7 .

bit 7 CRCFUL: CRC FIFO Full bit

1 = FIFO is full
0 = FIFO is not full

bit 6 CRCMPT: CRC FIFO Empty bit

1 = FIFO is empty
0 = FIFO is not empty

bit 5 CRCISEL: CRC Interrupt Selection bit

1 = Interrupt on FIFO is empty; the final word of data is still shifting through the CRC
0 = Interrupt on shift is complete and results are ready

bit 4 CRCGO: CRC Start bit

1 = Starts CRC serial shifter
0 = CRC serial shifter is turned off

bit 3 LENDIAN: Data Shift Direction Select bit

1 = Data word is shifted into the FIFO, starting with the LSb (little-endian)
0 = Data word is shifted into the FIFO, starting with the MSb (big-endian)

bit 2 MOD: CRC Calculation Mode bit

1 = Alternate mode
0 = Legacy mode bit

bit 1-0 Unimplemented: Read as '0'

REGISTER 19-2: CRCCONH: CRC CONTROL REGISTER HIGH

U-0 U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
— — —DWIDTH[4:0]
bit 15 bit 8
U-0 U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
— — —PLEN[4:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared

bit 15-13 Unimplemented: Read as '0'

bit 12-8 DWIDTH[4:0]: Data Word Width Configuration bits Configures the width of the data word (Data Word Width - 1).

bit 7-5 Unimplemented: Read as '0'

bit 4-0 PLEN[4:0]: Polynomial Length Configuration bits Configures the length of the polynomial (Polynomial Length - 1).

REGISTER 19-3: CRCXORL: CRC XOR POLYNOMIAL REGISTER, LOW BYTE

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
X[15:8]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 U-0
X[7:1]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0' -n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-1 X[15:1]: XOR of Polynomial Term x^n Enable bits bit 0 Unimplemented: Read as '0'

REGISTER 19-4: CRCXORH: CRC XOR POLYNOMIAL REGISTER, HIGH BYTE

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
X[31:24]
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
X[23:16]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0' -n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 X[31:16]: XOR of Polynomial Term x^n Enable bits

20.0 CURRENT BIAS GENERATOR (CBG)

Note 1: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive reference source. To complement the information in this data sheet, refer to “Current Bias Generator (CBG)” (www.microchip.com/DS70005253), which is available from the Microchip website (www.microchip.com).

2: Some registers and associated bits described in this section may not be available on all devices. Refer to Section 3.2 "Main Memory Organization" in this data sheet for device-specific register and bit information.

The Current Bias Generator (CBG) consists of two classes of current sources: 10 A and 50 A sources. The major features of each current source are:

• 1 0 μA Current Sources:

- Current sourcing only

- Up to four independent sources

• 50 μA Current Sources:

- Selectable current sourcing or sinking

- Selectable current mirroring for sourcing and sinking

A simplified block diagram of the CBG module is shown in Figure 20-1.

TABLE 20-1: CBG CHANNEL AVAILABILITY

PackageSRCxIBIASx
28-pinIBIAS0, IBIAS1, IBIAS2
36-pinISRC0, ISRC1IBIAS0, IBIAS1, IBIAS2
48-pinISRC0, ISRC1, ISRC2, ISRC3IBIAS0, IBIAS1, IBIAS2, IBIAS3
64-pinISRC0, ISRC1, ISRC2, ISRC3IBIAS0, IBIAS1, IBIAS2, IBIAS3
80-pinISRC0, ISRC1, ISRC2, ISRC3IBIAS0, IBIAS1, IBIAS2, IBIAS3

FIGURE 20-1: CONSTANT-CURRENT SOURCE MODULE BLOCK DIAGRAM

(2)

10 μA Source 50 μA Source
Microchip dsPIC33CH64MP208 - CURRENT BIAS GENERATOR (CBG) - 1

flowchart
graph TD
    A["I10ENx"] --> B["AND"]
    B --> C["ResD(1)"]
    C --> D["ISRCx"]
    D --> E["AVDD"]
    F["ADC"] --> G["ResD(1)"]
    G --> H["AVSS"]
    H --> I["ADC"]
    J["ARC"] --> K["ResD(1)"]
    K --> L["IBIASx"]
    M["ON"] --> N["ARC"]
    O["ON"] --> P["ARC"]
    Q["ON"] --> R["ARC"]
    S["ARC"] --> T["ARC"]
    U["ARC"] --> V["ARC"]
    W["ARC"] --> X["ARC"]
    Y["ARC"] --> Z["ARC"]
    AA["ARC"] --> AB["ARC"]
    AC["ARC"] --> AD["ARC"]
    AE["ARC"] --> AF["ARC"]

Note 1: RESD is typically 300 Ohms; for more information, refer to the device data sheet.
2: In Figure 20-1 only, the ADC analog input is shown for clarity. Each analog peripheral connected to the pin has a separate Electrostatic Discharge (ESD) resistor.

20.1 Current Bias Generator Control Registers

REGISTER 20-1: BIASCON: CURRENT BIAS GENERATOR CONTROL REGISTER

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15 ON: Current Bias Module Enable bit

1 = Module is enabled

0 = Module is disabled

bit 14-4 Unimplemented: Read as '0'

bit 3 I10EN3: 10 μA Enable for Output 3 bit

1 = 10 μA output is enabled

0 = 10 μA output is disabled

bit 2 I10EN2: 10 μA Enable for Output 2 bit

1 = 10 μA output is enabled

0 = 10 μA output is disabled

bit 1 I10EN1: 10 μA Enable for Output 1 bit

1 = 10 μA output is enabled

0 = 10 μA output is disabled

bit 0 I10EN0: 10 μA Enable for Output 0 bit

1 = 10 μA output is enabled

0 = 10 μA output is disabled

REGISTER 20-2: IBIASCONH: CURRENT BIAS GENERATOR 50 μA CURRENT SOURCE CONTROL HIGH REGISTER

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
SHRSRCEN3SHRSNKEN3GENSRCEN3GENSNKEN3SRCEN3SNKEN3
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
SHRSRCEN2SHRSNKEN2GENSRCEN2GENSNKEN2SRCEN2SNKEN2
bit 7 bit 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-14 Unimplemented: Read as '0'

bit 13 SHRSRCEN3: Share Source Enable for Output #3 bit

1 = Sourcing Current Mirror mode is enabled (uses reference from another source) 0 = Sourcing Current Mirror mode is disabled

bit 12 SHRSNKEN3: Share Sink Enable for Output #3 bit

1 = Sinking Current Mirror mode is enabled (uses reference from another source) 0 = Sinking Current Mirror mode is disabled

bit 11 GENSRCEN3: Generated Source Enable for Output #3 bit

1 = Source generates the current source mirror reference 0 = Source does not generate the current source mirror reference

bit 10 GENSNKEN3: Generated Sink Enable for Output #3 bit

1 = Source generates the current source mirror reference 0 = Source does not generate the current source mirror reference

bit 9 SRCEN3: Source Enable for Output #3 bit

1 = Current source is enabled 0 = Current source is disabled

bit 8 SNKEN3: Sink Enable for Output #3 bit

1 = Current sink is enabled 0 = Current sink is disabled

bit 7-6 Unimplemented: Read as '0'

bit 5 SHRSRCEN2: Share Source Enable for Output #2 bit

1 = Sourcing Current Mirror mode is enabled (uses reference from another source) 0 = Sourcing Current Mirror mode is disabled

bit 4 SHRSNKEN2: Share Sink Enable for Output #2 bit

1 = Sinking Current Mirror mode is enabled (uses reference from another source) 0 = Sinking Current Mirror mode is disabled

bit 3 GENSRCEN2: Generated Source Enable for Output #2 bit

1 = Source generates the current source mirror reference 0 = Source does not generate the current source mirror reference

bit 2 GENSNKEN2: Generated Sink Enable for Output #2 bit

1 = Source generates the current source mirror reference 0 = Source does not generate the current source mirror reference

bit 1 SRCEN2: Source Enable for Output #2 bit

1 = Current source is enabled 0 = Current source is disabled

bit 0 SNKEN2: Sink Enable for Output #2 bit

1 = Current sink is enabled 0 = Current sink is disabled

REGISTER 20-3: IBIASCONL: CURRENT BIAS GENERATOR 50 μA CURRENT SOURCE CONTROL LOW REGISTER

U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
SHRSRCEN1SHRSNKEN1GENSRCEN1GENSNKEN1SRCEN1SNKEN1
bit 15 bit 8
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
SHRSRCEN0SHRSNKEN0GENSRCEN0GENSNKEN0SRCEN0SNKEN0
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15-14 Unimplemented: Read as '0'

bit 13 SHRSRCEN1: Share Source Enable for Output #1 bit

1 = Sourcing Current Mirror mode is enabled (uses reference from another source)

0 = Sourcing Current Mirror mode is disabled

bit 12 SHRSNKEN1: Share Sink Enable for Output #1 bit

1 = Sinking Current Mirror mode is enabled (uses reference from another source)

0 = Sinking Current Mirror mode is disabled

bit 11 GENSRCEN1: Generated Source Enable for Output #1 bit

1 = Source generates the current source mirror reference

0 = Source does not generate the current source mirror reference

bit 10 GENSNKEN1: Generated Sink Enable for Output #1 bit

1 = Source generates the current source mirror reference

0 = Source does not generate the current source mirror reference

bit 9 SRCEN1: Source Enable for Output #1 bit

1 = Current source is enabled

0 = Current source is disabled

bit 8 SNKEN1: Sink Enable for Output #1 bit

1 = Current sink is enabled

0 = Current sink is disabled

bit 7-6 Unimplemented: Read as '0'

bit 5 SHRSRCENO: Share Source Enable for Output #0 bit

1 = Sourcing Current Mirror mode is enabled (uses reference from another source)

0 = Sourcing Current Mirror mode is disabled

bit 4 SHRSNKEN0: Share Sink Enable for Output #0 bit

1 = Sinking Current Mirror mode is enabled (uses reference from another source)

0 = Sinking Current Mirror mode is disabled

bit 3 GENSRCENO: Generated Source Enable for Output #0 bit

1 = Source generates the current source mirror reference

0 = Source does not generate the current source mirror reference

bit 2 GENSNKEN0: Generated Sink Enable for Output #0 bit

1 = Source generates the current source mirror reference

0 = Source does not generate the current source mirror reference

bit 1 SRCENO: Source Enable for Output #0 bit

1 = Current source is enabled

0 = Current source is disabled

bit 0 SNKEN0: Sink Enable for Output #0 bit

1 = Current sink is enabled

0 = Current sink is disabled

NOTES:

21.0 SPECIAL FEATURES

Note: This data sheet summarizes the features of the dsPIC33CH128MP508 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 of the "dsPIC33/PIC24 Family Reference Manual", which is available from the Microchip website (www.microchip.com).

The dsPIC33CH128MP508 family devices include several features intended to maximize application flexibility and reliability, and minimize cost through elimination of external components. These are:

  • Flexible Configuration
  • Watchdog Timer (WDT)
    • Code Protection and CodeGuard™ Security
    • JTAG Boundary Scan Interface
    • In-Circuit Serial Programming (ICSP)
    • In-Circuit Emulation
  • Brown-out Reset (BOR)

21.1 Configuration Bits

In dsPIC33CH128MP508 family devices, the Configuration Words are implemented as volatile memory. This means that configuration data will get loaded to volatile memory (from the Flash Configuration Words) each time the device is powered up. Configuration data are stored at the end of the on-chip program memory space, known as the Flash Configuration Words. Their specific locations are shown in Table 21-1. The configuration data are automatically loaded from the Flash Configuration Words to the proper Configuration Shadow registers during device Resets.

Note: Configuration data are reloaded on all types of device Main Resets. Secondary Resets do not load the Configuration registers. It is recommended not to change the Secondary Configuration register without resetting the Secondary along with the Main (S1MSRE = 1).

When creating applications for these devices, users should always specifically allocate the location of the Flash Configuration Words for configuration data in their code for the compiler. This is to make certain that program code is not stored in this address when the code is compiled. Program code executing out of configuration space will cause a device Reset. The Main code, as well as the Secondary code, are located in Flash memory. Table 21-1 shows the Main and the Secondary Configuration registers and their address locations in Flash memory.

Secondary Configuration bits are located in the Main Flash and loaded during a Main Reset.

Note: Performing a page erase operation on the last page of program memory clears the Flash Configuration Words.

TABLE 21-1: CONFIGURATION WORD ADDRESSES

Register 64k Address 128k Address
Main/General Configuration Registers
FSEC 00AF00015F00
FBSLIM00AF10015F10
FSIGN00AF14015F14
FOSCSEL00AF18015F18
FOSC00AF1C015F1C
FWDT00AF20015F20
FPOR00AF24015F24
FICD00AF28015F28
FDMTIVTL00AF2C015F2C
FDMTIVTH00AF30015F30
FDMTCNTL00AF34015F34
FDMTCNTH00AF38015F38
FDMT00AF3C015F3C
FDEVOPT00AF40015F40
FALTREG00AF44015F44
FMBXM00AF48015F48
FMBXHS100AFC4015F4C
FMBXHS200AF50015F50
FMBXHSEN00AF54015F54
FCFGPRA000AF58015F58
FCFGPRB000AF60015F60
FCFGPRC000AF68015F68
FCFGPRD000AF70015F70
FCFGPRE000AF78015F7C
Secondary Configuration Registers
FS1OSCSEL00AF80015F80
FS1OSC00AF84015F84
FS1WDT00AF88015F88
FS1POR00AF8C015F8C
FS1ICD00AF90015F90
FS1DEVOPT00AF94015F94
FS1ALTREG00AF98015F98

TABLE 21-2: MAIN CONFIGURATION REGISTERS MAP

Register NameBits 23-16Bit 15Bit 14Bit 13Bit 12Bit 11Bit 10Bit 9Bit 8Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
FSECAIVTDISCSS[2:0]CWRPGSS[1:0]GWRPBSENBSS[1:0]BWRP
FBSLIMBSLIM[12:0]
FSIGNr(2)
FOSCSELIESOFNOSC[2:0]
FOSCXTBSTXTCFG[1:0]r(1)FCKSM[1:0]OSCIOFNCPOSCMD[1:0]
FWDTFWDTENSWDTPS[4:0]WDTWIN[1:0]WINDISRCLKSEL[1:0]RWDTPS[4:0]
FPORr(1)r(1)
FICDr(1)JTAGENICS[1:0]
FDMTIVTLDMTIVT[15:0]
FDMTIVTHDMTIVT[31:16]
FDMTCNTLDMTCNT[15:0]
FDMTCNTHDMTCNT[31:16]
FDMTDMTDIS
FDEVOPTSP/2PINSMBENr(1)r(1)r(1)ALTI2C[2:1]r(1)
FALTREGCTXT4[2:0]CTXT3[2:0]CTXT2[2:0]CTXT1[2:0]
FMBXMMBXM[15:0]
FMBXHS1MBXHSD[3:0]MBXHSC[3:0]MBXHSB[3:0]MBXHSA[3:0]
FMBXHS2MBXHSH[3:0]MBXHSG[3:0]MBXHSF[3:0]MBXHSE[3:0]
FMBXHSENHS[H:A]EN
FCFGPRAOCPRA[4:0]
FCFGPRBOCPRB[15:0]
FCFGPRCOCPRC[15:0]
FCFGPRDOCPRD[15:0]
FCFGPREOCPRE[15:0]

Legend: — = unimplemented bit, read as '1'; r = reserved bit.
Note 1: Bit is reserved, maintain as ':-'.
2: Bit is reserved, maintain as '0'.

TABLE 21-3: SECONDARY CONFIGURATION REGISTERS MAP

Legend: — = unimplemented bit, read as '1'; r = reserved bit.
Note 1: Bit is reserved, maintain as
2: Only valid in Dual Debug mode.

REGISTER 21-1: FSEC CONFIGURATION REGISTER

U-1 U-1 U-1 U-1 U-1 U-1 U-1
——————
bit 23 bit 16
R/PO-1 U-1 U-1 U-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1
AIVTDIS— — —CSS2 CSS1 CSS0 CWRP
bit 15 bit 8
R/PO-1 R/PO-1 R/PO-1 U-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1
GSS1GSS0GWRPBSEN BSS1BSS0BWRP
bit 7 bit 0
Legend:PO = Program Once 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 23-16 Unimplemented: Read as '1'

bit 15 AIVTDIS: Alternate Interrupt Vector Table Disable bit

1 = Disables AIVT 0 = Enables AIVT

bit 14-12 Unimplemented: Read as '1'

bit 11-9 CSS[2:0]: Configuration Segment Code Flash Protection Level bits

111 = No protection (other than CWRP write protection) 110 = Standard security 10x = Enhanced security 0xx = High security

bit 8 CWRP: Configuration Segment Write-Protect bit 1 = Configuration Segment is not write-protected 0 = Configuration Segment is write-protected

bit 7-6 GSS[1:0]: General Segment Code Flash Protection Level bits 11 = No protection (other than GWRP write protection) 10 = Standard security 0x = High security

bit 5 GWRP: General Segment Write-Protect bit 1 = User program memory is not write-protected 0 = User program memory is write-protected

bit 4 Unimplemented: Read as '1'

bit 3 BSEN: Boot Segment Control bit 1 = No Boot Segment 0 = Boot Segment size is determined by BSLIM[12:0]

bit 2-1 BSS[1:0]: Boot Segment Code Flash Protection Level bits 11 = No protection (other than BWRP write protection) 10 = Standard security 0x = High security

bit 0 BWRP: Boot Segment Write-Protect bit 1 = User program memory is not write-protected 0 = User program memory is write-protected

REGISTER 21-2: FBSLIM CONFIGURATION REGISTER

U-1 U-1 U-1 U-1 U-1 U-1 U-1
——————
bit 23 bit 16
U-1 U-1 U-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1
— — —BSLIM[12:8]
bit 15 bit 8
R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1
BSLIM[7:0]
bit 7 bit 0
Legend:PO = Program Once 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 23-13 Unimplemented: Read as '1'

bit 12-0 BSLIM[12:0]: Boot Segment Code Flash Page Address Limit bits

Contains the page address of the first active General Segment page. The value to be programmed is the inverted page address, such that programming additional '0's can only increase the Boot Segment size.

REGISTER 21-3: FSIGN CONFIGURATION REGISTER

U-1 U-1 U-1 U-1 U-1 U-1 U-1
——————
bit 23 bit 16
r-0 U-1 U-1 U-1 U-1 U-1 U-1
——————
bit 15 bit 8
U-1 U-1 U-1 U-1 U-1 U-1 U-1 U-1
——————
bit 7 bit 0
Legend:r = Reserved bitPO = Program Once bit
R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 23-16 Unimplemented: Read as '1'

bit 15 Reserved: Maintain as '0'

bit 14-0 Unimplemented: Read as '1'

REGISTER 21-4: FOSCSEL CONFIGURATION REGISTER

U-1 U-1 U-1 U-1 U-1 U-1 U-1
——————
bit 23 bit 16
U-1 U-1 U-1 U-1 U-1 U-1 U-1 U-1
——————
bit 15 bit 8
R/PO-1 U-1 U-1 U-1 R/PO-1 R/PO-1 R/PO-1
IESO— — —FN O
bit 7 bit 0
Legend: PO = Program Once bit
R = Readable bit W = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 23-8 Unimplemented: Read as '1'

bit 7 IESO: Internal External Switchover bit

1 = Internal External Switchover mode is enabled (Two-Speed Start-up is enabled)

0 = Internal External Switchover mode is disabled (Two-Speed Start-up is disabled)

bit 6-3 Unimplemented: Read as '1'

bit 2-0 FNOSC[2:0]: Initial Oscillator Source Selection bits

111 = Internal Fast RC (FRC) Oscillator with Postscaler

110 = Backup Fast RC (BFRC)

101 = LPRC Oscillator

100 = Reserved

011 = Primary Oscillator with PLL (XTPLL, HSPLL, ECPLL)

010 = Primary (XT, HS, EC) Oscillator

001 = Internal Fast RC Oscillator with PLL (FRCPLL)

000 = Fast RC (FRC) Oscillator

REGISTER 21-5: FOSC CONFIGURATION REGISTER

U-1 U-1 U-1 U-1 U-1 U-1 U-1
—————
bit 23 bit 16
U-1U-1U-1R/PO-1R/PO-1R/PO-1U-1r-1
— — —XTBSTXTCFG1XTCFG0
bit 15 bit 8
R/PO-1R/PO-1U-1U-1U-1R/PO-1R/PO-1R/PO-1
FCKSM1FCKSM0— — —OSCIOFNC(1)POSCMD1POSCMD0
bit 7 bit 0
Legend:PO = Program Once bitr = Reserved 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 23-13 Unimplemented: Read as '1'

bit 12 XTBST: Oscillator Kick-Start Programmability bit

1 = Boosts the kick-start and maintains an increased drive strength of the crystal in addition to gain selected by XTCFG[1:0]

0 = Default kick-start

bit 11-10 XTCFG[1:0]: Crystal Oscillator Drive Select bits

Current gain programmability for oscillator (output drive).

11 = Gain3 (use for 24-32 MHz crystals)

1.0 = Gain2 (use for 16-24 MHz crystals)

01 = Gain1 (use for 8-16 MHz crystals)

00 = Gain0 (use for 4-8 MHz crystals)

bit 9 Unimplemented: Read as '1'

bit 8 Reserved: Maintain as '1'

bit 7-6 FCKSM[1:0]: Clock Switching Mode bits

1x = Clock switching is disabled, Fail-Safe Clock Monitor is disabled

01 = Clock switching is enabled, Fail-Safe Clock Monitor is disabled

00 = Clock switching is enabled, Fail-Safe Clock Monitor is enabled

bit 5-3 Unimplemented: Read as '1'

bit 2 OSCIOFNC: OSCO Pin Function bit (except in XT and HS modes) ^(1)

1 = OSCO is the clock output

0 = OSCO is the general purpose digital I/O pin

bit 1-0 POSCMD[1:0]: Primary Oscillator Mode Select bits

11 = Primary Oscillator is disabled

10 = HS Crystal Oscillator mode (10 MHz-32 MHz)

01 = XT Crystal Oscillator mode (3.5 MHz-10 MHz)

00 = EC (External Clock) mode

Note 1: The OSCO pin function is determined by the S1OSCIOFNC Configuration bit. If both the Main core OSCIOFNC and Secondary core S1OSCIOFNC bits are set, the Main core OSCIOFNC bit has priority.

REGISTER 21-6: FWDT CONFIGURATION REGISTER

U-1 U-1 U-1 U-1 U-1 U-1 U-1
——————
bit 23 bit 16
R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1
FWDTEN SWWDTPS4 SWDTPS3 SWDTPS2 SWDTPS1SWDTPS0 WDTWIN1 WDTVVIN0
bit 15 bit 8
R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1
WINDISRCLKSEL1RCLKSEL0RWDTPS4RWDTPS3RWDTPS2RWDTPS1RWDTPS0
bit 7 bit 0
Legend:PO = Program Once 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 23-16 Unimplemented: Read as '1'

bit 15 FWDTEN: Watchdog Timer Enable bit

1 = WDT is enabled in hardware

0 = WDT controller via the ON bit (WDTCONL[15])

bit 14-10 SWDTPS[4:0]: Sleep Mode Watchdog Timer Period Select bits

11111 = Divide by 2^31 = 2,147,483,648

11110 = Divide by 2^30 = 1,073,741,824

...

00001 = Divide by 2^1 = 2

00000 = Divide by 2^0 = 1

bit 9-8 WDTWIN[1:0]: Watchdog Timer Window Select bits

11 = WDT window is 25% of the WDT period

10 = WDT window is 37.5% of the WDT period

01 = WDT window is 50% of the WDT period

00 = WDT Window is 75% of the WDT period

bit 7 WINDIS: Watchdog Timer Window Enable bit

1 = Watchdog Timer is in Non-Window mode

0 = Watchdog Timer is in Window mode

bit 6-5 RCLKSEL[1:0]: Watchdog Timer Clock Select bits

11 = LPRC clock

10 = Uses FRC when WINDIS = 0, system clock is not INTOSC/LPRC and device is not in Sleep; otherwise, uses INTOSC/LPRC

01 = Uses peripheral clock when system clock is not INTOSC/LPRC and device is not in Sleep; otherwise, uses INTOSC/LPRC

00 = Reserved

bit 4-0 RWDTPS[4:0]: Run Mode Watchdog Timer Period Select bits

11111 = Divide by 2^31 = 2,147,483,648

11110 = Divide by 2^30 = 1,073,741,824

+ + +

00001 = Divide by 2^1 = 2

00000 = Divide by 2^0 = 1

REGISTER 21-7: FPOR CONFIGURATION REGISTER

U-1 U-1 U-1 U-1 U-1 U-1 U-1
——————
bit 23 bit 16
U-1 U-1 U-1 U-1 U-1 U-1 U-1
——————
bit 15 bit 8
U-1 U-1 r-1 r-1 U-1 U-1 U-1 U-1
—————— ——
bit 7 bit 0
Legend: PO = Program Once bit r = Reserved 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 23-6 Unimplemented: Read as '1'

bit 5-4 Reserved: Maintain as '1'

bit 3-0 Unimplemented: Read as '1'

REGISTER 21-8: FICD CONFIGURATION REGISTER

U-1 U-1 U-1 U-1 U-1 U-1 U-1
——————
bit 23 bit 16
U-1 U-1 U-1 U-1 U-1 U-1 U-1 U-1
——————
bit 15 bit 8
r-1 U-1 R/PO-1 U-1 U-1 U-1 R/PO-1 R/PO-1
— —JTAGEN— — ICS1 ICS0
bit 7 bit 0
Legend:PO = Program Once bitr = Reserved 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 23-8 Unimplemented: Read as '1'

bit 7 Reserved: Maintain as '1'

bit 6 Unimplemented: Read as '1'

bit 5 JTAGEN: JTAG Enable bit

1 = JTAG port is enabled

0 = JTAG port is disabled

bit 4-2 Unimplemented: Read as '1'

bit 1-0 ICS[1:0]: ICD Communication Channel Select bits

11 = Main communicates on PGC1 and PGD1

10 = Main communicates on PGC2 and PGD2

01 = Main communicates on PGC3 and PGD3

00 = Reserved, do not use

REGISTER 21-9: FDMTIVTL CONFIGURATION REGISTER

U-1 U-1 U-1 U-1 U-1 U-1 U-1
——————
bit 23 bit 16
R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1
DMTIVT[15:8]
bit 15 bit 8
R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1
DMTIVT[7:0]
bit 7 bit 0
Legend: PO = Program Once bit
R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 23-16 Unimplemented: Read as '1'

bit 15-0 DMTIVT[15:0]: DMT Window Interval Lower 16 bits

REGISTER 21-10: FDMTIVTH CONFIGURATION REGISTER

U-1 U-1 U-1 U-1 U-1 U-1 U-1
—————
bit 23 bit 16
R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1
DMTIVT[31:24]
bit 15 bit 8
R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1
DMTIVT[23:16]
bit 7 bit 0
Legend: PO = Program Once bit
R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 23-16 Unimplemented: Read as '1'

bit 15-0 DMTIVT[31:16]: DMT Window Interval Higher 16 bits

REGISTER 21-11: FDMTCNTL CONFIGURATION REGISTER

U-1 U-1 U-1 U-1 U-1 U-1 U-1
——————
bit 23 bit 16
R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1
DMTCNT[15:8]
bit 15 bit 8
R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1
DMTCNT[7:0]
bit 7 bit 0
Legend: PO = Program Once bit
R = Readable bit W = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown

bit 23-16 Unimplemented: Read as '1'

bit 15-0 DMTCNT[15:0]: DMT Instruction Count Time-out Value Lower 16 bits

REGISTER 21-12: FDMTCNTH CONFIGURATION REGISTER

U-1 U-1 U-1 U-1 U-1 U-1 U-1
—————
bit 23 bit 16
R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1
DMTCNT[31:24]
bit 15 bit 8
R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1
DMTCNT[23:16]
bit 7 bit 0
Legend: PO = Program Once bit
R = Readable bit W = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown

bit 23-16 Unimplemented: Read as '1'

bit 15-0 DMTCNT[31:16]: DMT Instruction Count Time-out Value Upper 16 bits

REGISTER 21-13: FDMT CONFIGURATION REGISTER

U-1 U-1 U-1 U-1 U-1 U-1 U-1
——————
bit 23 bit 16
U-1 U-1 U-1 U-1 U-1 U-1 U-1
——————
bit 15 bit 8
U-1 U-1 U-1 U-1 U-1 U-1 R/PO-1
——————DMTDIS
bit 7 bit 0
Legend: PO = Program Once 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 23-1 Unimplemented: Read as '1'

bit 0 DMTDIS: DMT Disable bit

1 = DMT is disabled and can be enabled by software using ON bit (DMTCON<15>)

0 = DMT is enabled and cannot be disabled by software

REGISTER 21-14: FDEVOPT CONFIGURATION REGISTER

U-1 U-1 U-1 U-1 U-1 U-1 U-1
— — —— — — —
bit 23 bit 16
U-1U-1R/PO-1U-1U-1R/PO-1r-1r-1
— —SPI2PIN(1)SMBEN
bit 15 bit 8
r-1 U-1 U-1R/PO-1R/PO-1r-1 U-1 U-1
ALTI2C2
bit 7 bit 0
Legend:PO = Program Once bitr = Reserved 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 23-14 Unimplemented: Read as '1'

bit 13 SPI2PIN: Main SPI #2 Fast I/O Pad Disable bit ^(1)

1 = Main SPI2 uses PPS (I/O remap) to make connections with device pins
0 = Main SPI2 uses direct connections with specified device pins

bit 12-11 Unimplemented: Read as '1'

bit 10 SMBEN: Select Input Voltage Threshold for I²C Pads to be SMBus 3.0 Compliant bit

1 = Enables SMBus 3.0 input threshold voltage
0 = I²C pad input buffer operation

bit 9-7 Reserved: Maintain as '1'

bit 6-5 Unimplemented: Read as '1'

bit 4 ALTI2C2: Alternate I2C2 Pin Mapping bit

1 = Default location for SCL2/SDA2 pins
0 = Alternate location for SCL2/SDA2 pins (ASCL2/ASDA2)

bit 3 ALTI2C1: Alternate I2C1 Pin Mapping bit

1 = Default location for SCL1/SDA1 pins
0 = Alternate location for SCL1/SDA1 pins (ASCL1/ASDA1)

bit 2 Reserved: Maintain as '1'

bit 1-0 Unimplemented: Read as '1'

Note 1: Fixed pin option is only available for higher pin packages (48-pin, 64-pin and 80-pin).

REGISTER 21-15: FALTREG CONFIGURATION REGISTER

U-1 U-1 U-1 U-1 U-1 U-1 U-1
——————
bit 23 bit 16
U-1 R/PO-1 R/PO-1 R/PO-1 U-1 R/PO-1 R/PO-1 R/PO-1
— CTXT4[2:0] — CTXT3[2:0]
bit 15 bit 8
U-1 R/PO-1 R/PO-1 R/PO-1 U-1 R/PO-1 R/PO-1 R/PO-1
— CTXT2[2:0] — CTXT1[2:0]
bit 7 bit 0
Legend:PO = Program Once 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 23-15 Unimplemented: Read as '1'

bit 14-12 CTXT4[2:0]: Specifies the Alternate Working Register Set #4 with Interrupt Priority Levels (IPL) bits 111 = Not assigned

110 = Alternate Register Set #4 is assigned to IPL Level 7
101 = Alternate Register Set #4 is assigned to IPL Level 6
100 = Alternate Register Set #4 is assigned to IPL Level 5
011 = Alternate Register Set #4 is assigned to IPL Level 4
010 = Alternate Register Set #4 is assigned to IPL Level 3
001 = Alternate Register Set #4 is assigned to IPL Level 2
000 = Alternate Register Set #4 is assigned to IPL Level 1

bit 11 Unimplemented: Read as '1'

bit 10-8 CTXT3[2:0]: Specifies the Alternate Working Register Set #3 with Interrupt Priority Levels (IPL) bits 111 = Not assigned

110 = Alternate Register Set #3 is assigned to IPL Level 7
101 = Alternate Register Set #3 is assigned to IPL Level 6
100 = Alternate Register Set #3 is assigned to IPL Level 5
011 = Alternate Register Set #3 is assigned to IPL Level 4
010 = Alternate Register Set #3 is assigned to IPL Level 3
001 = Alternate Register Set #3 is assigned to IPL Level 2
000 = Alternate Register Set #3 is assigned to IPL Level 1

bit 7 Unimplemented: Read as '1'

bit 6-4 CTXT2[2:0]: Specifies the Alternate Working Register Set #2 with Interrupt Priority Levels (IPL) bits 111 = Not assigned

110 = Alternate Register Set #2 is assigned to IPL Level 7
101 = Alternate Register Set #2 is assigned to IPL Level 6
100 = Alternate Register Set #2 is assigned to IPL Level 5
011 = Alternate Register Set #2 is assigned to IPL Level 4
010 = Alternate Register Set #2 is assigned to IPL Level 3
001 = Alternate Register Set #2 is assigned to IPL Level 2
000 = Alternate Register Set #2 is assigned to IPL Level 1

bit 3 Unimplemented: Read as '1'

REGISTER 21-15: FALTREG CONFIGURATION REGISTER (CONTINUED)

bit 2-0 CTXT1[2:0]: Specifies the Alternate Working Register Set #1 with Interrupt Priority Levels (IPL) bits

111 = Not assigned

110 = Alternate Register Set #1 is assigned to IPL Level 7

101 = Alternate Register Set #1 is assigned to IPL Level 6

100 = Alternate Register Set #1 is assigned to IPL Level 5

011 = Alternate Register Set #1 is assigned to IPL Level 4

010 = Alternate Register Set #1 is assigned to IPL Level 3

001 = Alternate Register Set #1 is assigned to IPL Level 2

000 = Alternate Register Set #1 is assigned to IPL Level 1

REGISTER 21-16: FMBXM CONFIGURATION REGISTER

U-1 U-1 U-1 U-1 U-1 U-1 U-1
——————
bit 23 bit 16
R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1
MBXM15 MBXM14 MBXM13 MBXM12 MBXM11 MBXM10MBXM9MBXM8
bit 15 bit 8
R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1
MBXM7MBXM6MBXM5MBXM4MBXM3MBXM2MBXM1MBXM0
bit 7 bit 0
Legend:PO = Program Once 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 23-16 Unimplemented: Read as '1'

bit 15 MBXM15: Mailbox Data Register Channel Direction Fuses bits

1 = Mailbox Register #15 is configured for Main data read (Secondary to Main data transfer)

0 = Mailbox Register #15 is configured for Main data write (Main to Secondary data transfer)

bit 14 MBXM14: Mailbox Data Register Channel Direction Fuses bits

1 = Mailbox Register #14 is configured for Main data read (Secondary to Main data transfer)

0 = Mailbox Register #14 is configured for Main data write (Main to Secondary data transfer)

bit 13 MBXM13: Mailbox Data Register Channel Direction Fuses bits

1 = Mailbox Register #13 is configured for Main data read (Secondary to Main data transfer)

0 = Mailbox Register #13 is configured for Main data write (Main to Secondary data transfer)

bit 12 MBXM12: Mailbox Data Register Channel Direction Fuses bits

1 = Mailbox Register #12 is configured for Main data read (Secondary to Main data transfer)

0 = Mailbox Register #12 is configured for Main data write (Main to Secondary data transfer)

bit 11 MBXM11: Mailbox Data Register Channel Direction Fuses bits

1 = Mailbox Register #11 is configured for Main data read (Secondary to Main data transfer)

0 = Mailbox Register #11 is configured for Main data write (Main to Secondary data transfer)

bit 10 MBXM10: Mailbox Data Register Channel Direction Fuses bits

1 = Mailbox Register #10 is configured for Main data read (Secondary to Main data transfer)

0 = Mailbox Register #10 is configured for Main data write (Main to Secondary data transfer)

REGISTER 21-16: FMBXM CONFIGURATION REGISTER (CONTINUED)

bit 9MBXM9: Mailbox Data Register Channel Direction Fuses bits1 = Mailbox Register #9 is configured for Main data read (Secondary to Main data transfer)0 = Mailbox Register #9 is configured for Main data write (Main to Secondary data transfer)
bit 8MBXM8: Mailbox Data Register Channel Direction Fuses bits1 = Mailbox Register #8 is configured for Main data read (Secondary to Main data transfer)0 = Mailbox Register #8 is configured for Main data write (Main to Secondary data transfer)
bit 7MBXM7: Mailbox Data Register Channel Direction Fuses bits1 = Mailbox Register #7 is configured for Main data read (Secondary to Main data transfer)0 = Mailbox Register #7 is configured for Main data write (Main to Secondary data transfer)
bit 6MBXM6: Mailbox Data Register Channel Direction Fuses bits1 = Mailbox Register #6 is configured for Main data read (Secondary to Main data transfer)0 = Mailbox Register #6 is configured for Main data write (Main to Secondary data transfer)
bit 5MBXM5: Mailbox Data Register Channel Direction Fuses bits1 = Mailbox Register #5 is configured for Main data read (Secondary to Main data transfer)0 = Mailbox Register #5 is configured for Main data write (Main to Secondary data transfer)
bit 4MBXM4: Mailbox Data Register Channel Direction Fuses bits1 = Mailbox Register #4 is configured for Main data read (Secondary to Main data transfer)0 = Mailbox Register #4 is configured for Main data write (Main to Secondary data transfer)
bit 3MBXM3: Mailbox Data Register Channel Direction Fuses bits1 = Mailbox Register #3 is configured for Main data read (Secondary to Main data transfer)0 = Mailbox Register #3 is configured for Main data write (Main to Secondary data transfer)
bit 2MBXM2: Mailbox Data Register Channel Direction Fuses bits1 = Mailbox Register #2 is configured for Main data read (Secondary to Main data transfer)0 = Mailbox Register #2 is configured for Main data write (Main to Secondary data transfer)
bit 1MBXM1: Mailbox Data Register Channel Direction Fuses bits1 = Mailbox Register #1 is configured for Main data read (Secondary to Main data transfer)0 = Mailbox Register #1 is configured for Main data write (Main to Secondary data transfer)
bit 0MBXM0: Mailbox Data Register Channel Direction Fuses bits1 = Mailbox Register #0 is configured for Main data read (Secondary to Main data transfer)0 = Mailbox Register #0 is configured for Main data write (Main to Secondary data transfer)

REGISTER 21-17: FMBXHS1 CONFIGURATION REGISTER

U-1 U-1 U-1 U-1 U-1 U-1 U-1
——————
bit 23 bit 16
R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1
MBXHSD3 MMBXHSD2 MBXHSD1 MBXHSD0 MBXHSC3MBXHSC2 MBBXHSC1 MBXHHSC0
bit 15 bit 8
R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1
MBXHSB3MBXHSB2MBXHSB1MBXHSB0MBXHSA3MBXHSA2MBXHSA1MBXHSA0
bit 7 bit 0
Legend: PO = Program Once 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 23-16Unimplemented: Read as '1'
bit 15-12MBXHSD[3:0]: Mailbox Handshake Protocol Block D Register Assignment bits1111 = MSIxMBXD15 is assigned to Mailbox Handshake Protocol Block D...0001 = MSIxMBXD1 is assigned to Mailbox Handshake Protocol Block D0000 = MSIxMBXD0 is assigned to Mailbox Handshake Protocol Block D
bit 11-8MBXHSC[3:0]: Mailbox Handshake Protocol Block C Register Assignment bits1111 = MSIxMBXD15 is assigned to Mailbox Handshake Protocol Block C...0001 = MSIxMBXD1 is assigned to Mailbox Handshake Protocol Block C0000 = MSIxMBXD0 is assigned to Mailbox Handshake Protocol Block C
bit 7-4MBXHSB[3:0]: Mailbox Handshake Protocol Block B Register Assignment bits1111 = MSIxMBXD15 is assigned to Mailbox Handshake Protocol Block B...0001 = MSIxMBXD1 is assigned to Mailbox Handshake Protocol Block B0000 = MSIxMBXD0 is assigned to Mailbox Handshake Protocol Block B
bit 3-0MBXHSA[3:0]: Mailbox Handshake Protocol Block A Register Assignment bits1111 = MSIxMBXD15 is assigned to Mailbox Handshake Protocol Block A...0001 = MSIxMBXD1 is assigned to Mailbox Handshake Protocol Block A0000 = MSIxMBXD0 is assigned to Mailbox Handshake Protocol Block A

REGISTER 21-18: FMBXHS2 CONFIGURATION REGISTER

U-1 U-1 U-1 U-1 U-1 U-1 U-1
——————
bit 23 bit 16
R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1
MBXHSH3MBXHSH2MBXHSH1MBXHSH0MBXHSG3MBXHSG2 M
bit 15 bit 8
R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1
MBXHSF3MBXHSF2MBXHSF1MBXHSF0MBXHSE3MBXHSE2MBXHSE1MBXHSE0
bit 7 bit 0
Legend:PO = Program Once 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 23-16 Unimplemented: Read as '1'

bit 15-12 MBXHSH[3:0]: Mailbox Handshake Protocol Block H Register Assignment bits

1111 = MSIxMBXD15 is assigned to Mailbox Handshake Protocol Block H

0001 = MSIxMBXD1 is assigned to Mailbox Handshake Protocol Block H 0000 = MSIxMBXD0 is assigned to Mailbox Handshake Protocol Block H

bit 11-8 MBXHSG[3:0]: Mailbox Handshake Protocol Block G Register Assignment bits

1111 = MSIxMBXD15 is assigned to Mailbox Handshake Protocol Block G ... 0001 = MSIxMBXD1 is assigned to Mailbox Handshake Protocol Block G 0000 = MSIxMBXD0 is assigned to Mailbox Handshake Protocol Block G

bit 7-4 MBXHSF[3:0]: Mailbox Handshake Protocol Block F Register Assignment bits

1111 = MSIxMBXD15 is assigned to Mailbox Handshake Protocol Block F ... 0001 = MSIxMBXD1 is assigned to Mailbox Handshake Protocol Block F 0000 = MSIxMBXD0 is assigned to Mailbox Handshake Protocol Block F

bit 3-0 MBXHSE[3:0]: Mailbox Handshake Protocol Block E Register Assignment bits

1111 = MSIxMBXD15 is assigned to Mailbox Handshake Protocol Block E ... 0001 = MSIxMBXD1 is assigned to Mailbox Handshake Protocol Block E 0000 = MSIxMBXD0 is assigned to Mailbox Handshake Protocol Block E

REGISTER 21-19: FMBXHSEN CONFIGURATION REGISTER

U-1 U-1 U-1 U-1 U-1 U-1 U-1
——————
bit 23 bit 16
U-1 U-1 U-1 U-1 U-1 U-1 U-1
——————
bit 15 bit 8
R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1
HS[H:A]EN
bit 7 bit 0
Legend: PO = Program Once bit
R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 23-8 Unimplemented: Read as '1'

bit 7-0 HS[H:A]EN: Mailbox Data Flow Control Protocol Block x Enable Fuses bits (x = A, B, C, D, E, F, G, H)

1 = Mailbox data flow control handshake protocol block is disabled

0 = Mailbox data flow control handshake protocol block is enabled

REGISTER 21-20: FCFGPRA0: PORTA CONFIGURATION REGISTER

U-1 U-1 U-1 U-1 U-1 U-1 U-1
—————
bit 23 bit 16
U-1 U-1 U-1 U-1 U-1 U-1 U-1
—————
bit 15 bit 8
U-1 U-1 U-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1
— — —CPRA[4:0]
bit 7 bit 0
Legend: PO = Program Once bit
R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 23-5 Unimplemented: Read as '1'

bit 4-0 CPRA[4:0]: Configure PORTA Ownership bits

1 = Main core owns pin

0 = Secondary core owns pin

REGISTER 21-21: FCFGPRB0: PORTB CONFIGURATION REGISTER

U-1 U-1 U-1 U-1 U-1 U-1 U-1
——————
bit 23 bit 16
R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1
CPRB[15:8]
bit 15 bit 8
R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1
CPRB[7:0]
bit 7 bit 0
Legend: PO = Program Once bit
R = Readable bit W = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown

bit 23-16 Unimplemented: Read as '1'

bit 15-0 CPRB[15:0]: Configure PORTB Ownership bits

1 = Main core owns pin
0 = Secondary core owns pin

REGISTER 21-22: FCFGPRC0: PORTC CONFIGURATION REGISTER

U-1 U-1 U-1 U-1 U-1 U-1 U-1
——————
bit 23 bit 16
R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1
CPRC[15:8]
bit 15 bit 8
R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1
CPRC[7:0]
bit 7 bit 0
Legend: PO = Program Once bit
R = Readable bit W = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown

bit 23-16 Unimplemented: Read as '1'

bit 15-0 CPRC[15:0]: Configure PORTC Ownership bits

1 = Main core owns pin
0 = Secondary core owns pin

REGISTER 21-23: FCFGPRD0: PORTD CONFIGURATION REGISTER

U-1 U-1 U-1 U-1 U-1 U-1 U-1
——————
bit 23 bit 16
R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1
CPRD[15:8]
bit 15 bit 8
R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1
CPRD[7:0]
bit 7 bit 0
Legend: PO = Program Once bit
R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 23-16 Unimplemented: Read as '1'

bit 15-0 CPRD[15:0]: Configure PORTD Ownership bits

1 = Main core owns pin

0 = Secondary core owns pin

REGISTER 21-24: FCFGPRE0: PORTE CONFIGURATION REGISTER

U-1 U-1 U-1 U-1 U-1 U-1 U-1
——————
bit 23 bit 16
R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1
CPRE[15:8]
bit 15 bit 8
R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1 R/PO-1
CPRE[7:0]
bit 7 bit 0
Legend: PO = Program Once bit
R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 23-16 Unimplemented: Read as '1'

bit 15-0 CPRE[15:0]: Configure PORTE Ownership bits

1 = Main core owns pin

0 = Secondary core owns pin

REGISTER 21-25: FS1OSCSEL CONFIGURATION REGISTER (SECONDARY)

U-1 U-1 U-1 U-1 U-1 U-1 U-1
——————
bit 23 bit 16
U-1 U-1 U-1 U-1 U-1 U-1 U-1
——————
bit 15 bit 8
R/PO-1 U-1 U-1 U-1 R/PO-1 R/PO-1 R/PO-1
S1IESO— — —— S1FNOSC[2:0]
bit 7 bit 0
Legend:PO = Program Once 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 23-8 Unimplemented: Read as '1'

bit 7 S1IESO: Internal External Switchover bit

1 = Internal External Switchover mode is enabled (Two-Speed Start-up is enabled)
0 = Internal External Switchover mode is disabled (Two-Speed Start-up is disabled)

bit 6-3 Unimplemented: Read as '1'

bit 2-0 S1FNOSC[2:0]: Oscillator Selection bits

111 = Fast RC Oscillator (FRC) divided by N
110 = Backup FRC (BFRC)
101 = Low-Power RC Oscillator (LPRC)
100 = Reserved
011 = Primary Oscillator with PLL Module (MSPLL, HSPLL, ECPLL)
010 = Primary Oscillator (MS, HS, EC)
001 = Fast RC Oscillator (FRC) with PLL Module (FRCPLL)
000 = Fast RC Oscillator (FRC)

REGISTER 21-26: FS1OSC CONFIGURATION REGISTER (SECONDARY)

U-1 U-1 U-1 U-1 U-1 U-1 U-1
—————— ——
bit 23 bit 16
U-1 U-1 U-1 U-1 U-1 U-1 r-1
———————
bit 15bit 8
R/PO-1R/PO-1U-1U-1U-1R/PO-1U-1U-1
S1FCKSM[1:0]— — —S1OSCIOFNC(1)
bit 7 bit 0
Legend:PO = Program Once bitr = Reserved 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 23-9 Unimplemented: Read as '1'

bit 8 Reserved: Maintain as '1'

bit 7-6 S1FCKSM[1:0]: Clock Switching and Monitor Selection Configuration bits

1x = Clock switching is disabled, Fail-Safe Clock Monitor is disabled 01 = Clock switching is enabled, Fail-Safe Clock Monitor is disabled 00 = Clock switching is enabled, Fail-Safe Clock Monitor is enabled

bit 5-3 Unimplemented: Read as '1'

bit 2 S1OSCIOFNC: OSCO Pin Function bit (except in XT and HS modes) ^(1)

1 = OSCO is the clock output 0 = OSCO is the general purpose digital I/O pin

bit 1-0 Unimplemented: Read as '1'

Note 1: The OSCO pin function is determined by the S1OSCIOFNC Configuration bit. If both the Main core OSCIOFNC and Secondary core S1OSCIOFNC bits are set, the Main core OSCIOFNC bit has priority.

REGISTER 21-27: FS1WDT CONFIGURATION REGISTER (SECONDARY)

U-1 U-1 U-1 U-1 U-1 U-1 U-1
—————— ——
bit 23 bit 16
R/PO-1R/PO-1R/PO-1R/PO-1R/PO-1R/PO-1R/PO-1R/PO-1
S1FWDTENS1SWDTPS4S1SWDTPS3S1SWDTPS2S1SWDTPS1S1SWDTPS0S1WDTWIN1S1WDTWIN0
bit 15 bit 8
R/PO-1R/PO-1R/PO-1R/PO-1R/PO-1R/PO-1R/PO-1R/PO-1
S1WINDISS1RCLKSEL1S1RCLKSEL0S1RWDTPS4S1RWDTPS3S1RWDTPS2S1RWDTPS1S1RWDTPS0
bit 7 bit 0
Legend:PO = Program Once 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 23-16 Unimplemented: Read as '1'

bit 15 S1FWDTEN: Watchdog Timer Enable bit

1 = WDT is enabled in hardware

0 = WDT is controlled via the ON (WDTCONL[15]) bit

bit 14-10 S1SWDTPS[4:0]: Sleep Mode Watchdog Timer Period Select bits

11111 = Divide by 2^31 = 2,147,483,648

11110 = Divide by 2^30 = 1,073,741,824

* * *

00001 = Divide by 2^1 = 2

00000 = Divide by 2^0 = 1

bit 9-8 S1WDTWIN[1:0]: Watchdog Window Select bits

11 = WDT window is 25% of WDT period

10 = WDT window is 37.5% of WDT period

01 = WDT window is 50% of WDT period

00 = WDT window is 75% of WDT period

bit 7 S1WINDIS: Windowed Watchdog Timer Disable bit

1 = Standard WDT is selected; windowed WDT is disabled

0 = Windowed WDT is enabled

bit 6-5 S1RCLKSEL[1:0]: Watchdog Timer Clock Select bits

11 = LPRC

10 = Uses FRC when S1WINDIS = 0, system clock is not INTOSC/LPRC and the device is not in Sleep; otherwise, uses INTOSC/LPRC

01 = Uses the peripheral clock when the system clock is not INTOSC/LPRC and the device is not in Sleep; otherwise, uses INTOSC/LPRC

00 = Reserved

bit 4-0 S1RWDTPS[4:0]: Run Mode Watchdog Timer Period Select bits

11111 = Divide by 2^31=2,147,483,648

11110 = Divide by 2^30 = 1,073,741,824

...

00001 = Divide by 2 ^1 = 2

00000 = Divide by 2^0 = 1

REGISTER 21-28: FS1POR CONFIGURATION REGISTER (SECONDARY)

U-1 U-1 U-1 U-1 U-1 U-1 U-1
——————
bit 23 bit 16
U-1 U-1 U-1 U-1 U-1 U-1 U-1 U-1
——————
bit 15 bit 8
U-1 U-1 U-1 U-1 U-1 U-1 U-1
—————— ——
bit 7 bit 0
Legend: PO = Program Once bit
R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 23-0 Unimplemented: Read as '1'

REGISTER 21-29: FS1ICD CONFIGURATION REGISTER (SECONDARY)

U-1 U-1 U-1 U-1 U-1 U-1 U-1
—————
bit 23 bit 16
RP/O-1 U-1 R/PO-1 U-1 U-1 U-1 U-1
S1NOBTSWPS1ISOLAT
bit 15 bit 8
r-1 U-1 U-1U-1 U-1 U-1R/PO-1R/PO-1
——————S1ICS[↑:0](1)
bit 7 bit 0
Legend:PO = Program Once bitr = Reserved 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 23-16 Unimplemented: Read as '1'

bit 15 S1NOBTSWP: BOOTSWP Instruction Disable bit

1 = BOOTSWP instruction is disabled

0 = BOOTSWP instruction is enabled

bit 14 Unimplemented: Read as '1'

bit 13 S1ISOLAT: Secondary Core Isolation bit

1 = The Secondary can operate (in Debug mode), even if the SLVEN bit in the MSI is zero

0 = The Secondary can only operate if the SLVEN bit in the MSI is set

bit 12-8 Unimplemented: Read as '1'

bit 7 Reserved: Maintain as '1'

bit 6-2 Unimplemented: Read as '1'

bit 1-0 S1ICS[1:0]: ICD Pin Placement Select bits ^(1)

11 = Secondary ICD pins are S1PGC1/S1PGD1/S1MCLR1

10 = Secondary ICD pins are S1PGC2/S1PGD2/S1MCLR2

01 = Secondary ICD pins are S1PGC3/S1PGD3/S1MCLR3

00 = None

Note 1: Only valid in Dual Debug mode (Main and Secondary core debugged at the same time).

REGISTER 21-30: FS1DEVOPT CONFIGURATION REGISTER (SECONDARY)

U-1 U-1 U-1 U-1 U-1 U-1 U-1
——————
bit 23 bit 16
R/PO-1 R/PO-1 R/PO-1 U-1 U-1 U-1 U-1
S1MSRES1SSRES1SPI1PIN(1)— — —— —
bit 15 bit 8
U-1 U-1 U-1 U-1R/PO-1U-1 U-1 U-1
S1ALTI2C1
bit 7 bit 0
Legend: PO = Program Once bit
R = Readable bit W = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is clearedx = Bit is unknown

bit 23-16 Unimplemented: Read as '1'

bit 15 S1MSRE: Main Secondary Reset Enable bit

1 = The Main software-oriented Reset events (Reset Opcode, Watchdog Timer Time-out Reset, Trap Reset, Illegal Instruction Reset) will also cause the Secondary subsystem to reset
0 = The Main software-oriented Reset events (Reset Opcode, Watchdog Timer Time-out Reset, Trap Reset, Illegal Instruction Reset) will not cause the Secondary subsystem to reset

bit 14 S1SSRE: Secondary Reset Enable bit

1 = Secondary generated Resets will reset the Secondary enable bit in the MSI module
0 = Secondary generated Resets will not reset the Secondary enable bit in the MSI module

bit 13 S1SPI1PIN: Secondary SPI1 Fast I/O Pad Disable bit ^(1)

1 = Secondary SPI1 uses PPS (I/O remap) to make connects with device pins
0 = Secondary SPI1 uses direct connections with specified device pins

bit 12-4 Unimplemented: Read as '1'

bit 3 S1ALTI2C1: Alternate I2C1 Pin Mapping bit

1 = Default location for SCL1/SDA1 pins
0 = Alternate location for SCL1/SDA1 pins (ASCL1/ASDA1)

bit 2-0 Unimplemented: Read as '1'

Note 1: Fixed pin option is only available for higher pin packages (48-pin, 64-pin and 80-pin).

REGISTER 21-31: FS1ALTREG CONFIGURATION REGISTER (SECONDARY)

U-1 U-1 U-1 U-1 U-1 U-1 U-1
——————
bit 23 bit 16
U-1 R/PO-1 R/PO-1 R/PO-1 U-1 R/PO-1 R/PO-1 R/PO-1
S1C T
bit 15 bit 8
U-1 R/PO-1 R/PO-1 R/PO-1 U-1 R/PO-1 R/PO-1 R/PO-1
S1C T
bit 7 bit 0
Legend:PO = Program Once 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 23-15 Unimplemented: Read as '1'

bit 14-12 S1CTXT4[2:0]: Alternate Working Register Set #4 Interrupt Priority Level Selection bits

111 = Not assigned

110 = Alternate Register Set #4 is assigned to IPL Level 7
101 = Alternate Register Set #4 is assigned to IPL Level 6
100 = Alternate Register Set #4 is assigned to IPL Level 5
011 = Alternate Register Set #4 is assigned to IPL Level 4
010 = Alternate Register Set #4 is assigned to IPL Level 3
001 = Alternate Register Set #4 is assigned to IPL Level 2
000 = Alternate Register Set #4 is assigned to IPL Level 1

bit 11 Unimplemented: Read as '1'

bit 10-8 S1CTXT3[2:0]: Alternate Working Register Set #3 Interrupt Priority Level Selection bits 111 = Not assigned

110 = Alternate Register Set #3 is assigned to IPL Level 7
101 = Alternate Register Set #3 is assigned to IPL Level 6
100 = Alternate Register Set #3 is assigned to IPL Level 5
011 = Alternate Register Set #3 is assigned to IPL Level 4
010 = Alternate Register Set #3 is assigned to IPL Level 3
001 = Alternate Register Set #3 is assigned to IPL Level 2
000 = Alternate Register Set #3 is assigned to IPL Level 1

bit 7 Unimplemented: Read as '1'

bit 6-4 S1CTXT2[2:0]: Alternate Working Register Set #2 Interrupt Priority Level Selection bits

111 = Not assigned

110 = Alternate Register Set #2 is assigned to IPL Level 7
101 = Alternate Register Set #2 is assigned to IPL Level 6
100 = Alternate Register Set #2 is assigned to IPL Level 5
011 = Alternate Register Set #2 is assigned to IPL Level 4
010 = Alternate Register Set #2 is assigned to IPL Level 3
001 = Alternate Register Set #2 is assigned to IPL Level 2
000 = Alternate Register Set #2 is assigned to IPL Level 1

bit 3 Unimplemented: Read as '1'

REGISTER 21-31: FS1ALTREG CONFIGURATION REGISTER (SECONDARY) (CONTINUED)

bit 2-0

S1CTXT1[2:0]: Alternate Working Register Set #1 Interrupt Priority Level Selection bits

111 = Not assigned

110 = Alternate Register Set #1 is assigned to IPL Level 7

101 = Alternate Register Set #1 is assigned to IPL Level 6

100 = Alternate Register Set #1 is assigned to IPL Level 5

011 = Alternate Register Set #1 is assigned to IPL Level 4

010 = Alternate Register Set #1 is assigned to IPL Level 3

001 = Alternate Register Set #1 is assigned to IPL Level 2

000 = Alternate Register Set #1 is assigned to IPL Level 1

21.2 Device Calibration and Identification

The PGAx and current source modules on the dsPIC33CH128MP508 family devices require Calibration Data registers to improve performance of the module over a wide operating range. These Calibration registers are read-only and are stored in configuration memory space. Prior to enabling the module, the calibration data must be read (TBLPAG and Table Read instruction) and loaded into their respective SFR registers. The device calibration addresses are shown in Table 21-4.

The dsPIC33CH128MP508 devices have two Identification registers, near the end of configuration memory space, that store the Device ID (DEVID) and Device Revision (DEVREV). These registers are used to determine the mask, variant and manufacturing information about the device. These registers are read-only and are shown in Register 21-32 and Register 21-33.

TABLE 21-4: DEVICE CALIBRATION ADDRESSES (1)

Calibration NameAddressBits 23-16Bit 15Bit 14Bit 13Bit 12Bit 11Bit 10Bit 9Bit 8Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
PGA1CAL 0xF8001CPGA1 Calibration Data
PGA2CAL 0xF8001EPGA2 Calibration Data
PGA3CAL0xF80020PGA3 Calibration Data
ISRCCAL0xF80012Current Source Calibration Data

Note 1: The calibration data must be copied into their respective registers prior to enabling the module.

REGISTER 21-32: DEVREV: DEVICE REVISION REGISTER

RRRRRRRR
DEVREV[23:16]
bit 23 bit 16
RRRRRRRR
DEVREV[15:8]
bit 15 bit 8
RRRRRRRR
DEVREV[7:0]
bit 7 bit 0

Legend: R = Read-only bit U = Unimplemented bit

bit 23-0 DEVREV[23:0]: Device Revision bits

REGISTER 21-33: DEVID: DEVICE ID REGISTERS

U-1U-1U-1U-1U-1U-1U-1U-1
bit 23 bit 16
RRRRRRRR
FAMID[7:0]
bit 15 bit 8
RRRRRRRR
DEV[7:0]^(1)
bit 7 bit 0

Legend: R = Read-only bit U = Unimplemented bit

bit 23-16 Unimplemented: Read as '1'

bit 15-8 FAMID[7:0]: Device Family Identifier bits

1000 0111 = dsPIC33CH128MP508 family

bit 7-0 DEV[7:0]: Individual Device Identifier bits ^(1)

Note 1: See Table 21-5 for the list of Device Identifier bits.

TABLE 21-5: DEVICE VARIANTS

DEVID[7:0] Device Name Core
Devices with CAN FD
0x40 dsPIC33CH64MP502 Main
0xC0 dsPIC33CH64MP502S1 Secondary
0x50 dsPIC33CH128MP502 Main
0xD0 dsPIC33CH128MP502S1Secondary
0x41 dsPIC33CH64MP503 Main
0xC1 dsPIC33CH64MP503S1 Secondary
0x51 dsPIC33CH128MP503 Main
0xD1 dsPIC33CH128MP503S1Secondary
0x42 dsPIC33CH64MP505 Main
0xC2 dsPIC33CH64MP505S1 Secondary
0x52 dsPIC33CH128MP505 Main
0xD2 dsPIC33CH128MP505S1Secondary
0x43 dsPIC33CH64MP506 Main
0xC3 dsPIC33CH64MP506S1 Secondary
0x53 dsPIC33CH128MP506 Main
0xD3 dsPIC33CH128MP506S1Secondary
0x44 dsPIC33CH64MP508 Main
0xC4 dsPIC33CH64MP508S1 Secondary
0x54 dsPIC33CH128MP508 Main
0xD4 dsPIC33CH128MP508S1Secondary

TABLE 21-5: DEVICE VARIANTS (CONTINUED)

DEVID[7:0] Device Name Core
Devices without CAN FD
0x00 dsPIC33CH64MP202 Main
0x80 dsPIC33CH64MP202S1 Secondary
0x10 dsPIC33CH128MP202 Main
0x90 dsPIC33CH128MP202S1 Secondary
0x01 dsPIC33CH64MP203 Main
0x81 dsPIC33CH64MP203S1 Secondary
0x11 dsPIC33CH128MP203 Main
0x91 dsPIC33CH128MP203S1 Secondary
0x02 dsPIC33CH64MP205 Main
0x82 dsPIC33CH64MP205S1 Secondary
0x12 dsPIC33CH128MP205 Main
0x92 dsPIC33CH128MP205S1 Secondary
0x03 dsPIC33CH64MP206 Main
0x83 dsPIC33CH64MP206S1 Secondary
0x13 dsPIC33CH128MP206 Main
0x93 dsPIC33CH128MP206S1 Secondary
0x04 dsPIC33CH64MP208 Main
0x84 dsPIC33CH64MP208S1 Secondary
0x14 dsPIC33CH128MP208 Main
0x94 dsPIC33CH128MP208S1 Secondary

21.3 User OTP Memory

The dsPIC33CH128MP508 family devices contain 64 One-Time-Programmable (OTP) double words, located at addresses, 801700h through 8017FEh. Each 48-bit OTP double word can only be written one time. The OTP Words can be used for storing checksums, code revisions, manufacturing dates, manufacturing lot numbers or any other application-specific information.

The OTP area is not cleared by any erase command. This memory can be written only once.

21.4 On-Chip Voltage Regulators

All of the dsPIC33CH128MP508 family devices have a capacitorless, internal voltage regulator to supply power to the core at 1.2V (typical). A pair of voltage regulators, VREG1 and VREG2 together, provide power for the core. The PLL is powered using a separate regulator, VREGPLL, as shown in Figure 21-1.

FIGURE 21-1: INTERNAL REGULATOR
Microchip dsPIC33CH64MP208 - On-Chip Voltage Regulators - 1

flowchart
graph TD
    A["0.1 µF Ceramic"] --> B["VSS"]
    A --> C["VDD"]
    B --> D["VREG1"]
    C --> E["VREG2"]
    D --> F["Main"]
    E --> G["Secondary"]
    F --> H["VREGPLL"]
    G --> I["Main PLL"]
    G --> J["Secondary PLL"]
    K["0.1 µF Ceramic"] --> L["AVDD"]
    K --> M["AVss"]
    L --> N["Band Gap Reference"]
    M --> N
    N --> O["Output"]

21.5 Regulator Control and Sleep Mode

As shown in Figure 21-1, both VREG1 and VREG2 together, share the total load for the Main and Secondary.

The PLL for the Main and Secondary is powered using a separate regulator, as shown for VREG3 (VREG-PLL).

REGISTER 21-34: VREGCON: VOLTAGE REGULATOR CONTROL REGISTER (1)

r-0 U-0 U-0 U-0 U-0 U-0 U-0 U-0
— — —++
bit 15 bit 8
Legend:r = Reserved 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 15 Reserved: Maintain as '0'

bit 14-6 Unimplemented: Read as '0'

bit 5-0 Reserved: Maintain as '0'

Note 1: HW only resets this register on POR

21.6 Limiting Dynamic Load Changes

The device start-up and shutdown must be staged to minimize large load steps.

  1. Start the device in FRC or Oscillator mode and enable the PLL option (if required).
  2. Main enables Auxiliary PLL, if required, for the PWM or DAC modules.
  3. Main initializes the Secondary PRAM with the Secondary programming.
  4. The Main enables the PWM generators in a sequential manner (as required).
  5. Main enables the Secondary processor.
  6. Secondary starts in FRC or Oscillator mode and enables the PLL option (if required).
  7. The Secondary enables its Auxiliary PLL (if required) for the Secondary's DAC or PWM modules.
  8. The Secondary enables its PWM generators in a sequential manner (as required).

When powering down the device to Sleep or Idle mode, the user should follow this general sequence in reverse.

21.7 Brown-out Reset (BOR)

The Brown-out Reset (BOR) module is based on an internal voltage reference circuit that monitors the regulated supply voltage. The main purpose of the BOR module is to generate a device Reset when a brown-out condition occurs. Brown-out conditions are generally caused by glitches on the AC mains (for example, missing portions of the AC cycle waveform due to bad power transmission lines or voltage sags due to excessive current draw when a large inductive load is turned on).

A BOR generates a Reset pulse which resets the device. The BOR selects the clock source based on the device Configuration bit selections.

If an Oscillator mode is selected, the BOR activates the Oscillator Start-up Timer (OST). The system clock is held until OST expires. If the PLL is used, the clock is held until the LOCK bit (OSCCON[5]) is '1'.

The BOR status bit (RCON[1]) is set to indicate that a BOR has occurred. The BOR circuit continues to operate while in Sleep or Idle mode and resets the device should VDD fall below the BOR threshold voltage.

FIGURE 21-2: POR EVENT ON VDD
Microchip dsPIC33CH64MP208 - Brown-out Reset (BOR) - 1

line | Time | VDD | | ---- | --- | | 0 | 1.0 | | Peak | 1.0 | | Mid | 0.5 | | Low | 0.0 | | High | 1.0 |

Note 1: If V DD drops below the BO11 value in Table 24-4, VDD must be brought down to 0V before ramping the device back up to operation range.

21.8 Dual Watchdog Timer (WDT)

Note 1: This data sheet summarizes the features of the dsPIC33CH128MP508 family of devices. It is not intended to be a comprehensive reference source. To complement the information in this data sheet, refer to “Dual Watchdog Timer”, (www.microchip.com/DS70005250), which is available from the Microchip website (www.microchip.com).

2: The WDT is identical for both Main core and Secondary core. The x is common for both Main core and Secondary core (where the x represents the number of the specific module being addressed). The number of WDT modules available on the Main and Secondarys is different and they are located in different SFR locations.
3: All associated register names are the same on the Main core and the Secondary core. The Secondary code will be developed in a separate project in MPLAB X IDE with the device selection, dsPIC33CH128MP508S1, where the S1 indicates the Secondary device.

Table 21-6 shows an overview of the WDT module.

TABLE 21-6: DUAL WDT MODULE OVERVIEW

Number of WDT ModulesIdentical (Modules)
Main Core 1 Yes
Secondary Core 1 Yes

The dsPIC33 dual Watchdog Timer (WDT) is described in this section. Refer to Figure 21-3 for a block diagram of the WDT.

The WDT, when enabled, operates from the internal Low-Power RC (LPRC) Oscillator clock source or a selectable clock source in Run mode. The WDT can be used to detect system software malfunctions by resetting the device if the WDT is not cleared periodically in software. The WDT can be configured in Windowed mode or Non-Windowed mode. Various WDT time-out periods can be selected using the WDT postscaler. The WDT can also be used to wake the device from Sleep or Idle mode (Power Save mode). If the WDT expires and issues a device Reset, the WTDO bit of the RCON register (Register 21-37) will be set. It is recommended to have at least two WDT clock cycles of delay after a CLRWDT instruction in case a PWRSAV/NVM operation needs to be performed soon after the CLRWDT instruction.

The following are some of the key features of the WDT modules:

  • Configuration or Software Controlled
  • Separate User-Configurable Time-out Periods for Run and Sleep/Idle
  • Can Wake the Device from Sleep or Idle
  • User-Selectable Clock Source in Run mode
  • Operates from LPRC in Sleep/Idle mode

Note: While executing a clock switch, the WDT will not be reset. It is recommended to reset the WDT prior to executing a clock switch instruction.

FIGURE 21-3: WATCHDOG TIMER BLOCK DIAGRAM
Microchip dsPIC33CH64MP208 - Dual Watchdog Timer (WDT) - 1

flowchart
graph TD
    A["CLKSEL[1:0"]] --> B["0.0"]
    B --> C["0.1"]
    C --> D["1.0"]
    D --> E["1.1"]
    F["FcY (Fosc/2)"] --> G["Reserved"]
    H["FRC Oscillator"] --> I["On"]
    J["LPRC Oscillator"] --> K["On"]
    L["Power Save"] --> L
    L --> M["AND"]
    M --> N["32-Bit Counter"]
    N --> O["Comparator"]
    O --> P["Wake-up and NMI"]
    Q["Power Save Mode WDT"] --> N
    R["Reset"] --> N
    S["SLPDIV[4:0"]] --> O
    T["Run Mode WDT"] --> N
    U["Reset"] --> V["32-Bit Counter"]
    V --> W["Comparator"]
    W --> X["NMI and Start NMI Counter"]
    Y["WDTCLRKEY[15:0"] = 5743h] --> Z["ON"]
    AA["All Resets"] --> AB["Clock Switch"]
    AC["Power Save"] --> AD["AND"]
    AE["Power Save"] --> AF["AND"]
    AG["Reset"] --> AH["AND"]

21.9 Watchdog Timer Control Registers

REGISTER 21-35: WDTCONL: WATCHDOG TIMER CONTROL REGISTER LOW

R/W-0 U-0 U-0 R-y R-y R-y R-y R-y
ON^(1,2) — — RUNDIV[4:0](3)
bit 15 bit 8
RRR-yR-yR-yR-yR-yHS/R/W-0
CLKSEL1(3,5)CLKSEL0(3,5)SLPDIV4(3)SLPDIV3(3)SLPDIV2(3)SLPDIV1(3)SLPDIV0(3)WDTWINEN(4)
bit 7 bit 0
Legend:HS = Hardware Settable bity = Value from Configuration bit on POR
R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15 ON: Watchdog Timer Enable bit ^(1,2) 1 = Enables the Watchdog Timer if it is not enabled by the device configuration 0 = Disables the Watchdog Timer if it was enabled in software

bit 14-13 Unimplemented: Read as '0'

bit 12-8 RUNDIV[4:0]: WDT Run Mode Postscaler Status bits ^(3) 11111 = Divide by 2^31 = 2,147,483,648 11110 = Divide by 2^30 = 1,073,741,824 00001 = Divide by 2^1 = 2 00000 = Divide by 2^0 = 1

bit 7-6 CLKSEL[1:0]: WDT Run Mode Clock Select Status bits ^(3,5) 11 = LPRC Oscillator

10 = FRC Oscillator

01 = Reserved

00 = FCY (Fosc/2)

bit 5-1 SLPDIV[4:0]: Sleep and Idle Mode WDT Postscaler Status bits ^(3) 11111 = Divide by 2 ^31 = 2,147,483,648

11110 = Divide by 2 ^30 = 1,073,741,824

...

00001 = Divide by 2 ^1 = 2

00000 = Divide by 2 ^0 = 1

bit 0 WDTWINEN: Watchdog Timer Window Enable bit ^(4) 1 = Enables Window mode 0 = Disables Window mode

Note 1: A read of this bit will result in a '1' if the WDT is enabled by the device configuration or by software.
2: The user's software should not read or write to the peripheral's SFRs in the SYSCLK cycle immediately following the instruction that clears the module's ON bit.
3: These bits reflect the value of the Configuration bits.
4: The WDTWINEN bit reflects the status of the Configuration bit if the bit is set. If the bit is cleared, the value is controlled by software.
5: The available clock sources are device-dependent.

REGISTER 21-36: WDTCONH: WATCHDOG TIMER CONTROL REGISTER HIGH

W-0W-0W-0W
WDTCLRKEY[15:8]
bit 15 bit 8
W-0W-0W-0W
WDTCLRKEY[7:0]
bit 7 bit 0

Legend:

R = Readable bit W = Writable bit U = Unimplemented bit, read as '0'

-n = Value at POR '1' = Bit is set '0' = Bit is cleared x = Bit is unknown

bit 15-0 WDTCLRKEY[15:0]: Watchdog Timer Clear Key bits

To clear the Watchdog Timer to prevent a time-out, software must write the value, 0x5743, to this location using a single 16-bit write.

REGISTER 21-37: RCON: RESET CONTROL REGISTER (1)

R/W-0 R/W-0 U-0 U-0 U-0 R/W-0 R/W-0
TRAPR IO PUWR — — —CMVREG
bit 15 bit 8
R/W-0 R/W-0 U-0 R/W-0 R/W-0 R/W-0 R/W-1 R/W-1
EXTR SWRWDTOSLEEPIDLEBORPOR
bit 7 bit 0

Legend:

R = Readable bitW = Writable bitU = Unimplemented bit, read as '0'
-n = Value at POR'1' = Bit is set'0' = Bit is cleared x = Bit is unknown

bit 15 TRAPR: Trap Reset Flag bit

1 = A Trap Conflict Reset has occurred

0 = A Trap Conflict Reset has not occurred

bit 14 IOPUWR: Illegal Opcode or Uninitialized W Register Access Reset Flag bit

1 = An illegal opcode detection, an illegal address mode or Uninitialized W register used as an Address Pointer caused a Reset

0 = An Illegal Opcode or Uninitialized W register Reset has not occurred

bit 13-10 Unimplemented: Read as '0'

bit 9 CM: Configuration Mismatch Flag bit

1 = A Configuration Mismatch Reset has occurred

0 = A Configuration Mismatch Reset has not occurred

bit 8 VREGS: Voltage Regulator Standby During Sleep bit

1 = Voltage regulator is active during Sleep

0 = Voltage regulator goes into Standby mode during Sleep

bit 7 EXTR: External Reset (MCLR) Pin bit

1 = A Main Clear (pin) Reset has occurred

0 = A Main Clear (pin) Reset has not occurred

bit 6 SWR: Software RESET (instruction) Flag bit

1 = A RESET instruction has been executed

0 = A RESET instruction has not been executed

bit 5 Unimplemented: Read as '0'

bit 4 WDTO: Watchdog Timer Time-out Flag bit

1 = WDT time-out has occurred

0 = WDT time-out has not occurred

bit 3 SLEEP: Wake from Sleep Flag bit

1 = Device was in Sleep mode

0 = Device was not in Sleep mode

bit 2 IDLE: Wake from Idle Flag bit

1 = Device was in Idle mode

0 = Device was not in Idle mode

bit 1 BOR: Brown-out Reset Flag bit

1 = Brown-out Reset has occurred

0 = Brown-out Reset has not occurred

bit 0 POR: Power-on Reset Flag bit

1 = Power-on Reset has occurred

0 = Power-on Reset has not occurred

Note 1: All of the Reset status bits can be set or cleared in software. Setting one of these bits in software does not cause a device Reset.

21.10 JTAG Interface

The dsPIC33CH128MP508 family devices implement a JTAG interface, which supports boundary scan device testing. Detailed information on this interface will be provided in future revisions of this document.

Note: Refer to "Programming and Diagnostics" (www.microchip.com/DS70000608) for further information on usage, configuration and operation of the JTAG interface.

21.11 In-Circuit Serial Programming ^TM (ICSP ^TM )

The dsPIC33CH128MP508 family devices can be serially programmed while in the end application circuit. This is done with two lines for clock and data, and three other lines for power, ground and the programming sequence. Serial programming allows customers to manufacture boards with unprogrammed devices and then program the device just before shipping the product. Serial programming also allows the most recent firmware or a custom firmware to be programmed. Refer to the "dsPIC33CH128MP508 Family Flash Programming Specification" (DS70005285) for details about In-Circuit Serial Programming (ICSP).

Any of the three pairs of programming clock/data pins can be used:

  • PGC1 and PGD1
  • PGC2 and PGD2
  • PGC3 and PGD3

Note: Both Main core and Secondary core can be used with MPLAB ICD to debug at the same time. There are PGCx and PGDx pins dedicated for the Main core and Secondary core (S1PGCx and S1PGDx) to make this possible. MCLR is the same for programming the Main core and the Secondary core. S1MCLRx is used only when the Main and Secondary are debugged simultaneously.

21.12 In-Circuit Debugger

When MPLAB ICD 3 or the REAL ICE emulator is selected as a debugger, the in-circuit debugging functionality is enabled. This function allows simple debugging functions when used with MPLAB IDE. Debugging functionality is controlled through the PGCx (Emulation/Debug Clock) and PGDx (Emulation/Debug Data) pin functions.

Any of the three pairs of debugging clock/data pins can be used:

  • PGC1 and PGD1 Main Debug or Secondary Debug
  • PGC2 and PGD2 Main Debug or Secondary Debug
  • PGC3 and PGD3 Main Debug or Secondary Debug for debugging Main and Secondary simultaneously, two MPLAB ICD debuggers or the REAL ICE™ emulator are required. This mode of debugging, where the Main and Secondary are simultaneously debugged, is called the Dual Debug mode.
    S1MCLRx and S1PGCx/S1PGDx are used only in Dual Debug mode.

The Dual Debug mode of operation needs the following PGCx/PGDx pins:

  • M C LPGC1 and PGD1 for Main Debug, and S1MCLR1, S1PGC1 and S1PGD1 for Secondary Debug
  • M C LPGC2 and PGD2 for Main Debug, and S1MCLR2, S1PGC2 and S1PGD2 for Secondary Debug
  • M C LPQC3 and PGD3 for Main Debug, and S1MCLR3, S1PGC3 and S1PGD3 for Secondary Debug

To use the in-circuit debugger function of the device, the design must implement ICSP connections to MCLR, VDD, Vss and the PGCx/PGDx pin pair. In addition, when the feature is enabled, some of the resources are not available for general use. These resources include the first 80 bytes of data RAM and two or five (in Dual Debug) I/O pins (PGCx and PGDx).

There are three modes of debugging the dual core family of dsPIC33CH128MP508:

  1. Main Only Debug
  2. Secondary Only Debug
  3. Dual Debug

21.12.1 MAIN ONLY DEBUG

In Main Only Debug, only the Main project will be debugged. There is no project for Secondary or no Secondary code. The main project will be for dsPIC33CHXXXMP50X/20X and the user has to use MCLR and PGCx/PGDx for debugging. This is similar to debugging any single core existing device.

21.12.2 SECONDARY ONLY DEBUG

In the Secondary Only Debug mode, the user will need two projects. One project is the Main project with dsPIC33CHXXXMP50X/20X as the device. This is called a Main Stub and is required to provide the configuration information to the Secondary. The Secondary does not have its own Configuration bits. The Configuration bits reside in the Main Flash. The Main Stub will be small code used to provide the Configuration bits for the Secondary. The Main Stub is first programmed to the Main Flash using MCLR, PGCx and PGDx.

Once the Main Stub is programmed in the Main Flash, the user has to open a new project with dsPIC33CHXXXMP50X/20XS1 (the S1 indicates the Secondary device). The same MCLR and PGCx/PGDx, or different PGCx/PGDx, can be used for debugging the Secondary. Now the Secondary can be debugged like any other single core device.

21.12.3 DUAL DEBUG (BOTH MAIN AND SECONDARY ARE DEBUGGED)

In this Debug mode, two debug tools are required: one for Main and one for Secondary.

In the Dual Debug mode, the user needs two projects. One project is the Main project with dsPIC33CHXXXMP50X/20X as the device. Configuration bits for the Main, as well as the Secondary, will be part of this project. The S1ISOLAT bit can be set and the Main project can be debugged like any other existing single core device. The Main can be debugged using MCLR, PGCx and PGDx.

Once the Main has started the debug process, the user has to open a new project with dsPIC33CHXXXMP50X/20XS1 (the S1 indicates the Secondary device). Connect the project using S1MCLRx and S1PGCx/S1PGDx, and start debugging the Secondary project.

21.13 Code Protection and CodeGuard™ Security – Main Flash

dsPIC33CH128MP508 family devices offer multiple levels of security for protecting individual intellectual property. The program Flash protection can be broken up into three segments: Boot Segment (BS), General Segment (GS) and Configuration Segment (CS). Boot Segment has the highest security privilege and can be thought to have limited restrictions when accessing other segments. General Segment has the least security and is intended for the end user system code. Configuration Segment contains only the device user configuration data, which are located at the end of the program memory space.

The code protection features are controlled by the Configuration registers, FSEC and FBSLIM. The FSEC register controls the code-protect level for each segment and if that segment is write-protected. The size of BS and GS will depend on the BSLIM[12:0] bits setting and if the Alternate Interrupt Vector Table (AIVT) is enabled. The BSLIM[12:0] bits define the number of pages for BS with each page containing 1024 IW. The smallest BS size is one page, which will consist of the Interrupt Vector Table (IVT) and 512 IW of code protection.

If the AIVT is enabled, the last page of BS will contain the AIVT and will not contain any BS code. With AIVT enabled, the smallest BS size is now two pages (2048 IW), with one page for the IVT and BS code, and the other page for the AIVT. Write protection of the BS does not cover the AIVT. The last page of BS can always be programmed or erased by BS code. The General Segment will start at the next page and will consume the rest of program Flash, except for the Flash Configuration Words. The IVT will assume GS security only if BS is not enabled. The IVT is protected from being programmed or page erased when either security segment has enabled write protection.

The different device security segments are shown in Figure 21-4. Here, all three segments are shown, but are not required. If only basic code protection is required, then GS can be enabled independently or combined with CS, if desired.

FIGURE 21-4: SECURITY SEGMENTS EXAMPLE
Microchip dsPIC33CH64MP208 - Code Protection and CodeGuard™ Security – Main Flash - 1

text_image IVT and AIVT Assume BS Protection IVT 0x000000 0x000200 BS AIVT + 512 IW(2) BSLIM[12:0] GS CS(1) 0x00B000 Note 1: If CS is write-protected, the last page (GS + CS) of program memory will be protected from an erase condition. 2: The last half (256 IW) of the last page of BS is unusable program memory.

21.14 Code Protection and CodeGuard™ Security – Secondary PRAM

The dsPIC33CH128MP508S1 family Secondary PRAM inherits its security configuration from the Main GSS[1:0] and GWRP Configuration bit settings. The Secondary PRAM does not have a BS or CS segment.

All user code space is considered GS, including the IVT. Therefore, there are no specific segment read and write permissions to consider.

If either the GSSx or GWRP bits are enabled, ICSP entry directly to the Secondary PRAM is inhibited. This prevents reading, programming and debugging the Secondary PRAM when the Main Flash GS is code-protected.

Main to Secondary Image Loading is always allowed, regardless of any code protection settings.

NOTES:

22.0 INSTRUCTION SET SUMMARY

Note: This data sheet summarizes the features of the dsPIC33CH128MP508 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 website (www.microchip.com).

The dsPIC33CH instruction set is almost identical to that of the dsPIC30F and dsPIC33F.

Most instructions are a single program memory word (24 bits). Only three instructions require two program memory locations.

Each single-word instruction is a 24-bit word, divided into an 8-bit opcode, which specifies the instruction type and one or more operands, which further specify the operation of the instruction.

The instruction set is highly orthogonal and is grouped into five basic categories:

• Word or byte-oriented operations
- Bit-oriented operations
- Literal operations
- DSP operations
• Control operations

Table 22-1 lists the general symbols used in describing the instructions.

The dsPIC33 instruction set summary in Table22-2 lists all the instructions, along with the status flags affected by each instruction.

Most word or byte-oriented W register instructions (including barrel shift instructions) have three operands:

  • The first source operand, which is typically a register 'Wb' without any address modifier
  • The second source operand, which is typically a register 'Ws' with or without an address modifier
  • The destination of the result, which is typically a register 'Wd' with or without an address modifier

However, word or byte-oriented file register instructions have two operands:

  • The file register specified by the value 'f'
  • The destination, which could be either the file register 'f' or the W0 register, which is denoted as 'WREG'

Most bit-oriented instructions (including simple rotate/shift instructions) have two operands:

  • The W register (with or without an address modifier) or file register (specified by the value of 'Ws' or 'f')
  • The bit in the W register or file register (specified by a literal value or indirectly by the contents of register 'Wb')

The literal instructions that involve data movement can use some of the following operands:

  • A literal value to be loaded into a W register or file register (specified by 'k')
  • The W register or file register where the literal value is to be loaded (specified by 'Wb' or 'f')

However, literal instructions that involve arithmetic or logical operations use some of the following operands:

  • The first source operand, which is a register 'Wb' without any address modifier
  • The second source operand, which is a literal value
  • The destination of the result (only if not the same as the first source operand), which is typically a register 'Wd' with or without an address modifier

The MAC class of DSP instructions can use some of the following operands:

  • The accumulator (A or B) to be used (required operand)
    • The W registers to be used as the two operands
    • The X and Y address space prefetch operations
    • The X and Y address space prefetch destinations
    • The accumulator write-back destination

The other DSP instructions do not involve any multiplication and can include:

• The accumulator to be used (required)
- The source or destination operand (designated as Wso or Wdo, respectively) with or without an address modifier
- The amount of shift specified by a W register 'Wn' or a literal value

The control instructions can use some of the following operands:

• A program memory address
- The mode of the Table Read and Table Write instructions

Most instructions are a single word. Certain double-word instructions are designed to provide all the required information in these 48 bits. In the second word, the 8 MSbs are '0's. If this second word is executed as an instruction (by itself), it executes as a NOP.

The double-word instructions execute in two instruction cycles.

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, or a PSV or Table Read is performed. In

these cases, the execution takes multiple instruction cycles, with the additional instruction cycle(s) executed as a NOP. Certain instructions that involve skipping over the subsequent instruction require either two or three cycles if the skip is performed, depending on whether the instruction being skipped is a single-word or two-word instruction. Moreover, double-word moves require two cycles.

Note: For more details on the instruction set, refer to the "16-Bit MCU and DSC Programmer's Reference Manual" (DS70000157).

TABLE 22-1: SYMBOLS USED IN OPCODE DESCRIPTIONS

Field Description
#text Means literal defined by “text”
(text) Means “content of text”
[text] Means “the location addressed by text”
{} Optional field or operation
a ∈ {b, c, d} a is selected from the set of values b, c, d
[n:m] Register bit field
.b Byte mode selection
.d Double-Word mode selection
.S Shadow register select
.wWord mode selection (default)
AccOne of two accumulators {A, B}
AWBAccumulator Write-Back Destination Address register ∈ {W13, [W13]+ = 2}
bit44-bit bit selection field (used in word-addressed instructions) ∈ {0...15}
C, DC, N, OV, ZMCU Status bits: Carry, Digit Carry, Negative, Overflow, Sticky Zero
ExprAbsolute address, label or expression (resolved by the linker)
fFile register address ∈ {0x0000...0x1FFF}
lit11-bit unsigned literal ∈ {0,1}
lit44-bit unsigned literal ∈ {0...15}
lit55-bit unsigned literal ∈ {0...31}
lit88-bit unsigned literal ∈ {0...255}
lit1010-bit unsigned literal ∈ {0...255} for Byte mode, {0:1023} for Word mode
lit1414-bit unsigned literal ∈ {0...16384}
lit1616-bit unsigned literal ∈ {0...65535}
lit2323-bit unsigned literal ∈ {0...8388608}; LSb must be ‘0’
NoneField does not require an entry, can be blank
OA, OB, SA, SBDSP Status bits: ACCA Overflow, ACCB Overflow, ACCA Saturate, ACCB Saturate
PCProgram Counter
Slit1010-bit signed literal ∈ {-512...511}
Slit1616-bit signed literal ∈ {-32768...32767}
Slit66-bit signed literal ∈ {-16...16}
WbBase W register ∈ {W0...W15}
WdDestination W register ∈ { Wd, [Wd], [Wd++], [Wd--], (++Wd], [--Wd]}
WdoDestination W register ∈ { Wnd, [Wnd], [Wnd++], [Wnd--], (++Wnd], [--Wnd], [Wnd+Wb]}
Wm,WnDividend, Divisor Working register pair (direct addressing)
FieldDescription
Wm*WmMultiplicand and Multiplier Working register pair for Square instructions ∈{W4 * W4,W5 * W5,W6 * W6,W7 * W7}
Wm*WnMultiplicand and Multiplier Working register pair for DSP instructions ∈{W4 * W5,W4 * W6,W4 * W7,W5 * W6,W5 * W7,W6 * W7}
Wn One of 16 Working registers ∈ {W0...W15}
Wnd One of 16 Destination Working registers ∈ {W0...W15}
Wns One of 16 Source Working registers ∈ {W0...W15}
WREG W0 (Working register used in file register instructions)
WsSource W register ∈ {Ws, [Ws], [Ws++, [Ws--], (++Ws], [--Ws]}
Wso Source W register ∈{ Wns, [Wns], [Wns++, [Wns--], (++Wns], [--Wns], [Wns+Wb]}
Wx X Data Space Prefetch Addressss register for DSP instructions∈ {[W8] += 6, [W8] += 4, [W8] += 2, [W8], [W8] -= 6, [W8] -= 4, [W8] -= 2,[W9] += 6, [W9] += 4, [W9] += 2, [W9], [W9] -= 6, [W9] -= 4, [W9] -= 2,[W9 + W12], none}
WxdX Data Space Prefetch Destination register for DSP instructions ∈ {W4...W7}
Wy Y Data Space Prefetch Addressss register for DSP instructions∈ {[W10] += 6, [W10] += 4, [W10] += 2, [W10], [W10] -= 6, [W10] -= 4, [W10] -= 2,[W11] += 6, [W11] += 4, [W11] += 2, [W11], [W11] -= 6, [W11] -= 4, [W11] -= 2,[W11 + W12], none}
WydY Data Space Prefetch Destination register for DSP instructions ∈ {W4...W7}

Note: In dsPIC33CH128MP508 devices, read and Read-Modify-Write (RMW) operations on non-CPU Special Function Registers require an additional cycle when compared to dsPIC30F, dsPIC33F, PIC24F and PIC24H devices

TABLE 22-2: INSTRUCTION SET OVERVIEW

Base Instr #Assembly MnemonicAssembly Syntax Description# of Words# of Cycles(1)Status Flags Affected
1 ADDADD Acc Aadd Accumulators 1 1 OA,OB,SA,SB
ADD f f=f+WREG 1 1 C,DC,N,OV,Z
ADD f,WREGWREG = f + WREG11C,DC,N,OV,Z
ADD #lit10,WnWd = lit10 + Wd11C,DC,N,OV,Z
ADD Wb,Ws,WdWd = Wb + Ws11C,DC,N,OV,Z
ADD Wb,#lit5,WdWd = Wb + lit511C,DC,N,OV,Z
ADD Wso,#Slit4,Acc16-bit Signed Add to Accumulator11OA,OB,SA,SB
2ADDCADDC ff = f + WREG + (C)11C,DC,N,OV,Z
ADDC f,WREGWREG = f + WREG + (C)11C,DC,N,OV,Z
ADDC #lit10,WnWd = lit10 + Wd + (C)11C,DC,N,OV,Z
ADDC Wb,Ws,WdWd = Wb + Ws + (C)11C,DC,N,OV,Z
ADDC Wb,#lit5,WdWd = Wb + lit5 + (C)11C,DC,N,OV,Z
3ANDAND ff = f.AND.WREG11N,Z
AND f,WREGWREG = f.AND.WREG11N,Z
AND #lit10,WnWd = lit10.AND.Wd11N,Z
AND Wb,Ws,WdWd = Wb.AND.Ws11N,Z
AND Wb,#lit5,WdWd = Wb.AND.lit511N,Z
4ASRASR ff = Arithmetic Right Shift f11C,N,OV,Z
ASR f,WREGWREG = Arithmetic Right Shift f11C,N,OV,Z
ASR Ws,WdWd = Arithmetic Right Shift Ws11C,N,OV,Z
ASR Wb,Wns,WndWnd = Arithmetic Right Shift Wb by Wns11N,Z
ASR Wb,#lit5,WndWnd = Arithmetic Right Shift Wb by lit511N,Z
5BCLRBCLR f,#bit4Bit Clear f11None
BCLR Ws,#bit4Bit Clear Ws11None
6BFEXTBFEXT bit4,wid5,Ws,WbBit Field Extract from Ws to Wb22None
BFEXT bit4,wid5,f,WbBit Field Extract from f to Wb22None
7BFINSBFINS bit4,wid5,Wb,WsBit Field Insert from Wb into Ws22None
BFINS bit4,wid5,Wb,fBit Field Insert from Wb into f22None
BFINS bit4,wid5,lit8,WsBit Field Insert from #lit8 to Ws22None
8BOOTSWPBOOTSWPSwap the Active and Inactive Program Flash Space12None

Note 1: Read and Read-Modify-Write (e.g., bit operations and logical operations) on non-CPU SFRs incur an additional instruction cycle.
2: Cycle times for Secondary core are different for Main core, as shown in 2.
3: For dsPIC33CH128MP508 devices, the divide instructions must be preceded with a "REPEAT #5" instruction, such that they are executed six consecutive times

TABLE 22-2: INSTRUCTION SET OVERVIEW (CONTINUED)

Base Instr #Assembly MnemonicAssembly SyntaxDescription# of Words# of Cycles(1)Status Flags Affected
9 BRABRA C, ExprBranch if Carry 1 1 (4)/1 (2)(2)None
BRA GE, Expr Branch if Greater Than or Equal1 1 (4)/1 (2)(2)None
BRA GEU, Expr Branch if unsigned Greater Than or Equal1 1 (4)/1 (2)(2)None
BRA GT, Expr Branch if Greater Than 1 1 (4)/1 (2)(2)None
BRA GTU, Expr Branch if Unsigned Greater Than 1 1 (4)/1 (2)(2)None
BRA LE, Expr Branch if Less Than or Equal 11 (4)/1 (2)(2)None
BRA LFU, ExprBranch if Unsigned Less Than or Equal11 (4)/1 (2)(2)None
BRA LT, Expr Branch if Less Than1 1 (4)/1 (2)(2)None
BRA LTU, Expr Branch if Unsigned Less Than1 1 (4)/1 (2)(2)None
BRA N, Expr Branch if Negative1 1 (4)/1 (2)(2)None
BRA NC, Expr Branch if Not Carry1 1 (4)/1 (2)(2)None
BRA NN, Expr Branch if Not Negative1 1 (4)/1 (2)(2)None
BRA NOV, Expr Branch if Not Overflow1 1 (4)/1 (2)(2)None
BRA NZ, ExprBranch if Not Zero11 (4)/1 (2)(2)None
BRA OA, ExprBranch if Accumulator A Overflow11 (4)/1 (2)(2)None
BRA OB, ExprBranch if Accumulator B Overflow11 (4)/1 (2)(2)None
BRA OV, Expr Branch if Overflow1 1 (4)/1 (2)(2)None
BRA SA, ExprBranch if Accumulator A Saturated11 (4)/1 (2)(2)None
BRA SB, ExprBranch if Accumulator B Saturated11 (4)/1 (2)(2)None
BRA ExprBranch Unconditionally14/2(2)None
BRA Z, Expr Branch if Zero1 1 (4)/1 (2)(2)None
BRA WnComputed Branch14None
10BREAKBREAKStop User Code Execution11None
11BSETBSET f,#bit4Bit Set f11None
Bit Set Ws11None
12BSWBSW.C Ws,WbWrite C Bit to Ws[Wb]11None
BSW.Z Ws,WbWrite Z Bit to Ws[Wb]11None
13BTGBTG f,#bit4Bit Toggle f11None
BTG Ws,#bit4Bit Toggle Ws11None
14BTSCBTSC f,#bit4Bit Test f, Skip if Clear11(2 or 3)None
BTSC Ws,#bit4Bit Test Ws, Skip if Clear11(2 or 3)None
15BTSSBTSS f,#bit4Bit Test f, Skip if Set11(2 or 3)None
BTSS Ws,#bit4Bit Test Ws, Skip if Set11(2 or 3)None
16BTSTBTST f,#bit4Bit Test f11Z
BTST.C Ws,#bit4Bit Test Ws to C11C
BTST.Z Ws,#bit4Bit Test Ws to Z11Z
BTST.C Ws,WbBit Test Ws[Wb] to C11C
BTST.Z Ws,WbBit Test Ws[Wb] to Z11Z
17BTSTSBTSTS f,#bit4Bit Test then Set f11Z
BTSTS.C Ws,#bit4Bit Test Ws to C, then Set11C
BTSTS.Z Ws,#bit4Bit Test Ws to Z, then Set11Z
18CALLCALL lit23Call Subroutine24/(2)(2)SFA
CALL WnCall Indirect Subroutine14(2)(2)SFA
CALL.L WnCall Indirect Subroutine (long address)14(2)(2)SFA

Note 1: Read and Read-Modify-Write (e.g., bit operations and logical operations) on non-CPU SFRs incur an additional instruction cycle.
2: Cycle times for Secondary core are different for Main core, as shown in 2.
3: For dsPIC33CH128MP508 devices, the divide instructions must be preceded with a "REFFAT #5" instruction, such that they are executed six consecutive times

TABLE 22-2: INSTRUCTION SET OVERVIEW (CONTINUED)

Base Instr #Assembly MnemonicAssembly SyntaxDescription# of Words# of Cycles(1)Status Flags Affected
19 CLRCLR f f=0x0000 1 1 None
CLR WREG WREG = 0x0000 1 1 None
CLR Ws Ws = 0x0000 1 1 None
CLR Acc,Wx,Wxd,Wy,Wyd,AWB Clear Accumulator 1 1 OA,OB,SA,SB
20CLRWDTCLRWDTClear Watchdog Timer11WDTO,Sleep
21 COMCOM f f=ff-11N,Z
COM f,WREG WREG = f-11N,Z
COM Ws,Wd Wd = Ws-11N,Z
22CPCP fCompare f with WREG11C,DC,N,OV,Z
CP Wb,#lit8Compare Wb with lit811C,DC,N,OV,Z
CP Wb,WsCompare Wb with Ws (Wb - Ws)11C,DC,N,OV,Z
23CPOCPO fCompare f with 0x000011C,DC,N,OV,Z
CPO WsCompare Ws with 0x000011C,DC,N,OV,Z
24CPBCPB fCompare f with WREG, with Borrow11C,DC,N,OV,Z
CPB Wb,#lit8Compare Wb with lit8, with Borrow11C,DC,N,OV,Z
CPB Wb,Ws Compare Wb with Ws, with Borrow (Wb - Ws - C)1 1C,DC,N,OV,Z
25CPSEQCPSEQ Wb,WnCompare Wb with Wn, Skip if =11(2 or 3)None
CPREQCPREQ Wb,Wn,ExprCompare Wb with Wn, Branch if =11(5)None
26CPSGTCPSGT Wb,WnCompare Wb with Wn, Skip if >11(2 or 3)None
CPBGTCPBGT Wb,Wn,ExprCompare Wb with Wn, Branch if >11(5)None
27CPSLTCPSLT Wb,WnCompare Wb with Wn, Skip if <11(2 or 3)None
CPBLT Wb,Wn,ExprCompare Wb with Wn, Branch if <11(5)None
28CPSNECPSNE Wb,WnCompare Wb with Wn, Skip if ≠11(2 or 3)None
CPBNE Wb,Wn,ExprCompare Wb with Wn, Branch if ≠11(5)None
29CTXTSWPCTXTSWP #lit3Switch CPU Register Context to Context Defined by lit312None
30CTXTSWPCTXTSWP WnSwitch CPU Register Context to Context Defined by Wn12None
31DAW.BDAW.B WnWn = Decimal Adjust Wn11C
32DECDEC ff = f - 111C,DC,N,OV,Z
DEC f,WREGWREG = f - 111C,DC,N,OV,Z
DEC Ws,WdWd = Ws - 111C,DC,N,OV,Z
33DEC2DEC2 ff = f - 211C,DC,N,OV,Z
DEC2 f,WREGWREG = f - 211C,DC,N,OV,Z
DEC2 Ws,WdWd = Ws - 211C,DC,N,OV,Z
34DISIDISI #lit14Disable Interrupts for k Instruction Cycles11None
35DIVFDIVF Wn,WnSigned 16/16-Bit Fractional Divide118/6N,Z,C,OV
36DIV.SDIV.S Wn,WnSigned 16/16-Bit Integer Divide118/6N,Z,C,OV
DIV.SD Wn,WnSigned 32/16-Bit Integer Divide118/6N,Z,C,OV
37DIV.UDIV.U Wn,WnUnsigned 16/16-Bit Integer Divide118/6N,Z,C,OV
DIV.UB Wn,WnUnsigned 32/16-Bit Integer Divide118/6N,Z,C,OV
38DIVF2DIVF2 Wn,WnSigned 16/16-Bit Fractional Divide (W1:W0 preserved)16N,Z,C,OV
39DIV2.SDIV2.S Wn,WnSigned 16/16-Bit Integer Divide (W1:W0 preserved)16N,Z,C,OV
DIV2.SD Wn,WnSigned 32/16-Bit Integer Divide (W1:W0 preserved)16N,Z,C,OV

Note 1: Read and Read-Modify-Write (e.g., bit operations and logical operations) on non-CPU SFRs incur an additional instruction cycle.
2: Cycle times for Secondary core are different for Main core, as shown in 2.
3: For dsPIC33CH128MP508 devices, the divide instructions must be preceded with a "REPEAT || 5" instruction, such that they are executed six consecutive times

TABLE 22-2: INSTRUCTION SET OVERVIEW (CONTINUED)

Base Instr #Assembly MnemonicAssembly SyntaxDescription# of Words# of Cycles(1)Status Flags Affected
40 DIV2.U DIV2.J Wm,Wn Unsigned 16/16-Bit Integer Divide(W1:W0 preserved)16N
DIV2.UC Wm,Wn Unsigned 32/16-Bit Integer Divide (W1:W0 preserved)16N
41DODO #Lit15,ExprDo Code to PC + Expr, lit15 + 1 Times22None
DO Wn,ExprDo code to PC + Expr, (Wn) + 1 Times22None
42EDED Wm*Wm,Acc,Wx,Wy,WxdEuclidean Distance (no accumulate)11OA,OB,OAB, SA,SB,SAB
43EDACEDAC Wm*Wm,Acc,Wx,Wy,WxdEuclidean Distance11OA,OB,OAB, SA,SB,SAB
44EXCHEXCH Wns,WndSwap Wns with Wnd11None
46FBCLFBCL Ws,WndFind Bit Change from Left (MSb) Side11C
47FFILFFIL Ws,WndFind First One from Left (MSb) Side11C
48FFIRFFIR Ws,WndFind First One from Right (LSb) Side11C
49FLIMFLIM Wb, WsForce Data (upper and lower) Range Limit without Limit Excess Result1 1N,Z,OV
FLIM.V Wb, Ws, WdForce Data (upper and lower) Range Limit with Limit Excess Result1 1N,Z,OV
50GOTOGOTO ExprGo to Address2 4/2^(2) None
GOTO WnGo to Indirect1 4/2^(2) None
GOTO.L WnGo to Indirect (long address)1 4/2^(2) None
51INCINC ff = f + 111C,DC,N,OV,Z
INC f,WREGWREG = f + 111C,DC,N,OV,Z
INC Ws,WdWd = Ws + 111C,DC,N,OV,Z
52INC2INC2 ff = f + 211C,DC,N,OV,Z
INC2 f,WREGWREG = f + 211C,DC,N,OV,Z
INC2 Ws,WdWd = Ws + 211C,DC,N,OV,Z
53IORIOR ff = f.IOR.WREG11N,Z
IOR f,WREGWREG = f.IOR.WREG11N,Z
IOR #Lit10,WnWd = lit10.IOR.Wd11N,Z
IOR Ww,Ws,WdWd = Wb.IOR.Ws11N,Z
IOR Ww,#Lit5,WdWd = Wb.IOR.lit511N,Z
54LACLAC Wso,#Slit4,AccLoad Accumulator11OA,OB,OAB, SA,SB,SAB
LAC.D Wso,#Slit4,AccLoad Accumulator Double12OA,SA,OB,SB
55LDSLVLDSLV Wso,Wdo,lit2Move a Single Instruction Word from Main to Secondary PRAM11N
56LNKLNK #Lit14Link Frame Pointer11SFA
57LSRLSR ff = Logical Right Shift f11C,N,OV,Z
LSR f,WREGWREG = Logical Right Shift f11C,N,OV,Z
LSR Ws,WdWd = Logical Right Shift Ws11C,N,OV,Z
LSR Ww,Wns,WndWnd = Logical Right Shift Wb by Wns11N,Z
LSR Ww,#Lit5,WndWnd = Logical Right Shift Wb by lit511N,Z
58 MAC MAC Wm*Wn,Acc,Wx,Wxd,Wy,Wyd, AWBMultiply and Accumulate1 1OA,OB,OAB, SA,SB,SAB
Square and Accumulate11OA,OB,OAB, SA,SB,SAB
59MAXMAX AccForce Data Maximum Range Limit11N,OV,Z
MAX.V Acc, WndForce Data Maximum Range Limit with Result11N,OV,Z

Note 1: Read and Read-Modify-Write (e.g., bit operations and logical operations) on non-CPU SFRs incur an additional instruction cycle.
2: Cycle times for Secondary core are different for Main core, as shown in 2.
3: For dsPIC33CH128MP508 devices, the divide instructions must be preceded with a "REPEAT #5" instruction, such that they are executed six consecutive times

TABLE 22-2: INSTRUCTION SET OVERVIEW (CONTINUED)

Base Instr #Assembly MnemonicAssembly SyntaxDescription# of Words# of Cycles(1)Status Flags Affected
60 MINMIN AccIf Accumulator A Less than B LoadAccumulator with B or vice versa1 1 NOV,Z
MIN.V Acc, Wd If Accumulator A Less than BAccumulator Force Minimum Data Range Limit with Limit Excess Result1 1 NOV,Z
MINZ Acc Accumulator Force Minimum Data Range Limit 1 1 N,OV,Z
MINZ.V Acc, Wd Accumulator Force Minimum Data Range Limit with Limit Excess Result1 1 NOV,Z
61MOVMOV f,WnMove f to Wn11None
MOV fMove f to f11None
MOV f,WREGMove f to WREG11None
MOV #lit16,WnMove 16-Bit Literal to Wn11None
MOV.b #lit8,WnMove 8-Bit Literal to Wn11None
MOV Wn,fMove Wn to f11None
MOV Wso,WdoMove Ws to Wd11None
MOV WREG,fMove WREG to f11None
MOV.D Wns,WdMove Double from W(ns):W(ns + 1) to Wd12None
MOV.D Ws,WndMove Double from Ws to W(nd + 1):W(nd)12None
62MOVPAGMOVPAG #lit10,DSRPAGMove 10-Bit Literal to DSRPAG11None
MOVPAG #litB,TBLPAGMove 8-Bit Literal to TBLPAG11None
MOVPAG Ws, DSRPAGMove Ws[9:0] to DSRPAG11None
MOVPAG Ws, TBLPAGMove Ws[7:0] to TBLPAG11None
64MOVSACMOVSAC Acc,Wx,Wxd,Wy,Wyd,AWBPrefetch and Store Accumulator11None
65MPYMPY Wm*Wn,Acc,Wx,Wxd,Wy,WydMultiply Wm by Wn to Accumulator11OA,OB,OAB,SA,SB,SAB
MPY Wm*Wn,Acc,Wx,Wxd,Wy,WydSquare Wm to Accumulator11OA,OB,OAB,SA,SB,SAB
66MPY.NMPY.N Wm*Wn,Acc,Wx,Wxd,Wy,Wyd-(Multiply Wm by Wn) to Accumulator11None
67 MSCMSC Wm*Wn,Acc,Wx,Wxd,Wy,Wyd,AWBMultiply and Subtract from Accumulator11OA,OB,OAB,SA,SB,SAB
68MULMUL.SS Wb,Ws,Wnd{Wnd + 1, Wind} = Signed(Wb) * Signed(WS)11None
MUL.SS Wb,Ws,AccAccumulator = Signed(Wb) * Signed(WS)11None
MUL.SU Wb,Ws,Wnd{Wnd + 1, Wind} = Signed(Wb) * Unsigned(WS)11None
MUL.SU Wb,Ws,AccAccumulator = Signed(Wb) * Unsigned(WS)11None
MUL.SU Wb,#lit5,AccAccumulator = Signed(Wb) * Unsigned(lit5)11None
MUL.US Wb,Ws,Wnd{Wnd + 1, Wind} = Unsigned(Wb) * Signed(WS)11None
MUL.US Wb,Ws,AccAccumulator = Unsigned(Wb) * Signed(WS)11None
MUL.UU Wb,Ws,Wnd{Wnd + 1, Wind} = Unsigned(Wb) * Unsigned(WS)11None
MUL.UU Wb,#lit5,AccAccumulator = Unsigned(Wb) * Unsigned(lit5)11None
MUL.UU Wb,Ws,AccAccumulator = Unsigned(Wb) * Unsigned(WS)11None
MULW.SS Wb,Ws,WndWnd = Signed(Wb) * Signed(WS)11None
MULW.SU Wb,Ws,WndWnd = Signed(Wb) * Unsigned(WS)11None
MULW.US Wb,Ws,WndWnd = Unsigned(Wb) * Signed(WS)11None
MULW.UU Wb,Ws,WndWnd = Unsigned(Wb) * Unsigned(WS)11None
MUL.SU Wb,#lit5,Wnd{Wnd + 1, Wind} = Signed(Wb) * Unsigned(lit5)11None
MUL.SU Wb,#lit5,WndWnd = Signed(Wb) * Unsigned(lit5)11None
MUL.UU Wb,#lit5,Wnd{Wnd + 1, Wind} = Unsigned(Wb) * Unsigned(lit5)11None
MUL.UU Wb,#lit5,WndWnd = Unsigned(Wb) * Unsigned(lit5)11None
MUL fW3:W2 = f * WREG11None

Note 1: Read and Read-Modify-Write (e.g., bit operations and logical operations) on non-CPU SFRs incur an additional instruction cycle.
2: Cycle times for Secondary core are different for Main core, as shown in 2.
3: For dsPIC33CH128MP508 devices, the divide instructions must be preceded with a "REPEAT #5" instruction, such that they are executed six consecutive times

TABLE 22-2: INSTRUCTION SET OVERVIEW (CONTINUED)

Base Instr #Assembly MnemonicAssembly SyntaxDescription# of Words# of Cycles(1)Status Flags Affected
69 NEGNEG AccNegate Accumulator 1 1 OA,OB,OAB,SA,SB,SAB
NEG f f=f+1 1 1 C,DC,N,OV,Z
NEG f,WREG WREG=f+11 1 CDC,N,OV,Z
NEG Ws,Wd Wd=Ws +11 1 CDC,N,OV,Z
70NOPNOPNo Operation11None
NOPRNo Operation11None
71NORMNORM Acc, WdNormalize Accumulator11N,OV,Z
72POPPOP fPop f from Top-of-Stack (TOS)11None
POP WdoPop from Top-of-Stack (TOS) to Wdo11None
POP.D WndPop from Top-of-Stack (TOS) to W(nd):W(nd + 1)12None
POP.SPop Shadow Registers11All
73PUSHPUSH fPush f to Top-of-Stack (TOS)11None
PUSH WsoPush Wso to Top-of-Stack (TOS)11None
PUSH.D WnsPush W(ns):W(ns + 1) to Top-of-Stack (TOS)12None
PUSH.SPush Shadow Registers11None
74PWRSAVPWRSAV #lit1Go into Sleep or Idle mode11WDTO,Sleep
75RCALLRCALL ExprRelative Call1 4/2^(2) SFA
RCALL WnComputed Call1 4/2^(2) SFA
76REPEATREPEAT #lit15Repeat Next Instruction lit15 + 1 Times11None
REPEAT WnRepeat Next Instruction (Wn) + 1 Times11None
77RESETRESETSoftware Device Reset11None
78RETFIERETFIEReturn from Interrupt1 6(5)/3^(2) SFA
79RETLWRETLW #lit10,WnReturn with Literal in Wn1 6(5)/3^(2) SFA
80RETURNRETURNReturn from Subroutine1 6(5)/3^(2) SFA
81RLCRLC ff = Rotate Left through Carry f11C,N,Z
RLC f,WREGWREG = Rotate Left through Carry f11C,N,Z
RLC Ws,WdWd = Rotate Left through Carry Ws11C,N,Z
82RLNCRLNC ff = Rotate Left (No Carry) f11N,Z
RLNC f,WREGWREG = Rotate Left (No Carry) f11N,Z
RLNC Ws,WdWd = Rotate Left (No Carry) Ws11N,Z
83RRCRRC ff = Rotate Right through Carry f11C,N,Z
RRC f,WREGWREG = Rotate Right through Carry f11C,N,Z
RRC Ws,WdWd = Rotate Right through Carry Ws11C,N,Z
84RRNCRRNC ff = Rotate Right (No Carry) f11N,Z
RRNC f,WREGWREG = Rotate Right (No Carry) f11N,Z
RRNC Ws,WdWd = Rotate Right (No Carry) Ws11N,Z
85SACSAC Acc,#Slit4,WdoStore Accumulator11None
SAC.R Acc,#Slit4,WdoStore Rounded Accumulator11None
SAC.D #Slit4,WdoStore Accumulator Double11None
86SESE Ws,WndWnd = Sign-Extended Ws11C,N,Z
87SETMSETM ff = 0xFFFF11None
SETM WREGWREG = 0xFFFF11None
SETM WsWs = 0xFFFF11None
88SFTACSFTAC Acc,WnArithmetic ShiftAccumulator by (Wn)11OA,OB,OAB, SA,SB,SAB
SFTAC Acc,#Slit6Arithmetic ShiftAccumulator by Slit611OA,OB,OAB, SA,SB,SAB

Note 1: Read and Read-Modify-Write (e.g., bit operations and logical operations) on non-CPU SFRs incur an additional instruction cycle.
2: Cycle times for Secondary core are different for Main core, as shown in 2.
3: For dsPIC33CH128MP508 devices, the divide instructions must be preceded with a "REPEAT #5" instruction, such that they are executed six consecutive times

TABLE 22-2: INSTRUCTION SET OVERVIEW (CONTINUED)

Base Instr #Assembly MnemonicAssembly Syntax Description# of Words# of Cycles(1)Status Flags Affected
89 SLSL f f = Left Shift f 1 1 C,N,OV,Z
SL f,WREG WREG = Left Shift f 1 1 C,N,OV,Z
SL Ws,Wd Wd = Left Shift Ws 1 1 C,N,OV,Z
SL Wb,Wns,Wnd Wnd = Left Shift Wb by Wns 1 1 N,Z
SL Wb,#lit5,WndWnd = Left Shift Wb by lit511N,Z
91SUBSUB AccSubtract Accumulators11OA,OB,OAB,SA,SB,SAB
SUB ff = f-WREG11C,DC,N,OV,Z
SUB f,WREGWREG = f-WREG11C,DC,N,OV,Z
SUB #lit10,WnWn = Wn - lit1011C,DC,N,OV,Z
SUB Wb,Ws,WdWd = Wb - Ws11C,DC,N,OV,Z
SUB Wb,#lit5,WdWd = Wb - lit511C,DC,N,OV,Z
92SUBBSUBB ff = f-WREG-(C)1 1C,DC,N,OV,Z
SUBB f,WREG WREG = f-WREG-(C)-1 1C,DC,N,OV,Z
SUBB #lit10,WnWn = Wn - lit10-(C)1 1C,DC,N,OV,Z
SUBB Wb,Ws,WdWd = Wb - Ws-(C)1 1C,DC,N,OV,Z
SUBB Wb,#lit5,WdWd = Wb - lit5-(C)1 1C,DC,N,OV,Z
93SUBRSUBR ff = WREG-f11C,DC,N,OV,Z
SUBR f,WREGWREG = WREG-f11C,DC,N,OV,Z
SUBR Wb,Ws,WdWd = Ws-Wb11C,DC,N,OV,Z
SUBR Wb,#lit5,WdWd = lit5-Wb11C,DC,N,OV,Z
94SUBBRSUBBR ff = WREG-f-(C)1 1C,DC,N,OV,Z
SUBBR f,WREG WREG = WREG-f-(C)-1 1C,DC,N,OV,Z
SUBBR Wb,Ws,WdWd = Ws-Wb-(C)1 1C,DC,N,OV,Z
SUBBR Wb,#lit5,WdWd = lit5-Wb-(C)1 1C,DC,N,OV,Z
95SWAPSWAP.b WnWn = Nibble Swap Wn11None
SWAP WnWn = Byte Swap Wn11None
96TBLRDHTBLRDH Ws,WdRead Prog[23:16] to Wd[7:0]1 5/3^(2) None
97TBLRDLTBLRDL Ws,WdRead Prog[15:0] to Wd1 5/3^(2) None
98TBLMTHTBLMTH Ws,WdWrite Ws[7:0] to Prog[23:16]12None
99TBLMTLTBLMTL Ws,WdWrite Ws to Prog[15:0]12None
101ULNKULNKUnlink Frame Pointer11SFA
103VFSLVVFSLV Wns,Wnd,lit2Compare (Main) Ws to (Secondary) Wd11None
104XORXOR ff = f.XOR.WREG11N,Z
XOR f,WREGWREG = f.XOR.WREG11N,Z
XOR #lit10,WnWd = lit10 .XOR.Wd11N,Z
XOR Wb,Ws,WdWd = Wb .XOR.Ws11N,Z
XOR Wb,#lit5,WdWd = Wb .XOR.lit511N,Z
105ZEZE Ws,WndWnd = Zero-Extend Ws11C,Z,N

Note 1: Read and Read-Modify-Write (e.g., bit operations and logical operations) on non-CPU SFRs incur an additional instruction cycle.

2: Cycle times for Secondary core are different for Main core, as shown in 2.

3: For dsPIC33CH128MP508 devices, the divide instructions must be preceded with a "REPEAT #S" instruction, such that they are executed six consecutive times

23.0 DEVELOPMENT SUPPORT

Move a design from concept to production in record time with Microchip's award-winning development tools. Microchip tools work together to provide state of the art debugging for any project with easy-to-use Graphical User Interfaces (GUIs) in our free MPLAB X and Atmel Studio Integrated Development Environments (IDEs), and our code generation tools. Providing the ultimate ease-of-use experience, Microchip's line of programmers, debuggers and emulators work seamlessly with our software tools. Microchip development boards help evaluate the best silicon device for an application, while our line of third party tools round out our comprehensive development tool solutions.

Microchip's MPLAB X and Atmel Studio ecosystems provide a variety of embedded design tools to consider, which support multiple devices, such as PIC ^ MCUs, AVR ^ MCUs, SAM MCUs and dsPIC DSCs. MPLAB X tools are compatible with Windows ^ , Linux ^ and Mac ^ operating systems while Atmel Studio tools are compatible with Windows.

Go to the following website for more information and details:

https://www.microchip.com/development-tools/

NOTES:

24.0 ELECTRICAL CHARACTERISTICS

This section provides an overview of the dsPIC33CH128MP508 family electrical characteristics. Additional information will be provided in future revisions of this document as it becomes available.

Absolute maximum ratings for the dsPIC33CH128MP508 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.

Absolute Maximum Ratings ^(1)

Ambient temperature under bias....-40°C to +125°C

Storage temperature .... -65°C to +150°C

Voltage on VDD with respect to Vss -0.3V to +4.0V

Voltage on any pin that is not 5V tolerant with respect to Vss ^(3) ......-0.3V to (VDD + 0.3V)

Voltage on any 5V tolerant pin with respect to Vss when V_DD ≥ 3.0V^(3) -0.3V to +5.5V

Voltage on any 5V tolerant pin with respect to Vss when VDD < 3.0V ^(3) .... -0.3V to +3.6V

Maximum current out of Vss pin ....300 mA

Maximum current into VDD pin ^(2) 300 mA

Maximum current sunk/sourced by any 4x I/O pin....15 mA

Maximum current sunk/sourced by any 8x I/O pin....25 mA

Maximum current sunk by a group of I/Os between two Vss pins ^(4) .....200 mA

Maximum current sourced by a group of I/Os between two VDD pins ^(4) .....200 mA

Note 1: 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.

2: Maximum allowable current is a function of device maximum power dissipation (see Table 24-2).

3: See the "Pin Diagrams" section for the 5V tolerant pins.

4: Not applicable to AV DD and AVss pins.

24.1 DC Characteristics

TABLE 24-1: OPERATING MIPS vs. VOLTAGE

CharacteristicVDD Range(in Volts)Temperature Range(in °C)Maximum MIPSdsPIC33CH128MP508 Family
Main Secondary
3.0V to 3.6V -40°C to +85°C 90 100
3.0V to 3.6V -40°C to +125°C 90 100

TABLE 24-2: THERMAL OPERATING CONDITIONS

Rating Symbol Min. Typ. Max.Unit
Industrial Temperature Devices
Operating Junction Temperature Range T_J -40+125°C
Operating Ambient Temperature Range T_A -40+85°C
Extended Temperature Devices
Operating Junction Temperature Range T_J -40+140°C
Operating Ambient Temperature Range T_A -40+125°C
Power Dissipation:
Internal Chip Power Dissipation: P_INT=V_DDx(IDD- IOH) I/O Pin Power Dissipation: I/O=(_DD-V_OH)+(VOLxIOL) P_D P_INT+P_I/O W
Maximum Allowed Power Dissipation P_DMAX (T_J-T_A)/_JA W

TABLE 24-3: THERMAL PACKAGING CHARACTERISTICS

CharacteristicSymbolTyp.Max.UnitNotes
Package Thermal Resistance, 80-Pin TQFP 12x12x1 mm _JA 50.67°C/W1
Package Thermal Resistance, 64-Pin TQFP 10x10x1 mm _JA 45.7°C/W1
Package Thermal Resistance, 64-Pin QFN 9x9 mm _JA 18.7°C/W1
Package Thermal Resistance, 48-Pin TQFP 7x7 mm _JA 62.76°C/W1
Package Thermal Resistance, 48-Pin UQFN 6x6 mm _JA 27.6°C/W1
Package Thermal Resistance, 36-Pin UQFN 5x5 mm _JA 29.2°C/W1
Package Thermal Resistance, 28-Pin UQFN 6x6 mm _JA 22.41°C/W1
Package Thermal Resistance, 28-Pin SSOP 5.30 mm _JA 52.84°C/W1

Note 1: Junction to ambient thermal resistance, Theta-JA ( _JA ) numbers are achieved by package simulations.

TABLE 24-4: OPERATING VOLTAGE SPECIFICATIONS

Operating Conditions: 3.0V to 3.6V (unless otherwise stated)(1)
Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ A≤ +125°C for Extended
Param No.SymbolCharacteristic Min. Typ. Max.Units Conditions
Operating Voltage
DC10VDDSupply Voltage3.03.6V
DC11AVDDSupply VoltageGreater of: VDD-0.3 or 3.0Lesser of: VDD+0.3 or 3.6VThe difference between AVDD supply and VDD supply must not exceed ±300 mV at all times, including during device power-up
DC16 VPORVDD Start Voltage to Ensure Internal Power-on Reset SignalVssV
DC17SVDDVDD Rise Rate to Ensure Internal Power-on Reset Signal0.3V/ms0V-3V in 100 ms (Note 4)
BO10VBORBOR Event on VDD Transition High-to-Low2.682.842.99V(Note 2)
BO11VPORPOR Event on VDD Transition High-to-Low1.65VVDD (Notes 2,3)

Note 1: Device is functional at VBORMIN < VDD < VDDMIN. Analog modules (ADC and comparators) may have degraded performance.
2: Parameters are characterized but not tested.
3: If VDD drops below the BO11 value, VDD must be brought down to 0V before ramping the device back up to operation range.
4: Failure to observe SVDD can result in device remaining in reset even after VDD is raised past VBORMAX.

TABLE 24-5: VOLTAGE REGULATOR SPECIFICATIONS

Operating Conditions: 3.0V to 3.6V (unless otherwise stated)(1)
Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ TA ≤ +125°C for Extended
Param No.SymbolCharacteristicMin.Typ.Max.UnitsConditions
Operating Voltage
DVR20VDDCORERegulator Output Voltage1.081.32VFor VREG and VREGPLL
DVR22VVREG_READYRegulator Ready Comparator Voltage1.08VCombined highest voltage for VREG and VREGPLL comparators (Notes 2,3)

Note 1: Device is functional at VBORMIN < VDD < VDDMIN. Analog modules (ADC and comparators) may have degraded performance.
2: Device is functional down to the Regulator Ready Comparator Voltage trip point (VVREG_READY ≤ VDDCORE).
3: Functionality of the VREG monitor is tested in production, assuring the monitor's Reset protection. Absolute trip point value is determined based on a combination of bench validation, simulation and production test results.

TABLE 24-6: DC CHARACTERISTICS: OPERATING CURRENT (I DD) (MAIN RUN/SECONDARY RUN)

DC CHARACTERISTICSMain (Run) + Secondary (Run)Standard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ AT ≤ +125°C for Extended
Parameter No. Typ. Max. Units Conditi ons
Operating Current (IDD)(1)
DC20 11.6 15.7 mA -40°C3.3V10 MIPS (N = 1, N2 = 5, N3 = 2,M = 50, Fvco = 400 MHz,FPLLO = 40 MHz)
11.7 17.5 mA+25°C
11.9 23.5 mA+85°C
15.8 30.0 mA +125°C
DC2115.9 20.3 mA-40°C3.3V20 MIPS (N = 1, N2 = 5, N3 = 1,M = 60, Fvco = 480 MHz,FPLLO = 280 MHz)
16.0 22.2 mA+25°C
16.1 28.0 mA+85°C
20.0 34.3 mA +125°C
DC2223.7 28.9 mA-40°C3.3V40 MIPS (N = 1, N2 = 3, N3 = 1,M = 60, Fvco = 480 MHz,FPLLO = 160 MHz)
23.9 30.9 mA+25°C
25.9 36.6 mA+85°C
27.8 42.1 mA +125°C
DC2337.3 44.0 mA-40°C3.3V70 MIPS (N = 1, N2 = 2, N3 = 1,M = 70, Fvco = 560 MHz,FPLLO = 280 MHz)
37.5 46.1 mA+25°C
37.2 51.1 mA+85°C
41.1 55.7 mA +125°C
DC2445.0 52.4 mA-40°C3.3V90 MIPS (N = 1, N2 = 2, N3 = 1,M = 90, Fvco = 720 MHz,FPLLO = 360 MHz)
45.2 54.8 mA+25°C
44.8 59.1 mA+85°C
48.3 63.1 mA +125°C
DC2545.5 53.0 mA-40°C3.3V100 MIPS (N = 1, N2 = 1,N3 = 1, M = 50,Fvco = 400 MHz,FPLLO = 400 MHz); Secondaryruns at 100 MIPS but Main isstill at 90 MIPS
45.7 55.3 mA+25°C
45.3 59.6 mA+85°C
48.9 63.6 mA +125°C

Note 1: IDD is primarily 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:

• FIN = 8 MHz, FPFD = 8 MHz

- CLKO is configured as an I/O input pin in the Configuration Word

- All I/O pins are configured as output low

- MCLR = VDD, WDT and FSCM are disabled

• CPU, SRAM, program memory and data memory are operational

- No peripheral modules are operating or being clocked (all defined PMDx bits are set)

• CPU is executing while(1) statement

- JTAG is disabled

TABLE 24-7: DC CHARACTERISTICS: OPERATING CURRENT (IDD) (MAIN SLEEP/SECONDARY RUN)

DC CHARACTERISTICSMain (Sleep) + Secondary (Run)Standard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ TA ≤ +125°C for Extended
Parameter No. Typ.Max. UnitsConditions
Operating Current (I_DD)^(1)
DC20a 7.2 11.0 mA-40°C3.3V10 MIPS (N = 1, N2 = 5,N3 = 2, M = 50,Fvco = 400 MHz,FPLLO = 40 MHz)
7.3 126mA+25°C
7.6 189mA+85°C
11.625.6mA+125°C
DC21a 9.0 12.9mA-40°C3.3V20 MIPS (N = 1, N2 = 5,N3 = 1, M = 50,Fvco = 400 MHz,FPLLO = 80 MHz)
9.214.6mA+25°C
9.420.8mA+85°C
13.427.5mA+125°C
DC22a13.117.2mA-40°C3.3V40 MIPS (N = 1, N2 = 3,N3 = 1, M = 60,Fvco = 480 MHz,FPLLO = 160 MHz)
13.219.0mA+25°C
13.425.1mA+85°C
17.331.5mA+125°C
DC23a18.623.2mA-40°C3.3V70 MIPS (N = 1, N2 = 2,N3 = 1, M = 70,Fvco = 560 MHz,FPLLO = 280 MHz)
18.825.0mA+25°C
18.831.1mA+85°C
22.837.0mA+125°C
DC24a23.028.1mA-40°C3.3V90 MIPS (N = 1, N2 = 2,N3 = 1, M = 90,Fvco = 720 MHz,FPLLO = 360 MHz)
23.230.0mA+25°C
23.235.8mA+85°C
27.141.4mA+125°C
DC25a23.528.6mA-40°C3.3V100 MIPS (N = 1, N2 = 1,N3 = 1, M = 50,Fvco = 400 MHz,FPLLO = 400 MHz)
23.730.4mA+25°C
23.736.4mA+85°C
27.641.9mA+125°C

Note 1: IDD is primarily 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:

- Oscillator is switched to EC+PLL mode in software

- CLKO is configured as an I/O input pin in the Configuration Word

- All I/O pins are configured as output low

- MCLR = VDD, WDT and FSCM are disabled

• CPU, SRAM, program memory and data memory are operational

- No peripheral modules are operating or being clocked (all defined PMDx bits are set)

• CPU is executing while(1) statement

- JTAG is disabled

TABLE 24-8: DC CHARACTERISTICS: OPERATING CURRENT (IDD) (MAIN RUN/SECONDARY SLEEP)

DC CHARACTERISTICSMain (Run) + Secondary (Sleep)Standard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ TA ≤ +125°C for Extended
Parameter No. Typ. Max. UnitsConditions
Operating Current (I_DD)^(1)
DC20b 7.9 11.8 mA -40°C3.3V10 MIPS (N = 1, N2 = 5,N3 = 2, M = 50,Fvco = 400 MHz,FPLLO = 40 MHz)
8.0 13.4mA+25°C
8.2 19.5mA+85°C
12.2 26.3mA+125°C
DC21b10.3 14.4mA+40°C3.3V20 MIPS (N = 1, N2 = 5,N3 = 1, M = 50,Fvco = 400 MHz,FPLLO = 80 MHz)
10.5 16.0mA+25°C
10.6 22.1mA+85°C
14.6 28.7mA+125°C
DC22b14.2 18.5mA+40°C3.3V40 MIPS (N = 1, N2 = 3,N3 = 1, M = 60,Fvco = 480 MHz,FPLLO = 160 MHz)
14.4 20.3mA+25°C
14.5 26.3mA+85°C
18.4 32.6mA+125°C
DC23b22.3 27.4mA+40°C3.3V70 MIPS (N = 1, N2 = 2,N3 = 1, M = 70,Fvco = 560 MHz,FPLLO = 280 MHz)
22.5 29.4mA+25°C
22.4 34.9mA+85°C
26.4 40.7mA+125°C
DC24b25.6 31.0mA+40°C3.3V90 MIPS (N = 1, N2 = 2,N3 = 1, M = 90,Fvco = 720 MHz,FPLLO = 360 MHz)
25.8 33.1mA+25°C
25.7 38.2mA+85°C
29.4 43.8mA+125°C

Note 1: IDD is primarily 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:

• FIN = 8 MHz, FPFD = 8 MHz

- CLKO is configured as an I/O input pin in the Configuration Word

- All I/O pins are configured as output low

- = V_DD , WDT and FSCM are disabled

• CPU, SRAM, program memory and data memory are operational

- No peripheral modules are operating or being clocked (all defined PMDx bits are set)

• CPU is executing while(1) statement

- JTAG is disabled

TABLE 24-9: DC CHARACTERISTICS: OPERATING CURRENT (I IDLE) (MAIN IDLE/SECONDARY IDLE)

DC CHARACTERISTICSMain (Idle) + Secondary (Idle)Standard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ AT ≤ +125°C for Extended
Parameter No. Typ. Max. UnitsConditions
Operating Current (I_DD)^(1)
DC40 9.1 11.1 mA-40°C3.3V10 MIPS (N = 1, N2 = 5,N3 = 2, M = 50,Fvco = 400 MHz,FPLLO = 40 MHz)
9.314.8mA+25°C
9.420.7mA+85°C
13.427.5mA+125°C
DC4110.5 12.5mA-40°C3.3V20 MIPS (N = 1, N2 = 5,N3 = 1, M = 50,Fvco = 400 MHz,FPLLO = 80 MHz)
10.616.3mA+25°C
10.822.2mA+85°C
14.728.8mA+125°C
DC4214.0 16.3mA-40°C3.3V40 MIPS (N = 1, N2 = 3,N3 = 1, M = 60,Fvco = 480 MHz,FPLLO = 160 MHz)
14.220.1mA+25°C
14.326.0mA+85°C
18.232.3mA+125°C
DC4318.9 21.6mA-40°C3.3V70 MIPS (N = 1, N2 = 2,N3 = 1, M = 70,Fvco = 560 MHz,FPLLO = 280 MHz)
19.125.5mA+25°C
19.131.2mA+85°C
23.037.2mA+125°C
DC4423.1 26.1mA-40°C3.3V90 MIPS (N = 1, N2 = 2,N3 = 1, M = 90,Fvco = 720 MHz,FPLLO = 360 MHz)
23.230.0mA+25°C
23.234.8mA+85°C
27.141.4mA+125°C
DC4522.3 25.2mA-40°C3.3V100 MIPS (N = 1, N2 = 1,N3 = 1, M = 50,Fvco = 400 MHz,FPLLO = 400 MHz); SecondaryIdle at 100 MIPS but Main Idleat 90 MIPS
22.429.2mA+25°C
22.438.7mA+85°C
26.340.6mA+125°C

Note 1: IDD is primarily 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:

• FIN = 8 MHz, FPFD = 8 MHz

- CLKO is configured as an I/O input pin in the Configuration Word

- All I/O pins are configured as output low

- = V_DD , WDT and FSCM are disabled

• CPU, SRAM, program memory and data memory are operational

- No peripheral modules are operating or being clocked (all defined PMDx bits are set)

• CPU is executing while(1) statement

- JTAG is disabled

TABLE 24-10: DC CHARACTERISTICS: IDLE CURRENT (IIDLE) (MAIN IDLE/SECONDARY SLEEP)

DC CHARACTERISTICSMain (Idle) + Secondary (Sleep)Standard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)Operating temperature -40°C ≤ T A ≤ +85°C for Industrial-40°C ≤ TA ≤ +125°C for Extended
Parameter No. Typ. Max. Units Conditions
Idle Current (IIDLE)(1)
DC40a 6.6 8.4 mA-40°C3.3V10 MIPS (N = 1, N2 = 5,N3 = 2, M = 50,Fvco = 400 MHz,FPLLO = 40 MHz)
6.711.9mA+25°C
6.917.9mA+85°C
10.924.9mA+125°C
DC41a 7.3 9.2 mA-40°C3.3V20 MIPS (N = 1, N2 = 5,N3 = 1, M = 50,Fvco = 400 MHz,FPLLO = 80 MHz)
7.512.7mA+25°C
7.718.7mA+85°C
11.725.7mA+125°C
DC42a 9.2 11.1 mA-40°C3.3V40 MIPS (N = 1, N2 = 3,N3 = 1, M = 60,Fvco = 480 MHz,FPLLO = 160 MHz)
9.414.8mA+25°C
9.520.7mA+85°C
13.527.5mA+125°C
DC43a11.813.9mA-40°C3.3V70 MIPS (N = 1, N2 = 2,N3 = 1, M = 70,Fvco = 560 MHz,FPLLO = 280 MHz)
12.017.6mA+25°C
12.123.5mA+85°C
16.130.1mA+125°C
DC44a14.116.3mA-40°C3.3V90 MIPS (N = 1, N2 = 2,N3 = 1, M = 90,Fvco = 720 MHz,FPLLO = 360 MHz)
14.220mA+25°C
14.325.9mA+85°C
18.232.3mA+125°C

Note 1: Base Idle current (IIDLE) is measured as follows:

• FIN = 8 MHz, FPFD = 8 MHz

- CLKO is configured as an I/O input pin in the Configuration Word

- All I/O pins are configured as output low

• MCLR = VDD, WDT and FSCM are disabled

- No peripheral modules are operating or being clocked (all defined PMDx bits are set)

- The NVMSIDL bit (NVMCON[12]) = 1 (i.e., Flash regulator is set to standby while the device is in Idle mode)

- JTAG is disabled

TABLE 24-11: DC CHARACTERISTICS: IDLE CURRENT (IIDLE) (MAIN SLEEP/SECONDARY IDLE)

DC CHARACTERISTICSMain (Sleep) + Secondary (Idle)Standard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ TA ≤ +125°C for Extended
Parameter No. Typ.Max. UnitsConditions
Idle Current (IDLE)(1)
DC40b 6.0 7.8 mA-40°C3.3V10 MIPS (N = 1, N2 = 5,N3 = 2, M = 50,Fvco = 400 MHz,FPLLO = 40 MHz)
6.211.4mA+25°C
6.417.5mA+85°C
10.424.4mA+125°C
DC41b 6.6 8.4 mA-40°C3.3V20 MIPS (N = 1, N2 = 5,N3 = 1, M = 50,Fvco = 400 MHz,FPLLO = 80 MHz)
6.812.0mA+25°C
7.018.1mA+85°C
11.025.0mA+125°C
DC42b 8.3 10.1mA-40°C3.3V40 MIPS (N = 1, N2 = 3,N3 = 1, M = 60,Fvco = 480 MHz,FPLLO = 160 MHz)
8.513.8mA+25°C
8.719.9mA+85°C
12.626.7mA+125°C
DC43b10.612.6mA-40°C3.3V70 MIPS (N = 1, N2 = 2,N3 = 1, M = 70,Fvco = 560 MHz,FPLLO = 280 MHz)
10.816.3mA+25°C
10.922.3mA+85°C
14.929.0mA+125°C
DC44b12.614.7mA-40°C3.3V90 MIPS (N = 1, N2 = 2,N3 = 1, M = 90,Fvco = 720 MHz,FPLLO = 360 MHz)
12.718.4mA+25°C
12.923.6mA+85°C
16.830.9mA+125°C
DC45b11.713.8mA-40°C3.3V100 MIPS (N = 1, N2 = 1,N3 = 1, M = 50,Fvco = 400 MHz,FPLLO = 400 MHz)
11.917.6mA+25°C
12.124.4mA+85°C
16.030.1mA+125°C

Note 1: Base Idle current (I IDLE) is measured as follows:

• FIN = 8 MHz, FPFD = 8 MHz

- CLKO is configured as an I/O input pin in the Configuration Word

- All I/O pins are configured as output low

• MCLR = VDD, WDT and FSCM are disabled

- No peripheral modules are operating or being clocked (all defined PMDx bits are set)

- The NVMSIDL bit (NVMCON[12]) = 1 (i.e., Flash regulator is set to standby while the device is in Idle mode)

- JTAG is disabled

TABLE 24-12: DC CHARACTERISTICS: POWER-DOWN CURRENT (IPD)

DC CHARACTERISTICSMain Sleep + Secondary SleepStandard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ AT ≤ +125°C for Extended
Parameter No. Typ. Max. Units Conditions
Power-Down Current (IPD)(1)
DC60 3.2 4.8 mA -40°C3.3V
3.4 8.2mA +25°C
3.714.3mA +85°C
7.621.5mA+125°C

Note 1: IPD (Sleep) current is measured as follows:
- CPU core is off, oscillator is configured in EC mode and External Clock is active; OSCI is driven with external square wave from rail-to-rail (EC clock overshoot/undershoot < 250 mV required)
- CLKO is configured as an I/O input pin in the Configuration Word
• All I/O pins are configured as output low
• MCLR = VDD, WDT and FSCM are disabled
- All peripheral modules are disabled (PMDx bits are all set)
- The VREGS bit (RCON[8]) = 0 (i.e., core regulator is set to standby while the device is in Sleep mode)
- JTAG is disabled

TABLE 24-13: DC CHARACTERISTICS: WATCHDOG TIMER DELTA CURRENT ( IWD ) ^(1)

DC CHARACTERISTICSMain and SecondaryStandard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ TA ≤ +125°C for Extended
Parameter No.Typ.Max.UnitsConditions
DC61d2.9— μA-40°C3.3V
DC61a2.7— μA+25°C
DC61b3.9— μA+85°C
DC61c5.5— μA+125°C

Note 1: The IWD T current is the additional current consumed when the module is enabled. This current should be added to the base IPD current. All parameters are characterized but not tested during manufacturing.

TABLE 24-14: DC CHARACTERISTICS: PWM DELTA CURRENT (1,2,3)

DC CHARACTERISTICSMain and SecondaryStandard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ A ≤ +125°C for Extended
Parameter No. Typ.Max. Units Conditions
DC100 6 8 mA -40°C, 3.3VPWM Output 500 kHz,PWM Input (AFPLLO = 500 MHz),AVCO = 1000 MHz, PLLFBD = 125, APLLDIV = 2
66.7mA+25°C, 3.3V
6.38mA+125°C, 3.3V
DC1014.96mA -40°C, 3.3VPWM Output 500 kHz,PWM Input (AFPLLO = 400 MHz),AVCO = 400 MHz, PLLFBD = 50, APLLDIV = 1
4.95.5mA+25°C, 3.3V
4.95.6mA+125°C, 3.3V
DC1022.63.4mA -40°C, 3.3VPWM Output 500 kHz,PWM Input (AFPLLO = 200 MHz),AVCO = 400 MHz, PLLFBD = 50, APLLDIV = 2
2.73mA+25°C, 3.3V
2.73.2mA+125°C, 3.3V
DC1031.52.9mA -40°C, 3.3VPWM Output 500 kHz,PWM Input (AFPLLO = 100 MHz),AVCO = 400 MHz, PLLFBD = 50, APLLDIV = 4
1.52.1mA+25°C, 3.3V
1.52.2mA+125°C, 3.3V

Note 1: The APLL current is not included. The APLL current will be the same if more than one PWM or all eight PWMs are running.
2: Delta current is for the one instance of PWM running.
3: PWM is configured for Low-Resolution mode with HREN (PGxCONL[7]) = 0. All parameters are characterized but not tested during manufacturing.

TABLE 24-15: DC CHARACTERISTICS: APLL DELTA CURRENT

DC CHARACTERISTICSMain or Secondary (2)Standard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ TA ≤ +125°C for Extended
Parameter No.Typ.Max.UnitsConditions(1)
DC1109.4mA-40°C,3.3VAFPLLO @ 500 MHz,AVCO = 1000 MHz,PLLFBD = 125, APLLDIV = 2
7.29.4mA+25°C,3.3V
18mA+125°C,3.3V
DC1115.7mA-40°C,3.3VAFPLLO @ 400 MHz,AVCO = 400 MHz,PLLFBD = 50, APLLDIV = 1
55.8mA+25°C,3.3V
14mA+125°C,3.3V
DC1124.7mA-40°C,3.3VAFPLLO @ 200 MHz,AVCO = 400 MHz,PLLFBD = 50, APLLDIV = 2
2.94.7mA+25°C,3.3V
14mA+125°C,3.3V
DC1134mA-40°C,3.3VAFPLLO @ 100 MHz,AVCO = 400 MHz,PLLFBD = 50, APLLDIV = 4
2.34mA+25°C,3.3V
12mA+125°C,3.3V

Note 1: The APLL current will be the same if more than one PWM or DAC is run to the APLL clock. All parameters are characterized but not tested during manufacturing.

2: Current is for the APLL for the Main or Secondary, not the combined current.

TABLE 24-16: DC CHARACTERISTICS: ADC Δ CURRENT

DC CHARACTERISTICSMain (1)Secondary (2)Standard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ A≤ +125°C for Extended
Parameter No. Typ.Max.Typ. Max.Max. UnitsConditions
DC1206.514mA-40°C3.3V
5.56914mA+25°C3.3V
7.115mA+125°C3.3V

Note 1: Main shared core continuous conversion; TAD = 14.3 nS (3.5 Msps Conversion rate).
2: Secondary dedicated core continuous conversion on all 3 SAR cores; TAD = 14.3 nS (3.5 Msps conversion rate). All parameters are characterized but not tested during manufacturing.

TABLE 24-17: DC CHARACTERISTICS: COMPARATOR + DAC DELTA CURRENT

DC CHARACTERISTICSMain or SecondaryStandard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ TA ≤ +125°C for Extended
Parameter No.Typ.Max.UnitsConditions
DC1302.8mA-40°C, 3.3VAFPLLO @ 500 MHz(1)
1.82.6mA+25°C, 3.3VAFPLLO @ 500 MHz(1)
3mA+125°C, 3.3VAFPLLO @ 500 MHz(1)

Note 1: The APLL current is not included. All parameters are characterized but not tested during manufacturing.

TABLE 24-18: DC CHARACTERISTICS: PGA DELTA CURRENT (1)

DC CHARACTERISTICSSecondaryStandard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ TA ≤ +125°C for Extended
Parameter No.Typ.Max.UnitsConditions
DC1410.5mA-40°C, 3.3V
0.40.65mA+25°C, 3.3V
1.1mA+125°C, 3.3V

Note 1: All parameters are characterized but not tested during manufacturing.

TABLE 24-19: I/O PIN INPUT SPECIFICATIONS

Operating Conditions: 3.0V to 3.6V (unless otherwise stated)
Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ TA ≤ +125°C for Extended
Param No.SymbolCharacteristic Min. Typ.(1)Max. UnitsConditions
DI10 VIInput Low Voltage
Any I/O Pin and MCLRVss0.2 VDDV
I/O Pins with SDAx, SCLxVss0.3 VDDV
I/O Pins with SDAx, SCLxVss0.8V
I/O Pins with SDAx, SCLxVss0.8V
DI18I/O Pins with SDAx, SCLxVss0.3 VDDV
DI19I/O Pins with SDAx, SCLxVss0.8V
DI20 VIHInput High Voltage
I/O Pins Not 5V Tolerant(3)0.8 VDDVDDV
5V Tolerant I/O Pins and MCLR(3)0.8 VDD5.5V
5V Tolerant I/O Pins with SDAx, SCLx(3)0.8 VDD5.5V
5V Tolerant I/O Pins with SDAx, SCLx(3)2.15.5V
I/O Pins 5V Tolerant with SDAx, SCLx1.35VDDV
I/O Pins with SDAx, SCLx Not 5V Tolerant(3)0.8 VDDVDDV
I/O Pins with SDAx, SCLx Not 5V Tolerant(3)2.1VDDV
I/O Pins Not 5V Tolerant with SDAx, SCLx1.35VDDV
DI30ICNPUInput Change Notification Pull-up Current(2,4)175360545μAVDD = 3.6V, VPIN = VSS
DI31ICNPDInput Change Notification Pull-Down Current(4)65215360μAVDD = 3.6V, VPIN = VDD

Note 1: Data in "Typ." column are at 3.3V, +25°C unless otherwise stated.
2: Negative current is defined as current sourced by the pin.
3: See the "Pin Diagrams" section for the 5V tolerant I/O pins.
4: All parameters are characterized but not tested during manufacturing.

TABLE 24-20: I/O PIN INPUT SPECIFICATIONS

Operating Conditions: 3.0V to 3.6V (unless otherwise stated)
Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ TA ≤ +125°C for Extended
Param No.SymbolCharacteristic Min. Max. Units Conditions
DI50 IIL Input Leakage Current ^(1) I/O Pins 5V Tolerant ^(2) I/O Pins Not 5V Tolerant ^(2) OSCI-800-800-800-800+800+800+800+800nAnAnAnAVPIN = VSS or VDDnANaXT and HS modes

Note 1: Negative current is defined as current sourced by the pin.
2: See the "Pin Diagrams" section for the 5V tolerant I/O pins. All parameters are characterized but not tested during manufacturing.

TABLE 24-21: I/O PIN INPUT INJECTION CURRENT SPECIFICATIONS

Operating Conditions: 3.0V to 3.6V (unless otherwise stated)
Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ AT ≤ +125°C for Extended
Param No.SymbolCharacteristicMin.Max.UnitsConditions
DI60aIICLInput Low Injection Current0 -5^(1,4) mAAll pins
DI60bIICHInput High Injection Current0 +5^(2,3,4) mAAll pins, except 5V tolerant pins
DI60cΣIICTTotal Input Injection Current (sum of all I/O and control pins) ^(5) -20+20mAAbsolute instantaneous sum of all ± input injection currents from all I/O pins(| IICL | + | IICH | ) ≤ ΣIICT

Note 1: VIL Source < (Vss - 0.3).
2: VIH Source > (VDD + 0.3) for non-5V tolerant pins only.
3: 5V tolerant pins do not have an internal high-side diode to VDD, and therefore, cannot tolerate any "positive" input injection current.
4: Injection currents can affect the ADC results.
5: Any number and/or combination of I/O pins, not excluded under I ICL or IICH conditions, are permitted in the sum.

TABLE 24-22: I/O PIN OUTPUT SPECIFICATIONS

Operating Conditions: 3.0V to 3.6V (unless otherwise stated)
Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ TA ≤ +125°C for Extended
Param.SymbolCharacteristicMin.Typ.Max.UnitsConditions
DO10VOLOutput Low Voltage4x Sink Driver Pins0.42V V_DD = 3.6V, I_OL < 9 mA
Output Low Voltage8x Sink Driver Pins^(1) 0.4V V_DD = 3.6V, I_OL < 11 mA
DO20VOHOutput High Voltage4x Source Driver Pins2.4V V_DD = 3.6V, I_OH > -8 mA
Output High Voltage8x Source Driver Pins^(1) 2.4V V_DD = 3.6V, I_OH > -12 mA

Note 1: The 8x sink/source pins are RB1, RC8, RC9 and RD8 pins; all other ports are 4x sink drivers.

TABLE 24-23: ELECTRICAL CHARACTERISTICS: BOR

DC CHARACTERISTICSStandard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)(1)Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ A ≤ +125°C for Extended
Param No.SymbolCharacteristic Min.(2)Typ. Max. UnitsConditions
BO10VBORBOR Event on VDD Transition High-to-Low2.682.962.99VVDD (Note 2)

Note 1: Device is functional at VBORMIN < VDD < VDDMIN, but will have degraded performance. Device functionality is tested, but not characterized. Analog modules (ADC, PGAs and comparators) may have degraded performance.
2: Parameters are for design guidance only and are not tested in manufacturing.

TABLE 24-24: PROGRAM MEMORY

Operating Conditions: 3.0V to 3.6V (unless otherwise stated)
Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ A ≤ +125°C for Extended
Param No.SymbolCharacteristicMin.Max.UnitsConditions
Program Flash Memory
D130EPCell Endurance10,000E/W-40°C to +125°C
D131VPRVDD for Read3.03.6V
D132bVPEWVDD for Self-Timed Write3.03.6V
D134 TRETDCharacteristic Retention20YearProvided no other specifications are violated, -40°C to +125°C
D137aTPEPage Erase Time15.316.82msTPE = 128,454 FRC cycles (Note 1)
D138aTWWWord Write Time47.752.3μsTww = 400 FRC cycles (Note 1)
D139aTRWRow Write Time2.02.2msTRW = 16,782 FRC cycles (Note 1)

Note 1: Other conditions: FRC = 8 MHz, TUN[5:0] = 011111 (for Minimum), TUN[5:0] = 100000 (for Maximum). This parameter depends on the FRC accuracy (see Table 24-30) and the value of the FRC Oscillator Tuning register (see Register 6-4). For complete details on calculating the Minimum and Maximum time, see Section 3.3.1 “Flash Programming Operations”.

24.2 AC Characteristics and Timing Parameters

This section defines the dsPIC33CH128MP508 family AC characteristics and timing parameters.

TABLE 24-25: TEMPERATURE AND VOLTAGE SPECIFICATIONS – AC

AC CHARACTERISTICSStandard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)Operating temperature -40^ ≤ TA ≤ +85^ for Industrial -40^ ≤ TA ≤ +125^ for ExtendedOperating voltage VDD range as described inSection 24.1 “DC Characteristics”.

FIGURE 24-1: LOAD CONDITIONS FOR DEVICE TIMING SPECIFICATIONS

Load Condition 1 – for all pins except OSCO
Microchip dsPIC33CH64MP208 - AC Characteristics and Timing Parameters - 1

text_image Pin VDD/2 RL CL Vss

Load Condition 2 – for OSCO
Microchip dsPIC33CH64MP208 - AC Characteristics and Timing Parameters - 2

$$ R L = 4 6 4 \Omega $$

$$ \begin{array}{r l} \mathrm{CL} & = 5 0 \mathrm{pF} \text { for all pins except OSCO } \ & 1 5 \mathrm{pF} \text { for OSCO output } \end{array} $$

TABLE 24-26: CAPACITIVE LOADING REQUIREMENTS ON OUTPUT PINS

Param No.SymbolCharacteristic Min. Typ. Max.Units Conditions
DO50CoscoOSCO Pin15pFIn XT and HS modes, when External Clock is used to drive OSCI
DO56CIOAll I/O Pins and OSCO50pFEC mode
DO58CBSCLx, SDAx400pFIn I^2C mode

FIGURE 24-2: EXTERNAL CLOCK TIMING
Microchip dsPIC33CH64MP208 - AC Characteristics and Timing Parameters - 3

text_image Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 OSCI OS20 OS30 OS30 OS31 OS31 OS25 CLKO OS41 OS40

TABLE 24-27: EXTERNAL CLOCK TIMING REQUIREMENTS

AC CHARACTERISTICSStandard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ AT ≤ +125°C for Extended
Param No.SymCharacteristic Min. Typ.(1)Max. UnitsConditions
OS10 FinExternalCLKI Frequency(External Clocks allowed only in EC and ECP LL modes)DC64MHzEC
Oscillator Crystal Frequency3.510MHzXT
1032MHzHS
OS20 ToscTosc = 1/Fosc15.6DCns
OS25 TcyInstruction Cycle Time ^(2) 10DCns
OS30 TosL, TosHExternal Clock in (OSCI)High or Low Time0.45 x Tosc0.55 x ToscnsEC
OS31 TosR, TosFExternal Clock in (OSCI)Rise or Fall Time20nsEC
OS40 TckRCLKO Rise Time ^(3,4) 5.4ns
OS41 TckFCLKO Fall Time ^(3,4) 6.4ns
OS42 GMExternal OscillatorTransconductance ^(3) 2.74mA/VXTCFG[1:0] = 00, XTBST = 0
47mA/VXTCFG[1:0] = 00, XTBST = 1
4.57mA/VXTCFG[1:0] = 01, XTBST = 0
611.9mA/VXTCFG[1:0] = 01, XTBST = 1
5.99.7mA/VXTCFG[1:0] = 10, XTBST = 0
6.915.9mA/VXTCFG[1:0] = 10, XTBST = 1
6.712mA/VXTCFG[1:0] = 11, XTBST = 0
7.519mA/VXTCFG[1:0] = 11, XTBST = 1

Note 1: Data in "Typ." column are at 3.3V, +25°C unless otherwise stated.
2: Instruction cycle period (TCY) equals two 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 "Minimum" values with an External Clock applied to the OSCI pin. When an External Clock input is used, the "Maximum" cycle time limit is "DC" (no clock) for all devices.
3: Measurements are taken in EC mode. The CLKO signal is measured on the OSCO pin.
4: This parameter is characterized but not tested in manufacturing.

TABLE 24-28: PLL CLOCK TIMING SPECIFICATIONS

AC CHARACTERISTICSStandard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ AT ≤ +125°C for Extended
Param No.SymbolCharacteristic Min. Typ.(1)Max. UnitsConditions
OS50 FPLLLI PLL Voltage Controlled Oscillator(VCO) Input Frequency Range 8^(2) — 64MHzECPLL, XTPLL modes
OS51FvcoOn-Chip VCO System Frequency4001600MHz
OS52 TLOCKPLL Start-up Time (Lock Time)60μs

Note 1: Data in "Typ." column are at 3.3V, +25°C unless otherwise stated. Parameters are for design guidance only and are not tested.
2: Inclusive of FRC Tolerance Specification F20a.

TABLE 24-29: AUXILIARY PLL CLOCK TIMING SPECIFICATIONS

AC CHARACTERISTICSStandard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ TA ≤ +125°C for Extended
Param No.SymbolCharacteristicMin. Typ. (1)Max. UnitsConditions
OS50 FLLI APLL VVoltage Controlled Oscillator(VCO) Input Frequency Range 8^(2) — 64MHzECPLL, XTPLL modes
OS51 FvcoOn-Chip VCO System Frequency4001600MHz
OS52TLOCKAPLL Start-up Time (Lock Time)60μs

Note 1: Data in "Typ" column are at 3.3V , +25^ unless otherwise stated. Parameters are for design guidance only and are not tested in manufacturing.
2: Inclusive of FRC Tolerance Specification F20a.

TABLE 24-30: INTERNAL FRC ACCURACY

AC CHARACTERISTICSStandard Operating Conditions: 3.0V to 3.6V (unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ AT ≤ +125°C for Extended
Param No.Characteristic Min.Typ. Max.Units Conditions
Internal FRC Accuracy @ FRC Frequency = 8 MHz(1)
F20a FRC-2(2)+2%-40°C ≤ TA ≤ -5°C
-1.5+1.5%-5°C ≤ TA ≤ +85°C
F20bFRC-2+2%+85°C ≤ TA ≤ +125°C
F22BFRC-17+17%-40°C ≤ TA ≤ +125°C

Note 1: Frequency is calibrated at +25^ and 3.3V. TUNx bits can be used to compensate for temperature drift.
2: Due to the effect of aging, this value may drift by an additional -0.5% over the lifetime of the device.

TABLE 24-31: INTERNAL LPRC ACCURACY

AC CHARACTERISTICSStandard Operating Conditions: 3.0V to 3.6V (unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ TA ≤ +125°C for Extended
Param No.CharacteristicMin.Typ.Max.UnitsConditions
LPRC @ 32 kHz
F21aLPRC-30+30%-40°C ≤ TA ≤ -10°CVDD = 3.0-3.6V
-20+20%-10°C ≤ TA ≤ +85°CVDD = 3.0-3.6V
F21bLPRC-30+30%+85°C ≤ TA ≤ +125°CVDD = 3.0-3.6V

FIGURE 24-3: I/O TIMING CHARACTERISTICS
Microchip dsPIC33CH64MP208 - AC Characteristics and Timing Parameters - 4

text_image I/O Pin (Input) DI35 DI40 I/O Pin (Output) Old Value New Value DO31 DO32 Note: Refer to Figure 24-1 for load conditions.

TABLE 24-32: I/O TIMING REQUIREMENTS

AC CHARACTERISTICSStandard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ AT ≤ +125°C for Extended
Param No.Symbol CCharacteristic Min. Typ.(1)Max. Units Conditions
DO31 TioRPortOutput Rise Time (2)6.59.7ns
DO32 TIOF PortOutput Fall Time (2)3.24.2ns
DI35TINPINTx Pin High or Low Time (input)20ns
DI40TRBPCNx High or Low Time (input)2Tcy

Note 1: Data in "Typ." column are at 3.3V, +25°C unless otherwise stated.
2: This parameter is characterized but not tested in manufacturing.

FIGURE 24-4: BOR AND MAIN CLEAR RESET TIMING CHARACTERISTICS
Microchip dsPIC33CH64MP208 - AC Characteristics and Timing Parameters - 5

flowchart
graph TD
    A["MCLR"] --> B["TMCLR (SY20)"]
    B --> C["Reset Sequence"]
    D["BOR"] --> E["TBOR (SY30)"]
    E --> F["Various Delays (depending on configuration)"]
    G["CPU Starts Fetching Code"] --> H["End"]

TABLE 24-33: RESET, WATCHDOG TIMER, OSCILLATOR START-UP TIMER, TIMING REQUIREMENTS

AC CHARACTERISTICSStandard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ AT≤ +125°C for Extended
Param No.Symbol Ccharacteristic (1)Min. Typ. (2)Max.Units Cconditions
SY00TPUPower-up Period200μs
SY10TOSTOscillator Start-up Time1024 ToscTosc = OSCI period
SY13 TIOZI/O High-Impedance from MCLR Low or Watchdog Timer Reset1.5μs
SY20 TMCLRMCLR Pulse Width (low)2μs
SY30 TBORBOR Pulse Width (low)1μs
SY35 TFSCMFail-Safe Clock Monitor Delay500900μs-40°C to +85°C
SY36 TVREGVoltage Regulator Standby-to-Active mode Transition Time40μsClock fail to BFRC switch
SY37TOSCDFRCFRC Oscillator Start-up Delay15μsFrom POR event
SY38TOSCDLPRCLPRC Oscillator Start-up Delay50μsFrom Reset event

Note 1: These parameters are characterized but not tested in manufacturing.
2: Data in "Typ." column are at 3.3V, +25°C unless otherwise stated.

FIGURE 24-5: HIGH-SPEED PWMx MODULE FAULT TIMING CHARACTERISTICS
Microchip dsPIC33CH64MP208 - AC Characteristics and Timing Parameters - 6

text_image MP30 Fault Input (active-low) MP20 PWMx

FIGURE 24-6: HIGH-SPEED PWMx MODULE TIMING CHARACTERISTICS
Microchip dsPIC33CH64MP208 - AC Characteristics and Timing Parameters - 7

text_image MP11 MP10 PWMx

Note: Refer to Figure 24-1 for load conditions.

TABLE 24-34: HIGH-SPEED PWMx MODULE TIMING REQUIREMENTS

AC CHARACTERISTICSStandard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ AT ≤ +125°C for Extended
Param No.SymbolCharacteristic (1)Min. Typ. Max.Units Conditions
MP00FINPWM Input Frequency500MHz(Note 2)
MP10 TFPWMPWMx Output Fall TimensSee Parameter DO32
MP11TRPWMPWMx Output Rise TimensSee Parameter DO31
MP20TFDFault Input ↓ to PWMx I/O Change26 nsPCIInputs 19 through 22
MP30TFHFault Input Pulse Width8ns

Note 1: These parameters are characterized but not tested in manufacturing.
2: Input frequency of 500 MHz must be used for High-Resolution mode.

TABLE 24-35: SPIx MAXIMUM DATA/CLOCK RATE SUMMARY

SPI Main Transmit Only (Half-Duplex)SPI Main Transmit/Receive (Full-Duplex)SPI Secondary Transmit/Receive (Full-Duplex)CKE
Figure 24-7 Table 24-360
Figure 24-8 Table 24-361
Figure 24-9 Table 24-37— 0
Figure 24-10 Table 24-38— 1
Figure 24-12 Table 24-400
Figure 24-13 Table 24-391

FIGURE 24-7: SPIx HOST MODE (HALF-DUPLEX, TRANSMIT ONLY, CKE = 0) TIMING CHARACTERISTICS
Microchip dsPIC33CH64MP208 - AC Characteristics and Timing Parameters - 8

text_image SCKx (CKP = 0) SP10 SP20SP21 SCKx (CKP = 1) SP21SP20SP35 SDOx MSb LSbBit 14 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SP30, SP31 SP30', SP31

Note: Refer to Figure 24-1 for load conditions.

FIGURE 24-8: SPIx HOST MODE (HALF-DUPLEX, TRANSMIT ONLY, CKE = 1) TIMING CHARACTERISTICS
Microchip dsPIC33CH64MP208 - AC Characteristics and Timing Parameters - 9

text_image SCKx (CKP = 0) SP36 SP10 SP21 SP20 SCKx (CKP = 1) SP35 SP20 SP21 SDOx MSb Bit 14 LSb SP30, SP31

Note: Refer to Figure 24-1 for load conditions.

TABLE 24-36: SPIx HOST MODE (HALF-DUPLEX, TRANSMIT ONLY) TIMING REQUIREMENTS

AC CHARACTERISTICSStandard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ TA ≤ +125°C for Extended
Param No.Symbol CCharacteristic (1)Min. Typ. (2)Max. Units Conditions
SP10FscPMaximum SCKx Frequency15MHzUsing PPS pins
— —40MHzSPI2 dedicated pins
SP20TscFSCKx Output Fall TimensSee Parameter DO32(Note 3)
SP21TscRSCKx Output Rise TimensSee Parameter DO31(Note 3)
SP30TdoFSDOx Data Output Fall TimensSee Parameter DO32(Note 3)
SP31TdoRSDOx Data Output Rise TimensSee Parameter DO31(Note 3)
SP35 TscH2doV,TscL2doVSDOx Data Output Valid After SCKx Edge6 20ns
SP36TdiV2scH,TdiV2scLSDOx Data Output Setup to First SCKx Edge30— —nsUsingPPS pins
3— —nsSPI2 dedicated pins

Note 1: These parameters are characterized but not tested in manufacturing.
2: Data in "Typ." column are at 3.3V, +25°C unless otherwise stated.
3: Assumes 50 pF load on all SPIx pins.

FIGURE 24-9: SPIx HOST MODE (FULL-DUPLEX, CKE = 1, CKP = x, SMP = 1) TIMING CHARACTERISTICS
Microchip dsPIC33CH64MP208 - AC Characteristics and Timing Parameters - 10

flowchart
graph TD
    A["SCKx (CKP = 0)"] --> B["SP36"]
    B --> C["SP10"]
    C --> D["SP21"]
    D --> E["SP20"]
    F["SCKx (CKP = 1)"] --> G["SP35"]
    G --> H["SP20"]
    H --> I["SP21"]
    J["SDOx"] --> K["MSb"]
    K --> L["Bit 14 - - - - 1"]
    L --> M["LSb"]
    N["SDIx"] --> O["MSb In"]
    O --> P["Bit 14 - - - - 1"]
    P --> Q["LSb In"]
    R["Note: Refer to Figure 24-1 for load conditions."]

TABLE 24-37: SPIx HOST MODE (FULL-DUPLEX, CKE = 1, CKP = x, SMP = 1) TIMING REQUIREMENTS

AC CHARACTERISTICSStandard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ AT ≤ +125°C for Extended
Param No.Symbol Ccharacteristic (1)Min. Typ. (2)Max. Units Conditions
SP10FscPMaximum SCKx Frequency15MHzUsing PPS pins
— 40MHzSPI2 dedicated pins
SP20TscFSCKx Output Fall TimensSee Parameter DO32 (Note 3)
SP21TscRSCKx Output Rise TimensSee Parameter DO31 (Note 3)
SP30 TdoFSDOx Data Output Fall TimensSee Parameter DO32 (Note 3)
SP31 TdoRSDOx Data Output Rise TimensSee Parameter DO31 (Note 3)
SP35 TscH2doV, TscL2doVSDOx Data Output Valid After SCKx Edge620ns
SP36 TdoV2sc, TdoV2scLSDOx Data Output Setup to First SCKx Edge30nsUsing PPS pins
3nsSPI2 dedicated pins
SP40 TdiV2scH, TdiV2scLSetup Time of SDlx Data Input to SCKx Edge30nsUsing PPS pins
20nsSPI2 dedicated pins
SP41 TscH2diL, TscL2diLHold Time of SDlx Data Input to SCKx Edge30nsUsing PPS pins
15nsSPI2 dedicated pins

Note 1: These parameters are characterized but not tested in manufacturing.
2: Data in "Typ." column are at 3.3V, +25°C unless otherwise stated.
3: Assumes 50 pF load on all SPIx pins.

FIGURE 24-10: SPIx HOST MODE (FULL-DUPLEX, CKE = 0, CKP = x, SMP = 1) TIMING CHARACTERISTICS
Microchip dsPIC33CH64MP208 - AC Characteristics and Timing Parameters - 11

flowchart
graph TD
    A["SCKx (CKP = 0)"] --> B["SP10"]
    B --> C["SP21"]
    C --> D["SP20"]
    E["SCKx (CKP = 1)"] --> F["SP35 SP36"]
    F --> G["SP20"]
    G --> H["SP21"]
    I["SDOx"] --> J["MSb"]
    J --> K["Bit 14 - 1"]
    K --> L["LSb"]
    M["SDlx"] --> N["MSb In"]
    N --> O["Bit 14 - 1"]
    O --> P["LSb In"]
    Q["Note: Refer to Figure 24-1 for load conditions."]

TABLE 24-38: SPIx HOST MODE (FULL-DUPLEX, CKE = 0, CKP = x, SMP = 1) TIMING REQUIREMENTS

AC CHARACTERISTICSStandard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ AT ≤ +125°C for Extended
Param No.Symbol CCharacteristic (1)Min. Typ. (2)Max. Units Conditions
SP10FscPMaximum SCKx Frequency15MHzUsing PPS pins
40MHzSPI2 dedicated pins
SP20TscFSCKx Output Fall TimensSee Parameter DO32 (Note 3)
SP21TscRSCKx Output Rise TimensSee Parameter DO31 (Note 3)
SP30TdoFSDOx Data Output Fall TimensSee Parameter DO32 (Note 3)
SP31TdoRSDOx Data Output Rise TimensSee Parameter DO31 (Note 3)
SP35 TscH2doV, TscL2doVSDOx Data Output Valid After SCKx Edge620ns
SP36 TdoV2scH, TdoV2scLSDOx Data Output Setup to First SCKx Edge30ns Using PPS pins
20ns SPI2 dedicated pins
SP40 TdV2scH, TdiV2scLSetup Time of SDIx Data Input to SCKx Edge30ns Using PPS pins
10ns SPI2 dedicated pins
SP41 TscH2diL, TscL2diLHold Time of SDIx Data Input to SCKx Edge30ns Using PPS pins
15ns SPI2 dedicated pins

Note 1: These parameters are characterized but not tested in manufacturing.
2: Data in "Typ." column are at 3.3V, +25°C unless otherwise stated.
3: Assumes 50 pF load on all SPIx pins.

FIGURE 24-11: SPIx CLIENT MODE (FULL-DUPLEX, CKE = 0, CKP = x, SMP = 0) TIMING CHARACTERISTICS
Microchip dsPIC33CH64MP208 - AC Characteristics and Timing Parameters - 12

flowchart
graph TD
    subgraph SSx
        A["SP50"] --> B["SCKx (CKP = 0)"]
        B --> C["SP10"]
        C --> D["SCKx (CKP = 1)"]
        D --> E["SP35 SP36"]
        E --> F["SDOx"]
        F --> G["MSb LSbBit14"]
        G --> H["SP30, SP31 SP51"]
        H --> I["SDIx"]
        I --> J["MSb In"]
        J --> K["Bit 14"]
        K --> L["SP40"]
        L --> M["SP41"]
        M --> N["SP52"]
        N --> O["SP72SP73"]
        O --> P["SP73SP72"]
    end

Note: Refer to Figure 24-1 for load conditions.

TABLE 24-39: SPIx CLIENT MODE (FULL-DUPLEX, CKE = 0, CKP = x, SMP = 0) TIMING REQUIREMENTS

AC CHARACTERISTICSStandard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ AT≤ +125°C for Extended
Param No.Symbol CCharacteristic (1)Min. Typ.(2)Max. Units Conditions
SP10FscPMaximum SCKx Input Frequency15MHzUsing PPS pins
40MHzSPI2 dedicated pins
SP72TscFSCKx Input Fall TimensSee Parameter DO32(Note 3)
SP73TscRSCKx Input Rise TimensSee Parameter DO31(Note 3)
SP30TdoFSDOx Data Output Fall TimensSee Parameter DO32(Note 3)
SP31TdoRSDOx Data Output Rise TimensSee Parameter DO31(Note 3)
SP35 TscH2doV,TscL2doVSDOx Data Output Valid After SCKx Edge620ns
SP36 TdoV2scH,TdoV2scLSDOx Data Output Setup to First SCKx Edge30nsUsing PPS pins
20nsSPI2 dedicated pins
SP40 TdiV2scH,TdiV2scLSetup Time of SDIx Data Input to SCKx Edge30nsUsing PPS pins
10nsSPI2 dedicated pins
SP41 TscH2diL,TscL2diLHold Time of SDIx Data Input to SCKx Edge30nsUsing PPS pins
15nsSPI2 dedicated pins
SP50 TssL2scH,TssL2scL to SCKx ↑ or SCKx ↓ Input120ns
SP51 TssH2doZ SSx ↑ to SDOx Output High-Impedance850ns(Note 3)
SP52 TscH2ssH,TscL2ssH After SCKx Edge1.5 TCY + 40ns(Note 3)

Note 1: These parameters are characterized but not tested in manufacturing.
2: Data in "Typ." column are at 3.3V, +25°C unless otherwise stated.
3: Assumes 50 pF load on all SPIx pins.

FIGURE 24-12: SPIx CLIENT MODE (FULL-DUPLEX, CKE = 1, CKP = x, SMP = 0) TIMING CHARACTERISTICS
Microchip dsPIC33CH64MP208 - AC Characteristics and Timing Parameters - 13

flowchart
graph TD
    subgraph SSx
        A["SP60"] --> B["SCKx (CKP = 0)"]
        B --> C["SP50"]
        C --> D["SCKx (CKP = 1)"]
        D --> E["SP10"]
        E --> F["SCKx (CKP = 0)"]
        F --> G["SP52"]
        G --> H["SP72SP73"]
        H --> I["SP36"]
        I --> J["SCKx (CKP = 1)"]
        J --> K["SP35"]
        K --> L["SCKx (CKP = 1)"]
        L --> M["SP73SP72"]
    end
    subgraph SDOx
        N["MSb Bit 14"] --> O["1 LSb"]
        P["SP30, SP31"] --> Q["1 LSb In"]
        R["SP51"] --> S["1 LSb In"]
        T["SDlx"] --> U["MSb In"]
        V["SP40"] --> W["Bit 14"]
        X["SP41"] --> Y["Bit 14"]
    end
    style SSx fill:#f9f,stroke:#333
    style SCKx fill:#ccf,stroke:#333
    style SDOx fill:#cfc,stroke:#333
    style SDlx fill:#fcc,stroke:#333

Note: Refer to Figure 24-1 for load conditions.

TABLE 24-40: SPIx CLIENT MODE (FULL-DUPLEX, CKE = 1, CKP = x, SMP = 0) TIMING REQUIREMENTS

AC CHARACTERISTICSStandard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ TA ≤ +125°C for Extended
Param No.Symbol CCharacteristic (1)Min. Typ.(2)Max. Units Conditions
SP10 FscP MaximumSCKx Input Frequency— —15MHz Using PPS pins
— —40MHz SPI2 dedicated pins
SP72TscFSCKx Input Fall TimensSee Parameter DO32 (Note 3)
SP73TscRSCKx Input Rise TimensSee Parameter DO31 (Note 3)
SP30TdoFSDOx Data Output Fall TimensSee Parameter DO32 (Note 3)
SP31TdoRSDOx Data Output Rise TimensSee Parameter DO31 (Note 3)
SP35 TscH2doV, TscL2doVSDOx Data Output Valid After SCKx Edge620 ns
SP36 TdoV2scH, TdoV2scLSDOx Data Output Setup to First SCKx Edge30nsUsing PPS pins
20nsSPI2 dedicated pins
SP40 TdiV2scH, TdiV2scLSetup Time of SDIx Data Input to SCKx Edge30nsUsing PPS pins
10nsSPI2 dedicated pins
SP41 TscH2diL, TscL2diLHold Time of SDIx Data Input to SCKx Edge30nsUsing PPS pins
15nsSPI2 dedicated pins
SP50TssL2scH, TssL2scLSSx ↓ to SCKx ↑ or SCKx ↓ Input120ns
SP51 TssH2doZ SSx ↑ to SDOx Output High-Impedance850ns(Note 3)
SP52TscH2ssH, TscL2ssHSSx ↑ After SCKx Edge1.5 TCY + 40ns(Note 3)
SP60TssL2doVSDOx Data Output Valid After SSx Edge— —50ns

Note 1: These parameters are characterized but not tested in manufacturing.
2: Data in "Typ." column are at 3.3V, +25°C unless otherwise stated.
3: Assumes 50 pF load on all SPIx pins.

FIGURE 24-13: I2Cx BUS START/STOP BITS TIMING CHARACTERISTICS (HOST MODE)
Microchip dsPIC33CH64MP208 - AC Characteristics and Timing Parameters - 14

text_image SCLx IM30 IM31 SDAx Start Condition Stop Condition IM33 IM34 Note: Refer to Figure 24-1 for load conditions.

FIGURE 24-14: I2Cx BUS DATA TIMING CHARACTERISTICS (HOST MODE)
Microchip dsPIC33CH64MP208 - AC Characteristics and Timing Parameters - 15

text_image SCLx IM20 IM11 IM10 IM26 IM21 IM11 IM10 IM25 IM33 SDAx In IM40 IM40 IM45 SDAx Out Note: Refer to Figure 24-1 for load conditions.

TABLE 24-41: I2Cx BUS DATA TIMING REQUIREMENTS (HOST MODE)

AC CHARACTERISTICSStandard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ TA ≤ +125°C for Extended
Param No.SymbolCharacteristic (4)Min.(1)Max. UnitsConditions
IM10 TLO:SCLClock Low Time100 kHz modeTCY (BRG + 1)μs
400 kHz modeTCY (BRG + 1)μs
1MHzmode^( 2) TCY (BRG + 1) —μs
IM11THI:SCLClock High Time100 kHz modeTCY (BRG + 1)μs
400 kHz modeTCY (BRG + 1)μs
1MHzmode^( 2) TCY (BRG + 1) —μs
100 kHz mode300nsCB is specified to be from 10 to 400 pF
400 kHz mode20 x (VDD/5.5V)300ns
1MHzmode^( 2) 120ns
IM20 TF:SCLSDAx and SCLx Fall Time100 kHz mode1000nsCB is specified to be from 10 to 400 pF
400 kHz mode20 + 0.1 CB300ns
1MHzmode^( 2) 120ns
IM21 TR:SCLSDAx and SCLx Rise Time100 kHz mode250ns
400 kHz mode100ns
1MHzmode^( 2) 50ns
IM25 TSU:DATData Input Setup Time100 kHz mode0μs
400 kHz mode00.9μs
1MHzmode^( 2) 00.3μs
IM26 THD:DATData Input Hold Time100 kHz modeTCY (BRG + 1)μsOnly relevant for Repeated Start condition
400 kHz modeTCY (BRG + 1)μs
1MHzmode^( 2) TCY (BRG + 1) —μs
IM30 TSU:STAStart Condition Setup Time100 kHz modeTCY (BRG + 1)μsAfter this period, the first clock pulse is generated
400 kHz modeTCY (BRG + 1)μs
1MHzmode^( 2) TCY (BRG + 1) —μs
IM31 THD:STAStart Condition Hold Time100 kHz modeTCY (BRG + 1)μs
400 kHz modeTCY (BRG + 1)μs
1MHzmode^( 2) TCY (BRG + 1) —μs
IM33 TSU:STOStop Condition Setup Time100 kHz modeTCY (BRG + 1)μs
400 kHz modeTCY (BRG + 1)μs
1MHzmode^( 2) TCY (BRG + 1) —μs
100 kHz modeTCY (BRG + 1)μs
IM34 THD:STOStop Condition Hold Time400 kHz modeTCY (BRG + 1)μs
1MHzmode^( 2) TCY (BRG + 1) —μs
IM40 TAA:SCLOutput Valid from Clock100 kHz mode3450ns
400 kHz mode900ns
1MHzmode^( 2) 450ns
IM45 TBF:SDABus Free Time100 kHz mode4.7μsTime the bus must be free before a new transmission can start
400 kHz mode1.3μs
1MHzmode^( 2) 0.5μs
IM50 CBBus Capacitive Loading400pF
IM51 TPGDPulse Gobbler Delay65390ns(Note 3)

Note 1: BRG is the value of the I ^2 C Baud Rate Generator.
2: Maximum Pin Capacitance = 10 pF for all I2Cx pins (for 1 MHz mode only).
3: Typical value for this parameter is 130 ns.
4: These parameters are characterized but not tested in manufacturing.

FIGURE 24-15: I2Cx BUS START/STOP BITS TIMING CHARACTERISTICS (CLIENT MODE)
Microchip dsPIC33CH64MP208 - AC Characteristics and Timing Parameters - 16

text_image SCLx IS30 IS31 IS34 SDAx Start Condition Stop Condition

FIGURE 24-16: I2Cx BUS DATA TIMING CHARACTERISTICS (CLIENT MODE)
Microchip dsPIC33CH64MP208 - AC Characteristics and Timing Parameters - 17

text_image SCLx IS20 IS11 IS10 IS26 IS21 IS30 IS31 IS25 IS33 SDAx In IS40 IS40 IS45 SDAx Out

TABLE 24-42: I2Cx BUS DATA TIMING REQUIREMENTS (CLIENT MODE)

AC CHARACTERISTICSStandard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ TA ≤ +125°C for Extended
Param No.SymbolCharacteristic (3)Min. Max.Units Conditions
IS10 TLO:SCLClock Low Time100 kHz mode4.7μs
400 kHz mode1.3μs
1MHzmode^(1) 0.5μs
IS11THI:SCLClock High Time100 kHz mode4.0μsDevice must operate at a minimum of 1.5 MHz
400 kHz mode0.6μsDevice must operate at a minimum of 10 MHz
1MHzmode^(1) 0.28μs
IS20TF:SCLSDAx and SCLx Fall Time100 kHz mode300nsCB is specified to be from 10 to 400 pF
400 kHz mode 20 x (V DD/5.5V)300ns
1MHzmode^(1) 20 x (VDD/5.5V)120ns
IS21TR:SCLSDAx and SCLx Rise Time100 kHz mode20 + 0.1 CB1000nsCB is specified to be from 10 to 400 pF
400 kHz mode300ns
1MHzmode^(1) 120ns
IS25TSU:DATData Input Setup Time100 kHz mode250ns
400 kHz mode100ns
1MHzmode^(1) 50ns
IS26THD:DATData Input Hold Time100 kHz mode0μs
400 kHz mode00.9μs
1MHzmode^(1) 00.3μs
IS30TSU:STAStart Condition Setup Time100 kHz mode4.7μsOnly relevant for Repeated Start condition
400 kHz mode0.6μs
1MHzmode^(1) 0.26μs
IS31THD:STAStart Condition Hold Time100 kHz mode4.0μsAfter this period, the first clock pulse is generated
400 kHz mode0.6μs
1MHzmode^(1) 0.26μs
IS33TSU:STOStop Condition Setup Time100 kHz mode4μs
400 kHz mode0.6μs
1MHzmode^(1) 0.26μs
IS34THD:STOStop Condition Hold Time100 kHz mode>0μs
400 kHz mode>0μs
1MHzmode^(1) >0μs
IS40TAA:SCLOutput Valid from Clock100 kHz mode03540ns
400 kHz mode0900ns
1MHzmode^(1) 0400ns
IS45TBF:SDABus Free Time100 kHz mode4.7μsTime the bus must be free before a new transmission can start
400 kHz mode1.3μs
1MHzmode^(1) 0.5μs
IS50 CBBus Capacitive Loading400pF
IS51TPGDPulse Gobbler Delay65390ns(Note 2)

Note 1: Maximum Pin Capacitance = 10 pF for all I2Cx pins (for 1 MHz mode only).
2: Typical value for this parameter is 130 ns.
3: These parameters are characterized but not tested in manufacturing.

FIGURE 24-17: UARTx MODULE I/O TIMING CHARACTERISTICS
Microchip dsPIC33CH64MP208 - AC Characteristics and Timing Parameters - 18

flowchart
graph LR
    A["UxRX"] --> B["MSb In"]
    C["UxTX"] --> D["MSb In"]
    B --> E["Bit 6-1"]
    D --> E
    E --> F["LSb In"]
    style A fill:#f9f,stroke:#333
    style C fill:#f9f,stroke:#333
    style B fill:#ccf,stroke:#333
    style D fill:#ccf,stroke:#333
    style E fill:#cfc,stroke:#333
    style F fill:#fcc,stroke:#333

TABLE 24-43: UARTx MODULE I/O TIMING REQUIREMENTS

AC CHARACTERISTICSStandard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +125°C
Param No.Symbol CCharacteristic (1)Min. Typ. (2)Max. Units Conditions
UA10TUABAUDUARTx Baud Time66.67ns
UA11FBAUDUARTx Baud Frequency40Mbps
UA20 TCWFStart Bit Pulse Width to Trigger UARTx Wake-up500ns

Note 1: These parameters are characterized but not tested in manufacturing.
2: Data in "Typ." column are at 3.3V, +25°C unless otherwise stated. Parameters are for design guidance only and are not tested.

TABLE 24-44: ADC MODULE SPECIFICATIONS

Operating Conditions: 3.0V to 3.6V (unless otherwise stated) ^(4) Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ TA ≤ +125°C for Extended
Param No.Symbol CCharacteristics Min. TypicalMax. Units Conditions
Analog Input
AD12 VINH-VINLFull-Scale Input SpanAVssAVDDV
AD14 VINAbsolute Input VoltageAVss – 0.3AVDD + 0.3V
AD60 CHOLDCapacitance5pFDedicated core (Note 1)
AD61 CHOLDCapacitance18pFShared core (Note 1)
AD62 RICInput Resistance5001000Ω(Note 1)
AD66 VBGInternal Voltage Reference Source1.141.21.26V
Clock Requirements
AD67 FSRCADC Module Input Frequency560MHzClock frequency selected by the CLKSELx bits
FCORESRCADC Control Clock Frequency250MHzClock frequency after the first divider controlled by the CLKDIVx bits
FADCOREADC SAR Core Clock Frequency70MHzSAR core frequency after the second divider controlled by the ADCSx or SHRADCSx bits
ADC Accuracy
AD20 NrResolution12 data bitsbits
AD21aINL_1DDedicated Core Integral Nonlinearity (1 Active Core)-3.5-1.5/+1.5+3.5LSb3.5 Msps ^(5) ,TADC = 4 nS (250 MHz),TCORESRC = 8 nS (125 MHz),TADCORE = 16 nS (62.5 MHz),Sampling Time = 4 TADCORE,VDD = 3.3V, AVDD = 3.3V
AD22aDNL_1DDifferential Nonlinearity>-11.5+3.5LSb
AD23aGERR_1DGain Error>-12< 12LSb
AD24aOERR_1DOffset Error>7.5< 7.5LSb
AD21bINL_1SShared Core Integral Nonlinearity (1 Active Core)-3.5-1.5/+1.5+3.5LSb2.7 Msps ^(6) ,TADC = 4 nS (250 MHz),TCORESRC = 8 nS (125 MHz),TADCORE = 16 nS (62.5 MHz),Sampling Time = 10 TADCORE,VDD = 3.3V, AVDD = 3.3V
AD22bDNL_1SShared Core Differential Nonlinearity (1 Active Core)-11.5+3.5 LSb
AD23bGERR_1SShared Core Gain Error (1 Active Core)+4LSb
AD24bOERR_1SShared Core Offset Error (1 Active Core)-4LSb
AD21cINL_3DDedicated Core Integral Nonlinearity (3 Active Cores)-5/+5LSb3.5 Msps ^(5) ,TADC = 4 nS (250 MHz),TCORESRC = 8 nS (125 MHz),TADCORE = 16 nS (62.5 MHz),Sampling Time = 4 TADCORE,VDD = 3.3V, AVDD = 3.3V, all core conversions are started simultaneously
AD22cDNL_3DDedicated Core Differential Nonlinearity (3 Active Cores)-1/+2LSb
AD23cGERR_3DDedicated Core Gain Error (3 Active Cores)+5LSb
AD24cOERR_3DDedicated Core Offset Error (3 Active Cores)-5LSb

Note
1: These parameters are not characterized or tested in manufacturing.
2: These parameters are characterized but not tested in manufacturing.
3: Characterized with a 1 kHz sine wave.
4: The ADC module is functional at VBORMIN < VDD < VDDMIN, but with degraded performance. Unless otherwise stated, module functionality is ensured, but not characterized.
5: For the dedicated core, the throughput includes 4 TADCORE sampling time and 13 TADCORE conversion time.
6: For the shared core, the throughput includes 10 TADCORE sampling time and 13 TADCORE conversion time.

TABLE 24-44: ADC MODULE SPECIFICATIONS (CONTINUED)

Operating Conditions: 3.0V to 3.6V (unless otherwise stated)(4)
Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ TA ≤ +125°C for Extended
Param No.AD21d INL_3S SharedSymbolCharacteristicsMin.-5/+5Typical— LSb 2.7Max.MspsUnitsConditions(6),TADC = 4 nS (250 MHz),TCORESRC = 8 nS (125 MHz),TADCORE ≈16 nS (62.5 MHz), Sampling Time = 10 TADCORE,VDD = 3.3V, AVDD = 3.3V, all core conversions are started simultaneously
AD22d DNL_3S SharedCore Integral Nonlinearity (3 Active Cores)
AD23d GERR_3S SharedCore Differential Nonlinearity (3 Active Cores)-1/
AD24d OERR_3S SharedCore Gain Error (3 Active Cores)+5LSb
AD25cMonotonicity+5LSb
Dynamic Performance
AD31b SINAD Signal-to-Noise and Distortion5670dBNote 2, 3
AD34bENOBEffective Number of Bits9.810.211.4bitsNote 2, 3
AD50TADADC Clock Period14.3ns
AD51FTPThroughput Rate3.5MspsDedicated Cores 0 and 1(Note 5)
2.7MspsShared core (Note 6)
Die Temperature Diode Specification
TD01TCOEFF1.5mV/C(Note 1)

Note
1: These parameters are not characterized or tested in manufacturing.
2: These parameters are characterized but not tested in manufacturing.
3: Characterized with a 1 kHz sine wave.
4: The ADC module is functional at VBORMIN < VDD < VDDMIN, but with degraded performance. Unless otherwise stated, module functionality is ensured, but not characterized.
5: For the dedicated core, the throughput includes 4 TADCORE sampling time and 13 TADCORE conversion time.
6: For the shared core, the throughput includes 10 TADCORE sampling time and 13 TADCORE conversion time.

TABLE 24-45: HIGH-SPEED ANALOG COMPARATOR MODULE SPECIFICATIONS

Operating Conditions: 3.0V to 3.6V (unless otherwise stated) ^(2) Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ TA ≤ +125°C for Extended
Param No.SymbolCharacteristic Min. Typ.Max. UnitsComments
CM09 FINInput Frequency400500550MHz
CM10 VIOFFInput Offset Voltage-20+20mV
CM11VICMInput Common-Mode Voltage Range ^(1) AVssAVDDV
CM13 CMRRCommon-Mode Rejection Ratio60dB
CM14 TRESPLarge Signal Response15nsV+ input step of 100 mV while V- input is held at AVDD/2
CM15VHYSTInput Hysteresis153045mVDepends on HYSSEL[1:0]

Note 1: These parameters are for design guidance only and are not tested in manufacturing.
2: The comparator module is functional at VBORMIN < VDD < VDDMIN, but with degraded performance. Unless otherwise stated, module functionality is tested, but not characterized.

TABLE 24-46: DACx MODULE SPECIFICATIONS

Operating Conditions: 3.0V to 3.6V (unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ TA ≤ +125°C for Extended
Param No.SymbolCharacteristic Min. Typ.(1)Max. UnitsComments
DA02 CVRES Ressolution 12 bits
DA03INLIntegral Nonlinearity Error-380LSB
DA04DNLDifferential Nonlinearity Error-55LSB
DA05EOFFOffset Error-3.521.5LSBInternal node at comparator input
DA06EGGain Error041%Internal node at comparator input
DA07 TSETSettling Time750nsOutput with 2% of desired output voltage with a 5-95% or 95-5% step
DA08VOUTVoltage Output Range0.1653.135V V_DD = 3.3V

Note 1: Parameters are for design guidance only and are not tested in manufacturing.

DACx OUTPUT (DACOUT1 PIN) SPECIFICATIONS

Operating Conditions: 3.0V to 3.6V (unless otherwise stated) ^(1)
Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ TA ≤ +125°C for Extended
Param No.SymbolCharacteristicMin.Typ.Max.UnitsComments
DA11RLOADResistive Output Load Impedance10KOhm
DA11aCLOADOutput Load Capacitance30pFIncluding output pin capacitance
DA12IOUTOutput Current Drive Strength3mASink and source
DA13INLIntegral Nonlinearity Error-500LSBIncludes INL of DACx module (DA03)
DA14DNLDifferential Nonlinearity Error-55LSBIncludes DNL of DACx module (DA04)
DA30EOFFOffset Error-1500LSBIncludes offset error of DACx module (DA05)
DA31EGGain Error-1460LSBIncludes gain error of DACx module (DA06)

Note 1: The DACx module is functional at VBORMIN < VDD < VDDMIN, but with degraded performance. Unless otherwise stated, module functionality is tested, but not characterized.

FIGURE 24-18: QEA/QEB INPUT CHARACTERISTICS
Microchip dsPIC33CH64MP208 - AC Characteristics and Timing Parameters - 19

AC CHARACTERISTICSStandard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ TA ≤ +125°C for Extended
Param.SymbolCharacteristic (1)Typ.(2)Max. Units Conditions
TQ30 TquLQuadrature Input Low Time6 TCYns
TQ31 TquHQuadrature Input High Time6 TCYns
TQ35TquINQuadrature Input Period12 TCYns
TQ36 TquPQuadrature Phase Period3 TCYns
TQ40 TquFLFilter Time to Recognize Low with Digital Filter3 * N * TCYnsN = 1, 2, 4, 16, 32, 64,128 and 256 (Note 3)
TQ41TquFHFilter Time to Recognize High with Digital Filter3 * N * TCYnsN = 1, 2, 4, 16, 32, 64,128 and 256 (Note 3)

Note 1: These parameters are characterized but not tested in manufacturing.
2: Data in "Typ" column is at 3.3V, +25°C unless otherwise stated. Parameters are for design guidance only and are not tested.
3: N = Index Channel Digital Filter Clock Divide Select bits. Refer to Section 15. "Quadrature Encoder Interface (QEI)" (DS70601). Please see the Microchip web site for the latest family reference manual sections.

FIGURE 24-19: QEI MODULE INDEX PULSE TIMING CHARACTERISTICS
Microchip dsPIC33CH64MP208 - AC Characteristics and Timing Parameters - 20

text_image QEA (input) QEB (input) Ungated Index TQ51 TQ50 Index Internal TQ55 Position Counter Reset

TABLE 24-48: QEI INDEX PULSE TIMING REQUIREMENTS

AC CHARACTERISTICSStandard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ TA ≤ +125°C for Extended
Param.SymbolCharacteristic (1)Min. Max.Units Conditions
TQ50TqILFilter Time to Recognize Low with Digital Filter3 * N * TCYnsN = 1, 2, 4, 16, 32, 64, 128 and 256 (Note 2)
TQ51TqiHFilter Time to Recognize High with Digital Filter3 * N * TCYnsN = 1, 2, 4, 16, 32, 64, 128 and 256 (Note 2)
TQ55TqidxrIndex Pulse Recognized to Position Counter Reset (ungated index)3 TCYns

Note 1: These parameters are characterized but not tested in manufacturing.
2: Alignment of index pulses to QEA and QEB is shown for position counter Reset timing only. Shown for forward direction only (QEA leads QEB). Same timing applies for reverse direction (QEA lags QEB) but index pulse recognition occurs on the falling edge.

FIGURE 24-20: QEI MODULE EXTERNAL CLOCK TIMING CHARACTERISTICS
Microchip dsPIC33CH64MP208 - AC Characteristics and Timing Parameters - 21

AC CHARACTERISTICSStandard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ AT ≤ +125°C for Extended
Param.SymbolCharacteristic(1)Min. Typ. Max.UnitsConditions
TQ10 TtQHTQCK High TimeSynchronous, with Prescaler[Greater of (12.5 or 0.5 Tcy)/N] + 25ns Must also meet Parameter TQ15
TQ11TtQLTQCK Low TimeSynchronous, with Prescaler[Greater of (12.5 or 0.5 Tcy)/N] + 25ns Must also meet Parameter TQ15
TQ15TtQPTQCP Input PeriodSynchronous, with Prescaler[Greater of (25 or Tcy)/N] + 50ns
TQ20TCKEXTMRLDelay from External TxCK Clock Edge to Timer Increment1Tcy

Note 1: These parameters are characterized but not tested in manufacturing.

TABLE 24-50: PGAx MODULE SPECIFICATIONS

AC/DC CHARACTERISTICSStandard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)(1)Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ TA ≤ +125°C for Extended
Param No.SymbolCharacteristic Min. Typ. Max. Units Comments
PA01 VINInput Voltage RangeAVss – 0.3AVDD + 0.3V
PA02 VCMCommon-Mode Input Voltage RangeAVssAVDD – 1.6V
PA03 VosInput Offset Voltage-9+9mVGain = 32x
PA04 VoSInput Offset Voltage Drift with Temperature±15μV/°C
PA05 RIN+ InputImpedance of Positive Input>1M || 7 pFΩ|| pF
PA06 RIN- Input Impedance of Negative Input10K || 7 pFΩ|| pF
PA07 GERRGain Error-3±0.5+3%Gain = 4x, 8x,16x, 32x
PA08LERRGain Nonlinearity Error0.5%% of full scale, Gain = 16x
PA09IDDCurrent Consumption2.0mAModule is enabled with a 2-volt P-P output voltage swing
PA10aBWSmall Signal Bandwidth (-3 dB)G = 4x10MHz
PA10bG = 8x5MHz
PA10cG = 16x2.5MHz
PA10dG = 32x1.25MHz
PA11 OST Output Settling Time to 1% of Final Value0.4μsGain = 16x, 100 mV input step change
PA12SROutput Slew Rate40V/μsGain = 16x
PA13 TGSELGain Selection Time1μs
PA14TONModule Turn-on/Setting Time10μs

Note 1: The PGAx module is functional at VBORMIN < VDD < VDDMIN, but with degraded performance. Unless otherwise stated, module functionality is tested, but not characterized.

TABLE 24-51: CONSTANT-CURRENT SOURCE SPECIFICATIONS

Operating Conditions: 3.0V to 3.6V (unless otherwise stated) ^(1)
Operating temperature -40°C ≤ TA ≤ +85°C for Industrial-40°C ≤ TA ≤ +125°C for Extended
Param No.SymbolCharacteristicMin.Typ.Max.UnitsConditions
CC03I10SRC10 μA Source Current8.812.0μAISRCx pin
CC04I50SRC50 μA Source Current4456μAIBIASx pin
CC05I50SNK50 μA Sink Current-44-56μAIBIASx pin

Note 1: The constant-current source module is functional at VBORMIN < VDD < VDDMIN, but with degraded performance. Unless otherwise stated, module functionality is tested, but not characterized.

NOTES:

25.0 HIGH-TEMPERATURE ELECTRICAL CHARACTERISTICS

This section provides an overview of the dsPIC33CH128MP508 family devices operating in an ambient temperature range of -40^ to +150^ .

The specifications between -40^ to +150^ are identical to those shown in Section 24.0 “Electrical Characteristics” for operation between -40^ to +125^ , with the exception of the parameters listed in this section. Parameters in this section begin with an H, which denotes High temperature.

Absolute maximum ratings for the dsPIC33CH128MP508 family high-temperature devices are listed below. Exposure to these maximum rating conditions for extended periods can 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.

Absolute Maximum Ratings ^(1)

Ambient temperature under bias....-40°C to +150°C
Storage temperature -65°C to +150°C
Voltage on VDD with respect to Vss -0.3V to +4.0V
Voltage on any pin that is not 5V tolerant with respect to Vss ^(3) ......-0.3V to (VDD + 0.3V)
Voltage on any 5V tolerant pin with respect to Vss when V_DD ≥ 3.0V^(3) -0.3V to +5.5V
Voltage on any 5V tolerant pin with respect to Vss when VDD < 3.0V ^(3) -0.3V to +3.6V
Maximum current out of Vss pin ....300 mA
Maximum current into VDD pin ^(2) 300 mA
Maximum current sunk/sourced by any 4x I/O pin....15 mA
Maximum current sunk/sourced by any 8x I/O pin....25 mA
Maximum current sunk by a group of I/Os between two Vss pins ^(4) 75 mA
Maximum current sourced by a group of I/Os between two VDD pins ^(4) .....75 mA
Maximum current sunk by all I/Os ^(2,5) 200 mA
Maximum current sourced by all I/Os ^(2,5) .....200 mA

Note 1: 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.
2: Maximum allowable current is a function of device maximum power dissipation (see Table 25-2).
3: See the "Pin Diagrams" section for the 5V tolerant pins.
4: Not applicable to AV DD and AVss pins.
5: For 28-pin packages, the maximum current sunk/sourced by all I/Os is limited by 150 mA.

25.1 DC Characteristics

TABLE 25-1: OPERATING MIPS vs. VOLTAGE

VDD RangeTemperature Range (in °C)Maximum MIPS
Main Secondary
3.0V to 3.6V -40°C to +150°C 60 60

TABLE 25-2: THERMAL OPERATING CONDITIONS

Rating Symbol Min. Max. Unit
High-Temperature Devices
Operating Junction Temperature RangeTJ-40+165°C
Operating Ambient Temperature RangeTA-40+150°C
Power Dissipation:
Internal Chip Power Dissipation:
PINT = VDD x (IDD - Σ IOH)PDPINT + PI/OW
I/O Pin Power Dissipation:
I/O = Σ {VDD - VOH} x IOH) + Σ (VOL x IOL)
Maximum Allowed Power DissipationPDMAX(TJ - TA)/0JAW

TABLE 25-3: THERMAL PACKAGING CHARACTERISTICS (1)

CharacteristicSymbolTyp.Unit
Package Thermal Resistance, 80-Pin TQFP 12x12x1 mm _JA 50.67°C/W
Package Thermal Resistance, 64-Pin TQFP 10x10x1.0 mm _JA 45.7°C/W
Package Thermal Resistance, 64-Pin QFN 9x9 mm _JA 18.7°C/W
Package Thermal Resistance, 48-Pin TQFP 7x7 mm _JA 62.76°C/W
Package Thermal Resistance, 48-Pin UQFN 6x6 mm _JA 27.6°C/W
Package Thermal Resistance, 36-Pin UQFN 5x5 mm _JA 29.2°C/W
Package Thermal Resistance, 28-Pin UQFN 6x6 mm _JA 22.41°C/W
Package Thermal Resistance, 28-Pin SSOP 5.30 mm _JA 52.84°C/W

Note 1: Junction to ambient thermal resistance, Theta-JA ( _JA ) numbers are achieved by package simulations.

TABLE 25-4: OPERATING VOLTAGE SPECIFICATIONS

Operating Conditions: 3.0V to 3.6V (unless otherwise stated)(1)Operating temperature -40°C ≤ TA ≤ +150°C
Param No.SymbolCharacteristic Min. Typ. Max. Units Conditions
Operating Voltage
DC10 V DDSupply Voltage3.03.6V
DC11AVDDSupply VoltageGreater of: VDD – 0.3 or 3.0Lesser of: VDD + 0.3 or 3.6VThe difference between AVDD supply and VDD supply must not exceed ±300 mV at all times, including during device power-up
DC16VPORVDD Start Voltage to Ensure Internal Power-on Reset SignalVssV
DC17SVDDVDD Rise Rate to Ensure Internal Power-on Reset Signal1V/ms0V-3V in 100 ms
BO10VBORBOR Event on VDD Transition High-to-Low(2)2.682.842.99V

Note 1: Device is functional at VBORMIN < VDD < VDDMIN. Analog modules (ADC and comparators) may have degraded performance.
2: Parameters are characterized but not tested.

TABLE 25-5: DC CHARACTERISTICS: OPERATING CURRENT (I DD) (MAIN RUN/SECONDARY RUN) ^4

Operating Conditions: 3.0V to 3.6V (unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +150°C
Parameter No. Typ.(1)Max. Units Conditions
HDC20 18.1 36 mA +150°C3.3V10 MIPS (N1 = 1, N2 = 5, N3 = 2, M = 50, Fvco = 400 MHz, FPLLO = 40 MHz)
HDC21 22.2 40.3 mA +150°C3.3V20 MIPS (N1 = 1, N2 = 5, N3 = 1, M = 50, Fvco = 400 MHz, FPLLO = 80 MHz)
HDC22 29.9 48.1 mA +150°C3.3V40 MIPS (N1 = 1, N2 = 3, N3 = 1, M = 60, Fvco = 480 MHz, FPLLO = 160 MHz)
HDC234661.7mA+150°C3.3V60 MIPS (N1 = 1, N2 = 2, N3 = 1, M = 60, Fvco = 480 MHz, FPLLO = 240 MHz)

Note 1: Data in the "Typ." column are for design guidance only and are not tested.
2: Base Run current (IDD) is measured as follows:

- Oscillator is switched to EC+PLL mode in software

- OSC1 pin is driven with external 8 MHz square wave with levels from 0.3V to V_DD - 0.3V

- OSC2 is configured as an I/O in the Configuration Words (OSCIOFNC (FOSC[2]) = 0)

- FSCM is disabled (FCKSM[1:0] (FOSC[7:6]) = 01)

- Watchdog Timer is disabled (FWDT[15] = 0 and WDTCONL[15] = 0)

- All I/O pins (except OSC1) are configured as outputs and driving low

- No peripheral modules are operating or being clocked (defined PMDx bits are all '1's)

- JTAG is disabled (JTAGEN (FICD[5]) = 0)

- NOP instructions are executed in while(1) loop

TABLE 25-6: DC CHARACTERISTICS: OPERATING CURRENT (IDD) (MAIN SLEEP/SECONDARY RUN)

Operating Conditions: 3.0V to 3.6V (unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +150°C
Parameter No. Typ.(1)Max. Units Conditions
HDC20a13.731.6mA+150°C3.3V10 MIPS (N = 1, N2 = 5,N3 = 2, M = 50,Fvco = 400 MHz,FPLLO = 40 MHz)
HDC21a15.533.5mA+150°C3.3V20 MIPS (N = 1, N2 = 5,N3 = 1, M = 50,Fvco = 400 MHz,FPLLO = 80 MHz)
HDC22a19.437.5mA+150°C3.3V40 MIPS (N = 1, N2 = 3,N3 = 1, M = 60,Fvco = 480 MHz,FPLLO = 160 MHz)
HDC23a2943mA+150°C3.3V60 MIPS (N1 = 1, N2 = 2,N3 = 1, M = 60,Fvco = 480 MHz,FPLLO = 240 MHz)

Note 1: Data in the "Typ." column are for design guidance only and are not tested.

TABLE 25-7: DC CHARACTERISTICS: OPERATING CURRENT (IDD) (MAIN RUN/SECONDARY SLEEP)

DC CHARACTERISTICSMain (Run) + Secondary (Sleep)Standard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +150°C
Parameter No. Typ.(1)Max. Units Conditions
Operating Current (IDD)
HDC20b 14.4 32.3 mA +150°C3.3V10 MIPS(N = 1, N2 = 5,N3 = 2, M = 50,Fvco = 400 MHz,FPLLO = 40 MHz)
HDC21b 16.8 34.7 mA +150°C3.3V20 MIPS(N = 1, N2 = 5,N3 = 1, M = 50,Fvco = 400 MHz,FPLLO = 80 MHz)
HDC22b 20.6 38.6 mA +150°C3.3V40 MIPS(N = 1, N2 = 3,N3 = 1, M = 60,Fvco = 480 MHz,FPLLO = 160 MHz)
HDC23b3246.7mA+150°C3.3V60 MIPS (N1 = 1, N2 = 3,N3 = 1, M = 60,Fvco = 480 MHz,FPLLO = 240 MHz)

Note 1: Data in the "Typ." column are for design guidance only and are not tested.

TABLE 25-8: DC CHARACTERISTICS: OPERATING CURRENT (IIDLE) (MAIN IDLE/SECONDARY IDLE) ^(2)

Operating Conditions: 3.0V to 3.6V (unless otherwise stated)Operating temperature -40°C ≤ T A ≤ +150°C
Parameter No. Typ.(1)Max. Units Conditions
HDC4015.533.5mA+150°C3.3V10 MIPS (N1 = 1, N2 = 5, N3 = 2,M = 50, Fvco = 400 MHz,FPLLO = 40 MHz)
HDC4116.934.8mA+150°C3.3V20 MIPS (N1 = 1, N2 = 5, N3 = 1,M = 50, Fvco = 400 MHz,FPLLO = 80 MHz)
HDC4220.438.3mA+150°C3.3V40 MIPS (N1 = 1, N2 = 3, N3 = 1,M = 60, Fvco = 480 MHz,FPLLO = 160 MHz)
HDC433043.2mA+150°C3.3V60 MIPS (N1 = 1, N2 = 2, N3 = 1,M = 60, Fvco = 480 MHz,FPLLO = 240 MHz)

Note 1: Data in the "Typ." column are for design guidance only and are not tested.
2: Base Idle current (IDLE) is measured as follows:

- Oscillator is switched to EC+PLL mode in software

- OSC1 pin is driven with external 8 MHz square wave with levels from 0.3V to VDD - 0.3V

- OSC2 is configured as an I/O in the Configuration Words (OSCIOFNC (FOSC[2]) = 0)

• FSCM is disabled (FCKSM[1:0] (FOSC[7:6]) = 01)

- Watchdog Timer is disabled (FWDT[15] = 0 and WDTCONL[15] = 0)

- All I/O pins (except OSC1) are configured as outputs and driving low

- No peripheral modules are operating or being clocked (defined PMDx bits are all '1's)

- JTAG is disabled (JTAGEN (FICD[5]) = 0)

- Flash in standby with NVMSIDL (NVMCON[12]) = 1

TABLE 25-9: DC CHARACTERISTICS: IDLE CURRENT (IIDLE) (MAIN IDLE/SECONDARY SLEEP) ^(2)

Operating Conditions: 3.0V to 3.6V (unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +150°C
Parameter No. Typ.(1)Max. Units Conditions
HDC40a1330.9mA+150°C3.3V10 MIPS (N1 = 1, N2 = 5, N3 = 2,M = 50, Fvco = 400 MHz,FPLLO = 40 MHz)
HDC41a13.831.7mA+150°C3.3V20 MIPS (N1 = 1, N2 = 5, N3 = 1,M = 50, Fvco = 400 MHz,FPLLO = 80 MHz)
HDC42a15.633.5mA+150°C3.3V40 MIPS (N1 = 1, N2 = 3, N3 = 1,M = 60, Fvco = 480 MHz,FPLLO = 160 MHz)
HDC43a21.935.4mA+150°C3.3V60 MIPS (N1 = 1, N2 = 2, N3 = 1,M = 60, Fvco = 480 MHz,FPLLO = 240 MHz)

Note 1: Data in the "Typ." column are for design guidance only and are not tested.
2: Base Idle current (IIDLE) is measured as follows:

- Oscillator is switched to EC+PLL mode in software

- OSC1 pin is driven with external 8 MHz square wave with levels from 0.3V to VDD - 0.3V

- OSC2 is configured as an I/O in the Configuration Words (OSCIOFNC (FOSC[2]) = 0)

• FSCM is disabled (FCKSM[1:0] (FOSC[7:6]) = 01)

- Watchdog Timer is disabled (FWDT[15] = 0 and WDTCONL[15] = 0)

- All I/O pins (except OSC1) are configured as outputs and driving low

- No peripheral modules are operating or being clocked (defined PMDx bits are all '1's)

• JTAG is disabled (JTAGEN (FICD[5]) = 0)

- Flash in standby with NVMSIDL (NVMCON[12]) = 1

TABLE 25-10: DC CHARACTERISTICS: IDLE CURRENT (IIDLE) (MAIN SLEEP/SECONDARY IDLE) ^(2)

Operating Conditions: 3.0V to 3.6V (unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +150°C
Parameter No. Typ.(1)Max. UnitsConditions
HDC40b 12.5 30.4 mA +150°C3.3V10 MIPS (N1 = 1, N2 = 5, N3 = 2, M = 50, Fvco = 400 MHz, FPLLO = 40 MHz)
HDC41b13.231mA+150°C3.3V20 MIPS (N1 = 1, N2 = 5, N3 = 1, M = 50, Fvco = 400 MHz, FPLLO = 80 MHz)
HDC42b 14.8 32.7 mA +150°C3.3V40 MIPS (N1 = 1, N2 = 3, N3 = 1, M = 60, Fvco = 480 MHz, FPLLO = 160 MHz)
HDC43b 22.9 34.3 mA +150°C3.3V60 MIPS (N1 = 1, N2 = 2, N3 = 1, M = 60, Fvco = 480 MHz, FPLLO = 240 MHz)

Note 1: Data in the "Typ." column are for design guidance only and are not tested.
2: Base Idle current (IDLE) is measured as follows:

- Oscillator is switched to EC+PLL mode in software

- OSC1 pin is driven with external 8 MHz square wave with levels from 0.3V to VDD - 0.3V

- OSC2 is configured as an I/O in the Configuration Words (OSCIOFNC (FOSC[2]) = 0)

• FSCM is disabled (FCKSM[1:0] (FOSC[7:6]) = 01)

- Watchdog Timer is disabled (FWDT[15] = 0 and WDTCONL[15] = 0)

- All I/O pins (except OSC1) are configured as outputs and driving low

- No peripheral modules are operating or being clocked (defined PMDx bits are all '1's)

• JTAG is disabled (JTAGEN (FICD[5]) = 0)

- Flash in standby with NVMSIDL (NVMCON[12]) = 1

TABLE 25-11: POWER-DOWN CURRENT (IPD) ^(2)

Operating Conditions: 3.0V to 3.6V (unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +150°C
Parameter No.Characteristic Typ.(1)Max. Units Conditions
HDC60 BasePower-Down Current 9.7 25.5 mA +150°C3.3V

Note 1: Data in the "Typ." column are for design guidance only and are not tested.
2: Base Sleep current (IPD) is measured as follows:

  • OSC1 pin is driven with external 8 MHz square wave with levels from 0.3V to VDD - 0.3V
  • OSC2 is configured as an I/O in the Configuration Words (OSCIOFNC (FOSC[2]) = 0)
    • FSCM is disabled (FCKSM[1:0] (FOSC[7:6]) = 01)
  • Watchdog Timer is disabled (FWDT[15] = 0 and WDTCONL[15] = 0)
  • All I/O pins (except OSC1) are configured as outputs and driving low
  • No peripheral modules are operating or being clocked (defined PMDx bits are all '1's)
  • JTAG is disabled (JTAGEN (FICD[5]) = 0)
    • The regulators are in Standby mode (VREGS (RCON[8]) = 0)

TABLE 25-12: WATCHDOG TIMER DELTA CURRENT ( IWDT ) ^(1)

Operating Conditions: 3.0V to 3.6V (unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +150°C
Parameter No.Typ.Max.UnitsConditions
HDC618μA+150°C3.3V

Note 1: The IWDT current is the additional current consumed when the module is enabled. This current should be added to the base IPD current. All parameters are characterized but not tested during manufacturing.

TABLE 25-13: PWM DELTA CURRENT (1)

Operating Conditions: 3.0V to 3.6V (unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +150°C
Parameter No.Typ. Max.UnitsConditions
HDC1006.58.2mA+150°C3.3VPWM Output Frequency = 500 kHz,PWM Input (AFPLLO = 500 MHz)(AVCO = 1000 MHz, PLLFBD = 125,APLLDIV1 = 2)
HDC10155.7mA+150°C3.3VPWM Output Frequency = 500 kHz,PWM Input (AFPLLO = 400 MHz),(AVCO = 400 MHz, PLLFBD = 50,APLLDIV1 = 1)
HDC1022.83.4mA+150°C3.3VPWM Output Frequency = 500 kHz,PWM Input (AFPLLO = 200 MHz),(AVCO = 400 MHz, PLLFBD = 50,APLLDIV1 = 2)
HDC1031.52.3mA+150°C3.3VPWM Output Frequency = 500 kHz,PWM Input (AFPLLO = 100 MHz),(AVCO = 400 MHz, PLLFBD = 50,APLLDIV1 = 4)

Note 1: APLL current is not included. The APLL current will be the same if more than one PWM is running. Listed delta currents are for only one PWM instance when HREN = 0 (PGxCONL[7]). All parameters are characterized but not tested during manufacturing.

TABLE 25-14: APLL DELTA CURRENT

Operating Conditions: 3.0V to 3.6V (unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +150°C
Parameter No.Typ.Max.UnitsConditions(1)
HDC11023mA+150°C3.3VAFPLLO = 500 MHz(AVCO = 1000 MHz, PLLFBD = 125, APLLDIV1 = 2)
HDC11116mA+150°C3.3VAFPLLO = 400 MHz(AVCO = 400 MHz, PLLFBD = 50, APLLDIV1 = 1)
HDC11215mA+150°C3.3VAFPLLO = 200 MHz(AVCO = 400 MHz, PLLFBD = 50, APLLDIV1 = 2)
HDC11315mA+150°C3.3VAFPLLO = 100 MHz(AVCO = 400 MHz, PLLFBD = 50, APLLDIV1 = 4)

Note 1: The APLL current will be the same if more than one PWM or DAC is run to the APLL clock. All parameters are characterized but not tested during manufacturing.

TABLE 25-15: ADC DELTA CURRENT (1,2)

Operating Conditions: 3.0V to 3.6V (unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +150°C
Parameter No.Main SecondaryUnits Conditions
Typ.Max.Typ.Max.
HDC120 — 8.5 —16.3 mA+150°C3.3VTAD = 14.3 ns(3.5 Msps conversion rate)

Note 1: Main shared core continuous conversion; TAD = 14.3 nS (3.5 Msps Conversion rate).
2: Secondary dedicated core continuous conversion on all 3 SAR cores; TAD = 14.3 nS (3.5 Msps conversion rate). All parameters are characterized but not tested during manufacturing.

TABLE 25-16: COMPARATOR + DAC DELTA CURRENT

Operating Conditions: 3.0V to 3.6V (unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +150°C
Parameter No.Typ.Max.UnitsConditions
HDC1305mA+150°C3.3VAFPLLO @ 500 MHz(1)

Note 1: APLL current is not included. Listed delta currents are for only one comparator + DAC instance. All parameters are characterized but not tested during manufacturing.

TABLE 25-17: PGAx DELTA CURRENT (1)

Operating Conditions: 3.0V to 3.6V (unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +150°C
Parameter No.Typ.Max.UnitsConditions
HDC1413mA+150°C3.3V

Note 1: All parameters are characterized but not tested during manufacturing.

TABLE 25-18: I/O PIN INPUT SPECIFICATIONS

Operating Conditions: 3.0V to 3.6V (unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +150°C
Param No.SymbolCharacteristic Min.(4)Typ.(1)Max.(5)UnitsConditions
HDI50IL Input Leakage Current (2)
I/O Pins 5V Tolerant(3)-800800nA
I/O Pins Not 5V Tolerant(3)-800800nA
MCLR-800800nA
OSCI-800800nAXT and HS modes

Note 1: Data in the "Typ." column are at 3.3V, +25°C unless otherwise stated.
2: Negative current is defined as current sourced by the pin.
3: See the "Pin Diagrams" section for the 5V tolerant I/O pins.
4: VPIN = VSS.
5: VPIN = VDD.

TABLE 25-19: INTERNAL FRC ACCURACY

Operating Conditions: 3.0V to 3.6V (unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +150°C
Param No.CharacteristicMin.Max.UnitsConditions
Internal FRC Accuracy @ FRC Frequency = 8 MHz(1)
HF20FRC-4+4%-40°C ≤ TA ≤ +150°C

Note 1: Frequency is calibrated at +25°C and 3.3V.

TABLE 25-20: INTERNAL LPRC ACCURACY

Operating Conditions: 3.0V to 3.6V (unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +150°C
Param No.CharacteristicMin.Max.UnitsConditions
LPRC @ 32 kHz
HF21LPRC-30+30%-40°C ≤ TA ≤ +150°C

TABLE 25-21: ADC MODULE SPECIFICATIONS

Operating Conditions: 3.0V to 3.6V (unless otherwise stated)(1)Operating temperature -40°C ≤ TA ≤ +150°C
Param No.SymbolCharacteristics Min. Typical Max. Units Conditions
ADC Accuracy
HAD23cG ERRGain Error>-17.5< 17.5LSbAVss = 0V, AVDD = 3.3V
HAD24cE OFFOffset Error>-15< 15LSbAVss = 0V, AVDD = 3.3V

Note 1: The ADC module is functional at VBORMIN < VDD < VDDMIN, but with degraded performance. Unless otherwise stated, module functionality is ensured, but not characterized.

TABLE 25-22: DACx MODULE SPECIFICATIONS

Operating Conditions: 3.0V to 3.6V (unless otherwise stated)Operating temperature -40°C ≤ TA ≤ +150°C
Param No.SymbolCharacteristicMin. Typ.^(1) Max. UnitsComments
HDA03INLIntegral Nonlinearity Error-500LSB
HDA05EOFFOffset Error045LSBInternal node at comparator input
HDA06EGGain Error055%Internal node at comparator input

Note 1: Parameters are for design guidance only and are not tested in manufacturing.

TABLE 25-23: PGAx MODULE SPECIFICATIONS

AC/DC CHARACTERISTICSStandard Operating Conditions: 3.0V to 3.6V(unless otherwise stated)(1)Operating temperature -40°C ≤ TA ≤ +150°C
Param No.SymbolCharacteristicMin.Typ.Max.UnitsComments
HPA03VosInput Offset Voltage-11+11mVGain = 32x

Note 1: The PGAx module is functional at VBORMIN < VDD < VDDMIN, but with degraded performance. Unless otherwise stated, module functionality is tested, but not characterized.

NOTES:

26.0 PACKAGING INFORMATION

26.1 Package Marking Information

28-Lead SSOP (5.30 mm)

Microchip dsPIC33CH64MP208 - Package Marking Information - 1

text_image XXXXXXXXXXXX XXXXXXXXXXXX YYWWNNN

Example

Microchip dsPIC33CH64MP208 - Package Marking Information - 2

text_image dsPIC33CH64 MP202 1810017

28-Lead UQFN (6x6 mm)

Microchip dsPIC33CH64MP208 - Package Marking Information - 3

text_image XXXXXXXX XXXXXXXX YYWWNNN

Example

Microchip dsPIC33CH64MP208 - Package Marking Information - 4

text_image 33CH64MP 202 1810017

36-Lead UQFN (5x5 mm)

Microchip dsPIC33CH64MP208 - Package Marking Information - 5

text_image XXXXXXX XXXXXXX XXXXXXX YYWWNNN

Example

Microchip dsPIC33CH64MP208 - Package Marking Information - 6

text_image dsPIC33 CH64MP 203 1810017

Legend: XX...X Customer-specific information Y Year code (last digit of calendar year) YY Year code (last 2 digits of calendar year) WW Week code (week of January 1 is week '01') NNN Alphanumeric traceability code

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.

26.1 Package Marking Information (Continued)

48-Lead TQFP (7x7 mm)

Microchip dsPIC33CH64MP208 - Package Marking Information (Continued) - 1

text_image XXXXXXXX XXXXXXXXXXXXYWW NNN

Example

Microchip dsPIC33CH64MP208 - Package Marking Information (Continued) - 2

text_image CH64MP 2041810 017

48-Lead UQFN (6x6 mm)

Microchip dsPIC33CH64MP208 - Package Marking Information (Continued) - 3

text_image XXXXXXX XXXXXXX XXXXXXX YYWWNNN

Example

Microchip dsPIC33CH64MP208 - Package Marking Information (Continued) - 4

text_image dsPIC33 CH64MP 205 1810017

64-Lead TQFP (10x10x1 mm)

Microchip dsPIC33CH64MP208 - Package Marking Information (Continued) - 5

text_image MICROCHIP XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX ○ YYWWNNN

Example

Microchip dsPIC33CH64MP208 - Package Marking Information (Continued) - 6

text_image MICROCHIP dsPIC33CH64 MP206 1810017

64-Lead QFN (9x9x0.9 mm)

Microchip dsPIC33CH64MP208 - Package Marking Information (Continued) - 7

text_image XXXXXXXXXXXX XXXXXXXXXXXX XXXXXXXXXXXX YYWWNNN

Example

Microchip dsPIC33CH64MP208 - Package Marking Information (Continued) - 8

text_image dsPIC33CH64 MP206 1810017

80-Lead TQFP (12x12x1 mm)

Microchip dsPIC33CH64MP208 - Package Marking Information (Continued) - 9

text_image MICROCHIP XXXXXXXXXXXXX XXXXXXXXXXXXX XXXXXXXXXXXXX YYYYWNNN

Example

Microchip dsPIC33CH64MP208 - Package Marking Information (Continued) - 10

text_image MICROCHIP dsPIC33CH64 MP208 1810017

26.2 Package Details

28-Lead Plastic Shrink Small Outline (SS) - 5.30 mm Body [SSOP]

Note: For the most current package drawings, please see the Microchip Packaging Specification located at http://www.microchip.com/packaging

Microchip dsPIC33CH64MP208 - 28-Lead Plastic Shrink Small Outline (SS) - 5.30 mm Body [SSOP] - 1

Microchip Technology Drawing C04-073 Rev C Sheet 1 of 2

28-Lead Plastic Shrink Small Outline (SS) - 5.30 mm Body [SSOP]

Note: For the most current package drawings, please see the Microchip Packaging Specification located at http://www.microchip.com/packaging

Microchip dsPIC33CH64MP208 - 28-Lead Plastic Shrink Small Outline (SS) - 5.30 mm Body [SSOP] - 1

natural_image Isometric line drawing of an integrated circuit chip with multiple 16-pin pins (no text or symbols)
UnitsMILLIMETERS
Dimension LimitsMINNOMMAX
NNumber of Pins 28
Pitche0.65 BSC
Overall HeightA--2.00
1.851.75
-0.05AStandoff
Overall Width8.207.80
5.605.30
10.5010.209.90DOverall
0.950.75
FootprintL11.25 REF
Lead Thicknessc0.25-0.09
Foot Angleφ8°4°0°
Lead Widthb0.38-0.22

Notes:

  1. Pin 1 visual index feature may vary, but must be located within the hatched area.
  2. Dimensions D and E1 do not include mold flash or protrusions. Mold flash or protrusions shall not exceed 0.20mm per side.
  3. Dimensioning and tolerancing per ASME Y14.5M

BSC: Basic Dimension. Theoretically exact value shown without tolerances.

REF: Reference Dimension, usually without tolerance, for information purposes only.

Microchip Technology Drawing C04-073 Rev C Sheet 2 of 2

28-Lead Plastic Shrink Small Outline (SS) - 5.30 mm Body [SSOP]

Note: For the most current package drawings, please see the Microchip Packaging Specification located at http://www.microchip.com/packaging

Microchip dsPIC33CH64MP208 - 28-Lead Plastic Shrink Small Outline (SS) - 5.30 mm Body [SSOP] - 1

text_image 28 G1 C SILK SCREEN Y1 1 2 X1 E

RECOMMENDED LAND PATTERN

UnitsMILLIMETERS
Dimension LimitsMINNOMMAX
Contact PitchE0.65 BSC
CContact Pad Spacing 7.00
Contact Pad Width (X28)X10.45
Contact Pad Length (X28)Y11.85
Contact Pad to Center Pad (X26)G1 0.20

Notes:

  1. Dimensioning and tolerancing per ASME Y14.5M

BSC: Basic Dimension. Theoretically exact value shown without tolerances.

  1. For best soldering results, thermal vias, if used, should be filled or tented to avoid solder loss during reflow process

Microchip Technology Drawing C04-2073 Rev B

28-Lead Ultra Thin Plastic Quad Flat, No Lead Package (2N) - 6x6x0.55 mm Body [UQFN] With 4.65x4.65 mm Exposed Pad and Corner Anchors

Note: For the most current package drawings, please see the Microchip Packaging Specification located at http://www.microchip.com/packaging

Microchip dsPIC33CH64MP208 - 28-Lead Ultra Thin Plastic Quad Flat, No Lead Package (2N) - 6x6x0.55 mm Body [UQFN] With 4.65x4.65 mm Exposed Pad and Corner Anchors - 1

text_image NOTE 1 N A B 1 2 (DATUM B) (DATUM A) 2X 0.10 C E 2X 0.10 C TOP VIEW SEATING PLANE C A (A3) SIDE VIEW // 0.10 C A1 28X 0.08 C 8X b1 D2 0.10 A B 8X b2 E2 2 1 2X P NOTE 1 N e 28X K BOTTOM VIEW 0.10 A B 0.05 M

Microchip Technology Drawing C04-385 Rev C Sheet 1 of 2

28-Lead Ultra Thin Plastic Quad Flat, No Lead Package (2N) - 6x6x0.55 mm Body [UQFN] With 4.65x4.65 mm Exposed Pad and Corner Anchors

Note: For the most current package drawings, please see the Microchip Packaging Specification located at http://www.microchip.com/packaging

Microchip dsPIC33CH64MP208 - 28-Lead Ultra Thin Plastic Quad Flat, No Lead Package (2N) - 6x6x0.55 mm Body [UQFN] With 4.65x4.65 mm Exposed Pad and Corner Anchors - 1

natural_image Technical line drawing of two rectangular electronic components with pins, shown from top and bottom views (no text or symbols)
UnitsMILLIMETERS
Dimension LimitsMINNOMMAX
Number of TerminalsN28
Pitche0.65 BSC
Overall HeightA0.450.500.55
StandoffA10.000.020.05
Terminal ThicknessA30.127 REF
Overall WidthE6.00 BSC
Exposed Pad WidthE24.554.654.75
Overall LengthD6.00 BSC
Exposed Pad LengthD24.554.654.75
Exposed Pad Corner Chamfer P -0.35 -
Terminal Widthb0.250.300.35
b10.35 0.400.43CornerAnchor Pad
Corner Pad, Metal Free Zone b20.15 0.200.25
Terminal LengthL0.300.400.50
Terminal-to-Exposed-PadK-

0.20 -

Notes:

  1. Pin 1 visual index feature may vary, but must be located within the hatched area.
  2. Package is saw singulated
  3. Dimensioning and tolerancing per ASME Y14.5M

BSC: Basic Dimension. Theoretically exact value shown without tolerances.

REF: Reference Dimension, usually without tolerance, for information purposes only.

Microchip Technology Drawing C04-385 Rev C Sheet 2 of 2

28-Lead Ultra Thin Plastic Quad Flat, No Lead Package (2N) - 6x6x0.55 mm Body [UQFN] With 4.65x4.65 mm Exposed Pad and Corner Anchors

Note: For the most current package drawings, please see the Microchip Packaging Specification located at http://www.microchip.com/packaging

Microchip dsPIC33CH64MP208 - 28-Lead Ultra Thin Plastic Quad Flat, No Lead Package (2N) - 6x6x0.55 mm Body [UQFN] With 4.65x4.65 mm Exposed Pad and Corner Anchors - 1

text_image C2 X2 EV 28 Y3 X1 1 2 Y4 G1 G2 X4 E Y1 SILK SCREEN C1 Y2 EV X3

RECOMMENDED LAND PATTERN

UnitsMILLIMETERS
Dimension LimitsMINNOMMAX
Contact PitchE0.65 BSC
Optional Center Pad WidthX24.75
Optional Center Pad LengthY24.75
C1Contact Pad Spacing 6.00
Contact Pad SpacingC26.00
Contact Pad Width (X28)X10.35
Contact Pad Length (X28)Y10.80
Corner Anchor (X4)X31.00
Corner Anchor (X4)Y31.00
Corner Anchor Chamfer (X4)X40.35
Corner Anchor Chamfer (X4)Y40.35
Contact Pad to Pad (X28) G1 0.20
Contact Pad to Center Pad (X28) G2 0.20
Thermal Via Diameter V0.33
Thermal Via Pitch EV1.20

Notes:

  1. Dimensioning and tolerancing per ASME Y14.5M

BSC: Basic Dimension. Theoretically exact value shown without tolerances.

  1. For best soldering results, thermal vias, if used, should be filled or tented to avoid solder loss during reflow process

Microchip Technology Drawing C04-2385 Rev C

36-Lead Ultra Thin Plastic Quad Flat, No Lead Package (M5) - 5x5 mm Body [UQFN] With Corner Anchors

Note: For the most current package drawings, please see the Microchip Packaging Specification located at http://www.microchip.com/packaging

Microchip dsPIC33CH64MP208 - 36-Lead Ultra Thin Plastic Quad Flat, No Lead Package (M5) - 5x5 mm Body [UQFN] With Corner Anchors - 1
Microchip Technology Drawing C04-436-M5 Rev D Sheet 1 of 2

36-Lead Ultra Thin Plastic Quad Flat, No Lead Package (M5) - 5x5 mm Body [UQFN] With Corner Anchors

Note: For the most current package drawings, please see the Microchip Packaging Specification located at http://www.microchip.com/packaging

Microchip dsPIC33CH64MP208 - 36-Lead Ultra Thin Plastic Quad Flat, No Lead Package (M5) - 5x5 mm Body [UQFN] With Corner Anchors - 1

text_image SEATING PLANE A C (A3) DETAIL A A1
UnitsMILLIMETERS
Dimension LimitsMINNOMMAX
Number of TerminalsN36
Pitche0.40 BSC
Overall HeightA0.500.550.60
StandoffA10.000.020.05
Terminal ThicknessA30.152 REF
Overall LengthD5.00 BSC
Exposed Pad LengthD2 3603.70 3.80
Overall WidthE5.00 BSC
Exposed Pad WidthE23.603.703.80
Terminal Widthb0.150.200.25
Terminal LengthL0.300.400.50
Terminal-to-Exposed-PadK 025 REF

Notes:
1. Pin 1 visual index feature may vary, but must be located within the hatched area.
2. Package is saw singulated
3. Dimensioning and tolerancing per ASME Y14.5M
BSC: Basic Dimension. Theoretically exact value shown without tolerances.
REF: Reference Dimension, usually without tolerance, for information purposes only.

Microchip Technology Drawing C04-436-M5 Rev D Sheet 2 of 2

36-Lead Ultra Thin Plastic Quad Flat, No Lead Package (M5) - 5x5 mm Body [UQFN] With Corner Anchors

Note: For the most current package drawings, please see the Microchip Packaging Specification located at http://www.microchip.com/packaging

Microchip dsPIC33CH64MP208 - 36-Lead Ultra Thin Plastic Quad Flat, No Lead Package (M5) - 5x5 mm Body [UQFN] With Corner Anchors - 1

text_image C1 X2 EV 36 Y3 1 2 ØV G C2 EV R X3 E Y1 X1 SILK SCREEN

RECOMMENDED LAND PATTERN

UnitsMILLIMETERS
Dimension LimitsMINNOMMAX
Contact PitchE0.40 BSC
Center Pad WidthX23.80
Center Pad LengthY23.80
C1Contact Pad Spacing 5.00
Contact Pad SpacingC25.00
Contact Pad Width (X36)X10.20
Contact Pad Length (X36)Y10.80
Corner Pad Width (X4)X30.85
Corner Pad Length (X4)Y30.85
Corner Pad Radius R 0.10
Contact Pad to Center Pad (X36) G0.20
Thermal Via Diameter V0.30
Thermal Via Pitch EV1.00

Notes:

  1. Dimensioning and tolerancing per ASME Y14.5M

BSC: Basic Dimension. Theoretically exact value shown without tolerances.

  1. For best soldering results, thermal vias, if used, should be filled or tented to avoid solder loss during reflow process

Microchip Technology Drawing C04-2436-M5 Rev D

48-Lead Plastic Thin Quad Flatpack (PT) - 7x7x1.0 mm Body [TQFP]

Note: For the most current package drawings, please see the Microchip Packaging Specification located at http://www.microchip.com/packaging

Microchip dsPIC33CH64MP208 - 48-Lead Plastic Thin Quad Flatpack (PT) - 7x7x1.0 mm Body [TQFP] - 1

text_image D D1 D2 D1 2 D A B E1/2 E1 N/4 TIPS NOTE 1 N A A E1/2 E2/2 0.20 C A-B D 1 2 3 e2 e 0.20 C A-B D 4X TOP VIEW

Microchip dsPIC33CH64MP208 - 48-Lead Plastic Thin Quad Flatpack (PT) - 7x7x1.0 mm Body [TQFP] - 2

text_image SEATING PLANE A A2 A1 48X b 0.08 C 0.08 A-B D SIDE VIEW

Microchip Technology Drawing C04-300-PT Rev D Sheet 1 of 2

48-Lead Plastic Thin Quad Flatpack (PT) - 7x7x1.0 mm Body [TQFP]

Note: For the most current package drawings, please see the Microchip Packaging Specification located at http://www.microchip.com/packaging

Microchip dsPIC33CH64MP208 - 48-Lead Plastic Thin Quad Flatpack (PT) - 7x7x1.0 mm Body [TQFP] - 1

text_image H θ2 θ1 R2 R1 c θ L (L1)

SECTION A-A

UnitsMILLIMETERS
Dimension LimitsMINNOMMAX
Number of TerminalsN48
Pitche0.50 BSC
Overall HeightA--1.20
StandoffA10.05-0.15
Molded Package ThicknessA20.95 1.051.00
Overall LengthD9.00 BSC
Molded Package LengthD17.00 BSC
Overall WidthE9.00 BSC
Molded Package WidthE17.00 BSC
Terminal Widthb0.170.220.27
Terminal Thicknessc0.09 - 0.16
Terminal LengthL0.450.600.75
L1 1.00 REFFootprint
R1-0.08 -Lead Bend Radius
R2-0.08 0.20Lead Bend Radius
Foot Angle 3.5°0°7'
Lead Angle 1 --
Mold Draft Angle 2 11°12°13°

Notes:
1. Pin 1 visual index feature may vary, but must be located within the hatched area.
2. Dimensioning and tolerancing per ASME Y14.5M
BSC: Basic Dimension. Theoretically exact value shown without tolerances.
REF: Reference Dimension, usually without tolerance, for information purposes only.

Microchip Technology Drawing C04-300-PT Rev D Sheet 2 of 2

48-Lead Plastic Thin Quad Flatpack (PT) - 7x7x1.0 mm Body [TQFP]

Note: For the most current package drawings, please see the Microchip Packaging Specification located at http://www.microchip.com/packaging

Microchip dsPIC33CH64MP208 - 48-Lead Plastic Thin Quad Flatpack (PT) - 7x7x1.0 mm Body [TQFP] - 1

text_image C1 C2 48 SILK SCREEN G Y1 1 2 X1 E

RECOMMENDED LAND PATTERN

UnitsMILLIMETERS
Dimension LimitsMINNOMMAX
Contact PitchE0.50 BSC
C1Contact Pad Spacing 8.40
C2Contact Pad Spacing40
Contact Pad Width (X48)X10.30
Contact Pad Length (X48)Y11.50
Distance Between Pads G 0.20

Notes:
1. Dimensioning and tolerancing per ASME Y14.5M
BSC: Basic Dimension. Theoretically exact value shown without tolerances.
2. For best soldering results, thermal vias, if used, should be filled or tented to avoid solder loss during reflow process

Microchip Technology Drawing C04-2300-PT Rev D

48-Lead Ultra Thin Plastic Quad Flat, No Lead Package (M4) - 6x6 mm Body [UQFN] With Corner Anchors and 4.6x4.6 mm Exposed Pad

Note: For the most current package drawings, please see the Microchip Packaging Specification located at http://www.microchip.com/packaging

Microchip dsPIC33CH64MP208 - 48-Lead Ultra Thin Plastic Quad Flat, No Lead Package (M4) - 6x6 mm Body [UQFN] With Corner Anchors and 4.6x4.6 mm Exposed Pad - 1

text_image NOTE 1 N 1 2 (DATUM B) (DATUM A) 2X 0.10 C 2X 0.10 C TOP VIEW A B E 52X 0.08 C // 0.10 C (A3) A SEATING PLANE SIDE VIEW 8X (b1) D2 0.10 M A B 8X (b2) E2 2 1 NOTE 1 L N 48X b e (K) 0.07 M A B 0.05 M BOTTOM VIEW

Microchip Technology Drawing C04-442A-M4 Sheet 1 of 2

48-Lead Ultra Thin Plastic Quad Flat, No Lead Package (M4) - 6x6 mm Body [UQFN] With Corner Anchors and 4.6x4.6 mm Exposed Pad

Note: For the most current package drawings, please see the Microchip Packaging Specification located at http://www.microchip.com/packaging

Microchip dsPIC33CH64MP208 - 48-Lead Ultra Thin Plastic Quad Flat, No Lead Package (M4) - 6x6 mm Body [UQFN] With Corner Anchors and 4.6x4.6 mm Exposed Pad - 1

natural_image Technical line drawing of two rectangular electronic components with square bases and internal circuit-like structures (no text or symbols)
UnitsMILLIMETERS
Dimension LimitsMINNOMMAX
Number of TerminalsN48
Pitche0.40 BSC
Overall HeightA0.500.550.60
StandoffA10.000.020.05
Terminal ThicknessA30.15 REF
Overall LengthD6.00 BSC
Exposed Pad LengthD24.504.60 4.70
Overall WidthE6.00 BSC
Exposed Pad WidthE24.50 4.60 4.70
Terminal Widthb0.150.200.25
Corner Anchor Padb10.45 REF
Corner Anchor Pad, Metal-free Zone b20.23 REF
Terminal LengthL0.350.400.45
K 0.30 REFTerminal-to-Exposed-Pad

Notes:
1. Pin 1 visual index feature may vary, but must be located within the hatched area.
2. Package is saw singulated
3. Dimensioning and tolerancing per ASME Y14.5M BSC: Basic Dimension. Theoretically exact value shown without tolerances. REF: Reference Dimension, usually without tolerance, for information purposes only.

Microchip Technology Drawing C04-442A-M4 Sheet 2 of 2

48-Lead Ultra Thin Plastic Quad Flat, No Lead Package (M4) - 6x6 mm Body [UQFN] With Corner Anchors and 4.6x4.6 mm Exposed Pad

Note: For the most current package drawings, please see the Microchip Packaging Specification located at http://www.microchip.com/packaging

Microchip dsPIC33CH64MP208 - 48-Lead Ultra Thin Plastic Quad Flat, No Lead Package (M4) - 6x6 mm Body [UQFN] With Corner Anchors and 4.6x4.6 mm Exposed Pad - 1

text_image C1 X2 EV R 48 Y3 ØV G2 Y1 C2 Y2 EV G1 Y1 SILK SCREEN X3 X1 E

RECOMMENDED LAND PATTERN

UnitsMILLIMETERS
Dimension LimitsMINNOMMAX
Contact PitchE0.40 BSC
Center Pad WidthX24.70
Center Pad LengthY24.70
C1Contact Pad Spacing 6.00
Contact Pad SpacingC26.00
Contact Pad Width (X48)X10.20
Contact Pad Length (X48)Y10.80
Corner Anchor Pad Width (X4)X30.90
Corner Anchor Pad Length (X4)Y30.90
Pad Corner Radius (X 20) R 0.10
Contact Pad to Center Pad (X48) G10.25
Contact Pad to Contact Pad G2 0.20
Thermal Via Diameter V0.33
Thermal Via Pitch EV1.20

Notes:
1. Dimensioning and tolerancing per ASME Y14.5M
BSC: Basic Dimension. Theoretically exact value shown without tolerances.
2. For best soldering results, thermal vias, if used, should be filled or tented to avoid solder loss during reflow process

Microchip Technology Drawing C04-2442A-M4

64-Lead Plastic Thin Quad Flatpack (PT)-10x10x1 mm Body, 2.00 mm Footprint [TQFP]

Note: For the most current package drawings, please see the Microchip Packaging Specification located at http://www.microchip.com/packaging

Microchip dsPIC33CH64MP208 - 64-Lead Plastic Thin Quad Flatpack (PT)-10x10x1 mm Body, 2.00 mm Footprint [TQFP] - 1

text_image NOTE 2 A N SEE DETAIL 1 4X N/4 TIPS D0.20 D0 DA-B DD NOTE 1 1 2 3 D1/2 D B E1/2 E1 4X D0.20 DH DA-B DD

TOP VIEW

Microchip dsPIC33CH64MP208 - 64-Lead Plastic Thin Quad Flatpack (PT)-10x10x1 mm Body, 2.00 mm Footprint [TQFP] - 2

text_image SEATING PLANE A C 0.08 DC e 64 X b A1 A2 0.05 ⊕ 0 .0 8 M A-B D

SIDE VIEW

Microchip Technology Drawing DC04-085-PT Rev E Sheet 1 of 2

64-Lead Plastic Thin Quad Flatpack (PT)-10x10x1 mm Body, 2.00 mm Footprint [TQFP]

Note: For the most current package drawings, please see the Microchip Packaging Specification located at http://www.microchip.com/packaging

Microchip dsPIC33CH64MP208 - 64-Lead Plastic Thin Quad Flatpack (PT)-10x10x1 mm Body, 2.00 mm Footprint [TQFP] - 1

text_image α H β L (L1) c θ SECTION A-A X=A-B OR D e/2

DETAIL 1

UnitsMILLIMETERS
Dimension LimitsMINNOMMAX
Number of LeadsN64
Lead Pitche0.50 BSC
Overall HeightA--1.20
Molded Package ThicknessA20.951.001.05
StandoffA10.05-0.15
Foot LengthL0.450.600.75
FootprintL11.00 REF
Foot Angleθ 0^ 3.5^ 7^
Overall WidthE12.00 BSC
Overall LengthD12.00 BSC
Molded Package WidthE110.00 BSC
Molded Package LengthD110.00 BSC
Lead Thicknessc0.09-0.20
Lead Widthb0.170.220.27
Mold Draft Angle Topα 11^ 12^ 13^
Mold Draft Angle Bottomβ 11^ 12^ 13^

Notes:

  1. Pin 1 visual index feature may vary, but must be located within the hatched area.
  2. Chamfers at corners are optional; size may vary.
  3. Dimensions D1 and E1 do not include mold flash or protrusions. Mold flash or protrusions shall not exceed 0.25mm per side.
  4. Dimensioning and tolerancing per ASME Y14.5M

BSC: Basic Dimension. Theoretically exact value shown without tolerances.

REF: Reference Dimension, usually without tolerance, for information purposes only.

Microchip Technology Drawing C04-085-PT Rev E Sheet 2 of 2

64-Lead Plastic Thin Quad Flatpack (PT) 10x10x1 mm Body, 2.00 mm Footprint [TQFP]

Microchip dsPIC33CH64MP208 - Notes: - 1

text_image C1 G SILK SCREEN Y1 X1 E C2

RECOMMENDED LAND PATTERN

Units UMILLIMETERS
Dimension LimitsMIN UNOMMAX
Contact Pitch UE0.50 BSC
Contact Pad SpacingC1 U11.40
Contact Pad SpacingC211.40
Contact Pad Width (X64)X10.30
Contact Pad Length (X64)Y11.50
Distance Between PadsG0.20

Notes:
1. UDimensioning and tolerancing per ASME Y14.5M
BSC: Basic Dimension. Theoretically exact value shown without tolerances.

Microchip Technology Drawing C04-2085-PT Rev E

64-Lead Plastic Quad Flat, No Lead Package (MR) - 9x9x0.9 mm Body with 5.40 x 5.40 Exposed Pad [QFN]

Note: For the most current package drawings, please see the Microchip Packaging Specification located at http://www.microchip.com/packaging

Microchip dsPIC33CH64MP208 - 64-Lead Plastic Quad Flat, No Lead Package (MR) - 9x9x0.9 mm Body with 5.40 x 5.40 Exposed Pad [QFN] - 1

text_image D A B E 0.25 C N NOTE 1 2 1 TOP VIEW A // 0.10 C SEATING PLANE C (A3) A1 64X 0.08 C D2 0.10M C A B N 1/2 e 0.10M C A B (DATUM B) E2 e/2 NOTE 1 (DATUM A) K L 64X b 0.10M C A B 0.05M C BOTTOM VIEW

Microchip Technology Drawing C04-154A Sheet 1 of 2

64-Lead Plastic Quad Flat, No Lead Package (MR) - 9x9x0.9 mm Body with 5.40 x 5.40 Exposed Pad [QFN]

Note: For the most current package drawings, please see the Microchip Packaging Specification located at http://www.microchip.com/packaging

Microchip dsPIC33CH64MP208 - 64-Lead Plastic Quad Flat, No Lead Package (MR) - 9x9x0.9 mm Body with 5.40 x 5.40 Exposed Pad [QFN] - 1

natural_image Isometric line drawing of a rectangular electronic component with square holes on both sides (no text or symbols)
UnitsMILLIMETERS
Dimension LimitsMINNOMMAX
Number of PinsN64
Pitche0.50 BSC
Overall HeightA0.800.901.00
StandoffA10.000.020.05
Contact ThicknessA30.20 REF
Overall WidthE9.00 BSC
Exposed Pad WidthE25.305.405.50
Overall LengthD9.00 BSC
Exposed Pad LengthD25.305.405.50
Contact Widthb0.200.250.30
Contact LengthL0.300.400.50
Contact-to-Exposed PadK0.20--

Notes:

  1. Pin 1 visual index feature may vary, but must be located within the hatched area.
  2. Package is saw singulated.
  3. Dimensioning and tolerancing per ASME Y14.5M.

BSC: Basic Dimension. Theoretically exact value shown without tolerances.

REF: Reference Dimension, usually without tolerance, for information purposes only.

Microchip Technology Drawing C04-154A Sheet 2 of 2

64-Lead Plastic Quad Flat, No Lead Package (MR) - 9x9x0.9 mm Body [QFN]

With 0.40 mm Contact Length and 5.40x5.40mm Exposed Pad

Note: For the most current package drawings, please see the Microchip Packaging Specification located at http://www.microchip.com/packaging

Microchip dsPIC33CH64MP208 - Notes: - 1

text_image C1 W2 C2 T2 E G Y1 X1 SILK SCREEN

RECOMMENDED LAND PATTERN

UnitsMILLIMETERS
Dimension LimitsMINNOMMAX
Contact PitchE0.50 BSC
Optional Center Pad WidthW25.50
Optional Center Pad LengthT25.50
Contact Pad SpacingC18.90
Contact Pad SpacingC28.90
Contact Pad Width (X64)X10.30
Contact Pad Length (X64)Y10.85
Distance Between PadsG0.20

Notes:

  1. Dimensioning and tolerancing per ASME Y14.5M

BSC: Basic Dimension. Theoretically exact value shown without tolerances.

Microchip Technology Drawing No. C04-2154A

80-Lead Plastic Thin Quad Flat Pack (PT) - 12x12x1.0 mm Body [TQFP]

Note: For the most current package drawings, please see the Microchip Packaging Specification located at http://www.microchip.com/packaging

Microchip dsPIC33CH64MP208 - 80-Lead Plastic Thin Quad Flat Pack (PT) - 12x12x1.0 mm Body [TQFP] - 1

text_image D E D1 2 D 0.08 C A-B C A NOTE1 N=80 1 2 3 4X 20 TIPS 0.20 C A-B D TOP VIEW A B E1 E1 E2 4X 0.20 H A-B D A2 A END VIEW e C SEATING PLANE 80X b 0.22 ∅ 0.08 M A-B D SIDE VIEW

Microchip Technology Drawing C04-092-PT Rev C Sheet 1 of 2

80-Lead Plastic Thin Quad Flat Pack (PT) - 12x12x1.0 mm Body [TQFP]

Note: For the most current package drawings, please see the Microchip Packaging Specification located at http://www.microchip.com/packaging

Microchip dsPIC33CH64MP208 - 80-Lead Plastic Thin Quad Flat Pack (PT) - 12x12x1.0 mm Body [TQFP] - 1

text_image H θ2 θ1 R1 R2 c L (L1) θ θ3

Microchip dsPIC33CH64MP208 - 80-Lead Plastic Thin Quad Flat Pack (PT) - 12x12x1.0 mm Body [TQFP] - 2

natural_image Isometric line drawing of an integrated circuit chip with multiple pins (no text or symbols)

SECTION A-A

UnitsMILLIMETERS
Dimension LimitsMINNOMMAX
Number of TerminalsN80
Pitche0.50 BSC
Overall HeightA--1.20
StandoffA10.05-0.15
Molded Package ThicknessA20.95 1.051.00
Overall LengthD14.00 BSC
Molded Package LengthD112.00 BSC
Overall WidthE14.00 BSC
Molded Package WidthE112.00 BSC
Terminal Widthb0.170.220.27
Terminal Thicknessc0.09 - 0.20
Terminal LengthL0.450.600.75
L1 1.00 REFFootprint
R1-0.08 -Lead Bend R
R2-0.08 020Lead Ber
Angleθ3.5°0° 7°
Lead Angleθ1--
Mold Draft Angleθ211°12°13°
Mold Draft Angleθ311°12°13°

Foot

Notes:

  1. Pin 1 visual index feature may vary, but must be located within the hatched area.
  2. Dimensioning and tolerancing per ASME Y14.5M

BSC: Basic Dimension. Theoretically exact value shown without tolerances.

REF: Reference Dimension, usually without tolerance, for information purposes only.

Microchip Technology Drawing C04-092-PT Rev C Sheet 2 of 2

80-Lead Plastic Thin Quad Flat Pack (PT) - 12x12x1.0 mm Body [TQFP]

Note: For the most current package drawings, please see the Microchip Packaging Specification located at http://www.microchip.com/packaging

Microchip dsPIC33CH64MP208 - 80-Lead Plastic Thin Quad Flat Pack (PT) - 12x12x1.0 mm Body [TQFP] - 1

text_image C1 SILK SCREEN C2 80 G Y X E

RECOMMENDED LAND PATTERN

UnitsMILLIMETERS
Dimension LimitsMINNOMMAX
Contact PitchE0.50 BSC
C1Contact Pad Spacing 13.40
C2Contact Pad Spacing40
Contact Pad Width (Xnn)X0.30
Contact Pad Length (Xnn)Y1.50
Contact Pad to Contact Pad (Xnn)G020

Notes:

Dimensioning and tolerancing per ASME Y14.5M1.

BSC: Basic Dimension. Theoretically exact value shown without tolerances.

Microchip Technology Drawing C04-2092-PT Rev C

APPENDIX A: REVISION HISTORY

Revision A (August 2017)

This is the initial version of the document.

Revision B (June 2018)

This revision incorporates the following updates:

- Registers:

- Updates Register 3-13, Register 3-16, Register 3-17, Register 3-18, Register 3-105, Register 3-106, Register 3-119, Register 3-120, Register 3-129, Register 3-130, Register 3-132, Register 3-135, Register 3-137, Register 3-138, Register 3-140, Register 3-141, Register 3-165, Register 3-199, Register 4-12, Register 4-13, Register 4-14, Register 4-15, Register 4-16, Register 4-17, Register 4-85 Register 4-88, Register 4-90, Register 10-1, Register 10-5, Register 11-1, Register 11-5, Register 15-3, Register 12-4, Register 12-13, Register 12-14, Register 12-20, Register 12-21, Register 18-3, Register 21-5, Register 21-14, Register 21-26, Register 21-33, Register 21-34, Register 21-35 and Register 21-37.

- Deletes ADCSSL: ADC CVD Scan Select Register Low, FOSCSEL: Oscillator Source Selection Register, FOSC: Oscillator Configuration Register, FS1OSCSEL: Secondary Oscillator Source Selection Register and FS1OSC: Secondary Oscillator Configuration Register.

- Tables:

- Updates Table 2, Table 3, Table 4, Table 5, Table 6, Table 7, Table 8, Table 9, Table 1-1, Table 3-4-Table 3-18 (adds additional information to the legend), Table 3-28, Table 3-36, Table 3-37, Table 3-38, Table 3-46, Table 4-3-Table 4-15 (adds additional information to the legend), Table 4-25, Table 4-33 through Table 4-37, Table 15-1, Table 21-2, Table 21-5, Table 22-2, Table 24-3, Table 24-6, Table 24-7, Table 24-8, Table 24-9, Table 24-10, Table 24-11, Table 24-12, Table 24-13, Table 24-14, Table 24-16, Table 24-17, Table 24-15, Table 24-18, Table 24-23, Table 24-30, Table 24-35-Table 24-40, Table 24-41, Table 24-44, Table 24-45 and Table 24-50. - Adds Table 24-14 through Table 24-18.

- Figures:

- Updates Figure 3-24, Figure 3-26, Figure 4-7, Figure 4-18, Figure 14-5, Figure 14-6, Figure 14-7, Figure 14-8, Figure 20-1, Figure 21-3 and Figure .

- Sections:

- Adds "Referenced Sources" section to front matter.

- Miscellaneous:

  • Adds headings to all SFR and Register tables.
  • Adds Error Correcting Code (ECC) information.
  • Adds the 48-Lead UQFN package to the document.
  • Removes External Count with External Gate information.

Revision C (November 2018)

This revision incorporates the following updates:

- Registers:

- Updates Register 3-10, Register 3-105, Register 3-162, Register 3-163, Register 4-9, Register 4-87, Register 9-9, Register 9-12, Register 9-15, Register 11-1, Register 11-9, Register 12-2, Register 13-3, Register 13-4, Register 21-6, Register 21-27, Register 21-29 and Register 21-35. - Adds Register 3-11 and Register 4-10.

- Tables:

- Updates Table 2, Table 3, Table 4, Table 1-1, Table 3-14, Table 3-17, Table 3-18, Table 3-24, Table 3-28, Table 3-32, Table 3-33, Table 3-34, Table 3-41, Table 4-19, Table 4-21, Table 4-23, Table 4-28, Table 21-3, Table 24-4, Table 24-14, Table 24-17, Table 24-31, Table 24-34 and Table 24-50. - Adds Table 6-3 and Table 15-3.

- Figures:

- Updates Figure 4-3, Figure 4-18 and Figure 18-3. - Removes Figure 4-13.

- Examples:

- Updates Example 6-4, Example 6-5, Example 6-6 and Example 6-7. - Adds Example 4-4.

Revision C (Continued)

  • Sections:
  • Adds Section 3.5.4.7 "Cross Core Interrupts", Section 4.5.7 "Cross Core Interrupts", Section 4.6.5.3 "Controlling Configuration Changes", Section 4.6.5.4 "Control Register Lock", Section 4.6.5.5 "Considerations for Peripheral Pin Selection", Section 15.4 "SMBus Support" and Section 21.6 "Limiting Dynamic Load Changes".
  • Updates Section 4.2.1.2 “Interrupt and Trap Vectors”, Section 4.2.8 “Interfacing Program and Data Memory Spaces”, Section 4.2.8.1 “Data Access from Program Memory Using Table Instructions”, Section 4.3 “Secondary PRAM Program Memory”, Section 4.3.7 “Secondary Program Memory Control/Status Registers”, Section 4.7 “High-Speed, 12-Bit Analog-to-Digital Converter (Secondary ADC)”, Section 21.5 “Regulator Control and Sleep Mode”, Section 21.14 “Code Protection and CodeGuard™ Security – Secondary PRAM” and Product Identification System.
  • Removes Section 4.3.2 "RTSP Operation and Section 4.3.4.2 Dual Partition Modes.
  • Miscellaneous:
  • Removes reference to QFN in the 48-Pin TQFP/UQFN pin diagram.
  • Updates 28-Lead (2N) drawing to Rev C.

Revision D (August 2019)

This revision incorporates the following updates:

- Registers:

- Updates Register 3-23, Register 3-136, Register 3-137, Register 3-174, Register 3-175, Register 3-176, Register 3-181, Register 3-186, Register 4-22, Register 4-103, Register 4-104, Register 4-105, Register 4-110, Register 4-112, Register 6-10, Register 6-20, Register 9-10, Register 9-13, Register 9-14, Register 9-19, Register 9-32, Register 10-1, Register 10-2, Register 10-4 and Register 10-5.

- Adds Register 6-12.

- Tables:

- Updates Table 4, Table 5, Table 6, Table 7, Table 8, Table 9, Table 3-12, Table 3-13, Table 3-34, Table 3-47, Table 4-9, Table 4-31, Table 8-2, Table 8-3, Table 24-4, Table 24-44, Table 24-50, Table 24-51, Table 25-1, Table 25-5, Table 25-7, Table 25-8, Table 25-11, Table 25-12, Table 25-13, Table 25-14, Table 25-15, Table 25-16, Table 25-17, Table 25-19, Table 25-20, Table 25-21 and Table 25-22.

  • Adds Table 3-23, Table 4-20 and Table 25-23.
  • Removes Table 4-25: 5V Input Tolerant Ports and Table 25-8: Doze Current (IDOZE).

- Figures

- Updates Figure 4-18, Figure 6-2, Figure 6-3 and Figure 10-1.

- Sections:

  • Adds FRM HTML links to all intro notes.
  • Adds Section 3.10.3 "Temperature Sensor", Section 4.7.3 "Temperature Sensor", Section 6.7 "Backup Internal Fast RC (BFRC) Oscillator" and Section 9.3 "PWM4H/L Output on Peripheral Pin Select".

- Updates Operating Conditions, Section 4.3 "Secondary PRAM Program Memory", Section 5.0 "Main Secondary Interface (MSI)", Section 6.1 "Primary PLL", Section 6.2 "Auxiliary PLL", Section 15.2 "Setting Baud Rate When Operating as a Bus Host", Section 18.1 "Control Registers" and Section 24.0 "Electrical Characteristics".

- Minor grammatical and formatting corrections throughout the document.

Revision E (September 2023)

This revision incorporates the following updates:

- Registers:

- Updates Register 3-24, Register 3-110, Register 3-111, Register 3-185, Register 4-90, Register 6-1, Register 6-12, Register 6-13, Register 6-19, Register 9-13, Register 10-1, Register 11-5, Register 12-7 (POSxHLD), Register 12-10 (VELxHLD), Register 12-15, Register 12-16, Register 12-19, Register 12-20, Register 13-1, Register 13-3, Register 13-9, Register 13-10, Register 13-11, Register 18-1, Register 18-3, Register 21-5, Register 21-13, and Register 21-34.

- Adds Register 3-4, Register 3-5, Register 4-4

- Removes Register 12-7 (POSxHLDL) and Register 12-7 (VELxHLDL).

- Tables:

- Updates Table 2, Table 3, Table 4, Table 5, Table 6, Table 7, Table 8, Table 9, Table 1-1, Table 3-18, Table 3-31, Table 3-47, Table 4-15, Table 4-27, Table 6-3, Table8-2, Table 8-3, Table 24-4, Table 24-19, Table 24-21, Table 24-30, Table 24-33, Table 24-35, Table 24-43, Table 24-44, Table 25-4 and Table 25-11.

- Adds Table 24-5, Table 24-47, Table 24-48 and Table 24-49.

- Removes Table 24-44: Analog-to-Digital Conversion Timing Specifications.

- Figures:

  • Updates Figure 1-2, Figure 2-3, Figure 4-18 and Figure 20-1.
  • Adds Figure 21-2, Figure 24-18, Figure 24-19 and Figure 24-20.

- Sections:

- Updates Communication Interfaces, Section 2.5 "External Oscillator Pins", Section 3.5.4.7 "Cross Core Interrupts", Section 3.10.3 "Temperature Sensor", Section 6.6 "Low-Power RC (LPRC) Oscillator", Section 6.8 "Reference Clock Output", Section 13.0 "Universal Asynchronous Receiver Transmitter (UART)", Section 13.4 "Protocol Extensions", Section 14.0 "Serial Peripheral Interface (SPI)", Section 21.5 "Regulator Control and Sleep Mode", Section 21.7 "Brown-out Reset (BOR)" and Section 21.8 "Dual Watchdog Timer (WDT)".

- Adds Functional Safety Readiness – ISO 26262/IEC 61508/IEC 60730, Terminology Cross Reference, Section 2.6 “External Oscillator Layout Guidance”, Section 3.7

"Cross-Core Signal Mapping", Section 3.10.2 "Sampling Time Requirements", Section 4.7.2 "Sampling Time Requirements", and Section 6.10 "Primary Oscillator Pin Functionality".

- Equations

- Updates Equation 15-1.

INDEX

Numerics

and SYNCMAX 642

Equations

SYNCMIN 642

5V Input Tolerant Ports 117

A

Absolute Maximum Ratings 733,777

AC Characteristics 748

ADC Specifications 768

Auxiliary PLL Clock Timing Specifications 750

Capacitive Loading Requirements on Output Pins ... 748

Constant-Current Source Specifications.... 775

DACx Output (DACOUT1 Pin) Specifications ..... 771

DACx Specifications 771

External Clock Timing Requirements.... 749

High-Speed Analog Comparator Specifications..... 770

High-Speed PWMx Timing Requirements 754

I/O Timing Requirements 752

I2Cx Bus Data Timing Requirements (Client Mode) . 766

I2Cx Bus Data Timing Requirements (Host Mode) .. 758, 764

Internal FRC Accuracy.... 751

Internal LPRC Accuracy.... 751

Load Conditions 748

PLL Clock Timing Specifications.... 750

Reset, WDT, OST, Requirements.... 753

SPIx Client Mode (Full-Duplex, CKE = 0, CKP = x, SMP = 0) Timing Requirements .... 760

SPIx Client Mode (Full-Duplex, CKE = 1, CKP = x, SMP = 0) Timing Requirements .... 762

SPIx Host Mode (Full-Duplex, CKE = 1, CKP = x, SMP = 1) Timing Requirements....757

SPIx Host Mode (Half-Duplex, Transmit Only) Timing Requirements....756

SPIx Maximum Data/Clock Rate Summary 755

Temperature and Voltage Specifications 748

UARTx I/O Timing Requirements 767

AC/DC Characteristics

PGAx Specifications 775

Alternate Main Interrupt Vector Table 98

Analog-to-Digital Converter. See ADC.

Arithmetic Logic Unit (ALU).... 49, 276

B

Bit-Reversed Addressing 75, 298

Example 76,299

Implementation 75,298

Sequence Table (16-Entry).... 76, 299

Block Diagrams

16-Bit Timer1 Module 649

32-Bit Timer Mode 546

ADC Module.... 227, 390

ADC Shared Core 228,391

Addressing for Table Registers....80

CALL Stack Frame 71,294

CAN FD Module 183

CLCx Input Source Selection.... 655

CLCx Logic Function Combinatorial Options 654

CLCx Module 653

Conceptual SCCPx Modules 544

Constant-Current Source 670

CRC Module 665

Data Access from Program Space Address Generation 77, 300

Deadman Timer Module 174

Dedicated ADC Core 391

Direct Memory Access (DMA) 500

dsPIC33CH128MP508 Family 25

Dual 16-Bit Timer Mode....546

High-Speed Analog Comparator.... 562

I2Cx Module 630

Input Capture x Module 548

Interleaved PFC.... 35

Internal Regulator 709

Main Core Oscillator Subsystem 440

Main CPU Core.... 40

Main/Secondary Core APLL and VCO 445

Main/Secondary Core PLL and VCO 442

Main/Secondary Core Shared Clock Sources ..... 439

Master Reset System 92

MCLR Pin Connections 32

Multiplexing Remappable Outputs for RPn.... 135

Multiplexing Remappable Outputs for S1RPn ..... 354

Off-Line UPS 37

Output Compare x Module.... 547

PGAx Functions 420

PGAx Module 419

Phase-Shifted Full-Bridge Converter 36

Programmer's Model 42

Programmer's Model (Secondary).... 269

PSV Read Address Generation.... 68, 291

PTG 252

PWM High-Level Module.... 510

QEI Module.... 575

Recommended Minimum Connection.... 32

Reference Clock Generator.... 449

Remappable Input for U1RX.... 129, 347

Reset System 313

Secondary Core Code Transfer.... 24

Secondary Core Oscillator Subsystem 441

Secondary CPU Core 267

Security Segments.... 719

SENTx Module....640

Shared Port Structure 118,336

Simplified UARTx.... 590

SPIx Client, Frame Host Connection 628

SPIx Host, Frame Client Connection 628

SPIx Host, Frame Host Connection.... 627

SPIx Host/Client Connection (Enhanced Buffer Modes) 627

SPIx Host/Client Connection (Standard Mode) ...... 626

SPIx Module (Enhanced Mode).... 614

SPIx Module (Standard Mode) 613

Suggested Oscillator Circuit Placement 34

Timer Clock Generator 544

Watchdog Timer (WDT).... 713

Brown-out Reset (BOR).... 675, 711

C

Calculations 642

CAN

CAN FD Module

Control/Status Registers.... 184

Features 182

Message Reception 182

Capture/Compare/PWM/Timer

Auto-Shutdown and Gating Sources (Main) 556

Auto-Shutdown and Gating Sources (Secondary) .... 556

Auxiliary Output.... 549

Control/Status Registers 550

General Purpose Timer.... 545

Input Capture Mode 548

Output Compare Mode 547

Overview 543

Synchronization Sources (Main) 553

Synchronization Sources (Secondary).... 554

Time Base Generator.... 544

Capture/Compare/PWM/Timer (SCCP) 543

CBG

CLC

Control Registers 656

Overview 653

Code Examples

Configuring UART1 Input and Output Functions ..... 129, 347

Flash Write/Read 81

MSI Enable Operation.... 437

MSI Enable Operation in C 437

Port Write/Read 345

PWRSAV Instruction Syntax 481

Secondary PRAM Load and Verify Routine.... 303

Secondary Start and Stop.... 303

Using Main or Secondary Auxiliary PLL with Internal FRC 446

Using Main PLL (50 MIPS) with POSC 451

Using Main PLL with 8 MHz Internal FRC 453

Using Main Primary PLL with 8 MHz Internal FRC ... 444

Using Secondary PLL (60 MIPS) with POSC ..... 452

Using Secondary PLL with 8 MHz Internal FRC ..... 454

Using Secondary Primary PLL with 8 MHz Internal FRC 444

Code Protection 675

Code Protection, CodeGuard Security (Main Flash)...... 718

Code Protection, CodeGuard Security (Secondary PRAM).... 719

CodeGuard Security 675

Comparator/DAC

Control Registers 563

Features Overview.... 563

Overview 561

Configurable Logic Cell (CLC) 653

Configurable Logic Cell. See CLC.

Configuration Bits.... 675

Bit Values for Main Clock Selection 455

Bit Values for Secondary Clock Selection.... 456

Controller Area Network (CAN FD) 182

Controller Area Network. See CAN.

CRC

Control Registers 666

Overview 665

Current Bias Generator

Channel Availability.... 669

Control Registers 671

Current Bias Generator (CBG).... 669

Current Bias Generator. See CBG.

Customer Change Notification Service 830

Customer Notification Service.... 830

Customer Support 830

Cyclic Redundancy Check. See CRC.

D

Data Address Space 53

Memory Map for dsPIC33CH128MP508 Devices ..... 54

Near Data Space 53

Organization, Alignment 53

SFR Space 53

Width 53

Data Address Space (Secondary) 279

Memory Map for Secondary dsPIC33CH128MP508S1 Devices.... 280

Near Data Space 279

Organization, Alignment 279

Resources 281

SFR Space 279

Width 279

Data Space

Extended X 71

Paged Data Memory Space (figure) 69

Paged Memory Scheme 68

Data Space (Secondary)

Extended X 294

Paged Data Memory Space (figure) 292

Paged Memory Scheme 291

DC Characteristics

ADC Delta Current....744

APLL Delta Current 743

Brown-out Reset (BOR)....747

Comparator + DAC Delta Current.... 744

Idle Current (IIDLE) (Main Idle/Secondary Sleep)..... 740

Idle Current (IIDLE) (Main Sleep/Secondary Idle)..... 741

Operating Current (IDD) (Main Run/Secondary Run) 736

Operating Current (IDD) (Main Run/Secondary Sleep) ... 738, 781

Operating Current (IDD) (Main Sleep/Secondary Run) ... 737

Operating Current (IIDLE) (Main Idle/Secondary Idle) 739

Operating MIPS vs. Voltage 734

PGA Delta Current....744

Power-Down Current (IPD).... 742

Program Memory....747

PWM Delta Current 743

Watchdog Timer Delta Current (ΔlwdT).... 742

Deadman Timer (DMT).... 174

Control/Status Registers.... 175

Deadman Timer. See DMT.

Development Support....731

Device Calibration....705

Addresses....705

and Identification 705

Device Overview....23

Device Variants....707

Direct Memory Access Controller. See DMA.

DMA

Channel Trigger Sources (Main) 507

Channel Trigger Sources (Secondary) 508

Control Registers.... 504

Peripheral Module Disable (PMD) 503

Summary of Operations.... 501

Types of Data Transfers 502

Typical Setup.... 503

DMT

Doze Mode 483

DSP Engine 49,276

dsPIC33CH128MP508S1 Family Interrupt Vector Table.. 318

Dual Watchdog Timer (Dual WDT) 712

Control Registers....714

Overview....712

E

Electrical Characteristics....733

AC 748

I/O Pin Input Injection Current Specifications ..... 746

I/O Pin Input Specifications.... 745, 746

I/O Pin Output Specifications 746

Operating Voltage Specifications.... 735

Voltage Regulator Specifications 735

Equations

Calculating Frequency Output 449

Frame Time Calculations 641

I^2C Baud Rate Reload Calculation.... 631

Main/Secondary Core AFvco Calculation.... 446

Main/Secondary Core FPLLO Calculation 443

Main/Secondary Core Fvco Calculation 443

Mainr/Secondary Core AFPLLO Calculation ..... 446

Relationship Between Device and SPIx Clock Speed .... 628

Tick Period Calculation 641

Errata 19

Error Correcting Code (ECC) 82, 304

Control Registers 89

Fault Injection....83

F

Flexible Configuration 675

G

Getting Started Guidelines 31

Connection Requirements 31

Decoupling Capacitors.... 31

External Oscillator Pins.... 33

ICSP Pins 33

Master Clear (MCLR) Pin.... 32

Oscillator Value Conditions on Start-up 34

Targeted Applications 34

Unused I/Os 34

H

High-Resolution PWM (HSPWM) with Fine Edge Placement. 509

High-Speed Analog Comparator with Slope Compensation DAC 561

High-Speed, 12-Bit Analog-to-Digital Converter (Main ADC).. 226

Control/Status Registers 230

Features Overview.... 226

Resources.... 229

Temperature Sensor 229

High-Speed, 12-Bit Analog-to-Digital Converter (Secondary ADC) 389

Control/Status Registers 393

Features Overview.... 389

Resources.... 392

High-Temperature AC/DC Characteristics

PGAx Specifications 789

High-Temperature DC Characteristics

ADC Delta Current 787

ADC Specifications 789

APLL Delta Current 786

Comparator + DAC Delta Current 787

DACx Specifications 789

I/O Pin Input Specifications.... 788

Idle Current (IIDLE), Main Idle/Secondary Sleep ..... 783

Internal FRC Accuracy.... 788

Internal LPRC Accuracy 788

Operating Current (IDD), Main Run/Secondary Run . 780

Operating Current (IDD), Main Sleep/Secondary Run.....780

Operating Current (IIDLE), Main Idle/Secondary Idle. 782

Operating Current (IIDLE), Main Sleep/Secondary Idle ... 784

Operating MIPS vs. Voltage 778

Operating Voltage Specifications.... 779

PGAx Delta Current 787

Power-Down Current (IPD).... 785

PWM Delta Current.... 786

Thermal Operating Conditions.... 778

Thermal Packaging Characteristics 778

Watchdog Timer Delta Current ( IWDT).... 785

High-Temperature Electrical Characteristics 777

HSPWM

Architecture 510

Control Registers.... 511

Overview....509

|

I^2C

Client Address Masking 631

Clock Rates 631

Communicating as Main in Single Main Environment .... 629

Control/Status Registers.... 633

Reserved Addresses 632

Setting Baud Rate as Bus Host 631

SMBus Support 632

In-Circuit Debugger....717

In-Circuit Emulation 675

In-Circuit Serial Programming (ICSP).... 675, 717

Input Change Notification (ICN).... 127, 345

Instruction Addressing Modes 72, 295

File Register Instructions 72, 295

Fundamental Modes Supported 72, 295

MAC Instructions.... 73, 296

MCU Instructions 72, 295

Move and Accumulator Instructions.... 73, 296

Other Instructions 73, 296

Instruction Set Summary 721

Overview....724

Symbols Used in Opcode Descriptions 722

Instruction-Based Power-Saving Modes.... 481

Idle....482

Sleep 482

Inter-Integrated Circuit. See I²C.

Internet Address 830

Interrupts Coincident with Power Save Instructions ..... 482

J

JTAG Boundary Scan Interface 675

JTAG Interface....717

L

Limiting Dynamic Load Changes 711

M

Main CPU 38

Addressing Modes 39

Control/Status Registers.... 44

Data Space Addressing.... 39

Instruction Set.... 38

Registers 38

Resources.... 43

Main Flash Program Memory....79

Control Registers 83

Operations 79

RTSP Operation....81

Main I/O Ports 116

Configuring Analog/Digital Port Pins.... 119

Control Registers 120

Helpful Tips 138

Open-Drain Configuration 119

Parallel I/O (PIO).... 116

Resources.... 139

Write/Read Timing 119

Main Interrupt Controller 96

Alternate Interrupt Vector Table (AIVT) 96

Control and Status Registers 107

INTCON1 107

INTCON2 107

INTCON3 107

INTCON4 107

INTTREG 107

Interrupt Vector Details 100

Interrupt Vector Table (IVT) 96

Reset Sequence 96

Resources.... 107

Status/Control Registers 108

Trap Table....99

Main Interrupt Vector Table 97

Main Program Memory

Address Space....50

Memory Map (dsPIC33CH128MPXXX Devices) 50

Memory Map (dsPIC33CH64MPXXX Devices) .. 51

Table Read High Instructions (TBLRDH) 78

Table Read Low Instructions (TBLRDL) 78

Interfacing with Data Memory Spaces 77

Organization....52

Reset Vector 52

Main Secondary Interface (MSI) 425

Main Secondary Interface. See MSI.

Main SFR Block

000h 56

100h 57

200h 58

300h-400h....59

500h 60

600h 61

700h 62

800h 62

900h 63

A00h....64

B00h....65

C00h 65

D00h 66

E00h....66

F00h....67

Master Resets....92

Brown-out Reset (BOR) 92

Configuration Mismatch Reset (CM)....92

Control Register 94

Illegal Condition Reset (IOPUWR).... 92

Illegal Opcode....92

Security....92

Uninitialized W Register.... 92

Master Clear (MCLR) Pin Reset 92

Power-on Reset (POR) 92

RESET Instruction (SWR) 92

Resources 93

Trap Conflict Reset (TRAPR) 92

Watchdog Timer Time-out Reset (WDTO) 92

Memory Organization

Resources 55

Microchip Internet Web Site 830

Modulo Addressing.... 74, 297

Applicability.... 75, 298

Operation Example.... 74, 297

Start and End Address 74,297

W Address Register Selection.... 74, 297

MSI

Main Control Registers 425

Secondary Control Registers.... 432

Secondary Processor Control.... 437

Secondary Reset Coupling Control 437

MSTRPR....275

N

NVM Control Registers 84

o

Oscillator Auxiliary PLL.... 445

Backup Internal Fast RC (BFRC) 448

CPU Clocking 447

Internal Fast RC (FRC).... 448

Low-Power RC (LPRC) 448

Main Configuration Registers 455

Main SFRs.... 457

OSCCON Unlock Sequence.... 450

Primary (POSC)...... 448

Primary PLL.... 442

Reference Clock Output 449

Secondary Configuration Registers.... 456

Secondary SFRs 470

Oscillator with High-Frequency PLL 439

P

Packaging....791

Details....793

Marking Information....791

Peripheral Module Disable (PMD) 483

Control Registers.... 484

Peripheral Pin Select (PPS).... 127, 346

Available Peripherals.... 127, 346

Available Pins 127,346

Considerations.... 128, 346

Control Register Lock 128,346

Control Registers.... 143, 361

Controlling Configuration Changes.... 128, 346

Main Remappable Output Pin Registers 136

Main Remappable Pin Inputs 130

Output Selection for Remappable Pins 137

Secondary Output Selection for Remappable Pins .. 357

Secondary PPS Inputs to Main Core PPS.... 350

Secondary Selectable Input Sources 351

Selectable Input Sources.... 133

Virtual Connections 350

Peripheral Trigger Generator (PTG) 251

Peripheral Trigger Generator. See PTG.

Pin and ANSELx Availability 117

Pinout I/O Descriptions (table)...... 26

Power-Saving Features

Clock Frequency and Switching.... 481

Resources....483

Power-Saving Features (Main and Secondary 481

PRAM for Secondary dsPIC33CH128MP508S1 Devices. 277

Program Address Space 277

Construction.... 300

Data Access from Program Memory Using Table Instructions 301

Program Memory

Address Space Construction....77 Data Access from Program Memory Using Table Instructions....78

Interfacing with Data Memory Spaces 300

Organization.... 278

Reset Vector 278

Programmable Gain Amplifier (PGA) Secondary...... 419

Control Registers 422

Description 420

Resources.... 421

Programmable Gain Amplifier. See PGA.

Programmer's Model.... 41

Register Descriptions.... 41

PTG

Command Options 263

Control/Status Registers 253

Features.... 251

Input Descriptions 264

Output Descriptions 264

Step Command Format/Description.... 262

Q

QEI

Control and Status Registers 576

Overview 573

Truth Table.... 574

Quadrature Encoder Interface (QEI) 573

Quadrature Encoder Interface. See QEI.

R

Referenced Sources 20

Register Maps

Main Configuration.... 676

Main Interrupt Enable.... 104

Main Interrupt Flag.... 104

Main Interrupt Priority.... 105

Main PMD 498

Main PPS Input Control 172

Main PPS Output Control.... 173

PORTA.... 140, 386

PORTB....140,386

PORTC 141,387

PORTD 141,387

PORTE.... 142, 388

Secondary Configuration 677

Secondary Interrupt Enable 323

Secondary Interrupt Flag 323

Secondary Interrupt Priority 324

Secondary PMD 498

Secondary PPS Input Control 353

Secondary PPS Output Control 358

Registers

ACLKCON1 (Main Auxiliary Clock Control) 464

ACLKCON1 (Secondary Auxiliary Clock Control) ..... 476

ADCAL1H (ADC Calibration 1 High) 414

ADCMPxCON (ADC Digital Comparator x Control). 247, 415

ADCMPxENH (ADC Digital Comparator x Channel Enable High) 248, 416

ADCMPxENL (ADC Digital Comparator x Channel Enable Low) 248, 416

ADCON1H (ADC Control 1 High) 231, 394

ADCON1L (ADC Control 1 Low).... 230, 393

ADCON2H (ADC Control 2 High) 233, 396

ADCON2L (ADC Control 2 Low).... 232, 395

ADCON3H (ADC Control 3 High) 235, 398

ADCON3L (ADC Control 3 Low)....234, 397

ADCON4H (ADC Control 4 High) 400

ADCON4L (ADC Control 4 Low).... 399

ADCON5H (ADC Control 5 High) 237, 402

ADCON5L (ADC Control 5 Low).... 236, 401

ADCORExH (Dedicated ADC Core x Control High) . 404

ADCORExL (Dedicated ADC Core x Control Low)... 403

ADEIEH (ADC Early Interrupt Enable High) ..... 239, 406

ADEIEL (ADC Early Interrupt Enable Low)..... 239, 406

ADEISTATH (ADC Early Interrupt Status High) 240, 407

ADEISTATL (ADC Early Interrupt Status Low). 240, 407

ADFLxCON (ADC Digital Filter x Control) ..... 249, 417

ADIEH (ADC Interrupt Enable High).... 243, 410

ADIEL (ADC Interrupt Enable Low) 243, 410

ADLVLTRGH (ADC Level-Sensitive Trigger Control High) 238, 405

ADLVLTRGL (ADC Level-Sensitive Trigger Control Low) 238, 405

ADMOD0H (ADC Input Mode Control 0 High).. 241, 408

ADMOD0L (ADC Input Mode Control 0 Low) ... 241, 408

ADMOD1L (ADC Input Mode Control 1 Low) ... 242, 409

ADSTATH (ADC Data Ready Status High) ..... 244, 411

ADSTATL (ADC Data Ready Status Low)..... 244, 411

ADTRIGnL/ADTRIGnH (ADC Channel Trigger n(x) Selection Low/High) 245, 412

ANSELx (Analog Select for PORTx).... 120, 338

APLLDIV (Secondary APLL Output Divider)...... 478

APLLDIV1 (Main APLL Output Divider) 466

APLLFBD1 (Main APLL Feedback Divider)...... 465

APLLFBD1 (Secondary APLL Feedback Divider) .... 477

BIASCON (Current Bias Generator Control) 671

C1BDIAG0H (CAN Bus Diagnostics 0 High) ...... 219

C1BDIAG0L (CAN Bus Diagnostics 0 Low)...... 219

C1BDIAG1H (CAN Bus Diagnostics 1 High) ...... 220

C1BDIAG1L (CAN Bus Diagnostics 1 Low)...... 221

C1CONH (CAN Control High).... 184

C1CONL (CAN Control Low) 186

C1DBTCFGH (CAN Data Bit Time Configuration High) . 188

C1DBTCFGL (CAN Data Bit Time Configuration Low)... 188

C1FIFOBAH (CAN Message Memory Base Address High) 203

C1FIFOBAL (CAN Message Memory Base Address Low)....203

C1FIFOCONHx (CAN FIFO Control x High).... 207

C1FIFOCONLx (CAN FIFO Control x Low) 208

C1FIFOSTAx (CAN FIFO Status x) 210

C1FIFOUAHx (CAN FIFO User Address High x) ..... 215

C1FIFOUALx (CAN FIFO User Address Low x)..... 215

C1FLTCONxH (CAN Filter Control x High).... 222

C1FLTCONxL (CAN Filter Control x Low) 223

C1FLTOBJxH (CAN Filter Object x High).... 224

C1FLTOBJxL (CAN Filter Object x Low) 224

C1INTH (CAN Interrupt High) 196

C1INTL (CAN Interrupt Low).... 197

C1MASKxH (CAN Mask x High) 225

C1MASKxL (CAN Mask x Low) 225

C1NBTCFGH (CAN Nominal Bit Time Configuration High) 187

C1NBTCFGL (CAN Nominal Bit Time Configuration Low) 187

C1RXIFH (CAN Receive Interrupt Status High)..... 198

C1RXIFL (CAN Receive Interrupt Status Low) ..... 198

C1RXOVIFH (CAN Receive Overflow Interrupt Status High) 199

C1RXOVIFL (CAN Receive Overflow Interrupt Status Low) 199

C1TBCH (CAN Time Base Counter High) 192

C1TBCL (CAN Time Base Counter Low).... 192

C1TDCH (CAN Transmitter Delay Compensation High) 190

C1TDCL (CAN Transmitter Delay Compensation Low).. 191

C1TEFCONH (CAN Transmit Event FIFO Control High) 212

C1TEFCONL (CAN Transmit Event FIFO Control Low) . 213

C1TEFSTA (CAN Transmit Event FIFO Status) ..... 214

C1TEFUAH (CAN Transmit Event FIFO User Address High) 216

C1TEFUAL (CAN Transmit Event FIFO User Address Low) 216

C1TRECH (CAN Transmit/Receive Error Count High) ... 218

C1TRECL (CAN Transmit/Receive Error Count Low) .... 218

C1TSCONH (CAN Timestamp Control High) ..... 193

C1TSCONL (CAN Timestamp Control Low)...... 193

C1TXATIFH (CAN Transmit Attempt Interrupt Status High) 201

C1TXATIFL (CAN Transmit Attempt Interrupt Status Low) 201

C1TXIFH (CAN Transmit Interrupt Status High) ..... 200

C1TXIFL (CAN Transmit Interrupt Status Low) ...... 200

C1TXQCONH (CAN Transmit Queue Control High). 204

C1TXQCONL (CAN Transmit Queue Control Low) .. 205

C1TXQSTA (CAN Transmit Queue Status) 206

C1TXQUAH (CAN Transmit Queue User Address High) 217

C1TXQUAL (CAN Transmit Queue User Address Low). 217

C1TXREQH (CAN Transmit Request High)...... 202

C1TXREQL (CAN Transmit Request Low) 202

C1VECH (CAN Interrupt Code High) 194

C1VECL (CAN Interrupt Code Low) 195

CANCLKCON (CAN Clock Control).... 467

CCPxCON1H (CCPx Control 1 High) 552

CCPxCON1L (CCPx Control 1 Low)....550

CCPxCON2H (CCPx Control 2 High) 557

CCPxCON2L (CCPx Control 2 Low).... 555

CCPxCON3H (CCPx Control 3 High) 558

CCPxSTATL (CCPx Status) 559

CLCxCONH (CLCx Control High) 657

CLCxCONL (CLCx Control Low) 656

CLCxGLSH (CLCx Gate Logic Input Select High) .... 662

CLCxGLSL (CLCx Gate Logic Input Select Low) ..... 660

CLCxSEL (CLCx Input MUX Select).... 658

CLKDIV (Main Clock Divider).... 459

CLKDIV (Secondary Clock Divider).... 472

CMBTRIGH (Combinational Trigger High) 516

CMBTRIGL (Combinational Trigger Low).... 515

CNCONx (Change Notification Control for PORTx) 124, 342

CNEN0x (Interrupt Change Notification Enable for PORTx).... 124, 342

CNEN1x (Interrupt Change Notification Edge Select for PORTx).... 125, 343

CNFx (Interrupt Change Notification Flag for PORTx) ... 126, 344

CNPDx (Change Notification Pull-Down Enable for PORTx).... 123, 341

CNPUx (Change Notification Pull-up Enable for PORTx) 123, 341

CNSTATx (Interrupt Change Notification Status for PORTx).... 125, 343

CORCON (Core Control).... 46, 109, 273

CORCON (Secondary Core Control).... 328

CRCCONH (CRC Control High) 667

CRCCONL (CRC Control Low) 666

CRCXORH (CRC XOR Polynomial, High Byte) ..... 668

CRCXORL (CRC XOR Polynomial, Low Byte)...... 668

CTXTSTAT (CPU W Register Context Status).... 47, 48, 274

DACCTRL1L (DAC Control 1 Low) 564

DACCTRL2H (DAC Control 2 High) 565

DACCTRL2L (DAC Control 2 Low) 565

DACxCONH (DACx Control High).... 566

DACxCONL (DACx Control Low) 566

DACxDATH (DACx Data High).... 568

DACxDATL (DACx Data Low) 568

DEVID (Device ID)....706

DEVREV (Device Revision).... 706

DMACHn (DMA Channel n Control) 505

DMACON (DMA Engine Control) 504

DMAINTn (DMA Channel n Interrupt).... 506

DMTCLR (Deadman Timer Clear).... 176

DMTCNTH (Deadman Timer Count High).... 178

DMTCNTL (Deadman Timer Count Low) 178

DMTCON (Deadman Timer Control) 175

DMTHOLDREG (DMT Hold) 181

DMTPRECLR (Deadman Timer Preclear).... 175

DMTPSCNTH (DMT Post-Configure Count Status High) 179

DMTPSCNTL (DMT Post-Configure Count Status Low) 179

DMTPSINTVH (DMT Post-Configure Interval Status High)....180

DMTPSINTVL (DMT Post-Configure Interval Status Low)....180

DMTSTAT (Deadman Timer Status) 177

ECCADDRH (ECC Fault Inject Address Compare High) 90, 311

ECCADDRL (ECC Fault Inject Address Compare Low). 90, 311

ECCCONH (ECC Fault Injection Configuration High) 89, 310

ECCCONL (ECC Fault Injection Configuration Low). 89, 310

ECCSTATH (ECC System Status Display High) 91, 312

ECCSTATL (ECC System Status Display Low) . 91, 312

FALTREG Configuration.... 689

FBSLIM Configuration 679

FCFGPRA0 (PORTA Configuration) 694

FCFGPRB0 (PORTB Configuration).... 695

FCFGPRC0 (PORTC Configuration) 695

FCFGPRD0 (PORTD Configuration) 696

FCFGPRE0 (PORTE Configuration 696

FDEVOPT Configuration.... 688

FDMT Configuration.... 687

FDMTCNTH Configuration.... 686

FDMTCNTL Configuration 686

FDMTIVTH Configuration 685

FDMTIVTL Configuration 685

FICD Configuration 684

FMBXHS1 Configuration.... 692

FMBXHS2 Configuration.... 693

FMBXHSEN Configuration.... 694

FMBXM Configuration.... 690

FOSC Configuration.... 681

FOSCSEL Configuration.... 680

FPOR Configuration.... 683

FS1ALTREG Configuration (Secondary) 703

FS1DEVOPT Configuration (Secondary).... 702

FS1ICD Configuration (Secondary) 701

FS1OSC Configuration (Secondary).... 698

FS1OSCSEL Configuration (Secondary).... 697

FS1POR Configuration (Secondary).... 700

FS1WDT Configuration (Secondary) 699

FSCL (Frequency Scale) 512

FSEC Configuration 678

FSIGN Configuration.... 679

FSMINPER (Frequency Scaling Minimum Period) ... 512

FWDT Configuration 682

I2CxCONH (I2Cx Control High) 635

I2CxCONL (I2Cx Control Low).... 633

I2CxMSK (I2Cx Client Mode Address Mask) ...... 637

I2CxSTAT (I2Cx Status) 636

IBIASCONH (Current Bias Generator Current Source Control High)....672

IBIASCONL (Current Bias Generator Current Source Control Low)....673

INDXxCNTH (Index x Counter High) 585

INDXxCNTL (Index x Counter Low) 585

INDXxHLD (Index x Counter Hold) 585

INTCON1 (Interrupt Control 1) 110

INTCON1 (Secondary Interrupt Control 1)...... 329

INTCON2 (Interrupt Control 2) 112

INTCON2 (Secondary Interrupt Control 2).... 331

INTCON3 (Interrupt Control 3) 113

INTCON3 (Secondary Interrupt Control 3).... 332

INTCON4 (Interrupt Control 4) 114

INTCON4 (Secondary Interrupt Control 4).... 332

INTTREG (Interrupt Control and Status).... 115

INTTREG (Secondary Interrupt Control and Status) 333

INTxHLDH (Interval x Timer Hold High).... 584

INTxHLDL (Interval x Timer Hold Low) 584

INTxTMRH (Interval x Timer High).... 583

INTxTMRL (Interval x Timer Low) 583

LATx (Output Data for PORTx) 122, 340

LFSR (Linear Feedback Shift) 521

LOGCONy (Combinatorial PWM Logic Control y) .... 517

MDC (Main Duty Cycle) 513

MPER (Main Period) 514

MPHASE (Main Phase) 513

MRSWFDATA (Main Read (Secondary Write) FIFO Data).... 431

MSI1CON (MSI1 Main Control) 426

MSI1FIFOCS (MSI1 Main FIFO Control/Status) ..... 430

MSI1KEY (MSI1 Main Interlock Key).... 428

MSI1MBXnD (MSI1 Main Mailbox n Data) 429

MSI1MBXS (MSI1 Main Mailbox Data Transfer Status) . 428

MSI1STAT (MSI1 Main Status) 427

MSTRPR (EDS Bus Master Priority Control)..... 48, 275

MWSRFDATA (Main Write (Secondary Read) FIFO Data) 431

NVMADR (Nonvolatile Memory Lower Address) ..... 86

NVMADR (Secondary Program Memory Lower Address) 307

NVMADRU (Nonvolatile Memory Upper Address) ..... 86

NVMADRU (Secondary Program Memory Upper Address).... 307

NVMCON (Nonvolatile Memory (NVM) Control)...... 84

NVMCON (Program Memory Secondary Control).... 305

NVMKEY (Nonvolatile Memory Key) 87

NVMKEY (Secondary Nonvolatile Memory Key) ..... 308

NVMSRCADRH (NVM Source Data Address High) ... 88

NVMSRCADRH (Secondary NVM Source Data Address High) 309

NVMSRCADRL (NVM Source Data Address Low) .... 88

NVMSRCADRL (Secondary NVM Source Data Address Low).... 309

ODCx (Open-Drain Enable for PORTx).... 122, 340

OSCCON (Main Oscillator Control) 457

OSCCON (Secondary Oscillator Control).... 470

OSCTUN (Main FRC Oscillator Tuning).... 462

PCLKCON (PWM Clock Control) 511

PGAxCAL (PGAx Calibration) 423

PGAxCON (PGAx Control) 422

PGxCAP (PWM Generator x Capture) 542

PGxCONH (PWM Generator x Control High) ..... 523

PGxCONL (PWM Generator x Control Low) 522

PGxDC (PWM Generator x Duty Cycle) 538

PGxDCA (PWM Generator x Duty Cycle Adjustment).... 539

PGxDTH (PWM Generator x Dead-Time High) ..... 541

PGxDTL (PWM Generator x Dead-Time Low) ..... 541

PGxEVTH (PWM Generator x Event High) 535

PGxEVTL (PWM Generator x Event Low).... 534

PGxIOCONH (PWM Generator x I/O Control High) . 528

PGxIOCONL (PWM Generator x I/O Control Low)... 527

PGxLEBH (PWM Generator x Leading-Edge Blanking High) 537

PGxLEBL (PWM Generator x Leading-Edge Blanking Low)....536

PGxPER (PWM Generator x Period).... 539

PGxPHASE (PWM Generator x Phase) 538

PGxSTAT (PWM Generator x Status) 525

PGxTRIGA (PWM Generator x Trigger A).... 540

PGxTRIGB (PWM Generator x Trigger B).... 540

PGxTRIGC (PWM Generator x Trigger C) 540

PGxyPCIH (PWM Generator xy PCI High).... 532

PGxyPCIL (PWM Generator xy PCI Low) 529

PLLDIV (Main PLL Output Divider).... 463

PLLDIV (Secondary PLL Output Divider) 475

PLLFBD (Main PLL Feedback Divider).... 461

PLLFBD (Secondary PLL Feedback Divider) ...... 474

PMD1 (Main PMD1 Control Low) 484

PMD1 (Secondary PMD1 Control).... 492

PMD2 (Main PMD2 Control High).... 485

PMD2 (Secondary PMD2 Control).... 493

PMD3 (Main PMD3 Control Low) 486

PMD4 (Main PMD4 Control) 487

PMD4 (Secondary PMD4 Control).... 494

PMD6 (Main PMD6 Control High).... 488

PMD6 (Secondary PMD6 Control High) 495

PMD7 (Main PMD7 Control Low) 489

PMD7 (Secondary PMD7 Control Low) 496

PMD8 (Main PMD8 Control) 490

PMD8 (Secondary PMD8 Control).... 497

PMDCON (Secondary PMD Control).... 491

PORTx (Input Data for PORTx) 121, 339

POSxCNTH (Position x Counter High) 581

POSxCNTL (Position x Counter Low).... 581

POSxHLD (Position x Counter Hold 582

PTGADJ (PTG Adjust) 260

PTGBTE (PTG Broadcast Trigger Enable Low) ..... 256

PTGBTEH (PTG Broadcast Trigger Enable High) .... 256

PTGC0LIM (PTG Counter 0 Limit).... 259

PTGC1LIM (PTG Counter 1 Limit).... 259

PTGCON (PTG Control/Status High).... 255

PTGCST (PTG Control/Status Low) 253

PTGHOLD (PTG Hold) 257

PTGL0 (PTG Literal 0) 260

PTGQPTR (PTG Step Queue Pointer) 261

PTGQUEn (PTG Step Queue n Pointer) 261

PTGSDLIM (PTG Step Delay Limit) 258

PTGT0LIM (PTG Timer0 Limit) 257

PTGT1LIM (PTG Timer1 Limit) 258

PWMEVTy (PWM Event Output Control y).... 519

QEIxCONL (QEIx Control Low) 576

QEIxGECH (QEIx Greater Than or Equal Compare High) 586

QEIXGECL (QEIX Greater Than or Equal Compare Low) 586

QEIXIOCH (QEIX I/O Control High).... 579

QEIxIOCL (QEIx I/O Control Low) 577

QEIXLECH (QEIX Less than or Equal Compare High).... 587

QEIXLECL (QEIX Less than or Equal Compare Low)587

QEIXSTAT (QEIX Status) 580

RCON (Reset Control) 94, 315, 716

REFOCONH (Main Reference Clock Control High).. 469

REFOCONH (Secondary Reference Clock Control High) 480

REFOCONL (Main Reference Clock Control Low) ... 468

REFOCONL (Secondary Reference Clock Control Low) 479

REFOTRIMH (Main Reference Oscillator Trim)...... 469

RPCON (Peripheral Remapping Configuration) 143, 361

RPIN0 (Peripheral Pin Select Input 0) 361

RPINR0 (Peripheral Pin Select Input 0)....143

RPINR1 (Peripheral Pin Select Input 1)..... 144, 362

RPINR10 (Peripheral Pin Select Input 10).... 148

RPINR11 (Peripheral Pin Select Input 11)..... 149, 365

RPINR12 (Peripheral Pin Select Input 12)..... 149, 365

RPINR13 (Peripheral Pin Select Input 13)..... 150, 366

RPINR14 (Peripheral Pin Select Input 14)..... 150, 366

RPINR15 (Peripheral Pin Select Input 15)..... 151, 367

RPINR18 (Peripheral Pin Select Input 18)..... 151, 367

RPINR19 (Peripheral Pin Select Input 19).... 152

RPINR2 (Peripheral Pin Select Input 2)..... 144, 362

RPINR20 (Peripheral Pin Select Input 20)..... 152, 368

RPINR21 (Peripheral Pin Select Input 21)..... 153, 368

RPINR22 (Peripheral Pin Select Input 22).... 153

RPINR23 (Peripheral Pin Select Input 23)..... 154, 369

RPINR26 (Peripheral Pin Select Input 26).... 154

RPINR3 (Peripheral Pin Select Input 3)..... 145, 363

RPINR30 (Peripheral Pin Select Input 30) ...... 155

RPINR37 (Peripheral Pin Select Input 37) ..... 155, 369

RPINR38 (Peripheral Pin Select Input 38) ..... 156, 370

RPINR4 (Peripheral Pin Select Input 4) ..... 145, 363

RPINR42 (Peripheral Pin Select Input 42) ..... 156, 370

RPINR43 (Peripheral Pin Select Input 43) ..... 157, 371

RPINR44 (Peripheral Pin Select Input 44) ..... 157, 371

RPINR45 (Peripheral Pin Select Input 45) ..... 158, 372

RPINR46 (Peripheral Pin Select Input 46) ..... 158, 372

RPINR47 (Peripheral Pin Select Input 47) ..... 159, 373

RPINR5 (Peripheral Pin Select Input 5) ..... 146, 364

RPINR6 (Peripheral Pin Select Input 6) ...... 146, 364

RPINR7 (Peripheral Pin Select Input 7) 147

RPINR8 (Peripheral Pin Select Input 8) ...... 147

RPINR9 (Peripheral Pin Select Input 9) ...... 148

RPOR0 (Peripheral Pin Select Output 0) ..... 160, 374

RPOR1 (Peripheral Pin Select Output 1) ..... 160, 374

RPOR10 (Peripheral Pin Select Output 10) ..... 165, 379

RPOR11 (Peripheral Pin Select Output 11) ..... 165, 379

RPOR12 (Peripheral Pin Select Output 12) ..... 166, 380

RPOR13 (Peripheral Pin Select Output 13) ..... 166, 380

RPOR14 (Peripheral Pin Select Output 14) ..... 167, 381

RPOR15 (Peripheral Pin Select Output 15) ..... 167, 381

RPOR16 (Peripheral Pin Select Output 16) ..... 168, 382

RPOR17 (Peripheral Pin Select Output 17) ..... 168, 382

RPOR18 (Peripheral Pin Select Output 18) ..... 169, 383

RPOR19 (Peripheral Pin Select Output 19) ..... 169, 383

RPOR2 (Peripheral Pin Select Output 2) ..... 161, 375

RPOR20 (Peripheral Pin Select Output 20) ..... 170, 384

RPOR21 (Peripheral Pin Select Output 21) ..... 170, 384

RPOR22 (Peripheral Pin Select Output 22) ..... 171, 385

RPOR3 (Peripheral Pin Select Output 3) ..... 161, 375

RPOR4 (Peripheral Pin Select Output 4) ..... 162, 376

RPOR5 (Peripheral Pin Select Output 5) ..... 162, 376

RPOR6 (Peripheral Pin Select Output 6) ...... 163, 377

RPOR7 (Peripheral Pin Select Output 7) ..... 163, 377

RPOR8 (Peripheral Pin Select Output 8) ...... 164, 378

RPOR9 (Peripheral Pin Select Output 9) ...... 164, 378

SENTxCON1 (SENTx Control 1)....643

SENTxDATH (SENTx Receive Data High)...... 647

SENTxDATL (SENTx Receive Data Low) 647

SENTxSTAT (SENTx Status) 645

SI1CON (MSI1 Secondary Control).... 432

SI1FIFOCS (MSI1 Secondary FIFO Status)...... 435

SI1MBX (MSI1 Secondary Mailbox Data Transfer Status) 434

SI1MBXnD (MSI1 Secondary Mailbox n Data)...... 434

SI1STAT (MSI1 Secondary Status).... 433

SLPxCONH (DACx Slope Control High) 569

SLPxCONL (DACx Slope Control Low).... 570

SLPxDAT (DACx Slope Data) 572

SPIxCON1H (SPIx Control 1 High) 618

SPIxCON1L (SPIx Control 1 Low)....616

SPIxCON2L (SPIx Control 2 Low)....620

SPIxIMSKH (SPIx Interrupt Mask High) 625

SPIxIMSKL (SPIx Interrupt Mask Low).... 624

SPIxSTATH (SPIx Status High).... 623

SR (CPU STATUS) 44, 108, 271, 327

SRMWFDATA (Secondary Read (Main Write) FIFO Data) 436

SWMRFDATA (Secondary Write (Main Read) FIFO Data) 436

T1CON (Timer1 Control) 650

TRISx (Output Enable for PORTx Register) 339

TRISx (Output Enable for PORTx).... 121

UxBRG (UARTx Baud Rate) 600

UxBRGH (UARTx Baud Rate High) 600

UxINT (UARTx Interrupt) 609

UxMODE (UARTx Configuration) 592

UxMODEH (UARTx Configuration High).... 594

UxP1 (UARTx Timing Parameter 1)....602

UxP2 (UARTx Timing Parameter 2)....603

UxP3 (UARTx Timing Parameter 3)....604

UxP3H (UARTx Timing Parameter 3 High)....604

UxRXCHK (UARTx Receive Checksum) 606

UxRXREG (UARTx Receive Buffer) 601

UxSCCON (UARTx Smart Card Configuration) ...... 607

UxSCINT (UARTx Smart Card Interrupt) 608

UxSTA (UARTx Status) 596

UxSTAH (UARTx Status High) 598

UxTXCHK (UARTx Transmit Checksum).... 605

UxTXREG (UARTx Transmit Buffer).... 601

VELxCNTH (Velocity x Counter High) 582

VELxCNTL (Velocity x Counter Low) 582

VELxHLD (Velocity x Counter Hold) 583

VREGCON (Voltage Regulator Control) 710

WDTCONH (Watchdog Timer Control High).... 715

WDTCONL (Watchdog Timer Control Low) 714

Regulator Control

Sleep Mode....710

Revision History 817

s

Secondary CPU 265

Addressing Modes 266

Control/Status Registers 271

Data Space Addressing 266

Instruction Set 265

Programmer's Model.... 268

Register Descriptions.... 268

Registers.... 265

Resources.... 270

Secondary I/O Ports.... 334

Configuring Analog/Digital Port Pins.... 337

Control/Status Registers 338

Helpful Tips 359

Open-Drain Configuration 337

Parallel I/O (PIO).... 334

Pin and ANSELx Availability 335

Resources.... 360

Write/Read Timing 337

Secondary Interrupt Controller 317

Control/Status Registers 327

Cross Core Interrupts.... 326

Interrupt Vector Details 320

Interrupt Vector Table (IVT) 317

Reset Sequence 317

Resources.... 326

Trap Table.... 319

Secondary Memory Organization.... 276

Secondary PRAM Program Memory 302

Control/Status Registers 305

Development Tool Support Functions.... 303

ECC Control/Status Registers 310

Main to Secondary Image Loading (MSIL) 303

Operations 302

Secondary Remappable Output Pin Registers .... 355

Secondary Remappable Pin Inputs.... 348

Secondary Resets.... 313

Configuration Mismatch Reset (CM) 313

Control Register.... 315

Illegal Condition Reset (IOPUWR).... 313

Security.... 313

Uninitialized W Register 313

Master Clear (MCLR) Pin Reset.... 313

Power-on Reset (POR).... 313

RESET Instruction (SWR).... 313

Resources 314

Trap Conflict Reset (TRAPR) 313

Watchdog Timer Time-out Reset (WDTO) 313

Secondary SFR Block

000h....282

100h....283

200h.... 283

300h....284

400h....285

800h....286

900h....287

A00h 287

B00h 288

C00h 288

D00h 289

E00h 290

F00h 290

SecondaryResets

Brown-out Reset (BOR).... 313

Illegal Condition Reset (IOPUWR)

Illegal Opcode.... 313

SENT

Serial Peripheral Interface (SPI) 611

Control/Status Registers.... 616

Overview....611

Serial Peripheral Interface. See SPI.

Single-Edge Nibble Transmission (SENT).... 639

Control/Status Registers.... 643

Overview.... 639

Protocol Data Frames.... 640

Receive Mode.... 642

Configuration 642

Transmit Mode....641

Configuration 641

Single-Edge Nibble Transmission for Automotive Applications

[Non-Text]

Single-Edge Nibble Transmission. See SENT.

Special Features of the CPU 675

T

Thermal Operating Conditions.... 734

Thermal Packaging Characteristics 734

Timer1 649

Control Register 650

Timing Diagrams

BOR and Master Clear Reset Timing Characteristics .... 752

Clock/Instruction Cycle 447

External Clock....748

High-Speed PWMx Fault Characteristics 754

High-Speed PWMx Module Characteristics.... 754

I/O Characteristics 752

I2Cx Bus Data Characteristics (Client Mode) 765

I2Cx Bus Data Characteristics (Host Mode) 763

I2Cx Bus Start/Stop Bits Characteristics (Client Mode).. 765

I2Cx Bus Start/Stop Bits Characteristics (Host Mode)....763

QEA/QEB Input 772

QEI Interface Signals 573

QEI Module Index Pulse 773

SPIx Client Mode (Full-Duplex, CKE = 0, CKP = x, SMP = 0)....759

SPIx Client Mode (Full-Duplex, CKE = 1, CKP = x, SMP = 0)....761

SPIx Host Mode (Full-Duplex, CKE = 0, CKP = x, SMP = 1)....758

SPIx Host Mode (Full-Duplex, CKE = 1, CKP = x, SMP = 1)....757

SPIx Host Mode (Half-Duplex, Transmit Only, CKE = 0) 755

SPIx Host Mode (Half-Duplex, Transmit Only, CKE = 1) 756

TimerQ (QEI Module) External Clock 774

UARTx I/O Characteristics.... 767

Timing Specifications

QEI External Clock Requirements 774

QEI Index Pulse Requirements.... 773

Quadrature Decoder Requirements.... 772

U

UART

Architectural Overview 590

Character Frame.... 591

Control/Status Registers 592

Data Buffers 591

Protocol Extensions 591

Universal Asynchronous Receiver Transmitter (UART).... 589

Overview 589

Universal Asynchronous Receiver Transmitter. See UART.

User OTP Memory 709

V

Voltage Regulators (On-Chip).... 709

W

Watchdog Timer (WDT) 675

WWW Address 830

WWW, On-Line Support 19

THE MICROCHIP WEBSITE

Microchip provides online support via our WWW site at www.microchip.com. This website is used as a means to make files and information easily available to customers. Accessible by using your favorite Internet browser, the website contains the following information:

  • Product Support – Data sheets and errata, application notes and sample programs, design resources, user's guides and hardware support documents, latest software releases and archived software
  • General Technical Support – Frequently Asked Questions (FAQ), technical support requests, online discussion groups, Microchip consultant program member listing
  • Business of Microchip – Product selector and ordering guides, latest Microchip press releases, listing of seminars and events, listings of Microchip sales offices, distributors and factory representatives

CUSTOMER CHANGE NOTIFICATION SERVICE

Microchip's customer notification service helps keep customers current on Microchip products. Subscribers will receive e-mail notification whenever there are changes, updates, revisions or errata related to a specified product family or development tool of interest.

To register, access the Microchip website at www.microchip.com. Under "Support", click on "Customer Change Notification" and follow the registration instructions.

CUSTOMER SUPPORT

Users of Microchip products can receive assistance through several channels:

• 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 website at: http://microchip.com/support

NOTES:

PRODUCT IDENTIFICATION SYSTEM

To order or obtain information, e.g., on pricing or delivery, refer to the factory or the listed sales office.

dsPIC 33 CH 128 MP 508 T I / PT - XXXMicrochip Trademark Architecture Flash Memory Family Program Memory Size (Kbyte) Product Group Pin Count Tape and Reel Flag (if applicable) Temperature Range Package PatternExamples: dsPIC33CH128MP506-I/PT: dsPIC33, Enhanced Performance, 128-Kbyte Program Memory, SMP: 64-Pin, Industrial Temperature, TQFP Package.
Architecture: 33 = 16-Bit Digital Signal ControllerFlash Memory Family: CH = Dual CoreProduct Group: MP = Motor Control/Power SupplyPin Count: 02 = 28-pin03 = 36-pin05 = 48-pin06 = 64-pin08 = 80-pinTemperature Range: I = -40°C to +85°C (Industrial)E = -40°C to +125°C (Extended)H = -40°C to 150°C (High)Package: SS = Plastic Shrink Small Outline – (28-pin) 5.30 mm body (SSOP)2N = Ultra Thin Plastic Quad Flat, No Lead – (28-pin) 6x6 mm body (UQFN)M5 = Ultra Thin Plastic Quad Flat, No Lead – (36-pin) 5x5 mm body (UQFN)PT = Thin Quad Flatpack – (48-pin) 7x7 mm body (TQFP)M4 = Ultra Thin Plastic Quad Flat, No Lead – (48-pin) 6x6 mm body (UQFN)PT = Plastic Thin Quad Flatpack – (64-pin) 10x10 mm body (TQFP)MR = Plastic Quad Flat, No Lead – (64-pin) 9x9 mm body (QFN)PT = Plastic Thin Quad Flatpack – (80-pin) 12x12 mm body (TQFP)

NOTES:

Note the following details of the code protection feature on Microchip products:

• Microchip products meet the specifications contained in their particular Microchip Data Sheet.
- Microchip believes that its family of products is secure when used in the intended manner, within operating specifications, and under normal conditions.
- Microchip values and aggressively protects its intellectual property rights. Attempts to breach the code protection features of Microchip product is strictly prohibited and may violate the Digital Millennium Copyright Act.
- Neither Microchip nor any other semiconductor manufacturer can guarantee the security of its code. Code protection does not mean that we are guaranteeing the product is "unbreakable" Code protection is constantly evolving. Microchip is committed to continuously improving the code protection features of our products.

This publication and the information herein may be used only with Microchip products, including to design, test, and integrate Microchip products with your application. Use of this information in any other manner violates these terms. Information regarding device applications is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. Contact your local Microchip sales office for additional support or, obtain additional support at https://www.microchip.com/en-us/support/design-help/client-support-services.

THIS INFORMATION IS PROVIDED BY MICROCHIP "AS IS". MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE, OR WARRANTIES RELATED TO ITS CONDITION, QUALITY, OR PERFORMANCE.

IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL, OR CONSEQUENTIAL LOSS, DAMAGE, COST, OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE INFORMATION OR ITS USE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THE INFORMATION OR ITS USE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THE INFORMATION.

Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights unless otherwise stated.

Trademarks

The Microchip name and logo, the Microchip logo, Adaptec, AVR, AVR logo, AVR Freaks, BesTime, BitCloud, CryptoMemory, CryptoRF, dsPIC, flexPWR, HELDO, IGLOO, JukeBlox, KeeLoq, Kleer, LANCheck, LinkMD, maXStylus, maXTouch, MediaLB, megaAVR, Microsemi, Microsemi logo, MOST, MOST logo, MPLAB, OptoLyzer, PIC, picoPower, PICSTART, PIC32 logo, PolarFire, Prochip Designer, QTouch, SAM-BA, SenGenuity, SpyNIC, SST, SST Logo, SuperFlash, Symmetricom, SyncServer, Tachyon, TimeSource, tinyAVR, UNI/O, Vectron, and XMEGA are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.

AgileSwitch, APT, ClockWorks, The Embedded Control Solutions Company, EtherSynch, Flashtec, Hyper Speed Control, HyperLight Load, Libero, motorBench, mTouch, Powermite 3, Precision Edge, ProASIC, ProASIC Plus, ProASIC Plus logo, Quiet-Wire, SmartFusion, SyncWorld, Temux, TimeCesium, TimeHub, TimePictra, TimeProvider, TrueTime, and ZL are registered trademarks of Microchip Technology Incorporated in the U.S.A.

Adjacent Key Suppression, AKS, Analog-for-the-Digital Age, Any Capacitor, AnyIn, AnyOut, Augmented Switching, BlueSky, BodyCom, Clockstudio, CodeGuard, CryptoAuthentication, CryptoAutomotive, CryptoCompanion, CryptoController, dsPICDEM, dsPICDEM.net, Dynamic Average Matching, DAM, ECAN, Espresso T1S, EtherGREEN, GridTime, IdealBridge, In-Circuit Serial Programming, ICSP, INICnet, Intelligent Paralleling, IntelliMOS, Inter-Chip Connectivity, JitterBlocker, Knob-on-Display, KoD, maxCrypto, maxView, memBrain, Mindi, MiWi, MPASM, MPF, MPLAB Certified logo, MPLIB, MPLINK, MultiTRAK, NetDetach, Omniscient Code Generation, PICDEM, PICDEM.net, PICkit, PICtail, PowerSmart, PureSilicon, QMatrix, REAL ICE, Ripple Blocker, RTAX, RTG4. SAM-ICE, Serial Quad I/O, simpleMAP, SimpliPHY, SmartBuffer, SmartHLS, SMART-I.S., storClad, SQI, SuperSwitcher, SuperSwitcher II, Switchtec, SynchroPHY, Total Endurance, Trusted Time, TSHARC, USBCheck, VariSense, VectorBlox, VeriPHY, ViewSpan, WiperLock, XpressConnect, 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.

The Adaptec logo, Frequency on Demand, Silicon Storage Technology, and Symmcom are registered trademarks of Microchip Technology Inc. in other countries.

GestIC is a registered trademark of Microchip Technology Germany II GmbH & Co. KG, a subsidiary of Microchip Technology Inc., in other countries.

All other trademarks mentioned herein are property of their respective companies.

© 2017-2023, Microchip Technology Incorporated and its subsidiaries.

All Rights Reserved.

ISBN: 978-1-6683-2986-3

For information regarding Microchip's Quality Management Systems, please visit www.microchip.com/quality.

Worldwide Sales and Service

AMERICAS

Corporate Office

2355 West Chandler Blvd.

Chandler, AZ 85224-6199

Tel: 480-792-7200

Fax: 480-792-7277

Technical Support:

http://www.microchip.com/

support

Web Address:

www.microchip.com

Atlanta

Duluth, GA

Tel: 678-957-9614

Fax: 678-957-1455

Austin, TX

Tel: 512-257-3370

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

Novi, MI

Tel: 248-848-4000

Houston, TX

Tel: 281-894-5983

Indianapolis

Noblesville, IN

Tel: 317-773-8323

Fax: 317-773-5453

Tel: 317-536-2380

Los Angeles

Mission Viejo, CA

Tel: 949-462-9523

Fax: 949-462-9608

Tel: 951-273-7800

Raleigh, NC

Tel: 919-844-7510

New York, NY

Tel: 631-435-6000

San Jose, CA

Tel: 408-735-9110

Tel: 408-436-4270

Canada - Toron

Tel: 905-695-1980

Fax: 905-695-2078

ASIA/PACIFIC

Australia - Sydney

Tel: 61-2-9868-6733

China - Beijing

Tel: 86-10-8569-7000

China - Chengdu

Tel: 86-28-8665-5511

China - Chongqing

Tel: 86-23-8980-9588

China - Dongguan

Tel: 86-769-8702-9880

China - Guangzhou

Tel: 86-20-8755-8029

China - Hangzhou

Tel: 86-571-8792-8115

China - Hong Kong SAR

Tel: 852-2943-5100

China - Nanjing

Tel: 86-25-8473-2460

China - Qingdao

Tel: 86-532-8502-7355

China - Shanghai

Tel: 86-21-3326-8000

China - Shenyang

Tel: 86-24-2334-2829

China - Shenzhen

Tel: 86-755-8864-2200

China - Suzhou

Tel: 86-186-6233-1526

China - Wuhan

Tel: 86-27-5980-5300

China - Xian

Tel: 86-29-8833-7252

China - Xiamen

Tel: 86-592-2388138

China - Zhuhai

Tel: 86-756-3210040

ASIA/PACIFIC

India - Bangalore

Tel: 91-80-3090-4444

India - New Delhi

Tel: 91-11-4160-8631

India - Pune

Tel: 91-20-4121-0141

Japan - Osaka

Tel: 81-6-6152-7160

Japan - Tokyo

Tel: 81-3-6880-3770

Korea - Daegu

Tel: 82-53-744-4301

Korea - Seoul

Tel: 82-2-554-7200

Malaysia - Kuala Lumpur

Tel: 60-3-7651-7906

Malaysia - Penang

Tel: 60-4-227-8870

Philippines - Manila

Tel: 63-2-634-9065

Singapore

Tel: 65-6334-8870

Taiwan - Hsin Chu

Tel: 886-3-577-8366

Taiwan - Kaohsiung

Tel: 886-7-213-7830

Taiwan - Taipei

Tel: 886-2-2508-8600

Thailand - Bangkok

Tel: 66-2-694-1351

Tel: 43-7242-2244-39

Fax: 43-7242-2244-393

Denmark - Copenhagen

Tel: 45-4485-5910

Fax: 45-4485-2829

Finland - Espoo

Tel: 358-9-4520-820

France - Paris

Tel: 33-1-69-53-63-20

Fax: 33-1-69-30-90-79

Germany - Garching

Tel: 49-8931-9700

Germany - Haan

Tel: 49-2129-3766400

Germany - Heilbronn

Tel: 49-7131-72400

Germany - Karlsruhe

Tel: 49-721-625370

Germany - Munich

Tel: 49-89-627-144-0

Fax: 49-89-627-144-44

Germany - Rosenheim

Tel: 49-8031-354-560

Israel - Ra'anana

Tel: 972-9-744-7705

Italy - Milan

Tel: 39-0331-742611

Fax: 39-0331-466781

Italy - Padova

Tel: 39-049-7625286

Netherlands - Drunen

Tel: 31-416-690399

Fax: 31-416-690340

Norway - Trondheim

Tel: 47-7288-4388

Poland - Warsaw

Tel: 48-22-3325737

Romania - Bucharest

Tel: 40-21-407-87-50

Spain - Madrid

Tel: 34-91-708-08-90

Fax: 34-91-708-08-91

Sweden - Gothenberg

Tel: 46-31-704-60-40

Sweden - Stockholm

Tel: 46-8-5090-4654

UK - Wokingham

Tel: 44-118-921-5800

Fax: 44-118-921-5820

Table of contents Click a title to access it
Manual assistant
Powered by Anthropic
Waiting for your message
Product information

Brand : Microchip

Model : dsPIC33CH64MP208

Category : Electronic component