Dspic30F Data Sheet: General Purpose and Sensor Families
Dspic30F Data Sheet: General Purpose and Sensor Families
•    Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the
     intended manner and under normal conditions.
•    There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our
     knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data
     Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
• Microchip is willing to work with the customer who is concerned about the integrity of their code.
•    Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
     mean that we are guaranteeing the product as “unbreakable.”
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our
products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts
allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
UART
SPI™
                                                                                                                                                 I2C™
                                                  SRAM EEPROM Timer                             Input   Output Comp/ A/D 12-bit
    Device        Pins
                           Bytes   Instructions   Bytes Bytes 16-bit                             Cap      Std PWM    100 Ksps
Pin Diagrams
             18-Pin SOIC and PDIP
                                                     MCLR     1                            18    AVDD
                                         AN0/VREF+/CN2/RB0    2                            17    AVSS
                                                                    dsPIC30F3012
                                                                    dsPIC30F2011
                                         AN1/VREF-/CN3/RB1    3                            16    AN6/SCK1/INT0/OCFA/RB6
                                    AN2/SS1/LVDIN/CN4/RB2     4                            15    EMUD2/AN7/OC2/IC2/INT2/RB7
                                              AN3/CN5/RB3     5                            14    VDD
                                                 OSC1/CLKI    6                            13    VSS
                                          OSC2/CLKO/RC15      7                            12    PGC/EMUC/AN5/U1RX/SDI1/SDA/CN7/RB5
                          EMUD1/SOSCI/T2CK/U1ATX/CN1/RC13     8                            11    PGD/EMUD/AN4/U1TX/SDO1/SCL/CN6/RB4
                         EMUC1/SOSCO/T1CK/U1ARX/CN0/RC14      9                            10    EMUC2/OC1/IC1/INT1/RD0
                                                     MCLR      1                           28     AVDD
                                  EMUD3/AN0/VREF+/CN2/RB0      2                           27     AVSS
                                  EMUC3/AN1/VREF-/CN3/RB1      3                           26     AN6/OCFA/RB6
                                    AN2/SS1/LVDIN/CN4/RB2      4                           25     EMUD2/AN7/RB7
                                                                        dsPIC30F2012
                                              AN3/CN5/RB3      5                           24     AN8/OC1/RB8
                                              AN4/CN6/RB4      6                           23     AN9/OC2/RB9
                                              AN5/CN7/RB5      7                           22     CN17/RF4
                                                       VSS     8                           21     CN18/RF5
                                                OSC1/CLKI      9                           20     VDD
                                          OSC2/CLKO/RC15       10                          19     VSS
                          EMUD1/SOSCI/T2CK/U1ATX/CN1/RC13      11                          18     PGC/EMUC/U1RX/SDI1/SDA/RF2
                         EMUC1/SOSCO/T1CK/U1ARX/CN0/RC14       12                          17     PGD/EMUD/U1TX/SDO1/SCL/RF3
                                                       VDD     13                          16     SCK1/INT0/RF6
                                              IC2/INT2/RD9     14                          15     EMUC2/IC1/INT1/RD8
                                                     MCLR      1                           28     AVDD
                                  EMUD3/AN0/VREF+/CN2/RB0      2                           27     AVSS
                                  EMUC3/AN1/VREF-/CN3/RB1      3                           26     AN6/OCFA/RB6
                                    AN2/SS1/LVDIN/CN4/RB2      4                           25     EMUD2/AN7/RB7
                                                                        dsPIC30F3013
                                              AN3/CN5/RB3      5                           24     AN8/OC1/RB8
                                              AN4/CN6/RB4      6                           23     AN9/OC2/RB9
                                              AN5/CN7/RB5      7                           22     U2RX/CN17/RF4
                                                       VSS     8                           21     U2TX/CN18/RF5
                                                OSC1/CLKI      9                           20     VDD
                                          OSC2/CLKO/RC15       10                          19     VSS
                          EMUD1/SOSCI/T2CK/U1ATX/CN1/RC13      11                          18     PGC/EMUC/U1RX/SDI1/SDA/RF2
                         EMUC1/SOSCO/T1CK/U1ARX/CN0/RC14       12                          17     PGD/EMUD/U1TX/SDO1/SCL/RF3
                                                       VDD     13                          16     SCK1/INT0/RF6
                                              IC2/INT2/RD9     14                          15     EMUC2/IC1/INT1/RD8
44-Pin QFN
                                                  EMUC2/IC1/INT1/RD8
                                                  SCK1/INT0/RF6
                                                  IC2/INT2/RD9
                                                  VDD
                                                  NC
                                                  NC
                                                  NC
                                                  NC
                                                  44
                                                  43
                                                  42
                                                  41
                                                  40
                                                  39
                                                  38
                                                  37
                                                  36
                                                  35
                                                  34
              PGC/EMUC/U1RX/SDI1/SDA/RF2     1                                            33   OSC2/CLKO/RC15
                                     VSS     2                                            32   OSC1/CLKI
                                      NC     3                                            31   VSS
                                     VDD     4                                            30   VSS
                                      NC     5                                            29   NC
                                      NC     6           dsPIC30F3013                     28   NC
                          U2TX/CN18/RF5      7                                            27   AN5/CN7/RB5
                                      NC     8                                            26   AN4/CN6/RB4
                          U2RX/CN17/RF4      9                                            25   AN3/CN5/RB3
                            AN9/OC2/RB9      10                                           24   NC
                            AN8/OC1/RB8      11                                           23   AN2/SS1/LVDIN/CN4/RB2
                                                  22
                                                  12
                                                  13
                                                  14
                                                  15
                                                  16
                                                  17
                                                  18
                                                  19
                                                  20
                                                  21
                                                                    MCLR
                                                                       NC
                                                                       NC
                                                                     AVSS
                                                                     AVDD
                                                                       NC
                                                                       NC
                                                          EMUD2/AN7/RB7
AN6/OCFA/RB6
                                                  EMUD3/AN0/VREF+/CN2/RB0
                                                  EMUC3/AN1/VREF-/CN3/RB1
UART
SPI™
                                                                                                                                                I2C™
                                                                                                                                                       CAN
                                           SRAM EEPROM Timer Input           Codec A/D 12-bit
    Device       Pins                                              Comp/Std
                        Bytes Instructions Bytes Bytes 16-bit Cap
                                                                     PWM
                                                                            Interface 100 Ksps
Pin Diagrams
40-Pin PDIP
                                                      MCLR    1                               40       AVDD
                                         AN0/VREF+/CN2/RB0    2                               39       AVSS
                                         AN1/VREF-/CN3/RB1    3                               38       AN9/RB9
                                    AN2/SS1/LVDIN/CN4/RB2     4                               37       AN10/RB10
                                              AN3/CN5/RB3     5                               36       AN11/RB11
                                              AN4/CN6/RB4     6                               35       AN12/RB12
                                              AN5/CN7/RB5     7                               34       EMUC2/OC1/RD0
                                                                           dsPIC30F3014
                                  PGC/EMUC/AN6/OCFA/RB6       8                               33       EMUD2/OC2/RD1
                                        PGD/EMUD/AN7/RB7      9                               32       VDD
                                                   AN8/RB8    10                              31       VSS
                                                        VDD   11                              30       RF0
                                                        VSS   12                              29       RF1
                                                 OSC1/CLKI    13                              28       U2RX/CN17/RF4
                                          OSC2/CLKO/RC15      14                              27       U2TX/CN18/RF5
                          EMUD1/SOSCI/T2CK/U1ATX/CN1/RC13     15                              26       U1RX/SDI1/SDA/RF2
                         EMUC1/SOSCO/T1CK/U1ARX/CN0/RC14      16                              25       EMUD3/U1TX/SDO1/SCL/RF3
                                                 INT0/RA11    17                              24       EMUC3/SCK1/RF6
                                               IC2/INT2/RD9   18                              23       IC1/INT1/RD8
                                                       RD3    19                              22       RD2
                                                        VSS   20                              21       VDD
40-Pin PDIP
                                                      MCLR    1                               40       AVDD
                                         AN0/VREF+/CN2/RB0    2                               39       AVSS
                                         AN1/VREF-/CN3/RB1    3                               38       AN9/CSCK/RB9
                                    AN2/SS1/LVDIN/CN4/RB2     4                               37       AN10/CSDI/RB10
                                              AN3/CN5/RB3     5                               36       AN11/CSDO/RB11
                                           AN4/IC7/CN6/RB4    6                               35       AN12/COFS/RB12
                                           AN5/IC8/CN7/RB5    7                               34       EMUC2/OC1/RD0
                                                                       dsPIC30F4013
                                  PGC/EMUC/AN6/OCFA/RB6       8                               33       EMUD2/OC2/RD1
                                        PGD/EMUD/AN7/RB7      9                               32       VDD
                                                   AN8/RB8    10                              31       VSS
                                                        VDD   11                              30       C1RX/RF0
                                                        VSS   12                              29       C1TX/RF1
                                                 OSC1/CLKI    13                              28       U2RX/CN17/RF4
                                          OSC2/CLKO/RC15      14                              27       U2TX/CN18/RF5
                          EMUD1/SOSCI/T2CK/U1ATX/CN1/RC13     15                              26       U1RX/SDI1/SDA/RF2
                         EMUC1/SOSCO/T1CK/U1ARX/CN0/RC14      16                              25       EMUD3/U1TX/SDO1/SCL/RF3
                                                 INT0/RA11    17                              24       EMUC3/SCK1/RF6
                                               IC2/INT2/RD9   18                              23       IC1/INT1/RD8
                                                   OC4/RD3    19                              22       OC3/RD2
                                                        VSS   20                              21       VDD
44-Pin TQFP
                                        EMUC1/SOSCO/T1CK/U1ARX/CN0/RC14
                                        EMUD3/U1TX/SDO1/SCL/RF3
                                        EMUC3/SCK1/RF6
                                        IC2/INT2/RD1
                                        INT0/RA11
                                        INT1/RD8
                                        RD2
                                        RD3
                                        VDD
                                        VSS
                                        NC
                                        44
                                        43
                                        42
                                        41
                                        40
                                        39
                                        38
                                        37
                                        36
                                        35
                                        34
                U1RX/SDI1/SDA/RF2      1                              33   NC
                   U2TX/CN18/RF5       2                              32   EMUD1/SOSCI/T2CK/U1ATX/CN1/RC13
                   U2RX/CN17/RF4       3                              31   OSC2/CLKO/RC15
                         C1TX/RF1      4                              30   OSC1/CLKI
                        C1RX/RF0       5                              29   VSS
                              VSS      6    dsPIC30F3014              28   VDD
                              VDD      7                              27   AN8/RB8
                  EMUD2/OC2/RD1        8                              26   PGD/EMUD/AN7/RB7
                  EMUC2/OC1/RD0        9                              25   PGC/EMUC/AN6/OCFA/RB6
                       AN12/RB12       10                             24   AN5/CN7/RB5
                        AN11/RB11      11                             23   AN4/CN6/RB4
                                        12
                                        13
                                        14
                                        15
                                        16
                                        17
                                        18
                                        19
                                        20
                                        21
                                        22
                                                           NC
                                                           NC
                                                        MCLR
                                                    AN10/RB10
                                                      AN9/RB9
                                            AN0/VREF+/CN2/RB0
                                            AN1/VREF-/CN3/RB1
                                                  AN3/CN5/RB3
                                        AN2/SS1/LVDIN/CN4/RB2
                                                         AVSS
                                                         AVDD
44-Pin TQFP
                                         EMUC1/SOSCO/T1CK/U1ARX/CN0/RC14
                                         EMUD3/U1TX/SDO1/SCL/RF3
                                         EMUC3/SCK1/RF6
                                         IC1/INT1/RD8
                                         IC2/INT2/RD1
                                         INT0/RA11
                                         OC3/RD2
                                         OC4/RD3
                                         VDD
                                         VSS
                                         NC
                                         44
                                         43
                                         42
                                         41
                                         40
                                         39
                                         38
                                         37
                                         36
                                         35
                                         34
                 U1RX/SDI1/SDA/RF2      1                              33   NC
                    U2TX/CN18/RF5       2                              32   EMUD1/SOSCI/T2CK/U1ATX/CN1/RC13
                    U2RX/CN17/RF4       3                              31   OSC2/CLKO/RC15
                          CTX1/RF1      4                              30   OSC1/CLKI
                         CRX1/RF0       5                              29   VSS
                               VSS      6    dsPIC30F4013              28   VDD
                               VDD      7                              27   AN8/RB8
                   EMUD2/OC2/RD1        8                              26   PGD/EMUD/TB7/AN7/RB7
                   EMUC2/OC1/RD0        9                              25   PGC/EMUC/TB6/AN6/OCFA/RB6
                   AN12/COFS/RB12       10                             24   AN5/IC8/CN7/RB5
                   AN11/CSDO/RB11       11                             23   AN4/IC7/CN6/RB4
                                         12
                                         13
                                         14
                                         15
                                         16
                                         17
                                         18
                                         19
                                         20
                                         21
                                         22
                                                            NC
                                                            NC
                                               AN10/CSDI/RB10
                                                 AN9/CSCK/RB9
                                                         MCLR
                                             AN0/VREF+/CN2/RB0
                                             AN1/VREF-/CN3/RB1
                                         AN2/SS1/LVDIN/CN4/RB2
                                                   AN3/CN5/RB3
                                                          AVSS
                                                          AVDD
44-Pin QFN
                                                EMUC1/SOSCO/T1CK/U1ARX/CN0/RC14
                                                EMUD1/SOSCI/T2CK/U1ATX/CN1/RC13
                                                EMUD3/U1TX/SDO1/SCL/RF3
                                                EMUC3/SCK1/RF6
                                                IC1/INT1/RD8
                                                IC2/INT2/RD9
                                                INT0/RA11
                                                RD2
                                                RD3
                                                VDD
                                                VSS
                                                44
                                                43
                                                42
                                                41
                                                40
                                                39
                                                38
                                                37
                                                36
                                                35
                                                34
                       U1RX/SDI1/SDA/RF2    1                                     33   OSC2/CLKO/RC15
                          U2TX/CN18/RF5     2                                     32   OSC1/CLKI
                          U2RX/CN17/RF4     3                                     31   VSS
                                C1TX/RF1    4                                     30   VSS
                               C1RX/RF0     5                                     29   VDD
                                     VSS    6        dsPIC30F3014                 28   VDD
                                     VDD    7                                     27   AN8/RB8
                                     VDD    8                                     26   PGD/EMUD/AN7/RB7
                         EMUD2/OC2/RD1      9                                     25   PGC/EMUC/AN6/OCFA/RB6
                         EMUC2/OC1/RD0     10                                     24   AN5/CN7/RB5
                              AN12/RB12    11                                     23   AN4/CN6/RB4
                                                12
                                                13
                                                14
                                                15
                                                16
                                                17
                                                18
                                                19
                                                20
                                                21
                                                22
                                                            AN11/RB11
                                                                   NC
                                                            AN10/RB10
                                                              AN9/RB9
                                                                MCLR
                                                    AN0/VREF+/CN2/RB0
                                                    AN1/VREF-/CN3/RB1
                                                          AN3/CN5/RB3
                                                AN2/SS1/LVDIN/CN4/RB2
                                                                 AVSS
                                                                 AVDD
44-Pin QFN
                                            EMUC1/SOSCO/T1CK/U1ARX/CN0/RC14
                                            EMUD1/SOSCI/T2CK/U1ATX/CN1/RC13
                                            EMUD3/U1TX/SDO1/SCL/RF3
                                            EMUC3/SCK1/RF6
                                            IC2/INT2/RD1
                                            TOC3/RD2
                                            INT0/RA11
                                            INT1/RD8
                                            OC4/RD3
                                            VDD
                                            VSS
                                            44
                                            43
                                            42
                                            41
                                            40
                                            39
                                            38
                                            37
                                            36
                                            35
                                            34
                   U1RX/SDI1/SDA/RF2    1                                     33   OSC2/CLKO/RC15
                      U2TX/CN18/RF5     2                                     32   OSC1/CLKI
                      U2RX/CN17/RF4     3                                     31   VSS
                            CTX1/RF1    4                                     30   VSS
                           CRX1/RF0     5                                     29   VDD
                                 VSS    6        dsPIC30F4013                 28   VDD
                                 VDD    7                                     27   AN8/RB8
                                 VDD    8                                     26   PGD/EMUD/TB7/AN7/RB7
                     EMUD2/OC2/RD1      9                                     25   PGC/EMUC/TB6/AN6/OCFA/RB6
                     EMUC2/OC1/RD0     10                                     24   AN5/IC8/CN7/RB5
                     AN12/COFS/RB12    11                                     23   AN4/IC7/CN6/RB4
                                            12
                                            13
                                            14
                                            15
                                            16
                                            17
                                            18
                                            19
                                            20
                                            21
                                            22
                                                   AN10/CSDI/RB10
                                                  AN11/CSDO/RB11
                                                               NC
                                                            MCLR
                                                    AN9/CSCK/RB9
                                                AN0/VREF+/CN2/RB0
                                                AN1/VREF-/CN3/RB1
                                                      AN3/CN5/RB3
                                            AN2/SS1/LVDIN/CN4/RB2
                                                             AVSS
                                                             AVDD
64-Pin TQFP
                                         OC6/IC6/CN14/RD5
                                         OC5/IC5/CN13/RD4
                                         EMUD2/OC2/RD1
                                         OC8/CN16/RD7
                                         OC7/CN15/RD6
                                         CSDO/RG13
                                         CSCK/RG14
                                         CSDI/RG12
                                         C2RX/RG0
                                         C2TX/RG1
                                         C1RX/RF0
                                         C1TX/RF1
                                         OC4/RD3
                                         OC3/RD2
                                         VDD
                                         VSS
                                         64
                                         63
                                         62
                                         61
                                         60
                                         59
                                         58
                                         57
                                         56
                                         55
                                         54
                                         53
                                         52
                                         51
                                         50
                                         49
                     COFS/RG15      1                                48   EMUC1/SOSCO/T1CK/CN0/RC14
                       T2CK/RC1     2                                47   EMUD1/SOSCI/T4CK/CN1/RC13
                       T3CK/RC2     3                                46   EMUC2/OC1/RD0
                  SCK2/CN8/RG6      4                                45   IC4/INT4/RD11
                   SDI2/CN9/RG7     5                                44   IC3/INT3/RD10
                 SDO2/CN10/RG8      6                                43   IC2/INT2/RD9
                          MCLR      7                                42   IC1/INT1/RD8
                   SS2/CN11/RG9     8                                41   VSS
                            VSS     9
                                                   dsPIC30F5011      40   OSC2/CLKO/RC15
                            VDD     10                               39   OSC1/CLKI
                AN5/IC8/CN7/RB5     11                               38   VDD
                AN4/IC7/CN6/RB4     12                               37   SCL/RG2
                    AN3/CN5/RB3     13                               36   SDA/RG3
          AN2/SS1/LVDIN/CN4/RB2     14                               35   EMUC3/SCK1/INT0/RF6
              AN1/VREF-/CN3/RB1     15                               34   U1RX/SDI1/RF2
              AN0/VREF+/CN2/RB0     16                               33   EMUD3/U1TX/SDO1/RF3
                                         17
                                         18
                                         19
                                         20
                                         21
                                         22
                                         23
                                         24
                                         25
                                         26
                                         27
                                         28
                                         29
                                         30
                                         31
                                         32
                                           AN15/OCFB/CN12/RB15
                                              PGD/EMUD/AN7/RB7
                                                          AVDD
                                                          AVSS
                                                       AN8/RB8
                                                       AN9/RB9
                                                     AN10/RB10
                                                     AN11/RB11
                                                           VSS
                                                           VDD
                                                     AN12/RB12
                                                     AN13/RB13
                                                     AN14/RB14
                                                 U2RX/CN17/RF4
                                                 U2TX/CN18/RF5
                                         PGC/EMUC/AN6/OCFA/RB6
64-Pin TQFP
                                           OC6/IC6/CN14/RD5
                                           OC5/IC5/CN13/RD4
                                           EMUD2/OC2/RD1
                                           OC8/CN16/RD7
                                           OC7/CN15/RD6
                                           C2RX/RG0
                                           C2TX/RG1
                                           C1RX/RF0
                                           C1TX/RF1
                                           OC4/RD3
                                           OC3/RD2
                                           RG13
                                           RG12
                                           RG14
                                           VDD
                                           VSS
                                           64
                                           63
                                           62
                                           61
                                           60
                                           59
                                           58
                                           57
                                           56
                                           55
                                           54
                                           53
                                           52
                                           51
                                           50
                                           49
                            RG15      1                             48   EMUC1/SOSCO/T1CK/CN0/RC14
                        T2CK/RC1      2                             47   EMUD1/SOSCI/T4CK/CN1/RC13
                        T3CK/RC2      3                             46   EMUC2/OC1/RD0
                   SCK2/CN8/RG6       4                             45   IC4/INT4/RD11
                    SDI2/CN9/RG7      5                             44   IC3/INT3/RD10
                  SDO2/CN10/RG8       6                             43   IC2/INT2/RD9
                           MCLR       7                             42   IC1/INT1/RD8
                    SS2/CN11/RG9      8                             41   VSS
                             VSS      9
                                                     dsPIC30F6011   40   OSC2/CLKO/RC15
                             VDD      10                            39   OSC1/CLKI
                 AN5/IC8/CN7/RB5      11                            38   VDD
                 AN4/IC7/CN6/RB4      12                            37   SCL/RG2
                     AN3/CN5/RB3      13                            36   SDA/RG3
           AN2/SS1/LVDIN/CN4/RB2      14                            35   EMUC3/SCK1/INT0/RF6
      PGC/EMUC/AN1/VREF-/CN3/RB1      15                            34   U1RX/SDI1/RF2
      PGD/EMUD/AN0/VREF+/CN2/RB0      16                            33   EMUD3/U1TX/SDO1/RF3
                                           17
                                           18
                                           19
                                           20
                                           21
                                           22
                                           23
                                           24
                                           25
                                           26
                                           27
                                           28
                                           29
                                           30
                                           31
                                           32
                                                     AN10/RB10
                                                     AN12/RB12
                                                     AN13/RB13
                                                     AN14/RB14
                                           AN15/OCFB/CN12/RB15
                                                       AN7/RB7
                                                          AVDD
                                                          AVSS
                                                       AN8/RB8
                                                       AN9/RB9
                                                     AN11/RB11
                                                           VSS
                                                           VDD
                                                 U2RX/CN17/RF4
                                                 U2TX/CN18/RF5
                                                  AN6/OCFA/RB6
64-Pin TQFP
                                          OC6/IC6/CN14/RD5
                                          OC5/IC5/CN13/RD4
                                          EMUD2/OC2/RD1
                                          OC8/CN16/RD7
                                          OC7/CN15/RD6
                                          CSDO/RG13
                                          CSCK/RG14
                                          CSDI/RG12
                                          C2RX/RG0
                                          C2TX/RG1
                                          C1RX/RF0
                                          C1TX/RF1
                                          OC4/RD3
                                          OC3/RD2
                                          VDD
                                          VSS
                                          64
                                          63
                                          62
                                          61
                                          60
                                          59
                                          58
                                          57
                                          56
                                          55
                                          54
                                          53
                                          52
                                          51
                                          50
                                          49
                    COFS/RG15        1                              48   EMUC1/SOSCO/T1CK/CN0/RC14
                      T2CK/RC1       2                              47   EMUD1/SOSCI/T4CK/CN1/RC13
                      T3CK/RC2       3                              46   EMUC2/OC1/RD0
                 SCK2/CN8/RG6        4                              45   IC4/INT4/RD11
                  SDI2/CN9/RG7       5                              44   IC3/INT3/RD10
                SDO2/CN10/RG8        6                              43   IC2/INT2/RD9
                         MCLR        7                              42   IC1/INT1/RD8
                  SS2/CN11/RG9       8                              41   VSS
                           VSS       9               dsPIC30F6012   40   OSC2/CLKO/RC15
                           VDD       10                             39   OSC1/CLKI
               AN5/IC8/CN7/RB5       11                             38   VDD
               AN4/IC7/CN6/RB4       12                             37   SCL/RG2
                   AN3/CN5/RB3       13                             36   SDA/RG3
         AN2/SS1/LVDIN/CN4/RB2       14                             35   EMUC3/SCK1/INT0/RF6
    PGC/EMUC/AN1/VREF-/CN3/RB1       15                             34   U1RX/SDI1/RF2
    PGD/EMUD/AN0/VREF+/CN2/RB0       16                             33   EMUD3/U1TX/SDO1/RF3
                                          17
                                          18
                                          19
                                          20
                                          21
                                          22
                                          23
                                          24
                                          25
                                          26
                                          27
                                          28
                                          29
                                          30
                                          31
                                          32
                                          AN15/OCFB/CN12/RB15
                                                      AN7/RB7
                                                         AVDD
                                                         AVSS
                                                      AN8/RB8
                                                      AN9/RB9
                                                    AN10/RB10
                                                    AN11/RB11
                                                          VSS
                                                          VDD
                                                    AN12/RB12
                                                    AN13/RB13
                                                    AN14/RB14
                                                U2RX/CN17/RF4
                                                U2TX/CN18/RF5
                                                 AN6/OCFA/RB6
80-Pin TQFP
                                                                                                                                                                                                                EMUD2/OC2/RD1
                                                                                                                                                                       IC6/CN19/RD13
                                                                                         OC8/CN16/RD7
                                                                                                                                                        OC7/CN15/RD6
                                                                                                                                                                       OC6/CN14/RD5
                                                                                                                                                                       OC5/CN13/RD4
                                         CSDO/RG13
                                                               CSCK/RG14
                                         CSDI/RG12
                                                                                         C2RX/RG0
                                                                                         C2TX/RG1
                                                                                         C1RX/RF0
                                                               RA7/CN23
                                                               RA6/CN22
C1TX/RF1
                                                                                                                                                                                                                IC5/RD12
                                                                                                                                                                                                                OC4/RD3
                                                                                                                                                                                                                OC3/RD2
                                                                                         VDD
                                                                                         VSS
                                         80
                                         79
                                         78
                                         77
                                         76
                                         75
                                         74
                                         73
                                         72
                                         71
                                         70
                                         69
                                         68
                                         67
                                         66
                                         65
                                         64
                                         63
                                         62
                                         61
                                                                                                                                                                                                                                                                  60            EMUC1/SOSCO/T1CK/CN0/RC14
             COFS/RG15       1
                                                                                                                                                                                                                                                                  59            EMUD1/SOSCI/CN1/RC13
               T2CK/RC1      2
                                                                                                                                                                                                                                                                  58            EMUC2/OC1/RD0
               T3CK/RC2      3
                                                                                                                                                                                                                                                                  57            IC4/RD11
               T4CK/RC3      4
                                                                                                                                                                                                                                                                  56            IC3/RD10
               T5CK/RC4      5
                                                                                                                                                                                                                                                                  55            IC2/RD9
          SCK2/CN8/RG6       6
                                                                                                                                                                                                                                                                  54            IC1/RD8
           SDI2/CN9/RG7      7
          SDO2/CN10/RG8                                                                                                                                                                                                                                           53            INT4/RA15
                             8
                  MCLR       9                                                                                                                                                                                                                                    52            INT3/RA14
                                                                                                                                                                                                                                                                  51            VSS
           SS2/CN11/RG9      10                                                                          dsPIC30F5013
                    VSS      11                                                                                                                                                                                                                                   50            OSC2/CLKO/RC15
                                                                                                                                                                                                                                                                  49            OSC1/CLKI
                    VDD      12
               INT1/RA12                                                                                                                                                                                                                                          48            VDD
                             13
              INT2/RA13                                                                                                                                                                                                                                           47            SCL/RG2
                             14
            AN5/CN7/RB5                                                                                                                                                                                                                                           46            SDA/RG3
                             15
            AN4/CN6/RB4      16                                                                                                                                                                                                                                   45            EMUC3/SCK1/INT0/RF6
            AN3/CN5/RB3      17                                                                                                                                                                                                                                   44            SDI1/RF7
   AN2/SS1/LVDIN/CN4/RB2     18                                                                                                                                                                                                                                   43            EMUD3/SDO1/RF8
  PGC/EMUC/AN1/CN3/RB1       19                                                                                                                                                                                                                                   42            U1RX/RF2
  PGD/EMUD/AN0/CN2/RB0       20                                                                                                                                                                                                                                   41            U1TX/RF3
                              21
                                             22
                                                                                                                                                                  34
                                                                                                                                                                              35
                                                                                                                                                                                          36
                                                                                                                                                                                                                37
                                                                                                                                                                                                                                38
                                                                                                                                                                                                                                                39
                                                                                                                                                                                                                                                                40
                                                       23
                                                                   24
                                                                                25
                                                                                       26
                                                                                              27
                                                                                                        28
                                                                                                                  29
                                                                                                                              30
                                                                                                                                          31
                                                                                                                                                32
                                                                                                                                                      33
                                                                                                                  AN10/RB10
                                                                                                                                                      AN12/RB12
                                                                                                                                                                  AN13/RB13
                                                                                                                                                                              AN14/RB14
                                                                                                                                                                                          AN15/OCFB/CN12/RB15
                                             AN7/RB7
                                                       VREF-/RA9
                                                                   VREF+/RA10
                                                                                AVDD
                                                                                                                                                                                                                IC7/CN20/RD14
                                                                                                                                                                                                                                IC8/CN21/RD15
                                                                                       AVSS
                                                                                              AN8/RB8
                                                                                                        AN9/RB9
                                                                                                                              AN11/RB11
                                                                                                                                          VSS
                                                                                                                                                VDD
                                                                                                                                                                                                                                                U2RX/CN17/RF4
                                                                                                                                                                                                                                                                U2TX/CN18/RF5
                              AN6/OCFA/RB6
80-Pin TQFP
                                                                                                                                                                                                    EMUD2/OC2/RD1
                                                                                                                                                                      IC6/CN19/RD13
                                                                                        OC8/CN16/RD7
                                                                                                                                                       OC7/CN15/RD6
                                                                                                                                                                      OC6/CN14/RD5
                                                                                                                                                                      OC5/CN13/RD4
                                                                                        C2RX/RG0
                                                                                        C2TX/RG1
                                                                                        C1RX/RF0
                                                              RA7/CN23
                                                              RA6/CN22
C1TX/RF1
                                                                                                                                                                                                    IC5/RD12
                                                                                                                                                                                                    OC4/RD3
                                                                                                                                                                                                    OC3/RD2
                                        RG13
                                        RG12
                                                              RG14
                                                                                        VDD
                                                                                        VSS
                                        80
                                        79
                                        78
                                        77
                                        76
                                        75
                                        74
                                        73
                                        72
                                        71
                                        70
                                        69
                                        68
                                        67
                                        66
                                        65
                                        64
                                        63
                                        62
                                        61
                                                                                                                                                                                                                                                  60              EMUC1/SOSCO/T1CK/CN0/RC14
                   RG15      1
                                                                                                                                                                                                                                                  59              EMUD1/SOSCI/CN1/RC13
               T2CK/RC1      2
                                                                                                                                                                                                                                                  58              EMUC2/OC1/RD0
               T3CK/RC2      3
                                                                                                                                                                                                                                                  57              IC4/RD11
               T4CK/RC3      4
                                                                                                                                                                                                                                                  56              IC3/RD10
               T5CK/RC4      5
                                                                                                                                                                                                                                                  55              IC2/RD9
           SCK2/CN8/RG6      6
                                                                                                                                                                                                                                                  54              IC1/RD8
           SDI2/CN9/RG7      7
          SDO2/CN10/RG8                                                                                                                                                                                                                           53              INT4/RA15
                             8
                  MCLR       9                                                                                                                                                                                                                    52              INT3/RA14
                                                                                                                                                                                                                                                  51              VSS
           SS2/CN11/RG9      10
                    VSS
                                                                                                        dsPIC30F6013                                                                                                                              50              OSC2/CLKO/RC15
                             11
                    VDD                                                                                                                                                                                                                           49              OSC1/CLKI
                             12
              INT1/RA12                                                                                                                                                                                                                           48              VDD
                             13
              INT2/RA13                                                                                                                                                                                                                           47              SCL/RG2
                             14
            AN5/CN7/RB5                                                                                                                                                                                                                           46              SDA/RG3
                             15
            AN4/CN6/RB4      16                                                                                                                                                                                                                   45              EMUC3/SCK1/INT0/RF6
            AN3/CN5/RB3      17                                                                                                                                                                                                                   44              SDI1/RF7
   AN2/SS1/LVDIN/CN4/RB2     18                                                                                                                                                                                                                   43              EMUD3/SDO1/RF8
  PGC/EMUC/AN1/CN3/RB1       19                                                                                                                                                                                                                   42              U1RX/RF2
  PGD/EMUD/AN0/CN2/RB0       20                                                                                                                                                                                                                   41              U1TX/RF3
                             21
                                            22
                                                                                                                                                                 34
                                                                                                                                                                             35
                                                                                                                                                                                         36
                                                                                                                                                                                                   37
                                                                                                                                                                                                                38
                                                                                                                                                                                                                                39
                                                                                                                                                                                                                                                40
                                                      23
                                                                  24
                                                                               25
                                                                                      26
                                                                                             27
                                                                                                       28
                                                                                                                 29
                                                                                                                             30
                                                                                                                                         31
                                                                                                                                               32
                                                                                                                                                     33
                             AN6/OCFA/RB6
                                                      VREF-/RA9
                                            AN7/RB7
VREF+/RA10
AN8/RB8
                                                                                                                 AN10/RB10
                                                                                                                             AN11/RB11
                                                                                                       AN9/RB9
                                                                                                                                                     AN12/RB12
                                                                                                                                                                 AN13/RB13
                                                                                                                                                                             AN14/RB14
                                                                                                                                                                                         AN15/OCFB/CN12/RB15
                                                                                                                                                                                                IC7/CN20/RD14
                                                                                                                                                                                                                IC8/CN21/RD15
                                                                                                                                                                                                                                U2RX/CN17/RF4
                                                                                                                                                                                                                                                U2TX/CN18/RF5
                                                                               AVDD
                                                                                      AVSS
                                                                                                                                         VSS
                                                                                                                                               VDD
80-Pin TQFP
                                                                                                                                                                                                                EMUD2/OC2/RD1
                                                                                                                                                                       IC6/CN19/RD13
                                                                                         OC8/CN16/RD7
                                                                                                                                                        OC7/CN15/RD6
                                                                                                                                                                       OC6/CN14/RD5
                                                                                                                                                                       OC5/CN13/RD4
                                         CSDO/RG13
                                                               CSCK/RG14
                                         CSDI/RG12
                                                                                         C2RX/RG0
                                                                                         C2TX/RG1
                                                                                         C1RX/RF0
                                                               RA7/CN23
                                                               RA6/CN22
