diff --git a/datasheet/ATSAMD51.pdf b/ATSAMD51_datasheet.pdf similarity index 61% rename from datasheet/ATSAMD51.pdf rename to ATSAMD51_datasheet.pdf index a0255be67d9219ff2124665b575b042d20eefddb..92a724beea548e022270cbe56f26d9cb79c7ba3d 100644 Binary files a/datasheet/ATSAMD51.pdf and b/ATSAMD51_datasheet.pdf differ diff --git a/README.md b/README.md index 1ec1dd370c18fbc6a498910f3640dceb65eb9786..91af9b6ee6470b49ad161d22e7f35767ac1decd6 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,39 @@ -# ATSAMD51 Documentation +# Yonder D51 -`` !warn! violently incomplete `` +The ATSAMD51 is an ARM Cortex-M4F microcontroller manufactured by Microchip (Atmel). As of Oct 13 2019, -> CBA :heart: D51 <- -Herein lies some source code for the ATSAMD51, made arduino-compatible [by the folks at Adafruit](https://www.adafruit.com/product/3382). +## Circuits using the D51 -Also includes example eagle circuit. + +[Adafruit Feather M4](/) - - + +[squidworks module](https://gitlab.cba.mit.edu/squidworks/moduleboard-atsamd51) - \ No newline at end of file + +[squidworks router](https://gitlab.cba.mit.edu/squidworks/routerboard-atsamd51) + +## Toolchains + +### Adafruit Bootloader / Platformio (or Arduino Compatible) + +Since [Adafruit](ada-feather-m4doc) has adopted the SAMD51, it is well supported by the open source community, and we can borrow their development tools. + +**fair warning** +>Use of the arduino bootloader *does* assume that your circuit has a USB port available, as well as a 32.678kHz clock on the RTC Xout / Xin pins. During cycles, the bootloader (assuming it is on a Feather M4) will toggle 'D13' (PA23) as well as send Neopixel Data to (?). + +To get started, find the latest build of the [adafruit bootloader] and download that (probably a `.bin` or `.elf` or `.hex` file). + +We need to write this file into the micro's memory. I have been using the `Serial Wire Debug` interface, which is enabled by default on the D51 hardware (but JTAG is also available, but requires an enable pin pulled low somewhere *I think*). `SWCLK is on PA30` and `SWDIO is on PA31`. + +To speak SWD, I just use the Atmel-Ice programmer, and Atmel Studio 7 (a windows application, sorry). Any programmer that speaks SWD should be capable of doing this. In Atmel Studio, go to `Tools -> Device Programming`, and select the Atmel-Ice Tool, the ATSAMD51xxxx device you'd like to program (the bootloader is written for the ATSAMD51J19A), and the SWD interface. You should be able to read the device signature. If this works, your SWD connection is all super-gucci (as they say). You can navigate to `Memories` - and write that bootloader in. OK. The device should now enumerate over USB as an Adafruit Feather M4 / FeatherBoot (or something similar). + +### Platformio + +To write code and load it, I use PlatformIO, which is an open source 'IOT' (embedded) programming tool written as a package for either `atom` code-editor, or [something else](link both). See their doc for setting up a new project for the D51 / Feather M4. + +### Real Registers in an Arduino World + +One of the troubles with Arduino is that people forget that it is just a big C++ library. This means that everything under the sun (that compiles) is legal here. *That* means that we can use Arduino as a crutch, but write really nice Special Function Register code inside of the same executable. Great! + +Indeed, in the PlatformIO environment, we even have wonderful autocomplete handles on the D51's core register map. For some examples of this kind of manipulation, check out the [hunks](gitlab ponyo) in the [ponyo](gitlab ponyo) project. diff --git a/circuit/board.png b/ancient/circuit/board.png similarity index 100% rename from circuit/board.png rename to ancient/circuit/board.png diff --git a/circuit/fab-front.jpg b/ancient/circuit/fab-front.jpg similarity index 100% rename from circuit/fab-front.jpg rename to ancient/circuit/fab-front.jpg diff --git a/circuit/mkbreadboardboard-v01-bom.html b/ancient/circuit/mkbreadboardboard-v01-bom.html similarity index 100% rename from circuit/mkbreadboardboard-v01-bom.html rename to ancient/circuit/mkbreadboardboard-v01-bom.html diff --git a/circuit/mkbreadboardboard-v01-bom.txt b/ancient/circuit/mkbreadboardboard-v01-bom.txt similarity index 100% rename from circuit/mkbreadboardboard-v01-bom.txt rename to ancient/circuit/mkbreadboardboard-v01-bom.txt diff --git a/circuit/mkbreadboardboard/eagle.epf b/ancient/circuit/mkbreadboardboard/eagle.epf similarity index 100% rename from circuit/mkbreadboardboard/eagle.epf rename to ancient/circuit/mkbreadboardboard/eagle.epf diff --git a/circuit/mkbreadboardboard/mkbreadboardboard.brd b/ancient/circuit/mkbreadboardboard/mkbreadboardboard.brd similarity index 100% rename from circuit/mkbreadboardboard/mkbreadboardboard.brd rename to ancient/circuit/mkbreadboardboard/mkbreadboardboard.brd diff --git a/circuit/mkbreadboardboard/mkbreadboardboard.sch b/ancient/circuit/mkbreadboardboard/mkbreadboardboard.sch similarity index 100% rename from circuit/mkbreadboardboard/mkbreadboardboard.sch rename to ancient/circuit/mkbreadboardboard/mkbreadboardboard.sch diff --git a/circuit/schematic.png b/ancient/circuit/schematic.png similarity index 100% rename from circuit/schematic.png rename to ancient/circuit/schematic.png diff --git a/code/pin.c b/ancient/code/pin.c similarity index 100% rename from code/pin.c rename to ancient/code/pin.c diff --git a/code/pin.h b/ancient/code/pin.h similarity index 100% rename from code/pin.h rename to ancient/code/pin.h diff --git a/code/pwm_foc.c b/ancient/code/pwm_foc.c similarity index 100% rename from code/pwm_foc.c rename to ancient/code/pwm_foc.c diff --git a/code/pwm_foc.h b/ancient/code/pwm_foc.h similarity index 100% rename from code/pwm_foc.h rename to ancient/code/pwm_foc.h diff --git a/code/spiport.c b/ancient/code/spiport.c similarity index 100% rename from code/spiport.c rename to ancient/code/spiport.c diff --git a/code/spiport.h b/ancient/code/spiport.h similarity index 100% rename from code/spiport.h rename to ancient/code/spiport.h diff --git a/code/uartport.c b/ancient/code/uartport.c similarity index 100% rename from code/uartport.c rename to ancient/code/uartport.c diff --git a/code/uartport.h b/ancient/code/uartport.h similarity index 100% rename from code/uartport.h rename to ancient/code/uartport.h diff --git a/bootloader/bootloader-feather_m4-v3.6.0.bin b/bootloader/bootloader-feather_m4-v3.6.0.bin new file mode 100644 index 0000000000000000000000000000000000000000..2907cbd8a847675aceab38012d347a67ba8b73e9 Binary files /dev/null and b/bootloader/bootloader-feather_m4-v3.6.0.bin differ