Close
0%
0%

HACK

HackAday Cortex Kit

Similar projects worth following
HACK is a development kit powered by an Atmel SAM D21 that is going to be used as the core of the HaDge

Features

  • a USB device port with cable shield filtering and transient suppression
  • a 3.3V LDO with bypass caps and filters to separate analog VDD from digital VDD
  • a 32.768 KHz crystal for the master clock
  • a reset pushbutton with debounce cap and pullup resistor
  • a blue LED on pin 13 for the classic Blinky test
  • PDIP-28 package compatible (+ VBUS pin available on one side)
  • the ATSAMD21E18 in QFN package
  • firmware based on the Arduino Zero core

Licences

  • HACK hardware is OSHW, licensed under CERN OHL 1.2
  • HACK software is LGPL 2.1 (because it's based on the Arduino Core)

Installation

  • Download Arduino IDE >= version 1.6.8
  • Go under File->Preferences...
  • Add the following URL to Additional Boards Manager URLS:

http://mickmad.github.io/hack/package_had-mickmad_samd_index.json

  • Go under Tools->Boards->Boards manager...
  • Select HACK - HackAday Cortex Kit - SAMD21E by Hackaday / Michele Perla and press Install

NOTE for Windows users: When you plug the board in your USB socket, Windows will fail to install its drivers; this will happen twice: the first time you use it in Bootloader mode, and the first time you use it in Sketch mode. When this happens, please click on Start, right-click on Computer, select Properties, then select Device Manager from the left-side menu of the newly opened window, then find an Unknown Device, double-click on it, go under the Drivers tab, and click on Update driver..., click Browse my computer for driver software, click Let me pick from a list of device drivers on my computer and then click Have Disk, then in the Install From Disk dialog box, click Browse, and go to C:\Users\your-username\AppData\Local\Arduino15\packages\had-mickmad\hardware\samd\1.0.0\driversand select the hack.inf file, then finally accept the warning that the driver is not signed.


TO DOs / MAYBEs:

  • Fix the bootloader double tap feature to be more reliable
  • Implement a bootloader pin that when grounded turns on the bootloader
  • I2S support
  • Adapt #Teensy Audio Library to work with the Arduino Zero/HACK Core
  • Any suggestion? Write me up!

  • Starting in bootloader mode

    Michele Perla08/02/2016 at 07:55 0 comments

    Hi there,

    I was modifying the bootloader to implement a blinking light when in bootloader mode so to signal the user that he/she can upload code, and I noticed a strange behavior:

    the double tap on reset function does not yet work reliably, although I found out that trying to program a sketch using the virtual serial port of the HACK in sketch mode results in resetting the board, and unplugging and replugging it back shows that the board has fallen back to bootloader mode.

    So, although I cannot yet get the double-tap-on-reset function to work reliably, this method works and is repeatable with no fuss. Which is a win after all.

    Cheers,

    Mick

  • Docs: How the variant system works on Arduino Zero boards

    Michele Perla07/07/2016 at 20:48 7 comments

    Hey there,

    long time no see.

    Albert from avdweb is working on a SAM D21 board, and he wrote me an email asking me for some help; he acknoweldged that the Arduino Zero has way less broken out pins on the three headers than the SAM D21 G actually has, but he does not know how to use them on his board that has all the pins broken out, and he also cannot find where those are defined in the variant files. He actually asked me what happened to pins:

    pin19 PB10

    pin20 PB11

    pin21 PA12

    pin22 PA13

    pin37 PB22

    pin38 PB23

    pin39 PA27

    pin41 PA28

    pin45 PA30

    pin46 PA31

    pin48 PB3

    This is my answer to him:

    you can find the base stuff inside variant.h, variant.cpp under your variant folder, and under WVariant.h in the core folder.

    The WVariant.h is the file that defines all the bits that you have to put in the control registers of the SAMD1 in order to configure all the functions described in Chapter 6 of the Datasheet; I suppose you already have a copy of the datasheet but here's the link anyway, just in case:

    http://www.atmel.com/images/atmel-42181-sam-d21_datasheet.pdf

    Values for the bigger SAMD21J (I'm sure they're working on some kind of Arduino Zero Mega) are already defined, and my version also contains the ones for the smaller D21 E.

    The variant.h and the variant.cpp use the values defined in WVariant.h; there's a description array called PinDescription g_APinDescription[] in variant.cpp that contains all the control values for all pins. These values are represented with a struct PinDescription, declared in WVariant.h, that is as follows:

    /* Types used for the table below */
    
    typedef struct _PinDescription
    
    {
    
      EPortType       ulPort ;
    
      uint32_t        ulPin ;
    
      EPioType        ulPinType ;
    
      uint32_t        ulPinAttribute ;
    
      EAnalogChannel  ulADCChannelNumber ; /* ADC Channel number in the SAM device */
    
      EPWMChannel     ulPWMChannel ;
    
      ETCChannel      ulTCChannel ;
    
      EExt_Interrupts ulExtInt ;
    
    } PinDescription ;
    
    /* Pins table to be instantiated into variant.cpp */
    
    extern const PinDescription g_APinDescription[] ;

    As you can see, the struct contains values that almost match the heading of Table 6.1 of the datasheet:

    EPortType ulPort corresponds to the first two letters of the value at column I/O PIN in table 6.1

    ulPin corresponds to the last two numbers of the value at column I/O PIN in table 6.1

    e.g.: PORTA, 21 corresponds to pin 30 of the SAM D21G.

    To understand the other values, just look at the declarations of the types and structs in WVariant.h.

    Position i of g_APinDescriptor[] corresponds to pin i of the Arduino Zero or of your board.

    Let's check Arduino Zero's first lines of this array and comment some pins:

    {
    
      // 0..13 - Digital pins
    
      // ----------------------
    
      // 0/1 - SERCOM/UART (Serial1)
    
      { PORTA, 11, PIO_SERCOM, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_11 }, // RX: SERCOM0/PAD[3]
    
      { PORTA, 10, PIO_SERCOM, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_10 }, // TX: SERCOM0/PAD[2]
    
      // 2..12
    
      // Digital Low
    
      { PORTA, 14, PIO_DIGITAL, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_14 },
    
      { PORTA,  9, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM0_CH1, TCC0_CH1, EXTERNAL_INT_9 }, // TCC0/WO[1]
    
      { PORTA,  8, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM0_CH0, TCC0_CH0, EXTERNAL_INT_NMI },  // TCC0/WO[0]
    
      { PORTA, 15, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM3_CH1, TC3_CH1, EXTERNAL_INT_15 }, // TC3/WO[1]
    
      { PORTA, 20, PIO_TIMER_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER_ALT), No_ADC_Channel, PWM0_CH6, TCC0_CH6, EXTERNAL_INT_4 }, // TCC0/WO[6]
    
      { PORTA, 21, PIO_DIGITAL, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_5 },

    As you can see, the first two pins (corresponding to pin 16 and 15 of the D21G) have everything disabled but the SERCOM module, which can be used for SPI, I2C (not for all pins though), USART, etc.

    In this case, those are set for Serial...

    Read more »

  • HACK downloadable via Arduino Boards Manager

    Michele Perla04/14/2016 at 21:33 0 comments

    Hi there,

    quick update to report that the HACK core is now available for the easiest of installs using the Arduino Boards Manager! You only need to add this link to the additional Boards Manager URLs:

    http://mickmad.github.io/hack/package_had-mickmad_samd_index.json

    More detailed instructions are available in the Details section of the main project page.

    Cheers,

    Mick

  • HACK bootloader+core available

    Michele Perla04/14/2016 at 09:56 2 comments

    Hi there,

    last week I went to #Hackaday | Belgrade to meet @Mike Szczys in order to leave him the first HACK prototypes!

    Before giving him the protos, I had to "hack the HACK"; that means that since I messed up big time the LDO package (mirrored footprint) I had to manually solder a bigger SOT-23 LDO using jumper wires to three locations: GND pin, VLDO pin, and VDD; to get VDD, I actually had to remove L1 and solder a wire across its pads; I tried soldering the wire to the VDD pad of the ferrite bead but I always ended up either damaging the bead pin or lifting it off from the board (because I also messed up passives footprints: 0402 footprint but 0603 components soldered on board). Luckily, the protos are fine!

    Next step was modding the bootloader; I re-built the Zero bootloader to reference the ATSAMD21E18A instead of the bigger pin count G18A that the Zero uses, and I also had to change the UART port to a more convenient one and finally VID and PID codes for USB enumeration; I also made a little Windows driver for it, which references the same VID and PID codes, so that it will show as "HACK Bootloader" when in bootloader mode, and it will show "Hackaday / Michele Perla" as manufacturer, how cool is that!

    Finally, I also got a modded Arduino Zero core working on the HACK; most was done in the variant.cpp, variant.h, and in the WVariant.h files, in order to correctly set pin mapping and functions to reflect the available pins on the smaller E18A mcu. Some tweaks were also made in some other files, and more have to be done in the libraries (SPI for example). BUT, at least it blinks an LED correctly, and USB Serial works fine too!

    So, go get the latest version of the repository and give it a look!

    Cheers,

    Mick

  • HACK is now PDIP-28 Wide compatible! Plus, some small additions

    Michele Perla01/26/2016 at 13:05 0 comments

    -Hi there,

    After the article published last week about HACK we decided to add in some features, some of which were suggested in the comments, like:

    1. another GND pin, so to have ground on both sides of the breakout
    2. correct controlled-ish impedance USB traces (Atmel suggests that since traces length in this applications is not significant, impedance for USB traces is not critical anyway)
    3. Cortex Debug connector on top side, to easily flash the bootloader (without having to fiddle with the Atmel ICE "squid" connector)

    Moreover, while talking with Anool we thought that we could try to shrink the layout at its limits, and voilà! You can now find HACK/small branch on Github, where you will find a PDIP-28 Wide (0.6 " spacing) version of HACK!

    Stay tuned for news.

    Cheers,

    Mick

  • Layout 100% finished

    Michele Perla01/04/2016 at 17:11 1 comment

    Hey there,

    quick update: the HACK is ready. I'm just waiting for feedback from Seeedstudio to know whether they can do castellated pins so that if that's the case I can update the pin headers package and add both castellated pins (for surface mounting on the #The Hackaday Badge mainboard) and normal through-hole pins (to mount pin headers for breadboarding).

    Then it's a matter of BOM filling.

    Proto run is near.

    Cheers,

    Mick

    PLUS: I received my #JACK boards back today, so I can add a 32768 KHz crystal to them and test something out before the HACK protos are ready (since they are so similar). Nice!

  • Layout 99,9% finished

    Michele Perla12/24/2015 at 17:16 0 comments

    Hey there,

    the final layout for HACK is 99,9% done; I only have to check if copper pours are connected to ground, and then I need to place fiducials markers around to ease the job of pick-n-place machines.

    So far the mods made from the original idea and from JACK are here synthesized:

    1. No more ATSAMR21, we're using the ATSAMD21E (32 pin)
    2. Smaller LDO accounts for more PCB real estate
    3. 2x13 pin headers, 1 additional pin connected to VDDANA (filtered analog power supply for sensitive analog applications)
    4. Jumper on backside to connect LDO input to VUSB or to external pin (jumper closed: board is powered by USB; jumper opened: board is powered by VLDO pin)

    Check out the github repo; more details about why no more SAMR21 will follow in the next days.

    Cheers, Mick

View all 7 project logs

Enjoy this project?

Share

Discussions

Kaspar Emanuel wrote 07/13/2016 at 18:46 point

Hey Michele, your board was featured quite prominently in my video:

I hope that's OK. I also opened a pull request a while back to let your project be included on kitnic.it from your repo direct, not sure if you saw that. https://github.com/MickMad/HACK/pull/2

  Are you sure? yes | no

Michele Perla wrote 07/13/2016 at 19:02 point

Oh hi there,

no problem for mentioning the project in the video, I actually appreciate that.

I'll take a look a the pull request right now.

  Are you sure? yes | no

Dan Twaddell wrote 03/09/2016 at 00:12 point

Are the modified Arduino Zero core files available?  I'm interested in using the SAMD21E for a project but I'm not sure where to start to get that variant working in the Arduino IDE.

  Are you sure? yes | no

Kumar, Abhishek wrote 01/08/2016 at 11:54 point

The boost converter will be a part of the main board on which HACK will be soldered. 

  Are you sure? yes | no

Sandeep Patil wrote 01/08/2016 at 04:27 point

Assuming it will be used in the battery powered HADGE, was a builtin boost convertor considered during the design? 

  Are you sure? yes | no

Michele Perla wrote 01/08/2016 at 08:30 point

Yes but for the HaDge, not for the HACK, at least not at this stage. For externa supply purposes, we breaked out pin VLDO that is connected to the LDO input pin, so that the board can be powered via an external supply or via USB by setting a jumper on the backside of the board.

  Are you sure? yes | no

femtoduino wrote 10/28/2015 at 17:47 point

Glad to see more peeps tackling the Atmel SAM R21 line of chips. Fwiw, if you need any help w/ it, I am using the ATSAMR21E18A on the FemtoBeacon here on hackaday.io ...I'd be happy to pitch in w/ this project too.

  Are you sure? yes | no

Alex wrote 10/14/2015 at 11:52 point

This ATSAMR21G18 looks really interesting. For me it seems like it's a SamD21 with2.4 GHz RF. Nice!

  Are you sure? yes | no

Michele Perla wrote 10/14/2015 at 12:05 point

Exactly, it's a SAM D21 without I2S but with an integrated AT86RF233. It has less pins than the equivalent D21 due to a lot of pins being eaten by RF master clock pins, more ground pins, and balanced antenna line pins.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates