

D21Debug
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
6ATSAMD21E15L-AF
TQFP-32(7x7)-40℃~+125℃ 1.62V~3.6V 10bit 12bit 26 32 Bit 32KB 48MHz 4KB ARM Cortex-M0+ Built-in FLASH TQFP-32(7x7) Microcontrollers (MCU/MPU/SOC) ROHSMicrochip TechnologyMicrocontrollers (MCU/MPU/SOC)ATSAMD21E16B-UU
WLCSP-35(2.5x2.8)-40℃~+85℃ 1.62V~3.6V 10bit 12bit 26 32 Bit 48MHz 64KB 8KB ARM Cortex-M0+ Built-in FLASH WLCSP-35(2.5x2.8) Microcontrollers (MCU/MPU/SOC) ROHSMicrochip TechnologyMicrocontrollers (MCU/MPU/SOC)SK9822
SMD-6P,5.5x5mm-20℃~+80℃ 2 20mA 30MHz 4.5V~5.5V Built-in PWM SMD-6P,5.5x5mm LED Drivers ROHSOPSCO OptoelectronicsLED DriversMIC5365-3.3YC5-TR
SC-70-5-40℃~+125℃ 1 150mA 200uVrms 3.3V 310mV@(150mA) 39uA 5.5V 65dB@(10kHz)、80dB@(1kHz) Fixed Over Current Protection、Over Temperature Protection、Enable Positive SC-70-5 Voltage Regulators - Linear, Low Drop Out (LDO) Regulators ROHSMicrochip TechnologyVoltage Regulators - Linear, Low Drop Out (LDO) RegulatorsINND-TS40RAB
DIP-10LED Segment DisplaysInoluxP120PK-Y25BR10K
插件Potentiometers & Variable ResistorsTT Electronics
README
README.mdAtmel SAM D21 Playground!
Important Links
- Documentation: WIP
- How to make your own Playground: docs/making_a_playground.md
- BOM: https://playground.ctrtl.com/bom
- Schematic: https://playground.ctrtl.com/schematic.pdf
- ATSAMD21E15L Datasheet: https://playground.ctrtl.com/SAMD21.pdf
- Latest Gerber Files: https://github.com/glingy/playground/releases/latest
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-essentialpackage on Ubuntu, Runxcode-select --installin 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 Itemstab 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 exploresources- 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.cfile..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
piocommand 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. Seeplatform.inifor 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.
Variablesare 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 itvolatileand re-download (forces compiler to not optimize it out; removevolatilewhen done) or look around to find its value from nearby functions or calculations.Watchlets 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,&varor&var + lenis often useful for checking addresses of different things.Call Stackshows which functions you're currently inside. If you go abovemain, you're now in thescripts/startup.cfile. Click on an entry to jump to that function.Peripheralsshows 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.Breakpointsis 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.Registersis not very useful for us, it's the current value of every register in the processor.Memoryenter a memory address and offset to see the hex value of that chunk of memory.Disassemblyif 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| Qty | Value | Footprint | References |
|---|---|---|---|
| 19 | 1kΩ | Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder | R1, 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_HandSolder | D1, D2, D3, D4, D5, D6, D7, D8, D11 | |
| 7 | 0.1uF | Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder | C1, C2, C3, C4, C9, C10, C11 |
| 5 | 10uF | Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder | C5, C6, C8, C13, C14 |
| 5 | SW_Push | Button_Switch_THT:SW_PUSH_6mm | locked, locked, SW3, SW4, SW5 |
| 2 | 10kΩ | Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder | R18, R22 |
| 2 | Conn_01x04_Male | Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical | J2, J3 |
| 1 | 10uH | Inductor_SMD:L_0603_1608Metric_Pad1.05x0.95mm_HandSolder | L1 |
| 1 | 300Ω | Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder | R17 |
| 1 | ATSAMD21E15L-A | Package_QFP:TQFP-32_7x7mm_P0.8mm | U1 |
| 1 | ATSAMD21E16B-U | CustomParts:WLCSP-35 | U4 |
| 1 | Buzzer | CustomParts:PS1240P02BT | BZ1 |
| 1 | INND-TS40RAB | CustomParts:INND-TS40RAB | D9 |
| 1 | LOGO | Turtle:Turtle0808 | G*** |
| 1 | LOGO | LOGO | G*** |
| 1 | MIC5365-3.3YC5 | Package_TO_SOT_SMD:SOT-353_SC-70-5 | U2 |
| 1 | Micro USB | CustomParts:MCR-B-S-RA-SMT-CS5A-NF-T | J1 |
| 1 | P120PK-Y25BR10K | CustomParts:P120PK-Y25BR10K | R20 |
| 1 | POWER | LED_SMD:LED_0603_1608Metric_Pad1.05x0.95mm_HandSolder | D10 |
| 1 | SK9822 | CustomParts:SK9822 | U3 |
| 1 | locked | Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder | R4 |
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 layers

- 2 layers131.7 × 81.3 mm

- 2 layers63.9 × 89.2 mm

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 mm

- 2 layers281.6 × 255.2 mm

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 mm

- 2 layers97 × 72.8 mm

- 4 layers155.4 × 116.3 mm

StartTech Valve
Lucasmnascimento94/Smart-Shower
This is an extended version of the project I made for my computer arquitecture class.
107 parts