Code Monkey home page Code Monkey logo

samd21's Introduction

SAMD21 Driver

IMPORTANT: Arduino version 1.8.11 has breaking changes in the library code that causes compilation to fail. Use an earlier version or select another driver for your project.
See issue #224 for more information. Also note that I am not going to make a workaround for this since the compilation error is in the shared grblHAL core code.

A grblHAL driver for the Atmel SAMD21 processor on a Arduino MKR ZERO board.

See the Wiki-page for compiling grblHAL for instructions for how to import the project, configure the driver and compile.

Available driver options can be found here.

Update 2019-08-10: Added support for optional I2C IO Expander, I2C EEPROM, I2C keypad and Trinamic TMC2130 drivers (via I2C bridge). FatFS updated to R0.13c.


This driver compiles and uploads from the Arduino IDE and is partially dependent on the Arduino framework.

For flexibility and to reduce overhead the vector table is relocated to RAM. On my todo list is to improve GPIO speed even more than already done.

Settings are stored in flash and will be overwritten on a fresh upload, this grbl config app (for Windows, a precompiled release is available) may be used to make a backup of the settings.

Optional streaming of GCode from a SD card is implemented according to this specification except for filtering that I have retained for now. Implementation is based on a port for FatFs R0.09b, on my todo list is to update this to the latest release (currently at R0.13c). Also on my todo list is to automatically mount the SD card when inserted.

Proposed pin assignments:

             ARef - PA03 (25) [  ]       [  ] +5V
      Spindle dir - PA02 (15) [  ]       [  ] Vin
      Cycle start - PB02 (16) [02]       [  ] +3V3
        Feed hold - PB03 (17) [03]   M   [  ] GND
            Probe - PA04 (18) [  ]   K   [  ] CPU RESET
           X step - PA05 (19) [  ]   R   [  ] (14) PB22 - UART TX
           Y step - PA06 (20) [  ]       [  ] (13) PB23 - UART RX
           Z step - PA07 (21) [  ]   Z   [  ] (12) PA09 - Flood
            X lim - PA22 (00) [06]   E   [  ] (11) PA08 - Mist
            Y lim - PA23 (01) [07]   R   [  ] (10) PA19 - Steppers enable
            X dir - PA10 (02) [  ]   O   [00] (09) PA17 - Reset
            Y dir - PA11 (03) [  ]       [01] (08) PA16 - Z lim
            Z dir - PB10 (04) [10]       [05] (07) PA21 - Spindle enable
      Safety door - PB11 (05) [11]       [04] (06) PA20 - Spindle PWM

CNC BoosterPack pin assignments:

             ARef - PA03 (25) [  ]       [  ] +5V
            Y dir - PA02 (15) [  ]       [  ] Vin
      Safety door - PB02 (16) [02]       [  ] +3V3
            Reset - PB03 (17) [03]   M   [  ] GND
            Probe - PA04 (18) [  ]   K   [  ] CPU RESET
           X step - PA05 (19) [  ]   R   [  ] (14) PB22 - UART TX
           Y step - PA06 (20) [  ]       [  ] (13) PB23 - UART RX
           Z step - PA07 (21) [  ]   Z   [  ] (12) PA09 - I2C SCL
            Z lim - PA22 (00) [06]   E   [  ] (11) PA08 - I2C SDA
            Y lim - PA23 (01) [07]   R   [  ] (10) PA19 - GPIO1
            Z dir - PA10 (02) [  ]   O   [00] (09) PA17 - Feed hold
            X dir - PA11 (03) [  ]       [01] (08) PA16 - Cycle start
            GPIO2 - PB10 (04) [10]       [05] (07) PA21 - X lim
    Keypad strobe - PB11 (05) [11]       [04] (06) PA20 - Spindle PWM

NOTE: I2C I/O-expander is used for coolant, spindle and stepper enable signals, I2C EEPROM for settings. Prototype PCB ready for test.


Numbers in round brackets are the Arduino pin assignments, in square brackets the GPIO interrupt (EXT_INT) assignments.

NOTE: Only tested on my bench with an oscilloscope, some switches and LEDs.


2021-04-14

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.