• It Blinks!

    WestfW08/05/2019 at 08:08 0 comments

    Aside from Microchip apparently deciding to rename all the peripheral registers, going from "running" to "blinking the LED" went pretty quickly.  Running at 48MHz, 2 wait states, and outputting the clock on its respective IO pin.  Woo hoo!

    int main(void) {
        // Clock at reset is set to the internal 48MHz clock, divided by 12.
        NVMCTRL_REGS->NVMCTRL_CTRLB |= NVMCTRL_CTRLB_RWS(2); // 2 wait states for 48MHz
        OSCCTRL_REGS->OSCCTRL_OSC48MDIV = 0;  // no division
        GCLK_REGS->GCLK_GENCTRL[0] |= GCLK_GENCTRL_OE_Msk; // output the clock on a pin
        PORT_REGS->GROUP[0].PORT_DIRSET = GCLK0_OUT;
        PORT_REGS->GROUP[0].PORT_PMUX[GCLK0_PIN/2] |= 7;  // PMUX H is clkO
        PORT_REGS->GROUP[0].PORT_PINCFG[GCLK0_PIN] |= PORT_PINCFG_PMUXEN_Msk;
        PORT_REGS->GROUP[0].PORT_DIRSET = LED;
        
        while (1) {
            PORT_REGS->GROUP[0].PORT_OUTTGL = LED;
            mydelay();
        }
        return;
    }

  • Runs an empty C program!

    WestfW08/05/2019 at 03:12 0 comments

    After fiddling with tools a bit (it looks like neither AS7 nor MPLABX 5.1 is quite up to using a PICKit4 with SAMC21), I have the board responding, have uploaded an empty C program, and can single-step through the C runtime startup code.

    (Using (upgraded) MPLABX 5.25 and the PICKit4, on MacOS...)

    So that's pretty significant!  Next up, Blink!

  • Assembled; Doesn't blow up!

    WestfW08/01/2019 at 00:32 0 comments


    Well, there it is, with what might be about the minimal set of components needed to attach a debugger to see if it works.  Applying USB power (remember, there is no actual USB on this chip :-( ) causes the power LED to light up, and didn't release any smoke or cause my Mac to complain about drawing too much power, so that's a good sign.

    The QFN soldering (my first time!) went better than I expected.  I used the "Maker Paste" low-temp solder from Adafruit, and a hot plate.  I guess I used too much paste, because I got solder balls around the outside, but they cleaned up pretty easily, and as much as I can actually see looks really good.  (and, it didn't blow up!)  https://forums.adafruit.com/viewtopic.php?f=42&t=154682

  • Bleh...

    WestfW07/23/2019 at 06:31 0 comments

    (A couple of people have recently "liked" this project, so I thought I should post an update...)

    I'm ready to call the existing PCB design a failure.

    Aside from the non-presence of USB in the chip, the PCB was designed with the "sweet spot price" prototype PCB of 50x50mm.  Since then, most of the cheap vendors have increased the max size of low-cost boards to 100x100mm, which would easily fit a much more "comfortable" design (Arduino Shield compatible, for instance.)

    I haven't gotten around to actually trying to build one of the boards (scary QFN pinouts!), and now I'm not even sure it's worth trying :-(

  • Well, crap. No USB!

    WestfW07/13/2017 at 09:51 0 comments

    So it turns out that i didn't read the datasheet carefully enough. A "quick" look showed that the SAMC21Gxxx was exactly the same as the SAMD21Gxxx, except for the 5V-ness. All the pins were in the same place, and etc.

    But it turns out that none of the SAMC parts have a USB controller! SAMC21 has CAN on the same pins that SAMD21 has USB. I guess I can't blame anyone but myself, but I wish Atmel had used more distinguishing part numbers. Sigh.
    (Found while looking at SW. I guess the boards are still usable.)

  • Real boards received

    WestfW07/03/2017 at 08:44 1 comment

    I sent the design out to OSHPark, and have received real boards that look pretty good (the slots for the USB connectors didn't work, but everything else looks pretty good.)

    Gee, those pads look awfully tiny "In Real Life", compared to how big they looked blown up on my monitor when I was working on them in EAGLE! I'm reviewing tutorials on QFN soldering without fancy equipment, and have practiced with some simpler SMT components and the hotplate that I own; that seemed to go "ok", but I don't really have any "practice" QFN chips (I've got some SSOPs) or boards (though I did find some SO-sized scrap boards...)

    And it seems that a toothpick is probably "too big" a tool for applying solder paste...