C1TX/RF1
                                                                                                                                                                                                                IC5/RD12
                                                                                                                                                                                                                OC4/RD3
                                                                                                                                                                                                                OC3/RD2
                                                                                         VDD
                                                                                         VSS
                                         80
                                         79
                                         78
                                         77
                                         76
                                         75
                                         74
                                         73
                                         72
                                         71
                                         70
                                         69
                                         68
                                         67
                                         66
                                         65
                                         64
                                         63
                                         62
                                         61
                                                                                                                                                                                                                                                                  60            EMUC1/SOSCO/T1CK/CN0/RC14
             COFS/RG15       1
                                                                                                                                                                                                                                                                  59            EMUD1/SOSCI/CN1/RC13
               T2CK/RC1      2
                                                                                                                                                                                                                                                                  58            EMUC2/OC1/RD0
               T3CK/RC2      3
                                                                                                                                                                                                                                                                  57            IC4/RD11
               T4CK/RC3      4
                                                                                                                                                                                                                                                                  56            IC3/RD10
               T5CK/RC4      5
                                                                                                                                                                                                                                                                  55            IC2/RD9
          SCK2/CN8/RG6       6
                                                                                                                                                                                                                                                                  54            IC1/RD8
           SDI2/CN9/RG7      7
          SDO2/CN10/RG8                                                                                                                                                                                                                                           53            INT4/RA15
                             8
                  MCLR       9                                                                                                                                                                                                                                    52            INT3/RA14
                                                                                                                                                                                                                                                                  51            VSS
           SS2/CN11/RG9      10                                                                         dsPIC30F6014
                    VSS      11                                                                                                                                                                                                                                   50            OSC2/CLKO/RC15
                                                                                                                                                                                                                                                                  49            OSC1/CLKI
                    VDD      12
               INT1/RA12                                                                                                                                                                                                                                          48            VDD
                             13
              INT2/RA13                                                                                                                                                                                                                                           47            SCL/RG2
                             14
            AN5/CN7/RB5                                                                                                                                                                                                                                           46            SDA/RG3
                             15
            AN4/CN6/RB4      16                                                                                                                                                                                                                                   45            EMUC3/SCK1/INT0/RF6
            AN3/CN5/RB3      17                                                                                                                                                                                                                                   44            SDI1/RF7
   AN2/SS1/LVDIN/CN4/RB2     18                                                                                                                                                                                                                                   43            EMUD3/SDO1/RF8
  PGC/EMUC/AN1/CN3/RB1       19                                                                                                                                                                                                                                   42            U1RX/RF2
  PGD/EMUD/AN0/CN2/RB0       20                                                                                                                                                                                                                                   41            U1TX/RF3
                              21
                                             22
                                                                                                                                                                  34
                                                                                                                                                                              35
                                                                                                                                                                                          36
                                                                                                                                                                                                                37
                                                                                                                                                                                                                                38
                                                                                                                                                                                                                                                39
                                                                                                                                                                                                                                                                40
                                                       23
                                                                   24
                                                                                25
                                                                                       26
                                                                                              27
                                                                                                        28
                                                                                                                  29
                                                                                                                              30
                                                                                                                                          31
                                                                                                                                                32
                                                                                                                                                      33
                                                                                                                  AN10/RB10
                                                                                                                                                      AN12/RB12
                                                                                                                                                                  AN13/RB13
                                                                                                                                                                              AN14/RB14
                                                                                                                                                                                          AN15/OCFB/CN12/RB15
                                             AN7/RB7
                                                       VREF-/RA9
                                                                   VREF+/RA10
                                                                                AVDD
                                                                                                                                                                                                                IC7/CN20/RD14
                                                                                                                                                                                                                                IC8/CN21/RD15
                                                                                       AVSS
                                                                                              AN8/RB8
                                                                                                        AN9/RB9
                                                                                                                              AN11/RB11
                                                                                                                                          VSS
                                                                                                                                                VDD
                                                                                                                                                                                                                                                U2RX/CN17/RF4
                                                                                                                                                                                                                                                                U2TX/CN18/RF5
                              AN6/OCFA/RB6
  Errata
  An errata sheet, describing minor operational differences from the data sheet and recommended workarounds, may exist for current
  devices. As device/documentation issues become known to us, we will publish an errata sheet. The errata will specify the revision
  of silicon and revision of document to which it applies.
  To determine if an errata sheet exists for a particular device, please check with one of the following:
  • Microchip’s Worldwide Web site; http://www.microchip.com
  • Your local Microchip sales office (see last page)
  • The Microchip Corporate Literature Center; U.S. FAX: (480) 792-7277
  When contacting a sales office or the literature center, please specify which device, revision of silicon and data sheet (include
  literature number) you are using.
                                                                                                                                      CN22/RA6
                                                      Y Data Bus                                                                      CN23/RA7
                                                                                                     X Data Bus
                                                                                                                                      VREF-/RA9
                                                                                           16    16         16                        VREF+/RA10
                                                                              16
                                                                                                                                      INT1/RA12
     Interrupt                                                                     Data Latch          Data Latch                     INT2/RA13
     Controller                   PSV & Table
                                  Data Access                                        Y Data              X Data                       INT3/RA14
                               24 Control Block         8           16                RAM                 RAM                         INT4/RA15
                                                                                   (4 Kbytes)          (4 Kbytes)
                                                                                                                      16   PORTA
                                                                                    Address             Address
                    24                                                               Latch               Latch                        PGD/EMUD/AN0/CN2/RB0
                                                                                           16     16             16                   PGC/EMUC/AN1/CN3/RB1
                                                                                                                                      AN2/SS1/LVDIN/CN4/RB2
                                24                                                                X RAGU
                                                                                   Y AGU                                              AN3/CN5/RB3
                                                PCU PCH PCL                                       X WAGU
                                                                                                                                      AN4/CN6/RB4
                                                Program Counter
                                                                                                                                      AN5/CN7/RB5
     Address Latch                              Stack     Loop
                                               Control   Control                                                                      AN6/OCFA/RB6
     Program Memory                             Logic    Logic                                                                        AN7/RB7
       (144 Kbytes)                                                                                                                   AN8/RB8
                                                                                                                                      AN9/RB9
     Data EEPROM
       (4 Kbytes)                                                                                                                     AN10/RB10
                                                                                     Effective Address                                AN11/RB11
       Data Latch                            16                                                                                       AN12/RB12
                                                                                                                                      AN13/RB13
                                                                                                                                      AN14/RB14
                                                         ROM Latch                              16                                    AN15/OCFB/CN12/RB15
                                     24                                                                                    PORTB
                                                                                                                                      T2CK/RC1
                                                              IR                                                                      T3CK/RC2
                                                                                                             16                       T4CK/RC3
                              16
                                                                                                                                      T5CK/RC4
                                                                                             16 x 16                                  EMUD1/SOSCI/CN1/RC13
                                                                                           W Reg Array                                EMUC1/SOSCO/T1CK/CN0/RC14
                                                                     Decode
                                                                                                                                      OSC2/CLKO/RC15
                           Instruction                                                                                     PORTC
                           Decode &                                                   16 16
                            Control                                                                                                   EMUC2/OC1/RD0
                                                                                                                                      EMUD2/OC2/RD1
                                                                                                                                      OC3/RD2
       Control Signals                                                     DSP                         Divide                         OC4/RD3
              to Various Blocks                     Power-up              Engine                                                      OC5/CN13/RD4
                                                                                                        Unit
                                                     Timer                                                                            OC6/CN14/RD5
                          Timing                     Oscillator                                                                       OC7/CN15/RD6
       OSC1/CLKI                                                                                                                      OC8/CN16/RD7
                         Generation                Start-up Timer
                                                                                                                                      IC1/RD8
                                                    POR/BOR                                     ALU<16>                               IC2/RD9
                                                     Reset                                                                            IC3/RD10
                                                    Watchdog             16                           16                              IC4/RD11
                               MCLR                                                                                                   IC5/RD12
                                                     Timer
                                                                                                                                      IC6/CN19/RD13
                                                   Low Voltage
                                                                                                                                      IC7/CN20/RD14
                             VDD, VSS                Detect                                                                           IC8/CN21/RD15
                            AVDD, AVSS                                                                                     PORTD
                                                   D15                           D0
                                                              W0/WREG
                                                                                                                  PUSH.S Shadow
                                                                  W1
                                                                                                                   DO Shadow
                                                                  W2
                                                                  W3                                             Legend
                                                                  W4
                            DSP Operand                           W5
                            Registers
                                                                  W6
                                                                  W7
                                                                                                  Working Registers
                                                                  W8
                                                                  W9
                            DSP Address
                            Registers                             W10
                                                                  W11
                                                           W12/DSP Offset
                                                          W13/DSP Write Back
                                                           W14/Frame Pointer
                                                            W15/Stack Pointer
               PC22                                                             PC0
                                                                                 0           Program Counter
          7                    0
                   TABPAG
                   TBLPAG               Data Table Page Address
               7                    0
                      PSVPAG               Program Space Visibility Page Address
                                                     15                            0
                                                               RCOUNT                        REPEAT Loop Counter
                                                     15                            0
                                                               DCOUNT                        DO Loop Counter
              22                                                                   0
                                           DOSTART                                           DO Loop Start Address
              22
                                           DOEND                                             DO Loop End Address
                                                     15                            0
                                                               CORCON                        Core Configuration Register
SRH SRL
FIGURE 2-8: INSTRUCTION PIPELINE FLOW: 1-WORD, 2-CYCLE WITH INSTRUCTION STALL
                                                                                            S
                                                                                            a
                    40                      40-bit Accumulator A                   40 Round t 16
                                            40-bit Accumulator B                            u
                                                                                      Logic r
                                                                                            a
                         Carry/Borrow Out                                                   t
                                                   Saturate                                 e
                         Carry/Borrow In           Adder
Negate
40 40 40
                                                                   Barrel
                                                                              16
                                                                   Shifter
                                                                                                         X Data Bus
                                                         40
                                                 Sign-Extend
       Y Data Bus
                                                                             32                     16
                                                                                   Zero Backfill
                                                                   32
                                                   33
                                                    17-bit
                                               Multiplier/Scaler
16 16
To/From W Array
0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1
               20
                        2   14
                                  2  13
                                          2   12
                                                    2   11
                                                             ....                                                         20
1.15 Fractional:
0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1
               -20  .   -1
                        2        2   -2   -3
                                          2        ...                                                                    2-15
Certain multiply operations always operate on signed                            different. In these instructions, data format selection is
data. These include the MAC/MSC, MPY[.N] and                                    made with the IF bit (CORCON<0>) and US bits
ED[AC] instructions. The 40-bit adder/subtracter may                            (CORCON<12>), and it must be set accordingly (‘0’ for
also optionally negate one of its operand inputs to                             Fractional mode, ‘1’ for Integer mode in the case of the
change the result sign (without changing the oper-                              IF bit, and ‘0’ for Signed mode, ‘1’ for Unsigned mode
ands). This is used to create a multiply and subtract                           in the case of the US bit). This is required because of
(MSC), or multiply and negate (MPY.N) operation.                                the implied radix point used by dsPIC30F fractions. In
In the special case when both input operands are 1.15                           Integer mode, multiplying two 16-bit integers produces
fractions and equal to 0x8000 (-110), the result of the                         a 32-bit integer result. However, multiplying two 1.15
multiplication is corrected to 0x7FFFFFFF (as the                               values generates a 2.30 result. Since the dsPIC30F
closest approximation to +1) by hardware before it is                           uses 1.31 format for the accumulators, a DSP multiply
used.                                                                           in Fractional mode also includes a left shift by one bit to
                                                                                keep the radix point properly aligned. This feature
It should be noted that with the exception of DSP mul-                          reduces the resolution of the DSP multiplier to 2-30, but
tiplies, the dsPIC30F ALU operates identically on inte-                         has no other effect on the computation.
ger and fractional data. Namely, an addition of two
integers will yield the same result (binary number) as
the addition of two fractional numbers. The only differ-
ence is how the result is interpreted by the user. How-
ever, multiplies performed by DSP operations are
                                                                 23 bits
                     Using
                     Program         0                    Program Counter                                0
                     Counter
                                                       Select
                                                                  1                  EA
                     Using
                     Program         0     PSVPAG Reg
                     Space
                     Visibility               8 bits                               15 bits
EA
                           User/
                           Configuration                                                                Byte
                           Space                                  24-bit EA
                                                                                                        Select
                           Select
Note: Program space visibility cannot be used to access bits <23:16> of a word in program memory.
             PC Address                      23           16                 8                   0
             0x000000         00000000
             0x000002         00000000
             0x000004         00000000
             0x000006         00000000
                                                                                 TBLRDL.B (Wn<0> = 0)
                                               TBLRDL.W
        Program Memory
        ‘Phantom’ Byte
                                                                       TBLRDL.B (Wn<0> = 1)
        (read as ‘0’)
TBLRDH.W
                    PC Address                        23       16                  8                  0
                     0x000000         00000000
                     0x000002         00000000
                     0x000004         00000000
                     0x000006         00000000
TBLRDH.B (Wn<0> = 0)
              Program Memory
              ‘Phantom’ Byte
              (read as ‘0’)                    TBLRDH.B (Wn<0> = 1)
3.1.2       PROGRAM SPACE VISIBILITY                         Note that by incrementing the PC by 2 for each
            FROM DATA SPACE                                  program memory word, the LS 15 bits of data space
                                                             addresses directly map to the LS 15 bits in the corre-
The upper 32 Kbytes of data space may optionally be
                                                             sponding program space addresses. The remaining
mapped into any 16K word program space page. This
                                                             bits are provided by the Program Space Visibility Page
provides transparent access of stored constant data
                                                             register, PSVPAG<7:0>, as shown in Figure 3-4.
from X data space without the need to use special
instructions (i.e., TBLRDL/H, TBLWTL/H instructions).          Note:     PSV access is temporarily disabled during
Program space access through the data space occurs                       table reads/writes.
if the MS bit of the data space EA is set and program        For instructions that use PSV which are executed
space visibility is enabled by setting the PSV bit in the    outside a REPEAT loop:
Core Control register (CORCON). The functions of
                                                             • The following instructions will require one
CORCON are discussed in Section 2.5, DSP Engine.
                                                               instruction cycle in addition to the specified
Data accesses to this area add an additional cycle to          execution time:
the instruction being executed, since two program              - MAC class of instructions with data operand
memory fetches are required.                                      pre-fetch
Note that the upper half of addressable data space is          - MOV instructions
always part of the X data space. Therefore, when a             - MOV.D instructions
DSP operation uses program space mapping to access
                                                             • All other instructions will require two instruction
this memory region, Y data space should typically con-
                                                               cycles in addition to the specified execution time
tain state (variable) data for DSP operations, whereas
                                                               of the instruction.
X data space should typically contain coefficient
(constant) data.                                             For instructions that use PSV which are executed
                                                             inside a REPEAT loop:
Although each data space address, 0x8000 and
higher, maps directly into a corresponding program           • The following instances will require two instruction
memory address (see Figure 3-4), only the lower                cycles in addition to the specified execution time
16 bits of the 24-bit program word are used to contain         of the instruction:
the data. The upper 8 bits should be programmed to             - Execution in the first iteration
force an illegal instruction to maintain machine robust-       - Execution in the last iteration
ness. Refer to the Programmer’s Reference Manual               - Execution prior to exiting the loop due to an
(DS70030) for details on instruction encoding.                    interrupt
                                                               - Execution upon re-entering the loop after an
                                                                  interrupt is serviced
                                                             • Any other iteration of the REPEAT loop will allow
                                                               the instruction accessing data, using PSV, to
                                                               execute in a single cycle.
Program Space
                                Data Space
                                                0x0000
                          15                              PSVPAG(1)
             EA<15> = 0                                     0x21
                                                               8
   Data 16
   Space                                        0x8000                                                       0x108000
                    15                                                    23         15                  0
   EA                                                  Address
         EA<15> = 1                                  Concatenation 23                                        0x108200
                                                15
     Note:     PSVPAG is an 8-bit register, containing bits <22:15> of the program space address (i.e., it defines
               the page in program space to which the upper half of data space is being mapped).
                               Alternate Vector Table    000084               address space data path for the dual operand read
     Space
                                                         0000FE
                                                         000100               instructions (MAC class). The X write data bus is the
                                     User Flash
                                  Program Memory                              only write path to data space for all instructions.
                                  (48K instructions)
                                                         017FFE
                                                                              The X data space also supports modulo addressing for
                                                         018000               all instructions, subject to Addressing mode restric-
                                      Reserved                                tions. Bit-reversed addressing is only supported for
                                     (Read ‘0’s)
                                                         7FEFFE               writes to X data space.
                                                         7FF000
                                   Data EEPROM                                The Y data space is used in concert with the X data
                                     (4 Kbytes)                               space by the MAC class of instructions (CLR, ED,
                                                         7FFFFE               EDAC, MAC, MOVSAC, MPY, MPY.N and MSC) to
                                                         800000               provide two concurrent data read paths. No writes
                                                                              occur across the Y bus. This class of instructions dedi-
                                                                              cates two W register pointers, W10 and W11, to always
                                                                              address Y data space, independent of X data space,
                                                                              whereas W8 and W9 always address X data space.
                                                                              Note that during accumulator write back, the data
                                      Reserved                                address space is considered a combination of X and Y
                                                                              data spaces, so the write occurs across the X bus.
                                                                              Consequently, the write can be to any address in the
                                                                              entire data space.
                                                                              The Y data space can only be used for the data pre-
                                                                              fetch operation associated with the MAC class of
  Configuration Memory
                                                         8005C0               tions can access the Y data address space through the
                                  UNITID (32 instr.)
                                                         8005FE               X data path as part of the composite linear space.
                                                         800600
                                      Reserved                                The boundary between the X and Y data spaces is
                                                         F7FFFE               defined as shown in Figure 3-8 and is not user pro-
                                Device Configuration     F80000
                                     Registers           F8000E
                                                                              grammable. Should an EA point to data outside its own
                                                         F80010               assigned address space, or to a location outside phys-
                                                                              ical memory, an all zero word/byte will be returned. For
                                                                              example, although Y address space is visible by all
                                                                              non-MAC instructions using any Addressing mode, an
                                                                              attempt by a MAC instruction to fetch data from that
                                      Reserved
                                                                              space using W8 or W9 (X space pointers) will return
                                                                              0x0000.
                                                         FEFFFE
                                     DEVID (2)           FF0000
                                                         FFFFFE
                                                                                                            POP : [--W15]
                                                                                                            PUSH : [W15++]
                      MS Byte                                                  LS Byte
                      Address                    16 bits                       Address
                                           MSB              LSB
                           0x0001                                         0x0000
          2-Kbyte
                                                 SFR Space
          SFR Space                                                       0x07FE
                           0x07FF
                           0x0801                                         0x0800
                                                                                                  8-Kbyte
                                                                                                  Near
                                               X Data RAM (X)                                     Data
                                                                                                  Space
                           0x27FF                                         0x27FE
                           0x2801                                         0x2800
0x8001 0x8000
                                                 X Data
                                             Unimplemented (X)
       Optionally
       Mapped
       into Program
       Memory
0xFFFF 0xFFFE
       Note:   The address map shown in Figure 3-8 is conceptual, and may vary across individual devices
               depending on available memory.
                                                                                                  X SPACE
                                                       UNUSED
X SPACE
                                                                                                  X SPACE
                                                       UNUSED
Indirect EA from any W Indirect EA from W8, W9 Indirect EA from W10, W11
   DS70083G-page 44
                                   W3           0006                                                                           W3                                                                        0000 0000 0000 0000
                                   W4           0008                                                                           W4                                                                        0000 0000 0000 0000
                                                                                                                                                                                                                               dsPIC30F
Preliminary
                                   ACCAU        0026                           Sign-Extension (ACCA<39>)                                                        ACCAU                                    0000 0000 0000 0000
                                   ACCBL        0028                                                                          ACCBL                                                                      0000 0000 0000 0000
                                   ACCBH        002A                                                                          ACCBH                                                                      0000 0000 0000 0000
                                   ACCBU        002C                           Sign-Extension (ACCB<39>)                                                        ACCBU                                    0000 0000 0000 0000
                                   PCL          002E                                                                           PCL                                                                       0000 0000 0000 0000
                                   PCH          0030           —       —        —        —        —        —        —         —         —                               PCH                              0000 0000 0000 0000
                                   TBLPAG       0032           —       —        —        —        —        —        —         —                                 TBLPAG                                   0000 0000 0000 0000
                                   PSVPAG       0034           —       —        —        —        —        —        —         —                                 PSVPAG                                   0000 0000 0000 0000
                                   RCOUNT       0036                                                                         RCOUNT                                                                      uuuu uuuu uuuu uuuu
                                   DCOUNT       0038                                                                         DCOUNT                                                                      uuuu uuuu uuuu uuuu
                                   DOSTARTL     003A                                                                    DOSTARTL                                                                  0      uuuu uuuu uuuu uuu0
                                   DOSTARTH     003C           —       —        —        —        —        —        —         —         —                             DOSTARTH                           0000 0000 0uuu uuuu
                                   DOENDL       003E                                                                       DOENDL                                                                 0      uuuu uuuu uuuu uuu0
                                   DOENDH       0040           —       —        —        —        —        —        —         —         —                             DOENDH                             0000 0000 0uuu uuuu
                                   SR           0042          OA       OB       SA       SB      OAB       SAB     DA         DC      IPL2    IPL1    IPL0    RA          N      OV       Z       C      0000 0000 0000 0000
                                   Legend:    u = uninitialized bit
Note: Refer to dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
Preliminary
                                                                                                                                                                                                                                dsPIC30F
   DS70083G-page 45
dsPIC30F
NOTES:
4.2.2        MCU INSTRUCTIONS                                     Note:    Not all instructions support all the
                                                                           Addressing modes given above. Individual
The three-operand MCU instructions are of the form:                        instructions may support different subsets
Operand 3 = Operand 1 <function> Operand 2                                 of these Addressing modes.
where Operand 1 is always a working register (i.e., the
                                                              4.2.4        MAC INSTRUCTIONS
Addressing mode can only be register direct) which is
referred to as Wb. Operand 2 can be the W register            The dual source operand DSP instructions (CLR, ED,
fetched from data memory or 5-bit literal. In two-            EDAC, MAC, MPY, MPY.N, MOVSAC and MSC), also
operand instructions, the result location is the same as      referred to as MAC instructions, utilize a simplified set of
that of one of the operands. Certain MCU instructions         Addressing modes to allow the user to effectively
are one-operand operations. The following addressing          manipulate the data pointers through register indirect
modes are supported by MCU instructions:                      tables.
•   Register Direct                                           The 2 source operand pre-fetch registers must be a
•   Register Indirect                                         member of the set {W8, W9, W10, W11}. For data
                                                              reads, W8 and W9 will always be directed to the X
•   Register Indirect Post-modified
                                                              RAGU and W10 and W11 will always be directed to the
•   Register Indirect Pre-modified                            Y AGU. The effective addresses generated (before and
•   5-bit or 10-bit Literal                                   after modification) must, therefore, be valid addresses
    Note:    Not all instructions support all the             within X data space for W8 and W9 and Y data space
             Addressing modes given above. Individual         for W10 and W11.
             instructions may support different subsets           Note:    Register indirect with register offset
             of these Addressing modes.                                    addressing is only available for W9 (in X
                                                                           space) and W11 (in Y space).
4.2.3        MOVE AND ACCUMULATOR
                                                              In summary, the following Addressing modes are
             INSTRUCTIONS
                                                              supported by the MAC class of instructions:
Move instructions and the DSP accumulator class of
                                                              •   Register Indirect
