<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE pinDefinitions SYSTEM "../pinDefinitions.dtd">

<!-- On this packaging of the 3013, all of the pin functions that we saw -->
<!-- together on the 28-pin SPDIP package are now assigned to pins with -->
<!-- different numbers.  There is also the addition of a VSS pin, and a -->
<!-- whole bunch of pins that are not connected to anything. -->

<pinDefinitions bitmap="44-Pin QFN" height="356" width="359" type="QFN" numberOfPins="44" numberOfSides="4" topLeftX="73" leftTopY="75" pinHeight="20" pinWidth="12" pinSpacing="10" pin1Side="0" pin1Pos="0">

  <!-- QFN pins 1-2 match SPDIP pins 18-19. -->
  <pin number="1" name="PGC/EMUC/U1RX/SDI1/SDA/RF2" initConnection="none">
    <connection type="other" name="PGC" polarity="Inp" desc="In Ckt Serial Programming Clock Input Pin"/>
    <connection type="periph" name="EMUC" feature="ICD" instance="1" polarity="Inp" desc="ICD Primary Comm Channel Clock Input Pin"/>
    <connection type="periph" name="U1RX" feature="UART" instance="1" polarity="Inp" desc="UART1 Receive"/>
    <connection type="periph" name="SDI1" feature="SPI" instance="1" polarity="I/O" desc="SPI1 Data In"/>
    <connection type="periph" name="SDA" feature="I2C" polarity="I/O" desc="I2C Sync Serial Data I/O"/>
    <connection type="IOPort" name="RF2" feature="IOPort" port="F" pin="2" polarity="I/O" desc="PORTB bidirectional I/O Port Pin 2"/>
  </pin>

  <pin number="2" name="VSS" initConnection="unaccessible">
    <connection type="other" name="VSS" polarity="P" desc="Gnd Ref for Logic and I/O Pins"/>
  </pin>

  <pin number="3" name="NC" initConnection="unaccessible"/>

  <!-- This was pin 20 on the SPDIP. -->
  <pin number="4" name="VDD" initConnection="unaccessible">
    <connection type="other" name="VDD" polarity="P" desc="Positive Supply for Logic and I/O Pins"/>
  </pin>

  <pin number="5" name="NC" initConnection="unaccessible"/>

  <pin number="6" name="NC" initConnection="unaccessible"/>

  <!-- This was pin 21 on the SPDIP. -->
  <pin number="7" name="U2RX/CN18/RF5" initConnection="none">
    <connection type="periph" name="U2RX" feature="UART" instance="2" polarity="Inp" desc="UART2 Receive"/>
    <connection type="CNF" name="CN18" feature="CN" pin="18" polarity="Inp" desc="Input Change Notification Input 18"/>
    <connection type="IOPort" name="RF5" feature="IOPort" port="F" pin="5" polarity="I/O" desc="PORTF bidirectional I/O Port Pin 5"/>
  </pin>

  <pin number="8" name="NC" initConnection="unaccessible"/>

  <!-- QFN pins 9-12 are pins 22-25 on the SPDIP. -->
  <pin number="9" name="U2TX/CN17/RF4" initConnection="none">
    <connection type="periph" name="U2TX" feature="UART" instance="2" polarity="Out" desc="UART2 Transmit"/>
    <connection type="CNF" name="CN17" feature="CN" pin="17" polarity="Inp" desc="Input Change Notification Input 17"/>
    <connection type="IOPort" name="RF4" feature="IOPort" port="F" pin="4" polarity="I/O" desc="PORTF bidirectional I/O Port Pin 4"/>
  </pin>

  <pin number="10" name="AN9/OC2/RB9" initConnection="none">
    <connection type="periph" name="AN9" feature="A2D" instance="9" polarity="Inp" desc="Analog Input 9"/>
    <connection type="periph" name="OC2" feature="OC" instance="2" polarity="Inp" desc="Compare Output 2"/>
    <connection type="IOPort" name="RB9" feature="IOPort" port="B" pin="9" polarity="I/O" desc="PORTB bidirectional I/O Port Pin 9"/>
  </pin>

  <pin number="11" name="AN8/OC1/RB8" initConnection="none">
    <connection type="periph" name="AN8" feature="A2D" instance="8" polarity="Inp" desc="Analog Input 8"/>
    <connection type="periph" name="OC1" feature="OC" instance="1" polarity="Inp" desc="Compare Output 1"/>
    <connection type="IOPort" name="RB8" feature="IOPort" port="B" pin="8" polarity="I/O" desc="PORTB bidirectional I/O Port Pin 8"/>
  </pin>

  <pin number="12" name="EMUD2/AN7/RB7" initConnection="none">
    <connection type="periph" name="EMUD2" feature="ICD" instance="3" polarity="I/O" desc="ICD Tertiary Comm Channel Data I/O Pin"/>
    <connection type="periph" name="AN7" feature="A2D" instance="7" polarity="Inp" desc="Analog Input 7"/>
    <connection type="IOPort" name="RB7" feature="IOPort" port="B" pin="7" polarity="I/O" desc="PORTB bidirectional I/O Port Pin 7"/>
  </pin>

  <pin number="13" name="NC" initConnection="unaccessible"/>

  <!-- This was pin 26 on the SPDIP. -->
  <!-- I question the correctness of the OCF connections. -->
  <pin number="14" name="AN6/OCFA/RB6" initConnection="none">
    <connection type="periph" name="AN6" feature="A2D" instance="6" polarity="Inp" desc="Analog Input 6"/>
    <connection type="periph" name="OCF1" feature="OC" instance="1-2" polarity="Inp" desc="Compare Fault A Input"/>
    <connection type="periph" name="OCF2" feature="OC" instance="1-2" polarity="Inp" desc="Compare Fault A Input"/>
    <connection type="periph" name="OCF3" feature="OC" instance="1-2" polarity="Inp" desc="Compare Fault A Input"/>
    <connection type="periph" name="OCF4" feature="OC" instance="1-2" polarity="Inp" desc="Compare Fault A Input"/>
    <connection type="periph" name="OCF5" feature="OC" instance="1-2" polarity="Inp" desc="Compare Fault A Input"/>
    <connection type="periph" name="OCF6" feature="OC" instance="1-2" polarity="Inp" desc="Compare Fault A Input"/>
    <connection type="IOPort" name="RB6" feature="IOPort" port="B" pin="6" polarity="I/O" desc="PORTB bidirectional I/O Port Pin 6"/>
  </pin>

  <pin number="15" name="NC" initConnection="unaccessible"/>

  <!-- QFN pins 16-17 are pins 27-28 on the SPDIP. -->
  <pin number="16" name="AVSS" initConnection="unaccessible">
    <connection type="other" name="AVSS" polarity="P" desc="Ground Ref for Analog Module"/>
  </pin>

  <pin number="17" name="AVDD" initConnection="unaccessible">
    <connection type="other" name="AVDD" polarity="P" desc="Positive Supply for Analog Module"/>
  </pin>

  <!-- QFN pins 18-20 are pins 1-3 on the SPDIP. -->
  <pin number="18" name="MCLR-L" initConnection="unaccessible">
    <connection type="other" name="MCLR-L" polarity="I/P" desc="Active low Master Reset Input or Programming Voltage Input"/>
  </pin>

  <pin number="19" name="EMUD3/AN0/VREF+/CN2/RB0" initConnection="none">
    <connection type="periph" name="EMUD3" feature="ICD" instance="4" polarity="I/O" desc="ICD Quaternary Comm Channel Data I/O Pin"/>
    <connection type="periph" name="AN0" feature="A2D" instance="0" polarity="Inp" desc="Analog Input 0"/>
    <connection type="other" name="VREF+" polarity="Input" desc="Analog Voltage Ref (High) Input"/>
    <connection type="CNF" name="CN2" feature="CN" pin="2" polarity="Inp" desc="Input Change Notification Input 2"/>
    <connection type="IOPort" name="RB0" feature="IOPort" port="B" pin="0" polarity="I/O" desc="PORTB bidirectional I/O Port Pin 0"/>
  </pin>

  <pin number="20" name="EMUC3/AN1/VREF-/CN3/RB1" initConnection="none">
    <connection type="periph" name="EMUC3" feature="ICD" instance="4" polarity="Inp" desc="ICD Quaternary Comm Channel Clock Input Pin"/>
    <connection type="periph" name="AN1" feature="A2D" instance="1" polarity="Inp" desc="Analog Input 1"/>
    <connection type="other" name="VREF-" polarity="Input" desc="Analog Voltage Ref (Low) Input"/>
    <connection type="CNF" name="CN3" feature="CN" pin="3" polarity="Inp" desc="Input Change Notification Input 3"/>
    <connection type="IOPort" name="RB1" feature="IOPort" port="B" pin="1" polarity="I/O" desc="PORTB bidirectional I/O Port Pin 1"/>
  </pin>

  <pin number="21" name="NC" initConnection="unaccessible"/>

  <pin number="22" name="NC" initConnection="unaccessible"/>

  <!-- This was pin 4 on the SPIDIP. -->
  <pin number="23" name="AN2/SS1/LVDIN/CN4/RB2" initConnection="none">
    <connection type="periph" name="AN2" feature="A2D" instance="2" polarity="Inp" desc="Analog Input 2"/>
    <connection type="periph" name="SS1" feature="SPI" instance="1" polarity="Inp" desc="SPI1 Slave Sync"/>
    <connection type="other" name="LVDIN" feature="Reset" polarity="Input" desc="Analog Low Voltage Detect Ref Volage Input Pin"/>
    <connection type="CNF" name="CN4" feature="CN" pin="4" polarity="Inp" desc="Input Change Notification Input 4"/>
    <connection type="IOPort" name="RB2" feature="IOPort" port="B" pin="2" polarity="I/O" desc="PORTB bidirectional I/O Port Pin 2"/>
  </pin>

  <pin number="24" name="NC" initConnection="unaccessible"/>

  <!-- QFN pins 25-27 are pins 5-7 on the SPDIP. -->
  <pin number="25" name="AN3/CN5/RB3" initConnection="none">
    <connection type="periph" name="AN3" feature="A2D" instance="3" polarity="Inp" desc="Analog Input 3"/>
    <connection type="CNF" name="CN5" feature="CN" pin="5" polarity="Inp" desc="Input Change Notification Input 5"/>
    <connection type="IOPort" name="RB3" feature="IOPort" port="B" pin="3" polarity="I/O" desc="PORTB bidirectional I/O Port Pin 3"/>
  </pin>

  <pin number="26" name="AN4/CN6/RB4" initConnection="none">
    <connection type="periph" name="AN4" feature="A2D" instance="4" polarity="Inp" desc="Analog Input 4"/>
    <connection type="CNF" name="CN6" feature="CN" pin="6" polarity="Inp" desc="Input Change Notification Input 6"/>
    <connection type="IOPort" name="RB4" feature="IOPort" port="B" pin="4" polarity="I/O" desc="PORTB bidirectional I/O Port Pin 4"/>
  </pin>

  <pin number="27" name="AN5/CN7/RB5" initConnection="none">
    <connection type="periph" name="AN5" feature="A2D" instance="5" polarity="Inp" desc="Analog Input 5"/>
    <connection type="CNF" name="CN7" feature="CN" pin="7" polarity="Inp" desc="Input Change Notification Input 7"/>
    <connection type="IOPort" name="RB5" feature="IOPort" port="B" pin="5" polarity="I/O" desc="PORTB bidirectional I/O Port Pin 5"/>
  </pin>

  <pin number="28" name="NC" initConnection="unaccessible"/>

  <pin number="29" name="NC" initConnection="unaccessible"/>

  <!-- This is an extra VSS pin that didn't exst on the SPDIP. -->
  <pin number="30" name="VSS" initConnection="unaccessible">
    <connection type="other" name="VSS" polarity="P" desc="Gnd Ref for Logic and I/O Pins"/>
  </pin>

  <!-- QFN pins 31-37 are pins 8-14 on the SPDIP. -->
  <pin number="31" name="VSS" initConnection="unaccessible">
    <connection type="other" name="VSS" polarity="P" desc="Gnd Ref for Logic and I/O Pins"/>
  </pin>

  <pin number="32" name="OSC1/CLKI" initConnection="none">
    <connection type="other" name="OSC1" polarity="Inp" desc="Oscillator Crystal Input"/>
    <connection type="other" name="CLKI" polarity="Inp" desc="Ext Clock Source Input"/>
  </pin>

  <pin number="33" name="OSC2/CLKO/RC15" initConnection="none">
    <connection type="other" name="OSC2" polarity="I/O" desc="Oscillator Crystal Output"/>
    <connection type="other" name="CLKO" polarity="Inp" desc="Oscillator Crystal Output"/>
    <connection type="IOPort" name="RC15" feature="IOPort" port="C" pin="15" polarity="I/O" desc="PORTC bidirectional I/O Port Pin 15"/>
  </pin>

  <pin number="34" name="EMUD1/SOSCI/T2CK/U1ATX/CN1/RC13" initConnection="none">
    <connection type="periph" name="EMUD1" feature="ICD" instance="2" polarity="I/O" desc="ICD Secondary Comm Channel Data I/O Pin"/>
    <connection type="other" name="SOSCI" polarity="Out" desc="32kHz Low Power Oscillator Crytal Output"/>
    <connection type="periph" name="T2CK" feature="Timer" instance="2" polarity="Inp" desc="Timer 2 exernal clock input"/>
    <connection type="periph" name="U1ATX" feature="UART" instance="1" polarity="Out" desc="UART1 Alternate Transmit Pin"/>
    <connection type="CNF" name="CN1" feature="CN" pin="2" polarity="Inp" desc="Input Change Notification Input 1"/>
    <connection type="IOPort" name="RC13" feature="IOPort" port="C" pin="13" polarity="I/O" desc="PORTC bidirectional I/O Port Pin 13"/>
  </pin>

  <pin number="35" name="EMUC1/SOSCO/T1CK/U1ARX/CN0/RC14" initConnection="none">
    <connection type="periph" name="EMUC1" feature="ICD" instance="2" polarity="Inp" desc="ICD Secondary Comm Channel Clock Input Pin"/>
    <connection type="other" name="SOSCO" polarity="Inp" desc="32kHz Low Power Oscillator Crytal Input"/>
    <connection type="periph" name="T1CK" feature="Timer" instance="1" polarity="Inp" desc="Timer 1 External Clock Input"/>
    <connection type="periph" name="U1ARX" feature="UART" instance="1" polarity="Inp" desc="UART1 Alternate Receive Pin"/>
    <connection type="CNF" name="CN0" feature="CN" pin="1" polarity="Inp" desc="Input Change Notification Input 0"/>
    <connection type="IOPort" name="RC14" feature="IOPort" port="C" pin="14" polarity="I/O" desc="PORTC bidirectional I/O Port Pin 14"/>
  </pin>

  <pin number="36" name="VDD" initConnection="unaccessible">
    <connection type="other" name="VDD" polarity="P" desc="Positive Supply for Logic and I/O Pins"/>
  </pin>

  <pin number="37" name="IC2/INT2/RD9" initConnection="none">
    <connection type="periph" name="IC2" feature="IC" instance="2" polarity="Inp" desc="Capture Input 2"/>
    <connection type="periph" name="INT2" feature="ExtInt" instance="3" polarity="Inp" desc="External Interrupt 2"/>
    <connection type="IOPort" name="RD9" feature="IOPort" port="D" pin="9" polarity="I/O" desc="PORTD bidirectional I/O Port Pin 9"/>
  </pin>

  <pin number="38" name="NC" initConnection="unaccessible"/>

  <pin number="39" name="NC" initConnection="unaccessible"/>

  <pin number="40" name="NC" initConnection="unaccessible"/>

  <pin number="41" name="NC" initConnection="unaccessible"/>

  <!-- QFN pins 42-44 are pins 15-17 on the SPDIP. -->
  <pin number="15" name="EMUC2/IC1/INT1/RD8" initConnection="none">
    <connection type="periph" name="EMUC2" feature="ICD" instance="3" polarity="Inp" desc="ICD Tertiary Comm Channel Clock Input Pin"/>
    <connection type="periph" name="IC1" feature="IC" instance="1" polarity="Inp" desc="Capture Input 1"/>
    <connection type="periph" name="INT1" feature="ExtInt" instance="2" polarity="Inp" desc="External Interrupt 1"/>
    <connection type="IOPort" name="RD8" feature="IOPort" port="D" pin="8" polarity="I/O" desc="PORTD bidirectional I/O Port Pin 8"/>
  </pin>

  <pin number="16" name="SCK1/INT0/RF6" initConnection="none">
    <connection type="periph" name="SCK1" feature="SPI" instance="1" polarity="I/O" desc="SPI1 Sync Serial Clock I/O"/>
    <connection type="periph" name="INT0" feature="ExtInt" instance="1" polarity="Inp" desc="External Interrupt 0"/>
    <connection type="IOPort" name="RF6" feature="IOPort" port="F" pin="6" polarity="I/O" desc="PORTF bidirectional I/O Port Pin 6"/>
  </pin>

  <pin number="17" name="PGD/EMUD/U1TX/SDO1/SCL/RF3" initConnection="none">
    <connection type="other" name="PGD" polarity="I/O" desc="In Ckt Serial Programming Data I/O Pin"/>
    <connection type="periph" name="EMUD" feature="ICD" instance="1" polarity="I/O" desc="ICD Primary Comm Channel Data I/O Pin"/>
    <connection type="periph" name="U1TX" feature="UART" instance="1" polarity="Out" desc="UART1 Transmit"/>
    <connection type="periph" name="SDO1" feature="SPI" instance="1" polarity="I/O" desc="SPI1 Data Out"/>
    <connection type="periph" name="SCL" feature="I2C" polarity="I/O" desc="I2C Sync Serial Clock I/O"/>
    <connection type="IOPort" name="RF3" feature="IOPort" port="F" pin="3" polarity="I/O" desc="PORTF bidirectional I/O Port Pin 3"/>
  </pin>

</pinDefinitions>
