Skip to the content
PCBKitNew board
2 layers45.7 × 43.2 mmD21Debug, the printed circuit board in 3D

This repository contains the development kit for building code for the Atmel SAM D21 playground board. This board was developed to help members of the Solar Car Club (Prisum) at Iowa State University to learn how to…

Size
45.7 × 43.2 mm
Copper layers
2
Thickness
1.6 mm
Parts
63
Nets
70
Pads
223
Tracks, vias
453, 71
Pours
2
Routed
Yes
KiCad
KiCad 7 (file 20221018)
Created
25 Jan 2023
Updated
20 Nov 2024

Overview

D21Debug is an open-source printed circuit board by glingy, from the glingy/playground repository on GitHub. It is a 2-layer board of 45.7 × 43.2 mm with 63 parts on 70 nets, routed with 453 tracks and 71 vias.

It is built around the ATSAMD21E15L-AF, ATSAMD21E16B-UU and SK9822, with the MIC5365-3.3YC5-TR, INND-TS40RAB and P120PK-Y25BR10K among its other parts. Its parts include 24 resistors, 12 capacitors, 11 diodes, 4 ICs and 3 connectors. It belongs with the SAM D and SAM boards of this library.

Main components

6

README

README.md

Atmel SAM D21 Playground!

Important Links

This repository contains the development kit for building code for the Atmel SAM D21 playground board. This board was developed to help members of the Solar Car Club (Prisum) at Iowa State University to learn how to program very low level embedded code. This repository is a reduced version of the development environment used by the team.

