The MattairTech SAM D|L|C Core for Arduino is a fork from arduino/ArduinoCore-samd on GitHub, which will be used to maintain Arduino support for MattairTech boards (see https://www.mattairtech.com/) as well as for "Generic" boards.
SAMD51 support starting with 1.6.18-beta-b0
This core is intended to be installed using Boards Manager (see below). To update from a previous version, click on MattairTech SAM D|L|C Boards in Boards Manager, then click Update.
New Version Numbering The MattairTech version number will now track with the Arduino version number, to better understand which upstream changes have been merged in. See the CHANGELOG for details on upstream commits and MattairTech additions that have been merged.
The latest updates are in the Beta version (if available). See below.
1.6.17 (February 22, 2018):
Beta builds are now included in the main json. See Beta Builds section.
1.6.18-beta-b1 (June 26, 2018):
1.6.18-beta-b0 (February 22, 2018):
1.6.17-beta-b0: Beta version 1.6.17-beta-b0 became release version 1.6.17. See above
1.6.16-beta-b0:
Feature | 51P (128 pin) | 51N (100 pin) | 51J (64 pin) | 51G (48 pin) |
---|---|---|---|---|
Board Variants | Generic 51P | Generic 51N | MattairTech Xeno, Generic 51J | Xeno Mini, Generic 51G |
Processor | 120 MHz 32-bit ARM Cortex M4F | 120 MHz 32-bit ARM Cortex M4F | 120 MHz 32-bit ARM Cortex M4F | 120 MHz 32-bit ARM Cortex M4F |
Processor Features | FPU, DSP, MPU | FPU, DSP, MPU | FPU, DSP, MPU | FPU, DSP, MPU |
Flash Memory | Up to 1MB with RWW support and cache | Up to 1MB with RWW support and cache | Up to 1MB with RWW support and cache | Up to 512KB with RWW support and cache |
SRAM | Up to 256KB (8KB backup SRAM), ECC | Up to 256KB (8KB backup SRAM), ECC | Up to 256KB (8KB backup SRAM), ECC | Up to 192KB (8KB backup SRAM), ECC |
Digital Pins | 99 | 81 | 51 | 37 |
Analog Inputs | 2 ADCs, 16/16 channels, 12-bit, 1MSPS | 2 ADCs, 16/12 channels, 12-bit, 1MSPS | 2 ADCs, 16/8 channels, 12-bit, 1MSPS | 2 ADCs, 16/4 channels, 12-bit, 1MSPS |
Analog Outputs | Two 12-bit, 1MSPS | Two 12-bit, 1MSPS | Two 12-bit, 1MSPS | Two 12-bit, 1MSPS |
PWM Outputs | 17 TCC channels, 16 TC channels | 17 TCC channels, 16 TC channels | 17 TCC channels, 12 TC channels | 13 TCC channels, 8 TC channels |
Interrupts | 16 | 16 | 16 | 16 |
USB | Full Speed Device and Host | Full Speed Device and Host | Full Speed Device and Host (not C21) | Full Speed Device and Host |
SERCOM | 8 (UART/SPI/I2C) | 8 (UART/SPI/I2C) | 6 (UART/SPI/I2C) | 6 (UART/SPI/I2C) |
QSPI / SDHC | 1 QSPI / 2 SDHC | 1 QSPI / 2 SDHC | 1 QSPI / 1 SDHC | 1 QSPI / 1 SDHC |
I2S | One RX, one TX, two clocks | One RX, one TX, two clocks | One RX, one TX, two clocks | One RX, one TX, two clocks |
Voltage | 1.71V - 3.63V | 1.71V - 3.63V | 1.71V - 3.63V | 1.71V - 3.63V |
I/O Pin Current | 8mA sink/source @ 3.3V | 8mA sink/source @ 3.3V | 8mA sink/source @ 3.3V | 8mA sink/source @ 3.3V |
Feature | 21J (64 pin) | 21G (48 pin) | 21E (32 pin) | D11 (24, 20, or 14 pin) |
---|---|---|---|---|
Board Variants | MattairTech Xeno, Generic 21J | Xeno Mini, Arduino Zero, Generic 21G | MT-D21E, Generic 21E | MT-D11, Generic D11D14AM, Generic D11D14AS, Generic D11C14A |
Processor | 48 MHz 32-bit ARM Cortex M0+ | 48 MHz 32-bit ARM Cortex M0+ | 48 MHz 32-bit ARM Cortex M0+ | 48 MHz 32-bit ARM Cortex M0+ |
Flash Memory | Up to 256KB (L21/C21 have RWW) | Up to 256KB (L21/C21 have RWW) | Up to 256KB (L21/C21 have RWW) | 16 KB (4KB used by bootloader) |
SRAM | Up to 32KB (plus <=8KB LPSRAM on L21) | Up to 32KB (plus <=8KB LPSRAM on L21) | Up to 32KB (plus <=8KB LPSRAM on L21) | 4 KB |
Digital Pins | 52 (51 for L21) | 38 (37 for L21) | 26 (25 for L21) | 24-pin: 21, 20-pin: 17, 14-pin: 11 |
Analog Inputs | 18 channels, 12-bit | 14 channels, 12-bit | 10 channels, 12-bit | 24-pin: 10, 20-pin: 8, 14-pin: 5 (12-bit) |
Analog Outputs | One 10-bit (two 12-bit on L21) | One 10-bit (two 12-bit on L21) | One 10-bit (two 12-bit on L21) | One 10-bit |
PWM Outputs | 18 | 14 | 14 | 8 (6 for 14-pin) |
Interrupts | 16 | 16 | 16 | 8 (7 for 14-pin) |
USB | Full Speed Device and Host (not C21) | Full Speed Device and Host (not C21) | Full Speed Device and Host (not C21) | Full Speed Device |
SERCOM* | 6 | 6 | 4 (6 for L21) | 3 (2 for 14-pin) |
UART (Serial)* | Up to 3 (will add more later) | Up to 6 | Up to 4 (up to 6 for L21) | Up to 2 |
SPI* | Up to 2 (will add more later) | Up to 2 | Up to 2 | Up to 1 |
I2C (WIRE)* | Up to 2 (will add more later) | Up to 2 | Up to 2 | Up to 1 |
I2S | Present on the D21 only | Present on the D21 only | Present on the D21 only | Not present |
Voltage | 1.62V-3.63V (2.7V-5.5V for the C21) | 1.62V-3.63V (2.7V-5.5V for the C21) | 1.62V-3.63V (2.7V-5.5V for the C21) | 1.62V-3.63V |
I/O Pin Current | D21: 7mA, L21: 5mA, C21: 6mA@5V | D21: 7mA, L21: 5mA, C21: 6mA@5V | D21: 7mA, L21: 5mA, C21: 6mA@5V | 7 mA |
Note that the maximum number of UART/SPI/I2C is the number of SERCOM. The number listed above for UART/SPI/I2C indicated how many are currently configurable through the Arduino IDE menu.
Pin configuration and peripheral assignment information is now in the README.md for each board variant. README.md also now includes technical information on the new PinDescription table format.
MattairTech Generic D11D14AM (24-pin 0.5mm QFN) (future)
MattairTech Generic x21E (SAM D21/L21/C21, 32-pin) (soon)
MattairTech Generic xx1G (SAM D51/D21/L21/C21, 48-pin) (future)
MattairTech Generic xx1J (SAM D51/D21/L21/C21, 64-pin) (future)
MattairTech Generic D51N (SAMD51, 100-pin) (future)
MattairTech Generic D51P (SAMD51, 128-pin) (future)
Depending on the board variant, different menu options will appear in the Tools menu.
This menu will appear with boards that have multiple microcontroller options.
There are up to four clock source choices, depending on board variant and microcontroller. They are:
See Clock Source section for more information.
With the D51, D21, L21, and C21, the bootloader size can be configured as:
With the D11, the bootloader size can be configured as:
Choose NO_BOOTLOADER if not using a bootloader (an external programmer will be used for sketch upload).
This menu is used to select different combinations of serial peripherals. It adds additional UART, SPI, and WIRE instances. This is also useful for the D11, which has a reduced pin count and number of SERCOMs. It can also be used to reduce FLASH and SRAM usage by selecting fewer UART peripherals, which are instantiated in the core, rather than only when including a library (like SPI and WIRE). Note that with options where there is more than one SPI or WIRE, the additional instances will consume a small amount of RAM, but neither the peripheral nor the pins are configured until begin() method is called (thus, the pins can be used for other purposes).
Use the ASCII art rendering at the top of the README.md file of the board variant used in order to determine the mapping of instances to pins. When USB CDC is enabled, Serial refers to SerialUSB, otherwise it refers to Serial1 (TX1/RX1).
This menu will appear with all microcontrollers except the C21, which does not have USB. The options are:
Choose an option that best matches your code and library usage. Each option results in a different USB PID. Choose an option with CDC if you want auto-reset to function, or the serial monitor over USB. If CDC is not enabled, Serial will refer to Serial1 instead of SerialUSB. These options can be used to optimize FLASH and SRAM usage by allowing CDC to be disabled (or USB completely disabled).
This menu will appear with all microcontrollers. It allows selection of the PWM frequency used by all timers. When using a timer in 16-bit mode, calls to analogWrite() are made with 8-bit resolution by default. For 16-bit writes, call analogWriteResolution(16) first. Because of the faster timer clock used with the D51, the 1465Hz setting is 16-bit. Older cores used the 187500Hz (8-bit) setting, which is now available in the menu. Note that some motor controllers can be inefficient or overheat with higher PWM frequencies, however, using a higher frequency can quiet down noisy ceramic capacitors or reduce flicker with LED lighting applications. The menu options are:
By default, when using the Print or String classes to print or convert floating point numbers to character arrays, singles are automatically promoted to doubles. This consumes a lot of code space. Use the options in this menu to make use of single floating point versions of Print and String, which will reduce code space, increase performance, and also allow the D51 to make use of the hardware FPU (in the case of Print). See Floating Point Notes.
This menu will appear with all microcontrollers. It is currently used to enable or disable including config.h, which contains several defines that are used primarily to reduce code space. config.h should be edited first. Please see config.h for documentation on the defines. The menu options are:
There are up to four clock source choices, depending on board features and microcontroller. Since currently the cpu runs at 48MHz (or 120MHz with the D51), the PLL or DFLL must be used (the SAMC can use OSC48M).
Source | Frequency Range | Supply Current (max.) | Startup Time typ. (max.) | Notes, jitter, accuracy, other differences |
---|---|---|---|---|
XOSC | 0.4MHz-32MHz crystal | 307uA (552uA) AGC on | 5K-14K cycles (10K-48K) | up to 32MHz digital clock input, Supply current based on 16MHz crystal |
XOSC32K | 32.768KHz typical crystal | 1.22uA (2.19uA) | 28K cycles (30K) | 32.768KHz typical digital clock input |
OSC32K | 32.27-33.26KHz (28.50-34.74KHz) | 0.67uA (1.32uA) | 1 cycle (2 cycles) | |
OSCULP32K | 31.29-34.57KHz (25.55-38.01KHz) | 0.125uA max. | 10 cycles | |
OSC8M | 7.94-8.06MHz (7.80-8.16MHz) | 64uA | 2.1us (3us) | |
FDPLL96M | 32KHz-2MHz in, 48MHz-96MHz out | 500uA (700uA) | Lock: 25us (50us) @ 2MHz in | 1.5% (2%) period jitter (32KHz in, 48MHz out), Lock: 1.3ms (2ms) @ 32KHz in |
DFLL48M open | 47MHz-49MHz out | 403uA (453uA) | 8us (9us) | |
DFLL48M closed | 0.73-33KHz in, 47.96-47.98MHz out | 425uA (482uA) | Lock: 200us (500us) | 0.42ns max. jitter |
Source | Frequency Range | Supply Current (max.) | Startup Time typ. (max.) | Notes, jitter, accuracy, other differences |
---|---|---|---|---|
XOSC (x2) | 8MHz-48MHz crystal | 250uA (810uA) ENALC on | 37K cycles (62K) | Up to 48MHz digital clock input, supply current based on 16MHz crystal |
XOSC32K | 32.768KHz crystal | 1.9uA (3uA) | 9K cycles (23K) | Use high gain setting |
OSCULP32K | 32.10-33.42KHz | Not Specified. | Not Specified | 27.12-37.68KHz across temperature |
FDPLL200M (x2) | 32KHz-3.2MHz in, 96MHz-200MHz out | 0.9mA (1.3mA) @ 96MHz | Lock: 54us (95us) @ 3.2MHz in | 1.9% (2.7%) period jitter (32KHz in, 96MHz out), Datasheet lock time in ms. |
DFLL48M open | 47.2MHz-48.8MHz | 400uA (850uA) | 4.3us (7us) | 45.8MHz-49.3MHz across temperature |
DFLL48M closed | 47.972MHz typical | 400uA (850uA) | Lock: 429us (1145us) | 0.42ns max. jitter, 0.73-33KHz input |
Source | Frequency Range | Supply Current (max.) | Startup Time typ. (max.) | Notes, jitter, accuracy, other differences |
---|---|---|---|---|
XOSC | 0.4MHz-32MHz crystal | 293uA (393uA) AGC on | 5K-14K cycles (10K-48K) | up to 24MHz digital clock input, Supply current based on 16MHz crystal |
XOSC32K | 32.768KHz typical crystal | 0.311uA (2.19uA) | 25K cycles (82K) | 32.768KHz typical digital clock input (1MHz max.) |
OSC32K | 32.57-33.05KHz (28.58-34.72KHz) | 0.54uA (1.10uA) | 1 cycle (2 cycles) | |
OSCULP32K | 31.77-34.03KHz (26.29-38.39KHz) | Not Specified. | Not Specified | |
OSC16M | 15.75-16.24MHz | 141uA (169uA) | 1.4us (3.1us) | Wake up time: 0.12us (0.25us) |
FDPLL96M | 32KHz-2MHz in, 48MHz-96MHz out | 454uA (548uA) | Lock: 25us (35us) @ 2MHz in | 1.9% (4%) period jitter (32KHz in, 48MHz out), Lock: 1ms (2ms) @ 32KHz in |
DFLL48M open | 46.6MHz-49MHz out | 286uA | 8.3us (9.1us) | |
DFLL48M closed | 0.73-33KHz in, 47.96-47.98MHz out | 362uA | Lock: 200us (700us) | 0.51ns max. jitter |
Source | Frequency Range | Supply Current (max.) | Startup Time typ. (max.) | Notes, jitter, accuracy, other differences |
---|---|---|---|---|
XOSC | 0.4MHz-32MHz crystal | 429uA (699uA) AGC on | 6K-12K cycles (20K-48K) | up to 48MHz digital clock input, Supply current based on 16MHz crystal |
XOSC32K | 32.768KHz typical crystal | 1.53uA (2.84uA) | 16K cycles (24K) | 32.768KHz typical digital clock input |
OSC32K | 32.11-33.43KHz (25.55-37.36KHz) | 0.864uA (1.08uA) | 1 cycle (2 cycles) | |
OSCULP32K | 30.96-34.57KHz (22.93-38.99KHz) | Not Specified. | Not Specified | |
OSC48M | 47.04-48.96MHz | 87uA (174uA) | 22.5us (25.5us) | |
FDPLL96M | 32KHz-2MHz in, 48MHz-96MHz out | 536uA (612uA) | Not Yet Specified |
The PLL will be used with the 32.768KHz crystal. PLL_FRACTIONAL_ENABLED can be defined, which will result in a more accurate 48MHz output frequency at the expense of increased jitter.
HS_CRYSTAL_FREQUENCY_HERTZ must be defined with the external crystal frequency in Hertz. The crystal frequency must be between 400000Hz and 32000000Hz (800000Hz and 48000000Hz with the D51). The PLL will be used. PLL_FRACTIONAL_ENABLED can be defined, which will result in a more accurate 48MHz output frequency at the expense of increased jitter. If PLL_FAST_STARTUP is defined, the crystal will be divided down to 1MHz - 2MHz, rather than 32KHz - 64KHz, before being multiplied by the PLL. This will result in a faster lock time for the PLL, however, it will also result in a less accurate PLL output frequency if the crystal is not divisible (without remainder) by 1MHz. In this case, define PLL_FRACTIONAL_ENABLED as well. By default, PLL_FAST_STARTUP is disabled. PLL_FAST_STARTUP is also useful for USB host mode applications. See datasheet USB electrical characteristics. The crystal frequency must be at least 1000000Hz when PLL_FAST_STARTUP is defined.
The DFLL will be used in open-loop mode, except with the C21 which lacks a DFLL, so the internal 48MHz RC oscillator is used instead. NVM_SW_CALIB_DFLL48M_FINE_VAL is the fine calibration value for DFLL open-loop mode. The coarse calibration value is loaded from NVM OTP (factory calibration values).
This is available for the D51, D21, D11, or L21. It will also use the DFLL in open-loop mode, except when connected to a USB port with data lines (and not suspended), then it will calibrate against the USB SOF signal. NVM_SW_CALIB_DFLL48M_FINE_VAL is the fine calibration value for DFLL open-loop mode. The coarse calibration value is loaded from NVM OTP (factory calibration values).
The D51 has 12 generators and all others have 9 generators. Unused generators are automatically stopped to reduce power consumption.
Warning : The maximum IO voltage is Vcc (up to 3.6 volts for the D51/D21/D11/L21, 5V for the C21)
D21 / D11 | Volts | D51 | Volts | L21 | Volts | C21 | Volts |
---|---|---|---|---|---|---|---|
AR_DEFAULT | 1/2 VCC* | AR_DEFAULT | VCC | AR_DEFAULT | VCC | AR_DEFAULT | VCC |
AR_INTERNAL1V0 | 1.00V | AR_INTREF | 1.00V | AR_INTREF | 1.00V | AR_INTREF | 1.024V |
AR_INTERNAL_INTVCC0 | 1/1.48 VCC | AR_INTREF_1V0 | 1.00V | AR_INTREF_1V0 | 1.00V | AR_INTREF_1V024 | 1.024V |
AR_INTERNAL_INTVCC1 | 1/2 VCC | AR_INTREF_1V1 | 1.10V | AR_INTREF_1V1 | 1.10V | AR_INTREF_2V048 | 2.048V |
AR_EXTERNAL_REFA | REFA | AR_INTREF_1V2 | 1.20V | AR_INTREF_1V2 | 1.20V | AR_INTREF_4V096 | 4.096V |
AR_EXTERNAL_REFB | REFB | AR_INTREF_1V25 | 1.25V | AR_INTREF_1V25 | 1.25V | AR_INTERNAL1V0 | 1.024V |
--- | AR_INTREF_2V0 | 2.00V | AR_INTREF_2V0 | 2.00V | AR_INTERNAL_INTVCC0 | 1/1.6 VCC | |
--- | AR_INTREF_2V2 | 2.20V | AR_INTREF_2V2 | 2.20V | AR_INTERNAL_INTVCC1 | 1/2 VCC | |
--- | AR_INTREF_2V4 | 2.40V | AR_INTREF_2V4 | 2.40V | AR_INTERNAL_INTVCC2 | VCC | |
--- | AR_INTREF_2V5 | 2.50V | AR_INTREF_2V5 | 2.50V | AR_EXTERNAL_REFA | REFA | |
--- | AR_INTERNAL1V0 | 1.00V | AR_INTERNAL1V0 | 1.00V | AR_EXTERNAL_DAC | DAC | |
--- | AR_INTERNAL_INTVCC1 | 1/2 VCC | AR_INTERNAL_INTVCC0 | 1/1.6 VCC | |||
--- | AR_INTERNAL_INTVCC2 | VCC | AR_INTERNAL_INTVCC1 | 1/2 VCC | |||
--- | AR_EXTERNAL_REFA | REFA | AR_INTERNAL_INTVCC2 | VCC | |||
--- | AR_EXTERNAL_REFB | REFB | AR_EXTERNAL_REFA | REFA | |||
--- | AR_EXTERNAL_REFC | REFC | AR_EXTERNAL_REFB | REFB |
Note that with the D51, INTVCC1 and INTVCC2 as used in Arduino are actually INTVCC0 and INTVCC1 in the datasheet. AR_DEFAULT uses 1/2X gain on each input and a Vcc/2 (1.65V) reference supporting measurements up to Vcc.
Configuration and MCU | TEST_SINGLE_PRINT | TEST_DOUBLE_PRINT | TEST_SINGLE_STRING | TEST_DOUBLE_STRING |
---|---|---|---|---|
FLOAT_BOTH_DOUBLES_ONLY - D21 | 9504 | 8144 | 16848 | 16688 |
FLOAT_BOTH_SINGLES_DOUBLES - D21 | 4176 | 8144 | 4016 | 16688 |
FLOAT_BOTH_DOUBLES_ONLY - D51 | 2968 | 2952 | 11144 | 11152 |
FLOAT_BOTH_SINGLES_DOUBLES - D51 | 544 | 2952 | 3264 | 11152 |
Values indicate additional size of option in bytes. The base test sketch was 864 bytes larger with the D51 when no floating point was used.
TODO: Disable usb, disable serial, enable config.h, use PIN_DESCRIPTION_TABLE_SIMPLE and PIN_MAP_COMPACT with the D11, don't use double precision (see above), use no bootloader Most of this can be done from the Tools menu, and by editing config.h.
TODO: This is old. Update this, maybe just for D11.
Sketch and Configuration | MT-D21E (Flash + RAM) | MT-D11 (Flash + RAM) |
---|---|---|
Blink (CDC + HID + UART) | 7564 + 1524 | 7452 + 1424 |
Blink (CDC + UART) | 6588 + 1496 | 6484 + 1396 |
Blink (CDC Only) | 5248 + 1304 | 5192 + 1300 |
Blink (UART Only) | 3828 + 336 | 3716 + 236 |
Blink (No USB or UART) | 2472 + 144 | 2416 + 140 |
Datalogger (No USB or UART) | 10340 + 948 | 10260 + 944 |
The flash used message at the end of compilation is not correct. The number shown represents the .text segment only. However, Flash usage = .text + .data segments (RAM usage = .data + .bss segments). In this release, two programs are run at the end of compilation to provide more detailed memory usage. To enable this output, go to File->Preferences and beside "Show verbose output during:", check "compilation".
Just above the normal flash usage message, is the output from the size utility. However, this output is also incorrect, as it shows .text+.data in the .text field, but 0 in the .data field. However, the .text field does show the total flash used. The .data field can be determined by subtracting the value from the normal flash usage message (.text) from the value in the .text field (.text+.data). The .bss field is correct.
Above the size utility output is the output from the nm utility. The values on the left are in bytes. The letters stand for: T(t)=.text, D(d)=.data, B(b)=.bss, and everything else (ie: W) resides in flash (in most cases).
To print to the Serial Monitor over USB, use 'Serial'. Serial refers to SerialUSB (Serial1 and Serial2 are UARTs). Unlike most Arduino boards (ie. Uno), SAMD boards do not automatically reset when the serial monitor is opened. To see what your sketch outputs to the serial monitor from the beginning, the sketch must wait for the SerialUSB port to open first. Add the following to setup():
while (!Serial) ;
Remember that if the sketch needs to run without SerialUSB connected, another approach must be used. You can also reset the board manually with the Reset button if you wish to restart your sketch. However, pressing the Reset button will reset the chip, which in turn will reset USB communication. This interruption means that if the serial monitor is open, it will be necessary to close and re-open it to restart communication.
When USB CDC is not enabled, Serial will instead refer to Serial1, which is the first UART.
Prior to core version 1.6.6-mt1, sketches compiled with both CDC and HID USB code by default, thus requiring a CDC driver for the bootloader and a CDC-HID driver for sketches. Now that PluggableUSB is supported, sketches compile with only CDC code by default. Thus, only one driver is needed. Since HID and MIDI are currently supported (and MSD potentially in the future), driver installation will be required for each different combination of USB devices. There are currently four USB composite device combinations that include CDC as well as a CDC only device. Each supported combination has a unique USB VID:PID pair, and these are listed in the .inf file. Once the first device is installed (the CDC only device), future installations might be automatic, otherwise, you may direct the installer to the same .inf file. The drivers are signed and support both 32 and 64 bit versions of Windows XP(SP3), Vista, 7, 8, and 10. Note that the Windows 10 generic CDC drivers work as well.
OS X support was added in version 1.6.7-beta-b0.
See Beta Builds section below to install the beta, as it uses a different json file
Currently, with MattairTech boards, USB PIDs are shared across boards (but they are different based on Tools->USB Config). This will result in Tools->Port showing "MattairTech Xeno Mini", for example, for all MattairTech boards.
Periodically, a beta is released for testing.
The beta builds are available through Boards Manager. If you want to install them:
https://www.mattairtech.com/software/arduino/beta/package_MattairTech_index.json
in the Additional Boards Manager URLs field, and click OK.The Arduino IDE will notify the user if an update to the beta is available, which can then be installed automatically.
If a particular beta is needed, just choose the version from the list. Alternatively, replace the url in step 2 with:
https://www.mattairtech.com/software/arduino/beta/package_MattairTech_SAM_DLC_Core_for_Arduino-${VERSION}-beta-b${BUILD_NUMBER}_index.json
or
https://www.mattairtech.com/software/arduino/beta/package_MattairTech_sam_m0p-${VERSION}-beta-b${BUILD_NUMBER}_index.json
(versions prior to 1.6.17-beta-b1)
where ${VERSION} and ${BUILD_NUMBER} match the beta name as shown in the CHANGELOG (ie: package_MattairTech_sam_m0p-1.6.7-beta-b0_index.json).
In this case, the IDE will not notify the user of updates, so this method is not recommended.
This bootloader is based on the Arduino Zero bootloader which is a part of the Arduino SAMD core. It provides a USB-CDC and/or TTL serial communications interface to a host running the bossac command line firmware programming utility (or the Arduino IDE) running on Windows, Linux, or OS X. Optionally, SD Card firmware loading is supported, using SDSC or SDHC cards with a FAT16 or FAT32 filesystem. This version adds support for the D51, L21, C21, and D11 microcontrollers. It also adds support for four different clock sources (two external crystals and two internal oscillator options). There are additional board definitions added, and binaries for most board/chip combinations are pre-built.
See bootloaders/zero/README.md for more technical information on the bootloader.
The bootloader can be started by:
Otherwise, it jumps to application and starts execution from there. The LED will PWM fade during bootloader execution.
Bossac is a command line utility for uploading firmware to SAM-BA bootloaders. It runs on Windows. Linux, and OS X. It is used by Arduino to upload firmware to SAM and SAMD boards. The version described here adds to the Arduino version (https://github.com/shumatech/BOSSA, Arduino branch), which in turn is a fork from the original Bossa (http://www.shumatech.com/web/products/bossa). It adds support for more SAM chips (D51, D21, L21, C21, and D11), support for four clock sources, and firmware loading from a MicroSD card.
If you are installing the bootloader because you think you deleted/corrupted it by uploading a bad sketch in Arduino, check first by entering the bootloader manually (double-press reset) as it is probably just a broken sketch.
A running sketch may interfere with the bootloader installation process. Be sure you are running the existing bootloader or using a blank chip.
See bootloaders/zero/README.md for information.
The bootloaders/zero/binaries directory contains the SAM-BA bootloaders built by the build_all_bootloaders.sh script from the 'MattairTech SAM D|L|C Core for Arduino' Arduino core, which is available at https://github.com/mattairtech/ArduinoCore-samd. Each board and chip combination has two bootloaders available:
SAM-BA interface only
SAM-BA interface and SD Card interface
See bootloaders/zero/README.md for information on using Bossac standalone.
Technical information on the new PinDescription table format is now in the README.md that accompanies each board variant. See board variants above.
The standard PinDescription table uses 12 bytes per pin. Define PIN_DESCRIPTION_TABLE_SIMPLE to use a more compact format that uses only 4 bytes per pin (currently only available for the D11 chips). In this case, the PinType, PinAttribute, and GCLKCCL columns are not used (they are not required). Additionally, the SetPortPin() and SetExtIntADC() macros are used to pack Port and Pin into the PortPin column, and ExtInt and ADCChannelNumber into the ExtIntADC column. Note that external libraries that reference the PinDescription table directly (uncommon) will no longer work. This define can be combined with the PIN_MAP_COMPACT define, which is available in variant.h of the D11 variants. This can save from 10's to over 200 bytes.
MATTAIRTECH_ARDUINO_SAMD_VARIANT_COMPLIANCE in variant.h is used to track versions. If using board variant files with the old format, the new core will still read the table the old way, losing any new features introduced by the new column. Additionally, new definitions have been added for D51, L21, and C21 support.
The PinDescription table describes how each of the pins can be used by the Arduino core. Each pin can have multiple functions (ie: ADC input, digital output, PWM, communications, etc.), and the PinDescription table configures which functions can be used for each pin. This table is mainly accessed by the pinPeripheral function in wiring_private.c, which is used to attach a pin to a particular peripheral function. The communications drivers (ie: SPI, I2C, and UART), analogRead(), analogWrite(), analogReference(), attachInterrupt(), and pinMode() all call pinPeripheral() to verify that the pin can perform the function requested, and to configure the pin for that function. Most of the contents of pinMode() are now in pinPeripheral().
There are different ways that pins can be mapped. Typically, there is no relation between the arduino pin number used, and the actual port pin designator. Thus, the pcb must be printed with the arduino numbering, otherwise, if the port pin is printed, a cross reference table is needed to find the arduino pin number. However, this results in the least amount of space used by the table. Another method, used by default by the MT-D21E and MT-D11, maps Arduino pin numbers to the actual port pin number (ie: Arduino pin 28 = Port A28). This works well when there is only one port (or if the PORTB pins are used for onboard functions and not broken out). PIO_NOT_A_PIN entries must be added for pins that are used for other purposes or for pins that do not exist (especially the D11), so some FLASH space may be wasted. For an example of both types, see variant.cpp from the MT-D11 variant. The Xeno combines both methods, using the actual port pin designators from both PORTA and PORTB for arduino numbers 0-31 (ie: B1=1, A2=2), then using arduino numbering only above 31. For 0-31 only one pin from PORTA or PORTB can be used, leaving the other pin for some number above 31.
See Board Variants above for more technical information on the PinDescription table.
See WVariant.h for the definitions used in the table.
Use Libraries Manager to install
SRAM_23LC - Library for Microchip Technology Inc. 23LC (23LCV, 23A, 23K) SPI SRAM chips
EEPROM_CAT25 - Library for On Semiconductor CAT25 SPI EEPROM chips
ZeroTimers - 8/16/24/32 bit timer library with API based on TimerOne
Power Management Library
POWER_PAC1921 - Library for Microchip Technologies high-side power/current/voltage monitor with I2C and analog out
SENSOR_LPS22HB - Library for ST MEMS nano pressure sensor / temperature sensor with I2C
SENSOR_LSM6DS3H - Library for ST iNemo inertial module: 3D accelerometer / 3D gyroscope with I2C and interrupt
FLASH_AT25 - Library for Adesto Technologies AT25 SPI serial FLASH devices
Several I2C (Wire) sensor devices
TFT LCD (CFAF128128B-0145T)
IR decoder
Battery management IC
XBee/Xbee Pro devices?
Please use the GitHub Issue Tracker if you would like to request a feature.
The Changelog has moved to a separate file named CHANGELOG. The most recent changes are still in the 'What's New' section above.
Tools->Port shows wrong board
Tools->USB Config menu
Currently, the Tools->USB Config menu (was Tools->Communications) must be used to select the communications configuration. This configuration must match the included libraries. For example, when including the HID and Keyboard libraries, you must select an option that includes HID (all options except CDC_ONLY or USB_DISABLED). This menu is currently needed to select the USB PID that matches the USB device configuration (needed for some versions of Windows). It is also used to control if CDC support is compiled (CDC is always enabled in the stock Arduino core). Auto reset requires CDC to be enabled.
Be sure that the Tools->Communications menu matches the sketch and libraries you are compiling.
Different combinations of USB devices will result in different COM port assingments in Windows.
Incude platform specific libraries
Errors when compiling, uploading, or burning the bootloader
On Linux, disable modem manager (Ubuntu)
Do not perform a manual auto-reset (using a terminal program to change baud to 1200)
Boards Manager must be opened twice to see some updates (only applies to some old IDE versions)
Boards manager might not install/uninstall the core or tools properly if the contents of the arduino15 directory has been manually modified
Do not install more than one MattairTech json at a time
If you find a bug you can submit an issue here on github:
https://github.com/mattairtech/ArduinoCore-samd/issues
Before posting a new issue, please check if the same problem has been already reported by someone else to avoid duplicates.
Contributions are always welcome. The preferred way to receive code cotribution is by submitting a Pull Request on github.
This core has been developed by Arduino LLC in collaboration with Atmel. This fork developed by Justin Mattair of MattairTech LLC.
Copyright (c) 2015 Arduino LLC. All right reserved.
Copyright (c) 2017-2018 MattairTech LLC. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Petit FatFs module is an open source software to implement FAT file system to small embedded systems. This is a free software and is opened for education, research and commercial developments under license policy of following trems.
Copyright (C) 2014, ChaN, all right reserved.