|
| 1 | +# Generic ATsamD11D14AS |
| 2 | + |
| 3 | +``` |
| 4 | +===================================== ATsamD11D14AS =================================== |
| 5 | +Other COM PWM Analog INT Arduino* Arduino* Analog INT PWM COM Other |
| 6 | +========================================================================================= |
| 7 | + 1------------------- |
| 8 | + TCC01 * * 5 | A5 A4 | 4 * * TCC00 REFB |
| 9 | + SS TCC02 * 6 | A6 A3 | 3 * REFA |
| 10 | + MISO TCC03 * * 7 | A7 A2 | 2 * * DAC |
| 11 | +Xin32/Xin 8 | A8 (XIN) Vdd | |
| 12 | +Xout32/Xout 9 | A9 (XOUT) Gnd | |
| 13 | + MOSI/TX2 * NMI 14 | A14 A25 | 25 USB D+ |
| 14 | + SCK/RX2 TC11 * * 15 | A15 A24 | 24 USB D- |
| 15 | + TC10 * 16 | A16 A31 | 31 * TC21 RX1 SWDIO |
| 16 | + SDA * 22 | A22 A30 | 30 TC20 TX1 SWDCLK |
| 17 | + SCL 23 | A23 RST/A28 | 28 BOOT |
| 18 | + ------------------- |
| 19 | +
|
| 20 | +* Most pins can be used for more than one function. When using PIN_MAP_STANDARD, the port |
| 21 | + pin number printed on the chip above is also used in Arduino (but without the 'A') for |
| 22 | + all of the supported functions (ie: digitalRead(), analogRead(), analogWrite(), etc.). |
| 23 | + When using PIN_MAP_COMPACT, the Arduino numbering is sequential starting from 0 at the |
| 24 | + top left pin (A5). PIN_MAP_COMPACT uses less RAM. |
| 25 | +* When USB CDC is enabled, Serial refers to SerialUSB, otherwise it refers to Serial1. |
| 26 | +* Tone available on TC2. |
| 27 | +* Leave pin A30 floating (or use external pullup) during reset. |
| 28 | +* DO NOT connect voltages higher than 3.3V! |
| 29 | +``` |
| 30 | + |
| 31 | + |
| 32 | +## Pins descriptions for Generic ATsamD11D14AS |
| 33 | + |
| 34 | +### PIN_MAP_STANDARD |
| 35 | +``` |
| 36 | +============================================================================================================================================ |
| 37 | +Arduino | Port | Alternate Function | Comments (! means not used with this peripheral assignment) |
| 38 | +--------|-------|-----------------------|------------------------------------------------------------------------------------------- |
| 39 | +0 | ---- | NOT A PIN | NOT A PIN |
| 40 | +1 | ---- | NOT A PIN | NOT A PIN |
| 41 | +2 | PA02 | DAC | EIC/EXTINT[2] ADC/AIN[0] PTC/Y[0] DAC/VOUT |
| 42 | +3 | PA03 | REFA | !EIC/EXTINT[3] REF/ADC/VREFA REF/DAC/VREFA ADC/AIN[1] PTC/Y[1] |
| 43 | +4 | PA04 | REFB / TCC00 | EIC/EXTINT[4] REF/ADC/VREFB ADC/AIN[4] AC/AIN[0] PTC/Y[2] !SERCOM0/PAD[2] !SERCOM0/PAD[0] !TC1/WO[0] TCC0/WO[0] |
| 44 | +5 | PA05 | TCC01 | EIC/EXTINT[5] ADC/AIN[3] AC/AIN[1] PTC/Y[3] !SERCOM0/PAD[3] !SERCOM0/PAD[1] !TC1/WO[1] TCC0/WO[1] |
| 45 | +6 | PA06 | SS (unused) / TCC02 | !EIC/EXTINT[6] ADC/AIN[4] AC/AIN[2] PTC/Y[4] SERCOM0/PAD[0] !SERCOM0/PAD[2] !TC2/WO[0] TCC0/WO[2] |
| 46 | +7 | PA07 | MISO / TCC03 | EIC/EXTINT[7] ADC/AIN[5] AC/AIN[3] PTC/Y[5] SERCOM0/PAD[1] !SERCOM0/PAD[3] !TC2/WO[1] TCC0/WO[3] |
| 47 | +8 | PA08 | Xin32 / Xin | Xin32 |
| 48 | +9 | PA09 | Xout32 / Xout | Xout32 |
| 49 | +10 | ---- | NOT A PIN | NOT A PIN |
| 50 | +11 | ---- | NOT A PIN | NOT A PIN |
| 51 | +12 | ---- | NOT A PIN | NOT A PIN |
| 52 | +13 | ---- | NOT A PIN | NOT A PIN |
| 53 | +14 | PA14 | MOSI / TX2 | EIC/NMI ADC/AIN[6] PTC/X[0] PTC/Y[6] SERCOM0/PAD[0] !SERCOM2/PAD[0] !TC1/WO[0] !TCC0/WO[0] |
| 54 | +15 | PA15 | SCK / RX2 / TC11 | EIC/EXTINT[1] ADC/AIN[7] PTC/X[1] PTC/Y[7] SERCOM0/PAD[1] !SERCOM2/PAD[1] TC1/WO[1] !TCC0/WO[1] |
| 55 | +16 | PA16 | TC10 | EIC/EXTINT[0] PTC/X[4] PTC/Y[10] !SERCOM1/PAD[2] !SERCOM2/PAD[2] TC1/WO[0] !TCC0/WO[6] |
| 56 | +17 | ---- | NOT A PIN | NOT A PIN |
| 57 | +18 | ---- | NOT A PIN | NOT A PIN |
| 58 | +19 | ---- | NOT A PIN | NOT A PIN |
| 59 | +20 | ---- | NOT A PIN | NOT A PIN |
| 60 | +21 | ---- | NOT A PIN | NOT A PIN |
| 61 | +22 | PA22 | SDA | EIC/EXTINT[6] PTC/X[6] PTC/Y[12] !SERCOM1/PAD[0] SERCOM2/PAD[0] !TC1/WO[0] !TCC0/WO[4] |
| 62 | +23 | PA23 | SCL | !EIC/EXTINT[7] PTC/X[7] PTC/Y[13] !SERCOM1/PAD[1] SERCOM2/PAD[1] !TC1/WO[1] !TCC0/WO[5] |
| 63 | +24 | PA24 | USB_NEGATIVE | USB/DM |
| 64 | +25 | PA25 | USB_POSITIVE | USB/DP |
| 65 | +26 | ---- | NOT A PIN | NOT A PIN |
| 66 | +27 | ---- | NOT A PIN | NOT A PIN |
| 67 | +28 | PA28 | Reset | Reset, BOOT (double tap bootloader entry) |
| 68 | +29 | ---- | NOT A PIN | NOT A PIN |
| 69 | +30 | PA30 | TX1 / TC20 / SWD CLK | !EIC/EXTINT[2] !SERCOM1/PAD[0] SERCOM1/PAD[2] TC2/WO[0] !TCC0/WO[2] SWD CLK, leave floating during boot |
| 70 | +31 | PA31 | RX1 / TC21 / SWD IO | EIC/EXTINT[3] !SERCOM1/PAD[1] SERCOM1/PAD[3] TC2/WO[1] !TCC0/WO[3] SWD IO |
| 71 | +============================================================================================================================================ |
| 72 | +``` |
| 73 | + |
| 74 | +### PIN_MAP_COMPACT |
| 75 | +``` |
| 76 | +============================================================================================================================================ |
| 77 | +Arduino | Port | Alternate Function | Comments (! means not used with this peripheral assignment) |
| 78 | +--------|-------|-----------------------|------------------------------------------------------------------------------------------- |
| 79 | +0 | PA02 | DAC | EIC/EXTINT[2] ADC/AIN[0] PTC/Y[0] DAC/VOUT |
| 80 | +1 | PA03 | REFA | !EIC/EXTINT[3] REF/ADC/VREFA REF/DAC/VREFA ADC/AIN[1] PTC/Y[1] |
| 81 | +2 | PA04 | REFB / TCC00 | EIC/EXTINT[4] REF/ADC/VREFB ADC/AIN[4] AC/AIN[0] PTC/Y[2] !SERCOM0/PAD[2] !SERCOM0/PAD[0] !TC1/WO[0] TCC0/WO[0] |
| 82 | +3 | PA05 | TCC01 | EIC/EXTINT[5] ADC/AIN[3] AC/AIN[1] PTC/Y[3] !SERCOM0/PAD[3] !SERCOM0/PAD[1] !TC1/WO[1] TCC0/WO[1] |
| 83 | +4 | PA06 | SS (unused) / TCC02 | !EIC/EXTINT[6] ADC/AIN[4] AC/AIN[2] PTC/Y[4] SERCOM0/PAD[0] !SERCOM0/PAD[2] !TC2/WO[0] TCC0/WO[2] |
| 84 | +5 | PA07 | MISO / TCC03 | EIC/EXTINT[7] ADC/AIN[5] AC/AIN[3] PTC/Y[5] SERCOM0/PAD[1] !SERCOM0/PAD[3] !TC2/WO[1] TCC0/WO[3] |
| 85 | +6 | PA08 | Xin32 / Xin | Xin32 |
| 86 | +7 | PA09 | Xout32 / Xout | Xout32 |
| 87 | +8 | PA14 | MOSI / TX2 | EIC/NMI ADC/AIN[6] PTC/X[0] PTC/Y[6] SERCOM0/PAD[0] !SERCOM2/PAD[0] !TC1/WO[0] !TCC0/WO[0] |
| 88 | +9 | PA15 | SCK / RX2 / TC11 | EIC/EXTINT[1] ADC/AIN[7] PTC/X[1] PTC/Y[7] SERCOM0/PAD[1] !SERCOM2/PAD[1] TC1/WO[1] !TCC0/WO[1] |
| 89 | +10 | PA16 | TC10 | EIC/EXTINT[0] PTC/X[4] PTC/Y[10] !SERCOM1/PAD[2] !SERCOM2/PAD[2] TC1/WO[0] !TCC0/WO[6] |
| 90 | +11 | PA22 | SDA | EIC/EXTINT[6] PTC/X[6] PTC/Y[12] !SERCOM1/PAD[0] SERCOM2/PAD[0] !TC1/WO[0] !TCC0/WO[4] |
| 91 | +12 | PA23 | SCL | !EIC/EXTINT[7] PTC/X[7] PTC/Y[13] !SERCOM1/PAD[1] SERCOM2/PAD[1] !TC1/WO[1] !TCC0/WO[5] |
| 92 | +13 | PA24 | USB_NEGATIVE | USB/DM |
| 93 | +14 | PA25 | USB_POSITIVE | USB/DP |
| 94 | +15 | PA28 | Reset | Reset, BOOT (double tap bootloader entry) |
| 95 | +16 | PA30 | TX1 / TC20 / SWD CLK | !EIC/EXTINT[2] !SERCOM1/PAD[0] SERCOM1/PAD[2] TC2/WO[0] !TCC0/WO[2] SWD CLK, leave floating during boot |
| 96 | +17 | PA31 | RX1 / TC21 / SWD IO | EIC/EXTINT[3] !SERCOM1/PAD[1] SERCOM1/PAD[3] TC2/WO[1] !TCC0/WO[3] SWD IO |
| 97 | +============================================================================================================================================ |
| 98 | +
|
| 99 | +* Most pins can be used for more than one function. When using PIN_MAP_STANDARD, the port |
| 100 | + pin number printed on the chip above is also used in Arduino (but without the 'A') for |
| 101 | + all of the supported functions (ie: digitalRead(), analogRead(), analogWrite(), etc.). |
| 102 | + When using PIN_MAP_COMPACT, the Arduino numbering is sequential starting from 0 at the |
| 103 | + top left pin (A5). PIN_MAP_COMPACT uses less RAM. |
| 104 | +* NOT A PIN means the Arduino pin number is not mapped to a physical pin. |
| 105 | +* Pins 24 and 25 are in use by USB (USB_NEGATIVE and USB_POSITIVE). |
| 106 | +* The tone library uses TC2. |
| 107 | +* Leave pin A30 floating (or use external pullup) during reset. |
| 108 | +``` |
| 109 | + |
| 110 | + |
| 111 | +## Board Configuration Notes |
| 112 | + |
| 113 | +* **Crystals** |
| 114 | + * Either a 32.768KHz crystal or a high speed crystal can be used. |
| 115 | + * The bootloader does not use an external crystal by default. Double-tap the reset button to enter manually. |
| 116 | + |
| 117 | +* **GPIO** |
| 118 | + * All pins (including analog) support INPUT, OUTPUT, INPUT_PULLUP, and INPUT_PULLDOWN. |
| 119 | + * Each pin can source or sink a maximum of 7 mA (when PER_ATTR_DRIVE_STRONG is set for the pin, enabled by default). |
| 120 | + * Internal pull-up and pull-down resistors of 20-60 Kohms (40Kohm typ., disconnected by default). |
| 121 | + |
| 122 | +* **Analog Inputs** |
| 123 | + * 8 pins can be configured as ADC analog inputs. |
| 124 | + * Each pin measures from ground to 3.3 volts by default. |
| 125 | + * Each pin provides 10 bits of resolution (1024 values) by default. |
| 126 | + * 12-bit resolution supported by using the analogReadResolution() function. |
| 127 | + * The upper end of the measurement range can be changed using the analogReference() function. |
| 128 | + * A reference voltage can be connected to REF. |
| 129 | + |
| 130 | +* **DAC** |
| 131 | + * One analog output is available on pin 2. |
| 132 | + * Provides a 10-bit voltage output with the analogWrite() function. |
| 133 | + |
| 134 | +* **PWM** |
| 135 | + * 8 pins can be configured as PWM outputs. |
| 136 | + * Each pin provides 8 bits of resolution (256 values) by default. |
| 137 | + * 12-bit resolution supported by using the analogWriteResolution() function. |
| 138 | + |
| 139 | +* **External Interrupts** |
| 140 | + * 8 pins can be configured with external interrupts. |
| 141 | + |
| 142 | +* **SERCOM** |
| 143 | + * 3 SERCOM are available. |
| 144 | + * Up to 2 UART instances |
| 145 | + * 1 SPI instance |
| 146 | + * 1 WIRE (I2C) instance |
| 147 | + |
| 148 | + |
| 149 | + |
| 150 | +## PinDescription table format |
| 151 | + |
| 152 | +### Note that a new column (GCLKCCL) was added for 1.6.8-beta-b0. |
| 153 | +MATTAIRTECH_ARDUINO_SAMD_VARIANT_COMPLIANCE in variant.h is used to track versions. |
| 154 | +If using board variant files with the old format, the new core will still read the |
| 155 | +table the old way, losing any new features introduced by the new column. Additionally, |
| 156 | +new definitions have been added for L21 and C21 support. |
| 157 | + |
| 158 | +### Each pin can have multiple functions. |
| 159 | +The PinDescription table describes how each of the pins can be used by the Arduino |
| 160 | +core. Each pin can have multiple functions (ie: ADC input, digital output, PWM, |
| 161 | +communications, etc.), and the PinDescription table configures which functions can |
| 162 | +be used for each pin. This table is mainly accessed by the pinPeripheral function in |
| 163 | +wiring_private.c, which is used to attach a pin to a particular peripheral function. |
| 164 | +The communications drivers (ie: SPI, I2C, and UART), analogRead(), analogWrite(), |
| 165 | +analogReference(), attachInterrupt(), and pinMode() all call pinPeripheral() to |
| 166 | +verify that the pin can perform the function requested, and to configure the pin for |
| 167 | +that function. Most of the contents of pinMode() are now in pinPeripheral(). |
| 168 | + |
| 169 | +### Pin Mapping |
| 170 | +There are different ways that pins can be mapped. Typically, there is no relation |
| 171 | +between the arduino pin number used, and the actual port pin designator. Thus, the |
| 172 | +pcb must be printed with the arduino numbering, otherwise, if the port pin is printed, |
| 173 | +a cross reference table is needed to find the arduino pin number. However, this results |
| 174 | +in the least amount of space used by the table. Another method, used by default by the |
| 175 | +MT-D21E and MT-D11, maps Arduino pin numbers to the actual port pin number (ie: Arduino |
| 176 | +pin 28 = Port A28). This works well when there is only one port (or if the PORTB pins |
| 177 | +are used for onboard functions and not broken out). PIO_NOT_A_PIN entries must be added |
| 178 | +for pins that are used for other purposes or for pins that do not exist (especially the |
| 179 | +D11), so some FLASH space may be wasted. For an example of both types, see variant.cpp |
| 180 | +from the MT-D11 variant. The MT-D21J combines both methods, using the actual port pin |
| 181 | +designators from both PORTA and PORTB for arduino numbers 0-31 (ie: B1=1, A2=2), then |
| 182 | +using arduino numbering only above 31. For 0-31 only one pin from PORTA or PORTB can be |
| 183 | +used, leaving the other pin for some number above 31. |
| 184 | + |
| 185 | +**See [WVariant.h](https://github.com/mattairtech/ArduinoCore-samd/tree/master/cores/arduino/WVariant.h) for the definitions used in the table.** |
| 186 | + |
| 187 | +### Port |
| 188 | +This is the port (ie: PORTA). |
| 189 | + |
| 190 | +### Pin |
| 191 | +This is the pin (bit) within the port. Valid values are 0-31. |
| 192 | + |
| 193 | +### PinType |
| 194 | +This indicates what peripheral function the pin can be attached to. In most cases, |
| 195 | +this is PIO_MULTI, which means that the pin can be anything listed in the PinAttribute |
| 196 | +field. It can also be set to a specific peripheral. In this case, any attempt to |
| 197 | +configure the pin (using pinPeripheral or pinMode) as anything else will fail (and |
| 198 | +pinPeripheral will return -1). This can be used to prevent accidental re-configuration |
| 199 | +of a pin that is configured for only one function (ie: USB D- and D+ pins). If a pin |
| 200 | +is not used or does not exist, PIO_NOT_A_PIN must be entered in this field. See |
| 201 | +WVariant.h for valid entries. These entries are also used as a parameter to |
| 202 | +pinPeripheral() with the exception of PIO_NOT_A_PIN and PIO_MULTI. The pinMode function |
| 203 | +now calls pinPeripheral() with the desired mode. Note that this field is not used to |
| 204 | +select between the two peripherals possible with each of the SERCOM and TIMER functions. |
| 205 | +PeripheralAttribute is now used for this. |
| 206 | + |
| 207 | +### PeripheralAttribute: |
| 208 | +This is an 8-bit bitfield used for various peripheral configuration. It is primarily |
| 209 | +used to select between the two peripherals possible with each of the SERCOM and TIMER |
| 210 | +functions. TIMER pins are individual, while SERCOM uses a group of two to four pins. |
| 211 | +This group of pins can span both peripherals. For example, pin 19 (SPI1 SCK) on the |
| 212 | +MT-D21E uses PER_ATTR_SERCOM_ALT while pin 22 (SPI1 MISO) uses PER_ATTR_SERCOM_STD. |
| 213 | +Both TIMER and SERCOM can exist for each pin. This bitfield is also used to set the |
| 214 | +pin drive strength. In the future, other attributes (like input buffer configuration) |
| 215 | +may be added. Starting with 1.6.8, the ADC instance on the C21 (there are two) is also |
| 216 | +selected here. See WVariant.h for valid entries. |
| 217 | + |
| 218 | +### PinAttribute |
| 219 | +This is a 32-bit bitfield used to list all of the valid peripheral functions that a |
| 220 | +pin can attach to. This includes GPIO functions like PIN_ATTR_OUTPUT. Certain |
| 221 | +attributes are shorthand for a combination of other attributes. PIN_ATTR_DIGITAL |
| 222 | +includes all of the GPIO functions, while PIN_ATTR_TIMER includes both |
| 223 | +PIN_ATTR_TIMER_PWM and PIN_ATTR_TIMER_CAPTURE (capture is not used yet). |
| 224 | +PIN_ATTR_ANALOG is an alias to PIN_ATTR_ANALOG_ADC. This bitfield is useful for |
| 225 | +limiting a pin to only input related functions or output functions. This allows a pin |
| 226 | +to have a more flexible configuration, while restricting the direction (ie: to avoid |
| 227 | +contention). See WVariant.h for valid entries. |
| 228 | + |
| 229 | +### TCChannel |
| 230 | +This is the TC/TCC channel (if any) assigned to the pin. Some TC channels are available |
| 231 | +on multiple pins. In general, only one pin should be configured in the pinDescription |
| 232 | +table per TC channel. Starting with 1.6.8, the timer type is now encoded in this column |
| 233 | +to support the L21 and C21, which use TC numbers starting at 0 (rather than 3 as on the |
| 234 | +D21). See WVariant.h for valid entries. |
| 235 | + |
| 236 | +### ADCChannelNumber |
| 237 | +This is the ADC channel (if any) assigned to the pin. The C21 has two ADC instances, |
| 238 | +which is selected in the PeripheralAttribute column. See WVariant.h for valid entries. |
| 239 | + |
| 240 | +### ExtInt |
| 241 | +This is the interrupt (if any) assigned to the pin. Some interrupt numbers are |
| 242 | +available on multiple pins. In general, only one pin should be configured in the |
| 243 | +pinDescription table per interrupt number. Thus, for example, if an interrupt was |
| 244 | +needed on pin 2, EXTERNAL_INT_2 can be moved from pin 18. See WVariant.h for valid |
| 245 | +entries. |
| 246 | + |
| 247 | +### GCLKCCL |
| 248 | +This column was added in 1.6.8-beta-b0. It is not yet used. It will eventually support |
| 249 | +the Analog Comparators (AC), the Configurable Custom Logic (CCL) units of the L21 and |
| 250 | +C21, and the GCLK outputs (inputs). |
0 commit comments