Getting Started

  • Download VS Code (https://code.visualstudio.com)
  • Install Git (build-essential package on Ubuntu, Run xcode-select --install in a terminal on macOS, or install from https://git-scm.com/downloads for Windows)
  • Clone this repository to your computer
  • Open the folder with VS Code (Either drag the folder onto the VS Code application or open VS Code and select Open Folder...)
  • VS Code will prompt you to install some recommended extensions. Do so, it should install PlatformIO, C/C++ tools, multisrc, and Explorer Exclude.
    • This environment is based on PlatformIO (https://platformio.org) with several modifications to make it easier to use.

What is all this stuff?

  • Several of these are hidden by default, look in the Hidden Items tab in the explorer sidebar to see them. If it's hidden, you can ignore it for the most part.
  • .vscode - VSCode configuration. Suggested extensions, file type associations, configuration of what's hidden, etc.
  • boards - PlatformIO board definition for the playground board.
  • include - Shared header files across all projects (See PlatformIO documentation)
  • lib - Shared library code across all projects (See PlatformIO documentation)
  • scripts - Linker scripts and C startup files. You probably won't need to touch this, but feel free to explore
  • sources - The code folder! To create a new project, create a new folder in here. To be detected as a valid project, it must contain at least once .c file.
  • .clang-format - Auto-formatter config file. It's who you blame if your code magically reorganizes whenever you save the file.
  • .gitignore - Tells git to ignore specific files which should not be tracked.
  • .multisrc - Tells the multisrc extension to activate and allow you to select source folders.
  • README.md - This file!
  • platformio.ini - PlatformIO config file.
  • multisrc.ini - Generated PlatformIO config file by multisrc

Bottom Status Bar Overview

PlatformIO adds a lot of buttons to the bottom status bar in VSCode. From left to right:

  • The first button is the checkmark, clicking that will build your code, but not run it. Good for checking syntax or verifying code when you don't have a board with you to run it on.
  • The second is the right arrow, that's the run button. It will build and run your code using the selected debugger.
  • The third is the trash can, that will delete everything from the build folder. If there's a strange linker error for some reason, you can try cleaning, but I've found that it's usually your fault and not because the build folder is dirty.
  • The serial monitor (plug) is not used yet.
  • The terminal will open a local terminal window with the pio command set up for debugging the development environment.
  • The next is the selected debugger. By default, it will assume the playground's internal debugger, but you can select another in local.ini. See platform.ini for example debugger definitions.
  • When editing, you may see a database icon and/or a fire symbol to the left of the line and column numbers. That indicates that intellisense is parsing the file, so if syntax highlighting or linting looks broken, wait for those to disappear, and if it's not fixed by the time they disappear, close and reopen the file.
  • In the bottom right corner of VSCode, < something > indicates the source folder currently selected for running / debugging. It will be red if you're looking at a file not in the current project so you don't compile the wrong project on accident. Click that to select a different project

Running

  • Select the program. Select the debugger. Press the arrow.

Debugging

  • On the left sidebar, there's a bug with a play button, press the green arrow at the top of that sidebar to debug.
    • Variables are the global (and local) variables that were not optimized away. You can also hover over a variable to see its value. If it says <optimized away>, the compiler decided that variable wasn't worth keeping around, so you'll have to either declare it volatile and re-download (forces compiler to not optimize it out; remove volatile when done) or look around to find its value from nearby functions or calculations.
    • Watch lets you type C expressions and see the results. This is extremely useful also for optimized math, you can put any simple C expression (including math) in there, &var or &var + len is often useful for checking addresses of different things.
    • Call Stack shows which functions you're currently inside. If you go above main, you're now in the scripts/startup.c file. Click on an entry to jump to that function.
    • Peripherals shows the current status of every register in the processor. Extremely useful, especially if something's just broken and you have no idea why. Sometimes, register values won't update unless you click on them to expand them, if you see it flash or a loading bar at the top flash by, it probably just updated. Most useful part of debugging.
    • Breakpoints is self-explanatory. Click next to a line number to add a breakpoint. Note: Breakpoints listed there are for all projects, not just the current one, so it might be useful to remove breakpoints as soon as you're done with one.
    • Registers is not very useful for us, it's the current value of every register in the processor.
    • Memory enter a memory address and offset to see the hex value of that chunk of memory.
    • Disassembly if it works, it will disassemble a function to let you see the assembly form it is currently running. I've had issues with that in the past.
  • You can press the run button or the debug button again while debugging the program, different debuggers behave differently, some get angry, some stop the current debug process while making vscode think you're still debugging, some just ignore you. I suggest you press the stop debugging button before starting a new program.
  • The reload button will restart the current program, but will not recompile nor re-download. If you want to download a new version, stop and restart.

Troubleshooting

Help! LED doesn't turn on!

  • Check wiring direction of external pullup/pulldown resistors (0/1)
  • Check output direction

Help! A peripheral isn't working!

  • Is it enabled in APB? - Did you wait after enabling it for the clock to enable?
  • Does it need AHB enabled?
  • Is it enabled?
  • Is its GCLK enabled?

Help! I need to force wipe and reset the board!

  • TBD

Help! It's just not working!

  • Yup. Welcome to software. Take a break and come back later. The answer's probably staring you in the face.

Parts

63
QtyValueFootprintReferences
191kΩResistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolderR1, R2, R3, R5, R6, R10, R11, R12, R13, R14, R15, R16, R19, R21, R23, R24 +3
9 LED_SMD:LED_0603_1608Metric_Pad1.05x0.95mm_HandSolderD1, D2, D3, D4, D5, D6, D7, D8, D11
70.1uFCapacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolderC1, C2, C3, C4, C9, C10, C11
510uFCapacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolderC5, C6, C8, C13, C14
5SW_PushButton_Switch_THT:SW_PUSH_6mmlocked, locked, SW3, SW4, SW5
210kΩResistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolderR18, R22
2Conn_01x04_MaleConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ2, J3
110uHInductor_SMD:L_0603_1608Metric_Pad1.05x0.95mm_HandSolderL1
1300ΩResistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolderR17
1ATSAMD21E15L-APackage_QFP:TQFP-32_7x7mm_P0.8mmU1
1ATSAMD21E16B-UCustomParts:WLCSP-35U4
1BuzzerCustomParts:PS1240P02BTBZ1
1INND-TS40RABCustomParts:INND-TS40RABD9
1LOGOTurtle:Turtle0808G***
1LOGOLOGOG***
1MIC5365-3.3YC5Package_TO_SOT_SMD:SOT-353_SC-70-5U2
1Micro USBCustomParts:MCR-B-S-RA-SMT-CS5A-NF-TJ1
1P120PK-Y25BR10KCustomParts:P120PK-Y25BR10KR20
1POWERLED_SMD:LED_0603_1608Metric_Pad1.05x0.95mm_HandSolderD10
1SK9822CustomParts:SK9822U3
1lockedResistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolderR4

Questions

How big is the D21Debug PCB?

It measures 45.7 × 43.2 mm and has 2 copper layers, 1.6 mm thick.

What parts does the D21Debug use?

63 parts, built around the ATSAMD21E15L-AF, ATSAMD21E16B-UU, SK9822 and MIC5365-3.3YC5-TR. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the D21Debug KiCad files?

From the glingy/playground repository on GitHub, at the commit this page was made from: the board is hardware/D21Debug.kicad_pcb and its schematic hardware/D21Debug.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the D21Debug design in my own project?

Its repository states no licence, so its author keeps all rights: ask glingy before reusing the design.

Similar boards

  • 2 layersQynth PCB, the printed circuit board in 3D

    Qynth PCB

    BAbhiraman/Qynth

    15 parts7
  • 2 layers131.7 × 81.3 mmMultimeter, the printed circuit board in 3D

    Multimeter

    Lucasmnascimento94/The_Art_of_Electronics

    72 parts3
  • 2 layers63.9 × 89.2 mmAb rec, the printed circuit board in 3D

    Ab rec

    LJWsao/sinitsa

    KiCAD files for the all band receiver. This can pick up strong local sources of RF such as AM and FM radio stations.

    47 parts1
  • 2 layers82 × 88.6 mmVSlideMPad, the printed circuit board in 3D

    VSlideMPad

    Arballio/VolumeSliderMacroPad

    15 partsMIT
  • 2 layers281.6 × 255.2 mmSynthia, the printed circuit board in 3D

    Synthia

    Engineering-House/Project-Synthia

    The programs used are as follows: - STMCube32MX - Visual Studio Code - STM32CubeIDE for Visual Studio Code (Extension Pack)

    236 parts
  • 2 layers125 × 50 mmControlModule, the printed circuit board in 3D

    ControlModule

    crempp/ucpu

    16bit CPU made from TTL Logic Chips

    25 parts4
  • 2 layers97 × 72.8 mmBrushed ethab redo, the printed circuit board in 3D

    Brushed ethab redo

    ill-ev-concept/EVC-PCB

    All new PCBs for EV Concept

    51 partsMIT
  • 4 layers155.4 × 116.3 mmStartTech Valve, the printed circuit board in 3D

    StartTech Valve

    Lucasmnascimento94/Smart-Shower

    This is an extended version of the project I made for my computer arquitecture class.

    107 parts