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

samd21's People

Contributors

terjeio avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

samd21's Issues

SAMC2x

May you consider to support 5V SAMC2x parts?
Especially I would like to try ATSAMC21E18A one.

Compiling issue

hey there,

I'm kinda new here, but i really admire the work put into this.
I'm using an arduino MKR1000, which has a SAMD21 MCU. I'm following the instructions step by step.
Howevery, when trying to compile, i get the same error as in issue #224, for which there also is a warning in the Readme.
I've gone as far as to IDE version 1.6.10, but to no avail.

What could be done to help this?

afbeelding

Does this driver support the MPG interface?

First off - sorry for entering this as "an issue", but this repo doesn't appear to have discussions enabled?

Anyway - I'm in the process of designing a pendant to use with my grblHAL (Teensy 4.1) based CNC mill. I'm putting together a test bench and I was hoping to use a MKRZero board as a stand-in for the mill, I have been able to work around the 'synchronized' compile issue and have an instance of ioSender talking to the MKRZero.

When I edit my_machine.h I do not find the #defines for KEYBOARD_ENABLE, MPG_ENABLE and I2C_STROBE_ENABLE (as I do in the Teensy4 driver's my_machine.h). I can define KEYBOARD_ENABLE and MPG_ENABLE (as 2) and get everything compiled, but I suspect that may not be enough to actually enable the MPG interface (at least the external serial port on the MKRZero doesn't seem to be active).

Am I missing something, or is it possible that the MPG interface is not actually implemented for this driver?
Thanks in advance!

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.