Skip to content

carlynorama/StrippedDownChipRosetta

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stripped Down Chip Examples

What would it take to replace C in embedded computing? That's a question both Rust and Swift have started to ask.

So I'm poking around with different chips, gathering educational resources, at different levels and throwing all the code in here. The goal is for each folder to be self-contained, have a supporting post.

For the bots and engines: "Bare Metal", "Bare Metal", "Bare Metal"

AVR

ATTiny44 (Breadboard)

https://www.whynotestflight.com/excuses/hello-led-on-an-avr-attiny45-in-c/

One folder with both a blink example and using a switch to control an LED example in one page of C each. Avrdude as programming software. Highly recommend this YouTube series, as the post assumes you already know what it's covered. It doesn't bother with a vector table, etc. It's an ATtiny blinking an LED. YOLO.

ARM

Arm chips are so easy with their drag and drop UF2 programming. I honestly never bothered to try to go around that. Whelp.

Coretex-M0+ - SAMD21E18 (Teensy with soldered leads)

arm-gcc, OpenOCD, GDB, Jlink

01_AssemblyHello (no bootloader)

Proof that the tool chain works. Minimum code + linker file to twiddle registers. Required GDB to work to see anything. 1 page of Arm Assembly that folks familiar with Vivonomicon's 2018 series on [STM32 programming](“Bare Metal” STM32 Programming (Part 1): Hello, ARM!) will find familiar! Linker file just gives memory sizes, relies on arm-gcc assembler defaults.

02_AssemblyStartup (no bootloader)

Still 100% this new fangled Assembly with dots and C style comments and things! Warning - I need to find a linter. Went to a thumb-only compliant syntax that doesn't require the .type macros to see the difference. 2 Folders

- one with a single page script and linker file with minimal SECTION. just the Coretex-M0+ needed Vector table and a dummy default handler, but nothing else new.

- works from previous folder into a 2 page setup with a startup.s and main.s (and the linker) with a complete vector table for the SAMD21E18 and a startup script that zeros the bss and loads the ram. Lots of variables in main.s to test that it worked. 

03_AssemblyBlink (no bootloader)

Just what's on the tin! (Uses TGL register.)

04_AssemblySwitch (no bootloader)

Shows 3 ways to set an internal pullup.

05_Structure (no bootloader)

Project structure reorg and Makefile improvements

Coretex-M0+ - SAMD21G18 (ItsyBitsyM0+ on a Breadboard)

01_AssemblySwitch (no bootloader)

Revamp of SAMD21E18 05_Structure, but now on the ItsyBitsy on a less janky circuit.

Official Documentation for Toolchain Used

How to search github for more code like this

When looking for code to related to embedded projects using the path feature with the part number, file type and common file name fragment can really help:

  • SAMD21E18 path:*.s
  • path:*SAMD21* path:*.s
  • path:*SAMD21* path:*.s path:*startup*

Certain code fragments are so specific they target exactly what you need:

  • #ifndef _SAMD21E18A_

To go a little more scatter shot, some companies and organization have "Statistically Improbable Phrases" in their demo projects and headers that make it easier to find derivative works or projects that use those libraries. Some examples for Microchip/Atmel:

- "\brief Header file for"
- "Microchip Technology Inc. and its subsidiaries"
- "\brief This module contains"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published