instructions provide a greater degree of addressing
flexibility than other instructions. In addition to the       •   Register Indirect Post-modified by 2
Addressing modes supported by most MCU instruc-               •   Register Indirect Post-modified by 4
tions, move and accumulator instructions also support         •   Register Indirect Post-modified by 6
Register Indirect with Register Offset Addressing             •   Register Indirect with Register Offset (Indexed)
mode, also referred to as Register Indexed mode.
                                                              4.2.5        OTHER INSTRUCTIONS
    Note:    For the MOV instructions, the Addressing
             mode specified in the instruction can differ     Besides the various Addressing modes outlined above,
             for the source and destination EA.               some instructions use literal constants of various sizes.
             However, the 4-bit Wb (register offset)          For example, BRA (branch) instructions use 16-bit
             field is shared between both source and          signed literals to specify the branch destination directly,
             destination (but typically only used by          whereas the DISI instruction uses a 14-bit unsigned
             one).                                            literal field. In some instructions, such as ADD Acc, the
                                                              source of an operand or result is implied by the opcode
                                                              itself. Certain operations, such as NOP, do not have any
                                                              operands.
    Byte
    Address                                 MOV      #0x1100,W0
                                            MOV      W0,XMODSRT     ;set modulo start address
                                            MOV      #0x1163,W0
                                            MOV      W0,MODEND      ;set modulo end address
        0x1100                              MOV      #0x8001,W0
                                            MOV      W0,MODCON      ;enable W1, X AGU for modulo
  Byte
  Address
                                    MOV    #0x11D0,W0
                                    MOV    #0,XMODSRT    ;set modulo start address
                                    MOV    0x11FF,W0
                                    MOV    W0,XMODEND    ;set modulo end address
                                    MOV    #0x8001,W0
                                    MOV    W0,MODCON     ;enable W1, X AGU for modulo
0x11FF
                                                 Pivot Point
                                                                    XB = 0x0008 for a 16-word Bit-Reversed Buffer
5.  Execution of a “BRA #literal” instruction or a             ‘Hard’ traps include exceptions of priority level 12
    “GOTO #literal” instruction, where literal                 through level 15, inclusive. The address error (level
    is an unimplemented program memory address.                12), stack error (level 13) and oscillator error (level 14)
                                                               traps fall into this category.
6. Executing instructions after modifying the PC to
    point to unimplemented program memory                      Like soft traps, hard traps can also be viewed as non-
    addresses. The PC may be modified by loading               maskable sources of interrupt. The difference between
    a value into the stack and executing a RETURN              hard traps and soft traps is that hard traps force the
    instruction.                                               CPU to stop code execution after the instruction caus-
• Stack Error Trap:                                            ing the trap has completed. Normal program execution
  This trap is initiated under the following                   flow will not resume until after the trap has been
  conditions:                                                  Acknowledged and processed.
    1. The stack pointer is loaded with a value                If a higher priority trap occurs while any lower priority
         which is greater than the (user program-              trap is in progress, processing of the lower priority trap
         mable) limit value written into the SPLIM             will be suspended and the higher priority trap will be
         register (stack overflow).                            Acknowledged and processed. The lower priority trap
    2. The stack pointer is loaded with a value                will remain pending until processing of the higher
         which is less than 0x0800 (simple stack               priority trap completes.
         underflow).                                           Each hard trap that occurs must be Acknowledged
• Oscillator Fail Trap:                                        before code execution of any type may continue. If a
  This trap is initiated if the external oscillator fails      lower priority hard trap occurs while a higher priority
  and operation becomes reliant on an internal RC              trap is pending, Acknowledged, or is being processed,
  backup.                                                      a hard trap conflict will occur. The conflict occurs
                                                               because the lower priority trap cannot be Acknowl-
                                                               edged until processing for the higher priority trap
                                                               completes.
                                                               The device is automatically reset in a hard trap conflict
                                                               condition. The TRAPR status bit (RCON<15>) is set
                                                               when the Reset occurs so that the condition may be
                                                               detected in software.
                                                               In the case of a math error trap or oscillator failure trap,
                                                               the condition that causes the trap to occur must be
                                                               removed before the respective trap flag bit in the
                                                               INTCON1 register may be cleared.
                                                                                 Decreasing
                                                                                                     Math Error Trap Vector
                                                                                  Priority
interrupt to occur if the corresponding bit in the Interrupt
                                                                                              IVT       Reserved Vector
Enable (IECx) register is set. For the remainder of the                                                 Reserved Vector
instruction cycle, the priorities of all pending interrupt                                              Reserved Vector
                                                                                                        Interrupt 0 Vector        0x000014
requests are evaluated.                                                                                 Interrupt 1 Vector
                                                                                                                 ~
If there is a pending IRQ with a priority level greater                                                          ~
than the current processor priority level in the IPL bits,                                                       ~
                                                                                                       Interrupt 52 Vector
the processor will be interrupted.                                                                     Interrupt 53 Vector        0x00007E
                                                                                                             Reserved             0x000080
The processor then stacks the current program counter                                                        Reserved             0x000082
                                                                                                             Reserved             0x000084
and the low byte of the processor STATUS register                                                   Oscillator Fail Trap Vector
(SRL), as shown in Figure 5-1. The low byte of the                                                   Stack Error Trap Vector
                                                                                                    Address Error Trap Vector
STATUS register contains the processor priority level at                                             Math Error Trap Vector
the time prior to the beginning of the interrupt cycle.                                   AIVT           Reserved Vector
                                                                                                         Reserved Vector
The processor then loads the priority level for this inter-                                              Reserved Vector
rupt into the STATUS register. This action will disable                                                 Interrupt 0 Vector        0x000094
                                                                                                        Interrupt 1 Vector
all lower priority interrupts until the completion of the                                                        ~
Interrupt Service Routine.                                                                                       ~
                                                                                                                 ~
                                                                                                       Interrupt 52 Vector
                                                                                                                                  0x0000FE
FIGURE 5-1:                           INTERRUPT STACK                                                  Interrupt 53 Vector
                                      FRAME
 0x0000 15                                    0                            5.5                Alternate Vector Table
                                                                           In program memory, the Interrupt Vector Table (IVT) is
                                                                           followed by the Alternate Interrupt Vector Table (AIVT),
   Stack Grows Towards
                                   INTCON1   0080 NSTDIS             —        —          —        —       OVATE      OVBTE      COVTE       —       —        —      MATHERR      ADDRERR   STKERR OSCFAIL           —      0000 0000 0000 0000
                                   INTCON2   0082 ALTIVT             —        —          —        —         —          —           —        —       —        —       INT4EP       INT3EP   INT2EP     INT1EP      INT0EP 0000 0000 0000 0000
                                   IFS0      0084     CNIF      MI2CIF      SI2CIF     NVMIF     ADIF     U1TXIF     U1RXIF      SPI1IF    T3IF    T2IF     OC2IF        IC2IF     T1IF    OC1IF       IC1IF      INT0IF   0000 0000 0000 0000
                                   IFS1      0086     IC6IF      IC5IF       IC4IF      IC3IF    C1IF     SPI2IF     U2TXIF     U2RXIF    INT2IF   T5IF     T4IF     OC4IF        OC3IF     IC8IF      IC7IF      INT1IF   0000 0000 0000 0000
                                   IFS2      0088       —            —        —          —        —       LVDIF      DCIIF         —        —      C2IF    INT4IF    INT3IF       OC8IF    OC7IF       OC6IF      OC5IF    0000 0000 0000 0000
                                   IEC0      008C     CNIE      MI2CIE      SI2CIE     NVMIE     ADIE     U1TXIE U1RXIE          SPI1IE   T3IE     T2IE     OC2IE        IC2IE     T1IE    OC1IE       IC1IE      INT0IE   0000 0000 0000 0000
Preliminary
                                   IPC10     00A8       —            —        —          —        —                LVDIP<2:0>               —              DCIIP<2:0>               —        —          —           —      0000 0100 0100 0000
                                   Legend:   u = uninitialized bit
                                   Note: Refer to dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
                                                                                                                                                                                                                                                 dsPIC30F
   DS70083G-page 61
dsPIC30F
NOTES:
                                                                  24 bits
                              Using
                              Program        0               Program Counter                0
                              Counter
                                                                        NVMADR Reg EA
                              Using
                              NVMADR        1/0   NVMADRU Reg
                              Addressing
                                                    8 bits                     16 bits
Working Reg EA
                                                                                            Byte
                User/Configuration                                                          Select
                Space Select                                      24-bit EA
Note: In Example 6-2, the contents of the upper byte of W3 has no effect.
                                   NVMCON          0760          WR     WREN     WRERR     —       —      —       —      TWRI      —                          PROGOP<6:0>                         0000 0000 0000 0000
                                   NVMADR          0762                                                                  NVMADR<15:0>                                                             uuuu uuuu uuuu uuuu
                                   NVMADRU         0764           —      —        —        —       —      —       —        —                              NVMADR<23:16>                           0000 0000 uuuu uuuu
                                   NVMKEY          0766           —      —        —        —       —      —       —        —                                KEY<7:0>                              0000 0000 0000 0000
                                   Legend:      u = uninitialized bit
Note: Refer to dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
   DS70083G-page 67
dsPIC30F
NOTES:
                                            Read TRIS
                                                                                       I/O Cell
                                                      TRIS Latch
                                 Data Bus               D        Q
WR TRIS CK
                                                        Data Latch
                                                        D        Q                           I/O Pad
                                 WR LAT +
                                 WR Port                 CK
Read LAT
Read Port
                                   PIO Module                           1
                                                                            Output Data
                                                                        0
Read TRIS
                                                                                                     I/O Pad
                    Data Bus              D      Q
                    WR TRIS               CK
                                         TRIS Latch
                                          D      Q
                    WR LAT +
                    WR Port               CK
                                         Data Latch
                                       Read LAT
                                                                                   Input Data
Read Port
8.2      Configuring Analog Port Pins                           8.2.1        I/O PORT WRITE/READ TIMING
The use of the ADPCFG and TRIS registers control the            One instruction cycle is required between a port
operation of the A/D port pins. The port pins that are          direction change or port write operation and a read
desired as analog inputs must have their correspond-            operation of the same port. Typically this instruction
ing TRIS bit set (input). If the TRIS bit is cleared            would be a NOP.
(output), the digital output level (VOH or VOL) will be
converted.                                                      EXAMPLE 8-1:              PORT WRITE/READ
When reading the Port register, all pins configured as                                    EXAMPLE
analog input channels will read as cleared (a low level).       MOV     0xFF00, W0        ; Configure PORTB<15:8>
Pins configured as digital inputs will not convert an                                     ; as inputs
                                                                MOV     W0, TRISB         ; and PORTB<7:0> as outputs
analog input. Analog levels on any pin that is defined as
                                                                NOP                       ; additional instruction
a digital input (including the ANx pins) may cause the
                                                                                            cylcle
input buffer to consume current that exceeds the                btss    PORTB, #13        ; bit test RB13 and skip if
device specifications.                                                                      set
Preliminary
                                   Legend:      u = uninitialized bit
                                   TRISD     02D2 TRISD15 TRISD14 TRISD13 TRISD12 TRISD11 TRISD10 TRISD9                                      TRISD8      TRISD7          TRISD6        TRISD5 TRISD4 TRISD3 TRISD2 TRISD1 TRISD0 1111 1111 1111 1111
                                   PORTD     02D4       RD15          RD14      RD13         RD12            RD11        RD10       RD9         RD8          RD7             RD6          RD5             RD4            RD3             RD2       RD1        RD0      0000 0000 0000 0000
                                   LATD      02D6     LATD15      LATD14       LATD13        LATD12          LATD11      LATD10     LATD9      LATD8      LATD7           LATD6          LATD5           LATD4          LATD3       LATD2         LATD1      LATD0     0000 0000 0000 0000
                                   Legend:      u = uninitialized bit
                                                                                                                                                                                                                                                                                              dsPIC30F
   DS70083G-page 77
                                   TABLE 8-5:            PORTF REGISTER MAP
                                    SFR
                                             Addr.    Bit 15     Bit 14          Bit 13      Bit 12        Bit 11   Bit 10      Bit 9      Bit 8       Bit 7       Bit 6       Bit 5      Bit 4     Bit 3     Bit 2     Bit 1     Bit 0        Reset State
                                   Name
                                   TRISF     02DE       —          —              —           —             —          —         —        TRISF8      TRISF7      TRISF6      TRISF5     TRISF4   TRISF3     TRISF2    TRISF1    TRISF0   0000 0001 1111 1111
                                   PORTF     02E0       —          —              —           —             —          —         —         RF8         RF7         RF6         RF5        RF4       RF3       RF2       RF1       RF0     0000 0000 0000 0000
                                   LATF      02E2       —          —              —           —             —          —         —        LATF8       LATF7       LATF6       LATF5      LATF4     LATF3     LATF2     LATF1     LATF0    0000 0000 0000 0000
   DS70083G-page 78
                                   Legend:      u = uninitialized bit
                                                                                                                                                                                                                                                                dsPIC30F
                                   TRISG      02E4    TRISG15 TRISG14 TRISG13 TRISG12                           —          —     TRISG9     TRISG8      TRISG7       TRISG6        —       —      TRISG3    TRISG2    TRISG1    TRISG0    1111 0011 1100 1111
                                   PORTG      02E6      RG15            RG14          RG13        RG12          —          —      RG9         RG8         RG7         RG6          —       —       RG3       RG2       RG1       RG0      0000 0000 0000 0000
                                   LATG       02E8    LATG15       LATG14          LATG13       LATG12          —          —     LATG9       LATG8       LATG7       LATG6         —       —      LATG3     LATG2     LATG1     LATG0     0000 0000 0000 0000
                                   Legend:      u = uninitialized bit
Note: Refer to dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
Preliminary
 2004 Microchip Technology Inc.
                                                                                                     dsPIC30F
8.3       Input Change Notification Module
The input change notification module provides the
dsPIC30F devices the ability to generate interrupt
requests to the processor, in response to a change of
state on selected input pins. This module is capable of
detecting input change of states even in Sleep mode,
when the clocks are disabled. There are up to 24 exter-
nal signals (CN0 through CN23) that may be selected
(enabled) for generating an interrupt request on a
change of state.
CNEN1      00C0       CN15IE        CN14IE   CN13IE   CN12IE   CN11IE    CN10IE    CN9IE     CN8IE    0000 0000 0000 0000
CNEN2      00C2           —           —        —        —        —         —         —        —       0000 0000 0000 0000
CNPU1      00C4      CN15PUE CN14PUE CN13PUE CN12PUE CN11PUE CN10PUE               CN9PUE   CN8PUE    0000 0000 0000 0000
CNPU2      00C6           —           —        —        —        —         —         —        —       0000 0000 0000 0000
Legend:     u = uninitialized bit
Note: Refer to dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
PR1
                                   Equal
                                           Comparator x 16                                 TSYNC
                                                                                             1       Sync
                                               TMR1
                                   Reset
                                                                                             0
                            0
             T1IF
             Event Flag     1                            Q    D     TGATE
                                                         Q   CK
                          TGATE
                                                                             TGATE
                                                                             TCS
                                                                                                   TCKPS<1:0>
            SOSCO/                                                                   TON              2
              T1CK                                                            1x
                                                             Gate                                   Prescaler
                                     LPOSCEN                                                       1, 8, 64, 256
                                                             Sync             01
              SOSCI
                                                             TCY              00
When the CPU enters Sleep mode, the RTC will con-
tinue to operate provided the 32 kHz external crystal
oscillator is active and the control bits have not been
changed. The TSIDL bit should be cleared to ‘0’ in
order for RTC to continue operation in Idle mode.
   DS70083G-page 84
                                   Legend:    u = uninitialized bit
                                   Note: Refer to dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
                                                                                                                                                                                                                                 dsPIC30F
Preliminary
 2004 Microchip Technology Inc.
                                                                                              dsPIC30F
10.0        TIMER2/3 MODULE                                     16-bit Timer Mode: In the 16-bit mode, Timer2 and
                                                                Timer3 can be configured as two independent 16-bit
    Note: This data sheet summarizes features of this group     timers. Each timer can be set up in either 16-bit Timer
    of dsPIC30F devices and is not intended to be a complete    mode or 16-bit Synchronous Counter mode. See
    reference source. For more information on the CPU,
    peripherals, register descriptions and general device
                                                                Section 9.0, Timer1 Module for details on these two
    functionality, refer to the dsPIC30F Family Reference       Operating modes.
    Manual (DS70046).                                           The only functional difference between Timer2 and
This section describes the 32-bit General Purpose               Timer3 is that Timer2 provides synchronization of the
(GP) Timer module (Timer2/3) and associated Opera-              clock prescaler output. This is useful for high frequency
tional modes. Figure 10-1 depicts the simplified block          external clock inputs.
diagram of the 32-bit Timer2/3 module. Figure 10-2              32-bit Timer Mode: In the 32-bit Timer mode, the timer
and Figure 10-3 show Timer2/3 configured as two                 increments on every instruction cycle, up to a match
independent 16-bit timers, Timer2 and Timer3,                   value preloaded into the combined 32-bit Period
respectively.                                                   register PR3/PR2, then resets to ‘0’ and continues to
The Timer2/3 module is a 32-bit timer (which can be             count.
configured as two 16-bit timers) with selectable                For synchronous 32-bit reads of the Timer2/Timer3
Operating modes. These timers are utilized by other             pair, reading the LS Word (TMR2 register) will cause
peripheral modules, such as:                                    the MS word to be read and latched into a 16-bit
• Input Capture                                                 holding register, termed TMR3HLD.
• Output Compare/Simple PWM                                     For synchronous 32-bit writes, the holding register
The following sections provide a detailed description,          (TMR3HLD) must first be written to. When followed by
including setup and control registers, along with asso-         a write to the TMR2 register, the contents of TMR3HLD
ciated block diagrams for the Operational modes of the          will be transferred and latched into the MSB of the
timers.                                                         32-bit timer (TMR3).
The 32-bit timer has the following modes:                       32-bit Synchronous Counter Mode: In the 32-bit
                                                                Synchronous Counter mode, the timer increments on
• Two independent 16-bit timers (Timer2 and                     the rising edge of the applied external clock signal
  Timer3) with all 16-bit Operating modes (except               which is synchronized with the internal phase clocks.
  Asynchronous Counter mode)                                    The timer counts up to a match value preloaded in the
• Single 32-bit timer operation                                 combined 32-bit period register PR3/PR2, then resets
• Single 32-bit synchronous counter                             to ‘0’ and continues.
Further, the following operational characteristics are          When the timer is configured for the Synchronous
supported:                                                      Counter mode of operation and the CPU goes into the
                                                                Idle mode, the timer will stop incrementing unless the
•   ADC event trigger
                                                                TSIDL (T2CON<13>) bit = 0. If TSIDL = 1, the timer
•   Timer gate operation                                        module logic will resume the incrementing sequence
•   Selectable prescaler settings                               upon termination of the CPU Idle mode.
•   Timer operation during Idle and Sleep modes
                                                                  Note:     In some devices, one or more of the TxCK
