Giter Site home page Giter Site logo

msp430-zig-minimal-example's Introduction

Blink In Zig For MSP430 Microcontrollers

I wanted to experiment a little with Zig lang. And I saw that it has a MSP430 backend. So I set out to try and run some Zig on an MSP430. This is the journey to a minimal blink example to get started.

The experiment:

  1. Starting with a known good blink example in C (./blink-c).
    • Well, what can I say, it blinks.
  2. Create minimal blink example in assembly (./blink-asm).
    • Understand what is really required by reading a) the manual and b) the generated assembly from blink-c.
    • To get C out of the loop completely.
  3. Try to replicate it with Zig (./blink-zig).

Relevant Documents

Hardware Requirements

Software Requirements

  • mspdebug (Debian/Ubuntu: sudo apt install mspdebug) - to flash and debug the code on the chip
  • msp430-elf-* MSP430-GCC-OPENSOURCE toolchain from TI (link)
    • "Mitto Systems GCC 64-bit Linux - toolchain only" -> extract into repo-dir/msp430-gcc-9.3.1.11_linux64 (or change path in .env)
    • "Header and Support Files" -> extract into repo-dir/msp430-gcc-support-files (or change path in .env)

How-To

First set up your terminal environment:

source .env

(Must be executed in the repo directory, in subfolders use cd .. && source .env && cd -.)

Enter the subdirectory of choice, then:

  1. Build: ./build.sh
  2. Inspect: ./inspect.sh (the generated assembly)
  3. Run: ./run.sh (then enter prog blink.o and run)

msp430-zig-minimal-example's People

Contributors

gschwaer avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.