•   Interrupt on a 32-bit period register match                             pins may be absent. Therefore, for such
These Operating modes are determined by setting the                         timers, the following modes should not be
appropriate bit(s) in the 16-bit T2CON and T3CON                            used:
SFRs.                                                                       1. TCS = 1 (16-bit counter)
For 32-bit timer/counter operation, Timer2 is the LS                        2. TCS = 0, TGATE = 1 (gated time
Word and Timer3 is the MS Word of the 32-bit timer.                            accumulation.
Data Bus<15:0>
                                           TMR3HLD
                                                       16
                                             16
                       Write TMR2
                       Read TMR2
16
                            Reset
                                            TMR3          TMR2                           Sync
                                            MSB           LSB
       ADC Event Trigger
                                             Comparator x 32
                              Equal
PR3 PR2
                        0
       T3IF
       Event Flag
                        1                             Q      D     TGATE (T2CON<6>)
                                                      Q     CK
                       TGATE
                    (T2CON<6>)
                                                                                  TGATE
                                                                                  TCS
                                                                                                        TCKPS<1:0>
                                                                                          TON              2
       T2CK                                                                         1x
                                                                 Gate                                     Prescaler
                                                                 Sync               01                  1, 8, 64, 256
TCY 00
      Note:     Timer configuration bit T32 (T2CON<3>) must be set to ‘1’ for a 32-bit timer/counter operation. All control
                bits are respective to the T2CON register.
PR2
                                 Equal
                                            Comparator x 16
                                                TMR2                                               Sync
                                 Reset
                         0
        T2IF
        Event Flag       1                             Q        D       TGATE
                                                       Q       CK
                       TGATE
                                                                                 TGATE
                                                                                 TCS
                                                                                                TCKPS<1:0>
                                                                                         TON       2
        T2CK                                                                      1x
                                                               Gate                              Prescaler
                                                               Sync               01            1, 8, 64, 256
TCY 00
PR3
                                                    TMR3
                                    Reset
                             0
          T3IF
          Event Flag         1                             Q        D    TGATE
                                                           Q    CK
                                                                                  TGATE
                       TGATE
                                                                                  TCS
                                                                                                 TCKPS<1:0>
                                                                                          TON       2
          T3CK                                                  Sync               1x
                                                                                                  Prescaler
                                                                                   01            1, 8, 64, 256
TCY 00
Preliminary
                                                                                                                                                                                                                                    dsPIC30F
   DS70083G-page 89
dsPIC30F
NOTES:
                                                TMR5HLD
                                                           16
                                                  16
                        Write TMR4
                        Read TMR4
16
                                   Reset
                                                 TMR5       TMR4                            Sync
MSB LSB
                                                  Comparator x 32
                                   Equal
PR5 PR4
                            0
               T5IF
               Event Flag   1                              Q     D     TGATE (T4CON<6>)
                                                          Q     CK
                         TGATE
                       (T4CON<6>)
                                                                                      TGATE
                                                                                      TCS
                                                                                                     TCKPS<1:0>
                                                                                              TON       2
               T4CK                                                                    1x
                                                                                                       Prescaler
                                                                     Gate                             1, 8, 64, 256
                                                                     Sync              01
TCY 00
           Note:      Timer configuration bit T32 (T4CON<3>) must be set to ‘1’ for a 32-bit timer/counter operation. All
                      control bits are respective to the T4CON register.
PR4
                               Equal
                                         Comparator x 16
                                             TMR4                                                 Sync
                               Reset
                       0
       T4IF
       Event Flag      1                            Q        D        TGATE
                                                    Q       CK
                                                                              TGATE
                     TGATE
                                                                              TCS
                                                                                              TCKPS<1:0>
                                                                                      TON        2
       T4CK                                                                    1x
                                                        Gate                                     Prescaler
                                                        Sync                   01              1, 8, 64, 256
TCY 00
PR5
                                               TMR5
                                 Reset
                           0
        T5IF
        Event Flag         1                            Q         D    TGATE
                                                        Q    CK
                                                                               TGATE
                      TGATE
                                                                               TCS
                                                                                                 TCKPS<1:0>
                                                                                       TON          2
        T5CK                                                 Sync               1x
                                                                                                  Prescaler
                                                                                01               1, 8, 64, 256
TCY 00
Preliminary
                                                                                                                                                                                                                                   dsPIC30F
   DS70083G-page 93
dsPIC30F
NOTES:
16 16
                                                                                                                      ICTMR
    ICx pin                                                                                             1        0
                   Prescaler            Clock                Edge                   FIFO
                    1, 4, 16         Synchronizer           Detection               R/W
                                                             Logic                  Logic
                        3        ICM<2:0>
                                Mode Select                                                             ICxBUF
ICBNE, ICOV
                                                    ICI<1:0>
                                                                        Interrupt
                               ICxCON                                     Logic
     Note:     Where ‘x’ is shown, reference is made to the registers or bits associated to the respective input capture
               channels 1 through N.
   DS70083G-page 98
                                   IC2CON      0146        —           —       ICSIDL    —        —        —        —          —        ICTMR        ICI<1:0>      ICOV    ICBNE           ICM<2:0>           0000 0000 0000 0000
                                   IC3BUF      0148                                                                     Input 3 Capture Register                                                              uuuu uuuu uuuu uuuu
                                   IC3CON      014A        —           —       ICSIDL    —        —        —        —          —        ICTMR        ICI<1:0>      ICOV    ICBNE           ICM<2:0>           0000 0000 0000 0000
                                                                                                                                                                                                                                    dsPIC30F
Note: Refer to dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
Preliminary
 2004 Microchip Technology Inc.
                                                                                                  dsPIC30F
13.0     OUTPUT COMPARE MODULE                                     The key operational features of the output compare
                                                                   module include:
 Note: This data sheet summarizes features of this group
 of dsPIC30F devices and is not intended to be a complete
                                                                   •   Timer2 and Timer3 Selection mode
 reference source. For more information on the CPU,                •   Simple Output Compare Match mode
 peripherals, register descriptions and general device             •   Dual Output Compare Match mode
 functionality, refer to the dsPIC30F Family Reference
 Manual (DS70046).                                                 •   Simple PWM mode
                                                                   •   Output Compare During Sleep and Idle modes
This section describes the output compare module and
associated Operational modes. The features provided                •   Interrupt on Output Compare/PWM Event
by this module are useful in applications requiring                These Operating modes are determined by setting the
Operational modes, such as:                                        appropriate bits in the 16-bit OCxCON SFR (where
• Generation of Variable Width Output Pulses                       x = 1,2,3,...,N). The dsPIC devices contain up to 8
                                                                   compare channels (i.e., the maximum value of N is 8).
• Power Factor Correction
                                                                   OCxRS and OCxR in Figure 13-1 represent the Dual
Figure 13-1 depicts a block diagram of the output
                                                                   Compare registers. In the Dual Compare mode, the
compare module.
                                                                   OCxR register is used for the first compare and OCxRS
                                                                   is used for the second compare.
OCxRS
                              OCxR                                           Output        S Q
                                                                              Logic        R
                                                                                                           OCx
                                                                                                 Output
                                                                                3
                                                                                                 Enable
                                                                        OCM<2:0>
                            Comparator                                 Mode Select
                                             OCTSEL                                                        OCFA
                        0                1              0                   1                      (for x = 1, 2, 3 or 4)
                                                                                                         or OCFB
         From GP                                                                                   (for x = 5, 6, 7 or 8)
         Timer Module
         Note:     Where ‘x’ is shown, reference is made to the registers associated with the respective output compare
                   channels 1 through N.
13.3     Dual Output Compare Match Mode                     The user must perform the following steps in order to
                                                            configure the output compare module for PWM
When control bits OCM<2:0> (OCxCON<2:0>) = 100              operation:
or 101, the selected output compare channel is config-
                                                            1.    Set the PWM period by writing to the appropriate
ured for one of two Dual Output Compare modes,
                                                                  period register.
which are:
                                                            2.    Set the PWM duty cycle by writing to the OCxRS
• Single Output Pulse mode                                        register.
• Continuous Output Pulse mode                              3.    Configure the output compare module for PWM
                                                                  operation.
13.3.1      SINGLE PULSE MODE
                                                            4.    Set the TMRx prescale value and enable the
For the user to configure the module for the generation           Timer, TON (TxCON<15>) = 1.
of a single output pulse, the following steps are
required (assuming timer is off):                           13.4.1       INPUT PIN FAULT PROTECTION
• Determine instruction cycle time TCY.                                  FOR PWM
• Calculate desired pulse width value based on TCY.         When control bits OCM<2:0> (OCxCON<2:0>) = 111,
• Calculate time to start pulse from timer start value      the selected output compare channel is again config-
  of 0x0000.                                                ured for the PWM mode of operation with the additional
• Write pulse width start and stop times into OCxR          feature of input FAULT protection. While in this mode,
  and OCxRS Compare registers (x denotes                    if a logic ‘0’ is detected on the OCFA/B pin, the respec-
  channel 1, 2, ...,N).                                     tive PWM output pin is placed in the high impedance
                                                            input state. The OCFLT bit (OCxCON<4>) indicates
• Set Timer Period register to value equal to, or
                                                            whether a FAULT condition has occurred. This state will
  greater than value in OCxRS Compare register.
                                                            be maintained until both of the following events have
• Set OCM<2:0> = 100.                                       occurred:
• Enable timer, TON (TxCON<15>) = 1.
                                                            • The external FAULT condition has been removed.
To initiate another single pulse, issue another write to    • The PWM mode has been re-enabled by writing
set OCM<2:0> = 100.                                           to the appropriate control bits.
Duty Cycle
                                                               TMR3 = PR3
                    TMR3 = PR3                                    T3IF = 1
                       T3IF = 1                               (Interrupt Flag)
                   (Interrupt Flag)                           OCxR = OCxRS
                   OCxR = OCxRS
                                              TMR3 = Duty Cycle           TMR3 = Duty Cycle
                                                  (OCxR)                      (OCxR)
                                   OC1RS      0180                                                                  Output Compare 1 Secondary Register                                                      0000 0000 0000 0000
                                   OC1R       0182                                                                      Output Compare 1 Main Register                                                       0000 0000 0000 0000
                                   OC1CON     0184        —            —       OCSIDL    —        —        —        —        —        —        —          —      OCFLT   OCTSEL           OCM<2:0>           0000 0000 0000 0000
                                   OC2RS      0186                                                                  Output Compare 2 Secondary Register                                                      0000 0000 0000 0000
   DS70083G-page 102
                                   OC2R       0188                                                                      Output Compare 2 Main Register                                                       0000 0000 0000 0000
                                   OC2CON     018A        —            —       OCSIDL    —        —        —        —        —        —        —          —      OCFLT   OCTSE            OCM<2:0>           0000 0000 0000 0000
                                                                                                                                                                                                                                   dsPIC30F
                                   OC3RS      018C                                                                  Output Compare 3 Secondary Register                                                      0000 0000 0000 0000
                                   OC3R       018E                                                                      Output Compare 3 Main Register                                                       0000 0000 0000 0000
                                   OC3CON     0190        —            —       OCSIDL    —        —        —        —        —        —        —          —      OCFLT   OCTSEL           OCM<2:0>           0000 0000 0000 0000
                                   OC4RS      0192                                                                  Output Compare 4 Secondary Register                                                      0000 0000 0000 0000
                                   OC4R       0194                                                                      Output Compare 4 Main Register                                                       0000 0000 0000 0000
                                   OC4CON     0196        —            —       OCSIDL    —        —        —        —        —        —        —          —      OCFLT   OCTSEL           OCM<2:0>           0000 0000 0000 0000
                                   OC5RS      0198                                                                  Output Compare 5 Secondary Register                                                      0000 0000 0000 0000
                                   OC5R       019A                                                                      Output Compare 5 Main Register                                                       0000 0000 0000 0000
                                   OC5CON     019C        —            —       OCSIDL    —        —        —        —        —        —        —          —      OCFLT   OCTSEL           OCM<2:0>           0000 0000 0000 0000
                                   OC6RS      019E                                                                  Output Compare 6 Secondary Register                                                      0000 0000 0000 0000
                                   OC6R       01A0                                                                      Output Compare 6 Main Register                                                       0000 0000 0000 0000
                                   OC6CON     01A2        —            —       OCSIDL    —        —        —        —        —        —        —          —      OCFLT   OCTSEL           OCM<2:0>           0000 0000 0000 0000
                                   OC7RS      01A4                                                                  Output Compare 7 Secondary Register                                                      0000 0000 0000 0000
                                   OC7R       01A6                                                                      Output Compare 7 Main Register                                                       0000 0000 0000 0000
Preliminary
                                   OC7CON     01A8        —            —       OCSIDL    —        —        —        —        —        —        —          —      OCFLT   OCTSEL           OCM<2:0>           0000 0000 0000 0000
                                   OC8RS      01AA                                                                  Output Compare 8 Secondary Register                                                      0000 0000 0000 0000
                                   OC8R       01AC                                                                      Output Compare 8 Main Register                                                       0000 0000 0000 0000
                                   OC8CON     01AE        —            —       OCSIDL    —        —        —        —        —        —        —          —      OCFLT   OCTSEL           OCM<2:0>           0000 0000 0000 0000
                                   Legend:    u = uninitialized bit
Note: Refer to dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
                                                                Internal
                                                               Data Bus
                                Read                    Write
SPIxBUF SPIxBUF
Receive Transmit
                                             SPIxSR
         SDIx                        bit 0
        SDOx                                           Shift
                                                      Clock
                        SS and FSYNC               Clock               Edge
                           Control                 Control             Select
         SSx
                                                                                       Secondary           Primary
                                                                                       Prescaler          Prescaler      FCY
                                                                                        1,2,4,6,8        1, 4, 16, 64
         SCKx
Note: x = 1 or 2.
SDOx SDIy
Note: x = 1 or 2, y = 1 or 2.
   DS70083G-page 106
                                   Legend:    u = uninitialized bit
                                                                                                                                                                                                                                          dsPIC30F
                                   SPI2STAT     0226     SPIEN            —     SPISIDL      —         —          —        —           —        —     SPIROV     —        —        —       —      SPITBF   SPIRBF   0000 0000 0000 0000
                                   SPI2CON      0228         —        FRMEN     SPIFSD       —       DISSDO MODE16        SMP        CKE      SSEN      CKP     MSTEN    SPRE2    SPRE1 SPRE0     PPRE1    PPRE0    0000 0000 0000 0000
                                   SPI2BUF      022A                                                                             Transmit and Receive Buffer                                                        0000 0000 0000 0000
                                   Legend:    u = uninitialized bit
Note: Refer to dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
Preliminary
 2004 Microchip Technology Inc.
                                                                                                  dsPIC30F
15.0     I2C MODULE                                                • Serial clock synchronization for I2C port can be
                                                                     used as a handshake mechanism to suspend and
 Note: This data sheet summarizes features of this group             resume serial transfer (SCLREL control).
                                                                   • I2C supports multi-master operation; detects bus
 of dsPIC30F devices and is not intended to be a complete
 reference source. For more information on the CPU,
 peripherals, register descriptions and general device               collision and will arbitrate accordingly.
 functionality, refer to the dsPIC30F Family Reference
 Manual (DS70046).
                                                                   15.1        Operating Function Description
The Inter-Integrated Circuit (I2CTM) module provides
                                                                   The hardware fully implements all the master and slave
complete hardware support for both Slave and Multi-
                                                                   functions of the I2C Standard and Fast mode
Master modes of the I2C serial communication
                                                                   specifications, as well as 7 and 10-bit addressing.
standard, with a 16-bit interface.
                                                                   Thus, the I2C module can operate either as a slave or
This module offers the following key features:
                                                                   a master on an I2C bus.
• I2C interface supporting both master and slave
  operation.                                                       15.1.1       VARIOUS I2C MODES
• I2C Slave mode supports 7 and 10-bit address.                    The following types of I2C operation are supported:
• I2C Master mode supports 7 and 10-bit address.                   •   I2C slave operation with 7-bit address
• I2C port allows bidirectional transfers between                  •   I2C slave operation with 10-bit address
  master and slaves.
                                                                   •   I2C master operation with 7 or 10-bit address
                                                                   See the I2C programmer’s model in Figure 15-1.
                                                                                        I2CRCV (8 bits)
                                                       Bit 7                    Bit 0
                                                                                        I2CTRN (8 bits)
                                                       Bit 7                    Bit 0
                                                                                        I2CBRG (9 bits)
                                                   Bit 8                        Bit 0
                                                                                        I2CCON (16 bits)
                        Bit 15                                                  Bit 0
                                                                                        I2CSTAT (16 bits)
                         Bit 15                                                 Bit 0
                                                                                        I2CADD (10 bits)
                                           Bit 9                                Bit 0
15.1.2      PIN CONFIGURATION IN I2C MODE                          The I2CADD register holds the slave address. A status
                                                                   bit, ADD10, indicates 10-bit Address mode. The
I 2C
   has a 2-pin interface: the SCL pin is clock and the
                                                                   I2CBRG acts as the baud rate generator reload value.
SDA pin is data.
                                                                   In receive operations, I2CRSR and I2CRCV together
15.1.3      I2C REGISTERS                                          form a double-buffered receiver. When I2CRSR
I2CCON and I2CSTAT are control and status registers,               receives a complete byte, it is transferred to I2CRCV
respectively. The I2CCON register is readable and writ-            and an interrupt pulse is generated. During
able. The lower 6 bits of I2CSTAT are read only. The               transmission, the I2CTRN is not double-buffered.
remaining bits of the I2CSTAT are read/write.                          Note:    Following a RESTART condition in 10-bit
I2CRSR is the shift register used for shifting data,                            mode, the user only needs to match the
whereas I2CRCV is the buffer register to which data                             first 7-bit address.
bytes are written, or from which data bytes are read.
I2CRCV is the receive buffer as shown in Figure 15-1.
I2CTRN is the transmit register to which bytes are
written during a transmit operation, as shown in
Figure 15-2.
                                                                                                         Internal
                                                                                                        Data Bus
                                    I2CRCV
                                                                                                      Read
                        Shift
      SCL               Clock
                                    I2CRSR
                                                LSB
      SDA                                             Addr_Match
                                 Match Detect
Write
I2CADD
Read
                                    Start and
                                 Stop bit Detect
                                                                                                      Write
                                                                                   I2CSTAT
                                Start, RESTART,
                                Stop bit Generate
                                                                                                      Read
                                                                   Control Logic
                                    Collision
                                     Detect
                                                                                                      Write
                                                                                   I2CCON
                                 Acknowledge
                                                                                                      Read
                                  Generation
                                     Clock
                                   Stretching                                                         Write
                                    I2CTRN
                                                LSB
                        Shift                                                                         Read
                        Clock
                                    Reload
                                    Control                                                           Write
As a master device, six operations are supported:            15.12.2      I2C MASTER RECEPTION
• Assert a Start condition on SDA and SCL.                   Master mode reception is enabled by programming the
• Assert a RESTART condition on SDA and SCL.                 Receive Enable bit, RCEN (I2CCON<11>). The I2C
• Write to the I2CTRN register initiating                    module must be Idle before the RCEN bit is set, other-
  transmission of data/address.                              wise the RCEN bit will be disregarded. The baud rate
                                                             generator begins counting and on each rollover, the
• Generate a Stop condition on SDA and SCL.
                                                             state of the SCL pin ACK and data are shifted into the
• Configure the I2C port to receive data.                    I2CRSR on the rising edge of each clock.
• Generate an ACK condition at the end of a
  received byte of data.
Preliminary
                                                                                                                                                                                                                               dsPIC30F
   DS70083G-page 113
dsPIC30F
NOTES:
Write Write
                                                                                Load TSR
                                                                                                                      UxTXIF
                              UTXBRK
                                         Data
                                                            Transmit Shift Register (UxTSR)
                                             ‘0’ (Start)
       UxTX
                                             ‘1’ (Stop)
                                                                                       Control
                                                                                       Signals
Note: x = 1 or 2.
UxMODE UxSTA
               LPBACK                                    8-9
       From UxTX
                 1                                             Load RSR
                                                                                                                  FERR
                                                                to Buffer
                                                                                                           PERR
                                                                                          Control
                                              Receive Shift Register                      Signals
         UxRX       0                               (UxRSR)
                                   U1MODE    020C    UARTEN           —       USIDL        —          —       ALTIO       —          —         WAKE      LPBACK     ABAUD         —        —     PDSEL1 PDSEL0 STSEL 0000 0000 0000 0000
                                   U1STA     020E    UTXISEL          —         —          —      UTXBRK UTXEN          UTXBF      TRMT      URXISEL1 URXISEL0 ADDEN            RIDLE    PERR     FERR    OERR    URXDA 0000 0001 0001 0000
                                   U1TXREG   0210        —            —         —          —          —         —         —         UTX8                                     Transmit Register                             0000 000u uuuu uuuu
                                   U1RXREG   0212        —            —         —          —          —         —         —         URX8                                     Receive Register                              0000 0000 0000 0000
                                   U1BRG     0214                                                                              Baud Rate Generator Prescaler                                                               0000 0000 0000 0000
                                   Legend:   u = uninitialized bit
                                   U2MODE    0216    UARTEN           —       USIDL      —          —         —         —          —         WAKE       LPBACK     ABAUD         —        —      PDSEL1 PDSEL0    STSEL 0000 0000 0000 0000
                                   U2STA     0218    UTXISEL          —        —         —        UTXBRK UTXEN         UTXBF     TRMT       URXISEL1 URXISEL0 ADDEN            RIDLE     PERR    FERR     OERR    URXDA 0000 0001 0001 0000
                                   U2TXREG   021A       —             —        —         —          —         —         —         UTX8                                     Transmit Register                               0000 000u uuuu uuuu
                                   U2RXREG   021C       —             —        —         —          —         —         —         URX8                                     Receive Register                                0000 0000 0000 0000
                                   U2BRG     021E                                                                              Baud Rate Generator Prescaler                                                               0000 0000 0000 0000
                                   Legend:   u = uninitialized bit
Note: Refer to dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
Preliminary
                                                                                                                                                                                                                                                 dsPIC30F
   DS70083G-page 121
dsPIC30F
NOTES:
                                                                                                                       Acceptance Mask
  BUFFERS                                                                                                                   RXM1
                                                                                                                       Acceptance Filter
                                                                                                                            RXF2
MESSAGE
                                                                     MESSAGE
 MTXBUFF
MTXBUFF
                                                   MTXBUFF
 MSGREQ
MSGREQ
                                                   MSGREQ
 TXLARB
TXLARB
                                                   TXLARB
                                                                               c              RXF0                          RXF4                    p
 TXERR
TXERR
                                                   TXERR
 TXABT
TXABT
                                                   TXABT
                                                                               e                                                                    t
                                                                                         Acceptance Filter             Acceptance Filter
                                                                               p
                                                                                              RXF1                          RXF5
                                                                               t
                                                                                   R                                                           R
                                                                                   X          Identifier        M      Identifier              X
  Message                                                                          B                            A                              B
   Queue                                                                           0                            B                              1
   Control
                              Transmit Byte Sequencer                                       Data Field                 Data Field
                                                                                                                      Receive             RERRCNT
                                                                                                                       Error
  PROTOCOL                                                                                                            Counter
                                                                                                                                         TERRCNT
                                                                                                                       Protocol
                                                                                                                        Finite
                                                   CRC Generator                       CRC Check
                                                                                                                        State
                                                                                                                       Machine
                                                                                                             Bit
                           Transmit
                                                                                                           Timing                Bit Timing
                            Logic
                                                                                                            Logic                Generator
CiTX(1) CiRX(1)
Input Signal
Sample Point
TQ
                                                             17.6.6       SYNCHRONIZATION
17.6.3      PROPAGATION SEGMENT
                                                             To compensate for phase shifts between the oscillator
This part of the bit time is used to compensate physical
                                                             frequencies of the different bus stations, each CAN
delay times within the network. These delay times con-
                                                             controller must be able to synchronize to the relevant
sist of the signal propagation time on the bus line and
                                                             signal edge of the incoming signal. When an edge in
the internal delay time of the nodes. The Prop Seg can
                                                             the transmitted data is detected, the logic will compare
be programmed from 1 TQ to 8 TQ by setting the
                                                             the location of the edge to the expected time (Synchro-
PRSEG<2:0> bits (CiCFG2<2:0>).
                                                             nous Segment). The circuit will then adjust the values
                                                             of Phase1 Seg and Phase2 Seg. There are 2
17.6.4      PHASE SEGMENTS
                                                             mechanisms used to synchronize.
The phase segments are used to optimally locate the
sampling of the received bit within the transmitted bit      17.6.6.1       Hard Synchronization
time. The sampling point is between Phase1 Seg and
                                                             Hard synchronization is only done whenever there is a
Phase2 Seg. These segments are lengthened or short-
                                                             ‘recessive’ to ‘dominant’ edge during bus Idle indicating
ened by resynchronization. The end of the Phase1 Seg
                                                             the start of a message. After hard synchronization, the
determines the sampling point within a bit period. The
                                                             bit time counters are restarted with the Sync Seg. Hard
segment is programmable from 1 TQ to 8 TQ. Phase2
                                                             synchronization forces the edge which has caused the
Seg provides delay to the next transmitted data transi-
                                                             hard synchronization to lie within the synchronization
tion. The segment is programmable from 1 TQ to 8 TQ,
                                                             segment of the restarted bit time. If a hard synchroniza-
or it may be defined to be equal to the greater of
                                                             tion is done, there will not be a resynchronization within
Phase1 Seg or the information processing time (2 TQ).
                                                             that bit time.
The Phase1 Seg is initialized by setting bits
SEG1PH<2:0> (CiCFG2<5:3>), and Phase2 Seg is                 17.6.6.2       Resynchronization
initialized by setting SEG2PH<2:0> (CiCFG2<10:8>).
                                                             As a result of resynchronization, Phase1 Seg may be
The following requirement must be fulfilled while setting    lengthened or Phase2 Seg may be shortened. The
the lengths of the phase segments:                           amount of lengthening or shortening of the phase
    Prop Seg + Phase1 Seg > = Phase2 Seg                     buffer segment has an upper bound known as the syn-
                                                             chronization jump width, and is specified by the
                                                             SJW<1:0> bits (CiCFG1<7:6>). The value of the syn-
                                                             chronization jump width will be added to Phase1 Seg or
                                                             subtracted from Phase2 Seg. The resynchronization
                                                             jump width is programmable between 1 TQ and 4 TQ.
                                                             The following requirement must be fulfilled while setting
                                                             the SJW<1:0> bits:
                                                                   Phase2 Seg > Synchronization Jump Width
                                   C1RXF0SID      0300        —            —          —                                 Receive Acceptance Filter 0 Standard Identifier <10:0>                                  —      EXIDE 000u uuuu uuuu uu0u
                                   C1RXF0EIDH     0302        —            —          —        —                                      Receive Acceptance Filter 0 Extended Identifier <17:6>                                   0000 uuuu uuuu uuuu
                                   C1RXF0EIDL     0304        Receive Acceptance Filter 0 Extended Identifier <5:0>          —        —           —           —         —          —         —          —       —       —      uuuu uu00 0000 0000
                                   C1RXF1SID      0308        —            —          —                                 Receive Acceptance Filter 1 Standard Identifier <10:0>                                  —      EXIDE 000u uuuu uuuu uu0u
                                   C1RXF1EIDH 030A            —            —          —        —                                      Receive Acceptance Filter 1 Extended Identifier <17:6>                                   0000 uuuu uuuu uuuu
   DS70083G-page 130
                                   C1RXF1EIDL     030C        Receive Acceptance Filter 1 Extended Identifier <5:0>          —        —           —           —         —          —         —          —       —       —      uuuu uu00 0000 0000
                                   C1RXF2SID      0310        —            —          —                                 Receive Acceptance Filter 2 Standard Identifier <10:0>                                  —      EXIDE 000u uuuu uuuu uu0u
                                                                                                                                                                                                                                                     dsPIC30F
                                   C1RXF2EIDH     0312        —            —          —        —                                      Receive Acceptance Filter 2 Extended Identifier <17:6>                                   0000 uuuu uuuu uuuu
                                   C1RXF2EIDL     0314        Receive Acceptance Filter 2 Extended Identifier <5:0>          —        —           —           —         —          —         —          —       —       —      uuuu uu00 0000 0000
                                   C1RXF3SID      0318        —            —          —                                 Receive Acceptance Filter 3 Standard Identifier <10:0>                                  —      EXIDE 000u uuuu uuuu uu0u
                                   C1RXF3EIDH 031A            —            —          —        —                                      Receive Acceptance Filter 3 Extended Identifier <17:6>                                   0000 uuuu uuuu uuuu
                                   C1RXF3EIDL     031C        Receive Acceptance Filter 3 Extended Identifier <5:0>          —        —           —           —         —          —         —          —       —       —      uuuu uu00 0000 0000
                                   C1RXF4SID      0320        —            —          —                                 Receive Acceptance Filter 4 Standard Identifier <10:0>                                  —      EXIDE 000u uuuu uuuu uu0u
                                   C1RXF4EIDH     0322        —            —          —        —                                      Receive Acceptance Filter 4 Extended Identifier <17:6>                                   0000 uuuu uuuu uuuu
                                   C1RXF4EIDL     0324        Receive Acceptance Filter 4 Extended Identifier <5:0>          —        —           —           —         —          —         —          —       —       —      uuuu uu00 0000 0000
                                   C1RXF5SID      0328        —            —          —                                 Receive Acceptance Filter 5 Standard Identifier <10:0>                                  —      EXIDE 000u uuuu uuuu uu0u
                                   C1RXF5EIDH 032A            —            —          —        —                                      Receive Acceptance Filter 5 Extended Identifier <17:6>                                   0000 uuuu uuuu uuuu
                                   C1RXF5EIDL     032C        Receive Acceptance Filter 5 Extended Identifier <5:0>          —        —           —           —         —          —         —          —       —       —      uuuu uu00 0000 0000
                                   C1RXM0SID      0330        —            —          —                                 Receive Acceptance Mask 0 Standard Identifier <10:0>                                    —      MIDE    000u uuuu uuuu uu0u
                                   C1RXM0EIDH 0332            —            —          —        —                                     Receive Acceptance Mask 0 Extended Identifier <17:6>                                      0000 uuuu uuuu uuuu
Preliminary
                                   C1RXM0EIDL     0334        Receive Acceptance Mask 0 Extended Identifier <5:0>            —        —           —           —         —          —         —          —       —       —      uuuu uu00 0000 0000
                                   C1RXM1SID      0338        —            —          —                                 Receive Acceptance Mask 1 Standard Identifier <10:0>                                    —      MIDE    000u uuuu uuuu uu0u
                                   C1RXM1EIDH 033A            —            —          —        —                                     Receive Acceptance Mask 1 Extended Identifier <17:6>                                      0000 uuuu uuuu uuuu
                                   C1RXM1EIDL 033C            Receive Acceptance Mask 1 Extended Identifier <5:0>            —        —           —           —         —          —         —          —       —       —      uuuu uu00 0000 0000
                                   C1TX2SID       0340        Transmit Buffer 2 Standard Identifier <10:6>          —        —        —                 Transmit Buffer 2 Standard Identifier <5:0>            SRR     TXIDE uuuu u000 uuuu uuuu
                                   C1TX2EID       0342      Transmit Buffer 2 Extended Identifier         —         —        —        —                         Transmit Buffer 2 Extended Identifier <13:6>                   uuuu 0000 uuuu uuuu
                                                                          <17:14>
                                   C1TX2DLC       0344               Transmit Buffer 2 Extended Identifier <5:0>            TXRTR   TXRB1      TXRB0                        DLC<3:0>                    —       —       —      uuuu uuuu uuuu u000
                                   C1TX2B1        0346                                  Transmit Buffer 2 Byte 1                                                            Transmit Buffer 2 Byte 0                           uuuu uuuu uuuu uuuu
                                   C1TX2B2        0348                                  Transmit Buffer 2 Byte 3                                                            Transmit Buffer 2 Byte 2                           uuuu uuuu uuuu uuuu
                                   C1TX2B3        034A                                  Transmit Buffer 2 Byte 5                                                            Transmit Buffer 2 Byte 4                           uuuu uuuu uuuu uuuu
                                   C1TX2B4        034C                                  Transmit Buffer 2 Byte 7                                                            Transmit Buffer 2 Byte 6                           uuuu uuuu uuuu uuuu
                                   C1TX2CON       034E        —            —          —        —          —         —        —        —           —         TXABT TXLARB TXERR             TXREQ        —       TXPRI<1:0>     0000 0000 0000 0000
                                   C1TX1SID       0350        Transmit Buffer 1 Standard Identifier <10:6>          —        —        —                 Transmit Buffer 1 Standard Identifier <5:0>            SRR     TXIDE uuuu u000 uuuu uuuu
                                   C1TX1EID       0352       Transmit Buffer 1 Extended Identifier        —         —        —        —                         Transmit Buffer 1 Extended Identifier <13:6>                   uuuu 0000 uuuu uuuu
                                                                           <17:14>
                                   C1TX1DLC       0354               Transmit Buffer 1 Extended Identifier <5:0>            TXRTR   TXRB1      TXRB0                        DLC<3:0>                    —       —       —      uuuu uuuu uuuu u000
                                   Legend:      u = uninitialized bit
Preliminary
                                   C1RX1B4       037C                                  Receive Buffer 1 Byte 7                                                                Receive Buffer 1 Byte 6                              uuuu uuuu uuuu uuuu
                                   C1RX1CON      037E        —            —          —        —          —          —       —         —         RXFUL           —         —          —     RXRTRRO               FILHIT<2:0>       0000 0000 0000 0000
                                   C1RX0SID      0380        —            —          —                                      Receive Buffer 0 Standard Identifier <10:0>                                            SRR     RXIDE 000u uuuu uuuu uuuu
                                   C1RX0EID      0382        —            —          —        —                                              Receive Buffer 0 Extended Identifier <17:6>                                           0000 uuuu uuuu uuuu
                                   C1RX0DLC      0384               Receive Buffer 0 Extended Identifier <5:0>             RXRTR RXRB1             —            —         —       RXRB0                  DLC<3:0>                  uuuu uuuu 000u uuuu
                                   C1RX0B1       0386                                  Receive Buffer 0 Byte 1                                                                Receive Buffer 0 Byte 0                              uuuu uuuu uuuu uuuu
                                   C1RX0B2       0388                                  Receive Buffer 0 Byte 3                                                                Receive Buffer 0 Byte 2                              uuuu uuuu uuuu uuuu
                                   C1RX0B3       038A                                  Receive Buffer 0 Byte 5                                                                Receive Buffer 0 Byte 4                              uuuu uuuu uuuu uuuu
                                   C1RX0B4       038C                                  Receive Buffer 0 Byte 7                                                                Receive Buffer 0 Byte 6                              uuuu uuuu uuuu uuuu
                                   C1RX0CON      038E        —            —          —        —          —          —       —         —         RXFUL           —         —          —     RXRTRRO DBEN JTOFF FILHIT0 0000 0000 0000 0000
                                   C1CTRL        0390    CANCAP           —       CSIDLE     ABAT     CANCKS            REQOP<2:0>                     OPMODE<2:0>                   —             ICODE<2:0>                  —   0000 0100 1000 0000
                                   C1CFG1        0392        —            —          —        —          —          —       —         —            SJW<1:0>                                    BRP<5:0>                            0000 0000 0000 0000
                                   C1CFG2        0394        —         WAKFIL        —        —          —              SEG2PH<2:0>           SEG2PHTS         SAM               SEG1PH<2:0>                     PRSEG<2:0>        0u00 0uuu uuuu uuuu
                                   C1INTF        0396    RX0OVR        RX1OVR      TXBO      TXEP      RXEP       TXWAR RXWAR EWARN              IVRIF        WAKIF     ERRIF      TX2IF      TX1IF      TX0IF     RX1IF   RX0IF 0000 0000 0000 0000
                                   C1INTE        0398        —            —          —        —          —          —       —         —          IVRIE        WAKIE     ERRIE      TX2IE     TX1IE       TX0IE     RX1E    RX0IE 0000 0000 0000 0000
                                   C1EC          039A                               Transmit Error Count Register                                                         Receive Error Count Register                             0000 0000 0000 0000
                                   Legend:     u = uninitialized bit
                                                                                                                                                                                                                                                         dsPIC30F
   DS70083G-page 131
                                   TABLE 17-2:            CAN2 REGISTER MAP
                                    SFR Name      Addr.     Bit 15         Bit 14      Bit 13     Bit 12    Bit 11      Bit 10    Bit 9      Bit 8       Bit 7       Bit 6        Bit 5     Bit 4       Bit 3      Bit 2    Bit 1   Bit 0        Reset State
                                   C2RXF0SID      03C0        —              —           —                                       Receive Acceptance Filter 0 Standard Identifier <10:0>                                      —      EXIDE   000u uuuu uuuu uu0u
                                   C2RXF0EIDH     03C2        —              —           —          —                                           Receive Acceptance Filter 0 Extended Identifier <17:6>                                      0000 uuuu uuuu uuuu
                                   C2RXF0EIDL     03C4          Receive Acceptance Filter 0 Extended Identifier <5:0>              —          —           —           —            —          —          —          —        —       —      uuuu uu00 0000 0000
                                   C2RXF1SID      03C8        —              —           —                                       Receive Acceptance Filter 1 Standard Identifier <10:0>                                      —      EXIDE   000u uuuu uuuu uu0u
   DS70083G-page 132
                                   C2RXF1EIDH     03CA        —              —           —          —                                           Receive Acceptance Filter 1 Extended Identifier <17:6>                                      0000 uuuu uuuu uuuu
                                   C2RXF1EIDL     03CC          Receive Acceptance Filter 1 Extended Identifier <5:0>              —          —           —           —            —          —          —          —        —       —      uuuu uu00 0000 0000
                                                                                                                                                                                                                                                                  dsPIC30F
                                   C2RXF2SID      03D0        —              —           —                                       Receive Acceptance Filter 2 Standard Identifier <10:0>                                      —      EXIDE   000u uuuu uuuu uu0u
                                   C2RXF2EIDH     03D2        —              —           —          —                                           Receive Acceptance Filter 2 Extended Identifier <17:6>                                      0000 uuuu uuuu uuuu
                                   C2RXF2EIDL     03D4          Receive Acceptance Filter 2 Extended Identifier <5:0>              —          —           —           —            —          —          —          —        —       —      uuuu uu00 0000 0000
                                   C2RXF3SID      03D8        —              —           —                                       Receive Acceptance Filter 3 Standard Identifier <10:0>                                      —      EXIDE   000u uuuu uuuu uu0u
                                   C2RXF3EIDH     03DA        —              —           —          —                                           Receive Acceptance Filter 3 Extended Identifier <17:6>                                      0000 uuuu uuuu uuuu
                                   C2RXF3EIDL     03DC          Receive Acceptance Filter 3 Extended Identifier <5:0>              —          —           —           —            —          —          —          —        —       —      uuuu uu00 0000 0000
                                   C2RXF4SID      03E0        —              —           —                                       Receive Acceptance Filter 4 Standard Identifier <10:0>                                      —      EXIDE   000u uuuu uuuu uu0u
                                   C2RXF4EIDH     03E2        —              —           —          —                                           Receive Acceptance Filter 4 Extended Identifier <17:6>                                      0000 uuuu uuuu uuuu
                                   C2RXF4EIDL     03E4          Receive Acceptance Filter 4 Extended Identifier <5:0>              —          —           —           —            —          —          —          —        —       —      uuuu uu00 0000 0000
                                   C2RXF5SID      03E8        —              —           —                                       Receive Acceptance Filter 5 Standard Identifier <10:0>                                      —      EXIDE   000u uuuu uuuu uu0u
                                   C2RXF5EIDH     03EA        —              —           —          —                                           Receive Acceptance Filter 5 Extended Identifier <17:6>                                      0000 uuuu uuuu uuuu
                                   C2RXF5EIDL     03EC          Receive Acceptance Filter 5 Extended Identifier <5:0>              —          —           —           —            —          —          —          —        —       —      uuuu uu00 0000 0000
                                   C2RXM0SID      03F0        —              —           —                                       Receive Acceptance Mask 0 Standard Identifier <10:0>                                        —      MIDE    000u uuuu uuuu uu0u
                                   C2RXM0EIDH     03F2        —              —           —          —                                          Receive Acceptance Mask 0 Extended Identifier <17:6>                                         0000 uuuu uuuu uuuu
Preliminary
                                   C2RXM0EIDL     03F4         Receive Acceptance Mask 0 Extended Identifier <5:0>                 —          —           —           —            —          —          —          —        —       —      uuuu uu00 0000 0000
                                   C2RXM1SID      03F8        —              —           —                                       Receive Acceptance Mask 1 Standard Identifier <10:0>                                        —      MIDE    000u uuuu uuuu uu0u
                                   C2RXM1EIDH     03FA        —              —           —          —                                          Receive Acceptance Mask 1 Extended Identifier <17:6>                                         0000 uuuu uuuu uuuu
                                   C2RXM1EIDL     03FC         Receive Acceptance Mask 1 Extended Identifier <5:0>                 —          —           —           —            —          —          —          —        —       —      uuuu uu00 0000 0000
                                   C2TX2SID       0400         Transmit Buffer 2 Standard Identifier <10:6>              —         —          —                  Transmit Buffer 2 Standard Identifier <5:0>                SRR     TXIDE   uuuu u000 uuuu uuuu
                                   C2TX2EID       0402       Transmit Buffer 2 Extended Identifier            —          —         —          —                              Transmit Buffer 2 Extended Identifier <13:6>                   uuuu 0000 uuuu uuuu
                                                                           <17:14>
                                   C2TX2DLC       0404                  Transmit Buffer 2 Extended Identifier <5:0>              TXRTR      TXRB1       TXRB0                          DLC<3:0>                     —        —       —      uuuu uuuu uuuu u000
                                   C2TX2B1        0406                                       Transmit Buffer 2 Byte 1                                                                  Transmit Buffer 2 Byte 0                             uuuu uuuu uuuu uuuu
                                   C2TX2B2        0408                                       Transmit Buffer 2 Byte 3                                                                  Transmit Buffer 2 Byte 2                             uuuu uuuu uuuu uuuu
                                   C2TX2B3        040A                                       Transmit Buffer 2 Byte 5                                                                  Transmit Buffer 2 Byte 4                             uuuu uuuu uuuu uuuu
                                   C2TX2B4        040C                                       Transmit Buffer 2 Byte 7                                                                  Transmit Buffer 2 Byte 6                             uuuu uuuu uuuu uuuu
                                   C2TX2CON       040E        —              —           —          —         —          —         —          —           —         TXABT       TXLARB     TXERR      TXREQ         —        TXPRI<1:0>     0000 0000 0000 0000
                                   C2TX1SID       0410         Transmit Buffer 1 Standard Identifier <10:6>              —         —          —                  Transmit Buffer 1 Standard Identifier <5:0>                SRR     TXIDE   uuuu u000 uuuu uuuu
                                   C2TX1EID       0412       Transmit Buffer 1 Extended Identifier            —          —         —          —                              Transmit Buffer 1 Extended Identifier <13:6>                   uuuu 0000 uuuu uuuu
                                                                           <17:14>
                                   C2TX1DLC       0414                  Transmit Buffer 1 Extended Identifier <5:0>              TXRTR      TXRB1       TXRB0                          DLC<3:0>                     —        —       —      uuuu uuuu uuuu u000
                                   Legend:      u = uninitialized bit
                                   C2TX1B1       0416                                       Transmit Buffer 1 Byte 1                                                                      Transmit Buffer 1 Byte 0                                   uuuu uuuu uuuu uuuu
                                   C2TX1B2       0418                                       Transmit Buffer 1 Byte 3                                                                      Transmit Buffer 1 Byte 2                                   uuuu uuuu uuuu uuuu
                                   C2TX1B3       041A                                       Transmit Buffer 1 Byte 5                                                                      Transmit Buffer 1 Byte 4                                   uuuu uuuu uuuu uuuu
                                   C2TX1B4       041C                                       Transmit Buffer 1 Byte 7                                                                      Transmit Buffer 1 Byte 6                                   uuuu uuuu uuuu uuuu
                                   C2TX1CON      041E        —              —           —          —         —          —           —           —           —         TXABT       TXLARB      TXERR      TXREQ          —         TXPRI<1:0>         0000 0000 0000 0000
                                   C2TX0SID      0420         Transmit Buffer 0 Standard Identifier <10:6>              —           —           —                  Transmit Buffer 0 Standard Identifier <5:0>                   SRR         TXIDE   uuuu u000 uuuu uuuu
                                   C2TX0EID      0422       Transmit Buffer 0 Extended Identifier            —          —           —           —                              Transmit Buffer 0 Extended Identifier <13:6>                          uuuu 0000 uuuu uuuu
                                                                          <17:14>
Preliminary
                                   C2RX1CON      043E        —              —           —          —         —          —           —           —        RXFUL          —             —          —      RXRTRRO                FILHIT<2:0>           0000 0000 0000 0000
                                   C2RX0SID      0440        —              —           —                                               Receive Buffer 0 Standard Identifier <10:0>                                              SRR     RXIDE       000u uuuu uuuu uuuu
                                   C2RX0EID      0442        —              —           —          —                                                   Receive Buffer 0 Extended Identifier <17:6>                                                   0000 uuuu uuuu uuuu
                                   C2RX0DLC      0444                  Receive Buffer 0 Extended Identifier <5:0>                 RXRTR      RXRB1          —           —             —       RXRB0                     DLC<3:0>                     uuuu uuuu 000u uuuu
                                   C2RX0B1       0446                                       Receive Buffer 0 Byte 1                                                                       Receive Buffer 0 Byte 0                                    uuuu uuuu uuuu uuuu
                                   C2RX0B2       0448                                       Receive Buffer 0 Byte 3                                                                       Receive Buffer 0 Byte 2                                    uuuu uuuu uuuu uuuu
                                   C2RX0B3       044A                                       Receive Buffer 0 Byte 5                                                                       Receive Buffer 0 Byte 4                                    uuuu uuuu uuuu uuuu
                                   C2RX0B4       044C                                       Receive Buffer 0 Byte 7                                                                       Receive Buffer 0 Byte 6                                    uuuu uuuu uuuu uuuu
                                   C2RX0CON      044E        —              —           —          —         —          —           —           —        RXFUL          —             —          —      RXRTRRO DBEN            JTOFF    FILHIT0     0000 0000 0000 0000
                                   C2CTRL        0450    CANCAP             —        CSIDLE      ABAT     CANCKS                REQOP<2:0>                        OPMODE<2:0>                    —                 ICODE<2:0>                 —      0000 0100 1000 0000
                                   C2CFG1        0452        —              —           —          —         —          —           —           —            SJW<1:0>                                        BRP<5:0>                                0000 0000 0000 0000
                                   C2CFG2        0454        —           WAKFIL         —          —         —                  SEG2PH<2:0>            SEG2PHTS        SAM                  SEG1PH<2:0>                        PRSEG<2:0>            0u00 0uuu uuuu uuuu
                                   C2INTF        0456    RX0OVR          RX1OVR       TXBO       TXEP      RXEP        TXWAR      RXWAR      EWARN        IVRIF       WAKIF        ERRIF       TX2IF      TX1IF       TX0IF     RX1IF        RX0IF   0000 0000 0000 0000
                                   C2INTE        0458        —              —           —          —         —          —           —           —         IVRIE       WAKIE        ERRIE       TX2IE      TX1IE       TX0IE     RX1E         RX0IE   0000 0000 0000 0000
                                   C2EC          045A                                   Transmit Error Count Register                                                                 Receive Error Count Register                                   0000 0000 0000 0000
                                   Legend:     u = uninitialized bit
                                                                                                                                                                                                                                                                           dsPIC30F
   DS70083G-page 133
                                   Note: Refer to dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
dsPIC30F
NOTES:
                                                         Sample Rate
                                         FOSC/4                                                                   CSCK
                                                          Generator
                                                                                        FSD
                          Word Size Selection bits     Frame
                       Frame Length Selection bits     Synchronization                                            COFS
                          DCI Mode Selection bits      Generator
     16-bit Data Bus
                        Receive Buffer
                        Registers w/Shadow
                                                                         DCI Buffer
                                                                         Control Unit
                                                            15                                0
                        Transmit Buffer
                                                                  DCI Shift Register                              CSDI
                        Registers w/Shadow
CSDO
When enabled, the DCI controls the data direction for         The operation of the COFSM control bits depends on
the four I/O pins associated with the module. The Port,       whether the DCI module generates the frame sync
LAT and TRIS register values for these I/O pins are           signal as a master device, or receives the frame sync
overridden by the DCI module when the DCIEN bit is set.       signal as a slave device.
It is also possible to override the CSCK pin separately       The master device in a DSP/Codec pair is the device
when the bit clock generator is enabled. This permits         that generates the frame sync signal. The frame sync
the bit clock generator to operate without enabling the       signal initiates data transfers on the CSDI and CSDO
rest of the DCI module.                                       pins and usually has the same frequency as the data
                                                              sample rate (COFS).
18.3.2      WORD SIZE SELECTION BITS                          The DCI module is a frame sync master if the COFSD
The WS<3:0> word size selection bits in the DCICON2           control bit is cleared and is a frame sync slave if the
SFR determine the number of bits in each DCI data             COFSD control bit is set.
word. Essentially, the WS<3:0> bits determine the
counting period for a 4-bit counter clocked from the          18.3.5       MASTER FRAME SYNC
CSCK signal.                                                               OPERATION
Any data length, up to 16-bits, may be selected. The          When the DCI module is operating as a frame sync
value loaded into the WS<3:0> bits is one less the            master device (COFSD = 0), the COFSM mode bits
desired word length. For example, a 16-bit data word          determine the type of frame sync pulse that is
size is selected when WS<3:0> = 1111.                         generated by the frame sync generator logic.
                                                              A new COFS signal is generated when the frame sync
  Note:     These WS<3:0> control bits are used only
                                                              generator resets to ‘0’.
            in the Multi-Channel and I2S modes. These
            bits have no effect in AC-Link mode since         In the Multi-Channel mode, the frame sync pulse is
            the data slot sizes are fixed by the protocol.    driven high for the CSCK period to initiate a data trans-
                                                              fer. The number of CSCK cycles between successive
18.3.3      FRAME SYNC GENERATOR                              frame sync pulses will depend on the word size and
The frame sync generator (COFSG) is a 4-bit counter           frame sync generator control bits. A timing diagram for
that sets the frame length in data words. The frame           the frame sync signal in Multi-Channel mode is shown
sync generator is incremented each time the word size         in Figure 18-2.
counter is reset (refer to Section 18.3.2). The period for    In the AC-Link mode of operation, the frame sync sig-
the frame synchronization generator is set by writing         nal has a fixed period and duty cycle. The AC-Link
the COFSG<3:0> control bits in the DCICON2 SFR.               frame sync signal is high for 16 CSCK cycles and is low
The COFSG period in clock cycles is determined by the         for 240 CSCK cycles. A timing diagram with the timing
following formula:                                            details at the start of an AC-Link frame is shown in
                                                              Figure 18-3.
EQUATION 18-1:          COFSG PERIOD                          In the I2S mode, a frame sync signal having a 50% duty
                                                              cycle is generated. The period of the I2S frame sync
     Frame Length = Word Length • (FSG Value + 1)
                                                              signal in CSCK cycles is determined by the word size
                                                              and frame sync generator control bits. A new I2S data
Frame lengths, up to 16 data words, may be selected.          transfer boundary is marked by a high-to-low or a
The frame length in CSCK periods can vary up to a             low-to-high transition edge on the COFS pin.
maximum of 256 depending on the word size that is
selected.
  Note:     The COFSG control bits will have no effect
            in AC-Link mode since the frame length is
            set to 256 CSCK periods by the protocol.
CSCK
COFS
BIT_CLK
SYNC
CSCK
WS
      Note:     A 5-bit transfer is shown here for illustration purposes. The I2S protocol does not specify word length - this will
                be system dependent.
The formula for the bit clock frequency is given in            18.3.9      DATA JUSTIFICATION
Equation 18-2.                                                             CONTROL BIT
                                                               In most applications, the data transfer begins one
EQUATION 18-2:          BIT CLOCK FREQUENCY
                                                               CSCK cycle after the COFS signal is sampled active.
                                                               This is the default configuration of the DCI module. An
                                FCY
                FBCK =                                         alternate data alignment can be selected by setting the
                          2 • (BCG + 1)                        DJST control bit in the DCICON2 SFR. When DJST = 1,
                                                               data transfers will begin during the same CSCK cycle
The required bit clock frequency will be determined by         when the COFS signal is sampled active.
the system sampling rate and frame size. Typical bit
                                                               18.3.10     TRANSMIT SLOT ENABLE BITS
clock frequencies range from 16x to 512x the converter
sample rate depending on the data converter and the            The TSCON SFR has control bits that are used to
communication protocol that is used.                           enable up to 16 time slots for transmission. These con-
                                                               trol bits are the TSE<15:0> bits. The size of each time
To achieve bit clock frequencies associated with com-
                                                               slot is determined by the WS<3:0> word size selection
mon audio sampling rates, the user will need to select
                                                               bits and can vary up to 16 bits.
a crystal frequency that has an ‘even’ binary value.
Examples of such crystal frequencies are listed in             If a transmit time slot is enabled via one of the TSE bits
Table 18-1.                                                    (TSEx = 1), the contents of the current transmit shadow
                                                               buffer location will be loaded into the CSDO Shift regis-
TABLE 18-1:        DEVICE FREQUENCIES FOR                      ter and the DCI buffer control unit is incremented to
                   COMMON CODEC CSCK                           point to the next location.
                   FREQUENCIES                                 During an unused transmit time slot, the CSDO pin will
                                                               drive ‘0’s or will be tri-stated during all disabled time
      FOSC                PLL                FCYC
                                                               slots depending on the state of the CSDOM bit in the
   2.048 MHz               16x            32.768 MIPs          DCICON1 SFR.
   4.096 MHz               8x             32.768 MIPs          The data frame size in bits is determined by the chosen
   4.800 MHz               8x              38.4 MIPs           data word size and the number of data word elements
                                                               in the frame. If the chosen frame size has less than 16
   9.600 MHz               4x              38.4 MIPs
                                                               elements, the additional slot enable bits will have no
                                                               effect.
   Note 1: When the CSCK signal is applied exter-              Each transmit data word is written to the 16-bit transmit
           nally (CSCKD = 1), the BCG<11:0> bits               buffer as left justified data. If the selected word size is
           have no effect on the operation of the DCI          less than 16 bits, then the LS bits of the transmit buffer
           module.                                             memory will have no effect on the transmitted data. The
                                                               user should write ‘0’s to the unused LS bits of each
         2: When the CSCK signal is applied exter-
                                                               transmit buffer location.
            nally (CSCKD = 1), the external clock
            high and low times must meet the device
            timing requirements.
                                   DCICON1    0240     DCIEN           —       DCISIDL    —       DLOOP    CSCKD     CSCKE     COFSD UNFM        CSDOM     DJST     —       —       —       COFSM1    COFSM0 0000 0000 0000 0000
                                   DCICON2    0242        —            —         —        —       BLEN1    BLEN0        —                COFSG<3:0>                 —                      WS<3:0>             0000 0000 0000 0000
                                   DCICON3    0244        —            —         —        —                                                        BCG<11:0>                                                   0000 0000 0000 0000
                                   DCISTAT    0246        —            —         —        —       SLOT3    SLOT2     SLOT1     SLOT0       —           —    —       —      ROV     RFUL      TUNF     TMPTY    0000 0000 0000 0000
                                   TSCON      0248     TSE15          TSE14    TSE13     TSE12    TSE11    TSE10      TSE9      TSE8     TSE7     TSE6     TSE5    TSE4    TSE3    TSE2       TSE1     TSE0    0000 0000 0000 0000
                                   RSCON      024C     RSE15          RSE14    RSE13     RSE12    RSE11    RSE10      RSE9      RSE8     RSE7     RSE6     RSE5    RSE4 RSE3       RSE2       RSE1     RSE0    0000 0000 0000 0000
                                   RXBUF0     0250                                                                  Receive Buffer #0 Data Register                                                            0000 0000 0000 0000
                                   RXBUF1     0252                                                                  Receive Buffer #1 Data Register                                                            0000 0000 0000 0000
Note: Refer to dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
Preliminary
                                                                                                                                                                                                                                     dsPIC30F
   DS70083G-page 143
dsPIC30F
NOTES:
                                       0000                                                          Comparator
        AN0
                                                                                   DAC
                                       0001
        AN1
AN2 0010
AN4 0100
                                                                                                                    Data Format
                                       0101                                                    16-word, 12-bit
        AN5                                                                                       Dual Port
                                                                                                   Buffer
                                                                                                                                  Bus Interface
                                       0110
        AN6
                                       0111
        AN7
                                       1000                                                      Sample/Sequence
        AN8                                                 Sample                                   Control
                                       1001
        AN9
                                       1010                                          Input
       AN10                                                                        Switches             Input Mux
                                       1011                                                               Control
       AN11
AN12 1100
AN13 1101
AN14 1110
       AN15                            1111
                                      CH0G             S/H     CH0
                                      CH0R
                                                                                                CHOLD
                   VA         CPIN                              I leakage                       = DAC capacitance
                                                    VT = 0.6V   ± 500 nA                        = 18 pF
VSS
Note: CPIN value depends on device package and is not tested. Effect of CPIN negligible if Rs ≤ 2.5 kΩ.
RAM Contents: d11 d10 d09 d08 d07 d06 d05 d04 d03 d02 d01 d00
Read to Bus:
Signed Fractional d11 d10 d09 d08 d07 d06 d05 d04 d03 d02 d01 d00 0 0 0 0
Fractional d11 d10 d09 d08 d07 d06 d05 d04 d03 d02 d01 d00 0 0 0 0
Signed Integer d11 d11 d11 d11 d11 d10 d09 d08 d07 d06 d05 d04 d03 d02 d01 d00
Integer 0 0 0 0 d11 d10 d09 d08 d07 d06 d05 d04 d03 d02 d01 d00
Preliminary
                                   ADCHS     02A6        —             —         —      CH0NB             CH0SB<3:0>                —          —        —        CH0NA            CH0SA<3:0>             0000 0000 0000 0000
                                   ADPCFG    02A8    PCFG15 PCFG14 PCFG13 PCFG12                 PCFG11 PCFG10 PCFG9 PCFG8 PCFG7            PCFG6 PCFG5          PCFG4   PCFG3 PCFG2 PCFG1       PCFG0   0000 0000 0000 0000
                                   ADCSSL    02AA    CSSL15 CSSL14 CSSL13               CSSL12   CSSL11   CSSL10 CSSL9     CSSL8   CSSL7    CSSL6      CSSL5     CSSL4   CSSL3   CSSL2   CSSL1   CSSL0   0000 0000 0000 0000
                                   Legend:    u = uninitialized bit
                                   Note: Refer to dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
                                                                                                                                                                                                                               dsPIC30F
   DS70083G-page 151
dsPIC30F
NOTES:
Wake-up Request
                                                           FPLL
   OSC1
                       Primary               PLL
                       Oscillator        x4, x8, x16       PLL
   OSC2
                                                           Lock                            COSC<2:0>
                                                Primary Osc
                                                                                           NOSC<2:0>
                                          Primary
                                          Oscillator                                       OSWEN
                                      Stability Detector
                                          Oscillator
                    POR Done              Start-up
                                           Timer                      Clock
                                                                                         Programmable
                                              Secondary Osc         Switching
                                                                                         Clock Divider System
                                                                   and Control
                                                                                                        Clock
                                                                      Block
   SOSCO
                       32 kHz LP         Secondary                                                2
                                          Oscillator
                       Oscillator
    SOSCI                             Stability Detector
                                                                                           POST<1:0>
                                      Internal Fast RC
                                      Oscillator (FRC)
                                                                                                 CF
                                                                  Fail-Safe Clock
                                    FCKSM<1:0>                    Monitor (FSCM)
                                                       2                                         Oscillator Trap
To Timer1
The Fail-Safe Clock Monitor (FSCM) allows the device          • COSC<1:0>: Read only status bits always reflect
to continue to operate even in the event of an oscillator       the current oscillator group in effect.
failure. The FSCM function is enabled by appropriately        • NOSC<2:0>: Control bits which are written to
programming the FCKSM configuration bits (clock                 indicate the new oscillator group of choice.
switch and monitor selection bits) in the FOSC Device           - On POR and BOR, COSC<2:0> and
Configuration register. If the FSCM function is enabled,           NOSC<1:0> are both loaded with the
the LPRC internal oscillator will run at all times (except         configuration bit values FOS<2:0>.
during Sleep mode) and will not be subject to control by      • LOCK: The LOCK status bit indicates a PLL lock.
the SWDTEN bit.                                               • CF: Read only status bit indicating if a clock fail
In the event of an oscillator failure, the FSCM will gen-       detect has occurred.
erate a clock failure trap event and will switch the sys-     • OSWEN: Control bit changes from a ‘0’ to a ‘1’
tem clock over to the FRC oscillator. The user will then        when a clock transition sequence is initiated.
have the option to either attempt to restart the oscillator     Clearing the OSWEN control bit will abort a clock
or execute a controlled shutdown. The user may decide           transition in progress (used for hang-up
to treat the trap as a warm Reset by simply loading the         situations).
Reset address into the oscillator fail trap vector. In this
                                                              If configuration bits FCKSM<2:0> = 1x, then the clock
event, the CF (Clock Fail) status bit (OSCCON<3>) is
                                                              switching and Fail-Safe Clock monitoring functions are
also set whenever a clock failure is recognized.
                                                              disabled. This is the default configuration bit setting.
In the event of a clock failure, the WDT is unaffected
and continues to run on the LPRC clock.
                                     Digital
                                  Glitch Filter
     MCLR
                      Sleep or Idle
                       WDT
                      Module
                 Illegal Opcode/
                 Uninitialized W Register
VDD
MCLR
INTERNAL POR
                                             TOST
      OST TIME-OUT
                                                      TPWRT
PWRT TIME-OUT
INTERNAL Reset
FIGURE 20-4: TIME-OUT SEQUENCE ON POWER-UP (MCLR NOT TIED TO VDD): CASE 1
VDD
MCLR
INTERNAL POR
                                              TOST
       OST TIME-OUT
                                                              TPWRT
PWRT TIME-OUT
INTERNAL Reset
VDD
MCLR
INTERNAL POR
                                      TOST
      OST TIME-OUT
                                                   TPWRT
PWRT TIME-OUT
INTERNAL Reset
The LVD module is enabled by setting the LVDEN bit          Moreover, if LP oscillator was active during Sleep and
(RCON<12>).                                                 LP is the oscillator used on wake-up, then the start-up
                                                            delay will be equal to TPOR. PWRT delay and OST
                                                            timer delay are not applied. In order to have -the small-
                                                            est possible start-up delay when waking up from Sleep,
                                                            one of these faster wake-up options should be selected
                                                            before entering Sleep.
   DS70083G-page 168
                                   PMD1         0770      T5MD      T4MD        T3MD       T2MD      T1MD        —         —        DCIMD   I2CMD     U2MD       U1MD     SPI2MD SPI1MD      C2MD      C1MD     ADCMD 0000 0000 0000 0000
                                   PMD2         0772      IC8MD     IC7MD       IC6MD     IC5MD      IC4MD     IC3MD     IC2MD      IC1MD   OC8MD OC7MD         OC6MD     OC5MD     OC4MD OC3MD       OC2MD     OC1MD 0000 0000 0000 0000
                                                                                                                                                                                                                                                       dsPIC30F
Note: Refer to dsPIC30F Family Reference Manual (DS70046) for descriptions of register bit fields.
Preliminary
 2004 Microchip Technology Inc.
                                                                                               dsPIC30F
21.0        INSTRUCTION SET SUMMARY                             Most bit-oriented instructions (including simple rotate/
                                                                shift instructions) have two operands:
    Note: This data sheet summarizes features of this group
    of dsPIC30F devices and is not intended to be a complete
                                                                • The W register (with or without an address
    reference source. For more information on the CPU,            modifier) or file register (specified by the value of
    peripherals, register descriptions and general device         ‘Ws’ or ‘f’)
    functionality, refer to the dsPIC30F Family Reference       • The bit in the W register or file register
    Manual (DS70046). For more information on the device
    instruction set and programming, refer to the dsPIC30F        (specified by a literal value or indirectly by the
    Programmer’s Reference Manual (DS70030).                      contents of register ‘Wb’)
The dsPIC30F instruction set adds many                          The literal instructions that involve data movement may
enhancements to the previous PICmicro® instruction              use some of the following operands:
sets, while maintaining an easy migration from                  • A literal value to be loaded into a W register or file
PICmicro instruction sets.                                        register (specified by the value of ‘k’)
Most instructions are a single program memory word              • The W register or file register where the literal
(24 bits). Only three instructions require two program            value is to be loaded (specified by ‘Wb’ or ‘f’)
memory locations.                                               However, literal instructions that involve arithmetic or
Each single word instruction is a 24-bit word divided           logical operations use some of the following operands:
into an 8-bit opcode which specifies the instruction            • The first source operand which is a register ‘Wb’
type, and one or more operands which further specify              without any address modifier
the operation of the instruction.
                                                                • The second source operand which is a literal
The instruction set is highly orthogonal and is grouped           value
into five basic categories:                                     • The destination of the result (only if not the same
•   Word or byte-oriented operations                              as the first source operand) which is typically a
•   Bit-oriented operations                                       register ‘Wd’ with or without an address modifier
•   Literal operations                                          The MAC class of DSP instructions may use some of the
•   DSP operations                                              following operands:
•   Control operations                                          • The accumulator (A or B) to be used (required
                                                                  operand)
Table 21-1 shows the general symbols used in
describing the instructions.                                    • The W registers to be used as the two operands
                                                                • The X and Y address space pre-fetch operations
The dsPIC30F instruction set summary in Table 21-2
lists all the instructions, along with the status flags         • The X and Y address space pre-fetch destinations
affected by each instruction.                                   • The accumulator write back destination
Most word or byte-oriented W register instructions              The other DSP instructions do not involve any
(including barrel shift instructions) have three                multiplication, and may include:
operands:                                                       • The accumulator to be used (required)
• The first source operand which is typically a                 • The source or destination operand (designated as
  register ‘Wb’ without any address modifier                      Wso or Wdo, respectively) with or without an
• The second source operand which is typically a                  address modifier
  register ‘Ws’ with or without an address modifier             • The amount of shift specified by a W register ‘Wn’
• The destination of the result which is typically a              or a literal value
  register ‘Wd’ with or without an address modifier             The control instructions may use some of the following
However, word or byte-oriented file register instructions       operands:
have two operands:                                              • A program memory address
• The file register specified by the value ‘f’                  • The mode of the table read and table write
• The destination, which could either be the file                 instructions
  register ‘f’ or the W0 register, which is denoted as
  ‘WREG’
†NOTICE: Stresses above those listed under “Absolute Maximum Ratings” may cause permanent damage to the
 device. This is a stress rating only and functional operation of the device at those or any other conditions above those
 indicated in the operation listings of this specification is not implied. Exposure to maximum rating conditions for
 extended periods may affect device reliability.
    Note:       All peripheral electrical characteristics are specified. For exact peripherals available on specific
                devices, please refer the the Family Cross Reference Table.
VDD
LV10
                  LVDIF
                  (LVDIF set by hardware)
VDD
Load Condition 1 - for all pins except OSC2 Load Condition 2 - for OSC2
VDD/2
RL Pin CL
                                                                                     VSS
                                                CL
                           Pin                                 RL = 464 Ω
                                                               CL = 50 pF for all pins except OSC2
                                         VSS                        5 pF for OSC2 output
Q4 Q1 Q2 Q3 Q4 Q1
       OSC1
                                      OS20
                                                                 OS30     OS30    OS31     OS31
                                                              OS25
   CLKOUT
OS40 OS41
    I/O Pin
    (Input)
                                                                   DI35
                                                                   DI40
VDD SY12
MCLR
      Internal                                                  SY10
        POR
                             SY11
        PWRT
      Time-out
                                 SY30
         OSC
      Time-out
      Internal
       RESET
    Watchdog
       Timer
      RESET
                                                                       SY20
                                                         SY13
                                                                              SY13
I/O Pins
                                        SY35
      FSCM
      Delay
                                                                                                                VBGAP
             0V
           TxCK
                                               Tx10                   Tx11
                                                             Tx15                         Tx20
                                                             OS60
                TMRX
TABLE 23-21: TYPE C TIMER (TIMER3 AND TIMER5) EXTERNAL CLOCK TIMING REQUIREMENTS
                                                    Standard Operating Conditions: 2.5V to 5.5V
                                                    (unless otherwise stated)
AC CHARACTERISTICS
                                                    Operating temperature -40°C ≤ TA ≤ +85°C for Industrial
                                                                            -40°C ≤ TA ≤ +125°C for Extended
 Param
           Symbol              Characteristic                    Min         Typ     Max      Units      Conditions
  No.
TC10      TtxH       TxCK High Time        Synchronous       0.5 TCY + 20     —       —         ns    Must also meet
                                                                                                      parameter TC15
TC11      TtxL       TxCK Low Time         Synchronous       0.5 TCY + 20     —       —         ns    Must also meet
                                                                                                      parameter TC15
TC15      TtxP       TxCK Input Period Synchronous,            TCY + 10       —       —         ns    N = prescale
                                       no prescaler                                                   value
                                           Synchronous,       Greater of:                             (1, 8, 64, 256)
                                           with prescaler      20 ns or
                                                             (TCY + 40)/N
TC20      TCKEXTMRL Delay from External TQCK Clock              2 TOSC        —     6 TOSC      —
                    Edge to Timer Increment
  Note:    Timer3 and Timer5 are Type C.
ICX
                                                       IC10               IC11
                                                               IC15
                                      OCx
                           (Output Compare
                             or PWM Mode)              OC11               OC10
OC20
OCFA/OCFB
OC15
OCx
   CSCK
  (SCKE = 1)
   CSCK
  (SCKE = 0)
CS20 CS21
   COFS
                       CS55 CS56
                                          CS35
                    CS51           CS50                                                     70
CS30 CS31
CS40 CS41
  BIT_CLK
  (CSCK)
CS71 CS70
CS72
  SYNC
  (COFS)
                                                                              CS76                             CS75
            CS80
  SDI                      MSb IN
  (CSDI)
                        CS65 CS66
    SCKx
    (CKP = 0)
    SCKx
    (CKP = 1)
SP31 SP30
SP40 SP41
                        SP36
    SCKX
    (CKP = 0)
    SCKX
    (CKP = 1)
                                           SP35
                                                                           SP20       SP21
SP40 SP30,SP31
SP41
SSX
                         SP50                                                                    SP52
       SCKX
       (CKP = 0)
       SCKX
       (CKP = 1)
                                                                            SP20          SP21
                                SP35
SP30,SP31 SP51
                                              SP41
                                       SP40
                        SP50                                                              SP52
    SCKX
    (CKP = 0)
    SCKX
    (CKP = 1)
                                                                     SP35
                                                                            SP20       SP21
                                                SP52
SP30,SP31 SP51
    SDIX
                               MSb IN               BIT14 - - - -1            LSb IN
                                   SP41
                            SP40
  SCL
                                    IM31                                              IM34
                      IM30                                                   IM33
SDA
                         Start                                                  Stop
                        Condition                                             Condition
         SDA
         Out
  SCL
                                 IS31                                            IS34
                     IS30                                             IS33
SDA
                        Start                                            Stop
                      Condition                                        Condition
         SDA
         Out
                                               CA10 CA11
   CXRX Pin
   (input)
                                                    CA20
AD50
       ADCLK
    Instruction
    Execution BSF SAMP             BCF SAMP
SAMP
ch0_dischrg
ch0_samp
eoc
                 AD61
                                   AD60
TSAMP AD55
DONE
ADIF
ADRES(0)
1 2 3 4 5 6 7 8 9
          XXXXXXXXXXXXXXXXXXXX                                              PIC30F2012-30I/SO
          XXXXXXXXXXXXXXXXXXXX                                                    0310017
          XXXXXXXXXXXXXXXXXXXX
                 YYWWNNN
                Note:    In the event the full Microchip part number cannot be marked on one line, it will
                         be carried over to the next line thus limiting the number of available characters
                         for customer specific information.
    * Standard device marking consists of Microchip part number, year code, week code, and traceability code.
      For device marking beyond this, certain price adders apply. Please check with your Microchip Sales Office.
      For QTP devices, any special marking adders are included in QTP price.
              XXXXXXXXXXXXXXXXXX                             dsPIC30F3014-30I/P
              XXXXXXXXXXXXXXXXXX
              XXXXXXXXXXXXXXXXXX
                   YYWWNNN                                       0348017
                    XXXXXXXXXX                                dsPIC30F
                    XXXXXXXXXX                                3014-30I/PT
                    XXXXXXXXXX
                      YYWWNNN                                    0348017
                    XXXXXXXXXX
                    XXXXXXXXXX                              dsPIC30F4013-30I/ML
                    XXXXXXXXXX                                    0310017
                    YYWWNNN
                    XXXXXXXXXX                                dsPIC30F
                    XXXXXXXXXX                                5011-30I/PT
                    XXXXXXXXXX
                      YYWWNNN                                    0348017
                    XXXXXXXXXXXX                              dsPIC30F6011
                    XXXXXXXXXXXX                              -30I/PF
                      YYWWNNN                                  0348017
                     XXXXXXXXXXXX                         dsPIC30F5013
                     XXXXXXXXXXXX                         -30I/PT
                       YYWWNNN                               0348017
                     XXXXXXXXXXXX                         dsPIC30F6013
                     XXXXXXXXXXXX                         -30I/PF
                       YYWWNNN                             0348017
E1
n 1 α
E A2
c L
                                                         A1
                                                                            B1
                     β
                                                                           B                               p
                          eB
                                 2
               n                 1                                                                                    α
E A2
                                                                                                                                  L
                                       c
β A1 B1
eB B p
                                         E
                  p
                                         E1
                                                       2
           B          n                                1
                                              h
                                                                                                                     α
45°
           c
                                                                             A                                             A2
                                                                   φ
                                β                          L                  A1
                                     E
                                     E1
                      p
                B
                                                   2
                       n                           1
                                      h
                                                                                                                        α
45°
                c
                                                                         A                                                    A2
                                                             φ
                                 β                      L               A1
E1
                                   2                                                                                      α
             n                     1
A A2
                                                                                                                                    L
                                        c
                 β                                                                    B1
                                                 A1
                       eB                                                             B                               p
                                           E
                                           E1
                                    #leads=n1
D1 D
                                                             2
                                                             1
              B
                                                       n
                                                                         CH x 45 °
                                                                                                                             α
                                                                                      A
                                                                 φ
                  β                                                             A1                                      A2
                                                                     L
                                                                                                (F)
                                            E
                                            E1
                                        #leads=n1
D1 D
                                                               2
                                                               1
                B
                                                         n
                                                                              CH x 45 °
                                                                                                                                   α
                                                                                           A
                 c
                                                                                                                                       A2
                                                     L                    φ
                      β                                                             A1
                                                                                                         (F)
                                     E
                                     E1
                                 #leads=n1
D1 D
                                                        2
                                                        1
         B
                                                  n
                                                                       CH x 45 °
                                                                                                                              α
                                                                                    A
          c
                                                                                                                                  A2
                                              L                    φ
               β                                                             A1
                                                                                                   (F)
                                        E
                                        E1
                                     #leads=n1
D1 D
                                                              2
              B                                               1
                                                        n
                                                                       CH x 45 °
                                                                                       A                                      α
             c
                  β                                                    φ                                                    A2
                                                                   L           A1
                                                                                                 (F)
                                      E
                                      E1
                                   #leads=n1
D1 D
                                                            2
            B                                               1
                                                      n
                                                                     CH x 45 °
                                                                                     A                                          α
           c
                β                                                    φ                                                        A2
                                                                 L           A1
                                                                                                (F)
    From: Name
            Company
            Address
            City / State / ZIP / Country
            Telephone: (_______) _________ - _________                 FAX: (______) _________ - _________
    Application (optional):
    Would you like a reply?      Y         N
Questions:
2. How does this document meet your hardware and software development needs?
3. Do you find the organization of this document easy to follow? If not, why?
4. What additions to the document do you think would enhance the structure and subject?
5. What deletions from the document could be made without affecting the overall usefulness?
                              d s P I C 3 0 F 4 0 1 3 AT- 3 0 I / P - E S
                                                                                                   Custom ID (3 digits) or
    Trademark                                                                                      Engineering Sample (ES)
    Architecture                                                                                Package
                                                                                                PT = TQFP 10x10
                                                                                                PT = TQFP 12x12
                                                                                                PF = TQFP 14x14
      Flash                                                                                     P = DIP
                                                                                                SO = SOIC
                                                                                                SP = SPDIP
    Memory Size in Bytes
                                                                                                ML = QFN 6x6 or 8x8
    0 = ROMless                                                                                 S = Die (Waffle Pack)
    1 = 1K to 6K
    2 = 7K to 12K                                                                               W = Die (Wafers)
    3 = 13K to 24K
    4 = 25K to 48K                                                                 Temperature
    5 = 49K to 96K                                                                 I = Industrial -40°C to +85°C
    6 = 97K to 192K                                                                E = Extended High Temp -40°C to +125°C
    7 = 193K to 384K
    8 = 385K to 768K
                                                                                                                 Speed
    9 = 769K and Up
                                                                                                                 20 = 20 MIPS
                                                                                                                 30 = 30 MIPS
      Device ID                                                                                          T = Tape and Reel
   Examples:
   a) dsPIC30F2011AT-E/SO = Extended temp., SOIC package, Rev. A.
   b) dsPIC30F5011AT-I/PT = Industrial temp., TQFP package, Rev. A.
   c) dsPIC30F3012AT-I/P = Industrial temp., DIP package, Rev. A.
08/24/04