Bare metal micro:bit: Difference between revisions

From Bare Metal micro:bit
Jump to navigation Jump to search
No edit summary
No edit summary
 
(28 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{DISPLAYTITLE:Bare Metal {{microbit}}}}__NOTOC__
{{DISPLAYTITLE:Bare metal {{microbit}}}}__NOTOC__
[[Image:notbug.gif|right]]
===Twenty experiments in low-level programming===
{{Smallcaps|This book describes}} a series of experiments in programming the BBC {{microbit}} at a low level.
 
Chapters will appear one-by-one in coming weeks, starting with some experiments with programming the {{microbit}} in machine code.  If you want to follow along as the book grows, you should get a {{microbit}} and either a Raspberry Pi or a Linux laptop, and begin with the appendices about [[Appendix A: Hardware setup|hardware]] and [[Appendix B: Software setup|software]] setup.  The hardware setup instructions include some modifications to the {{microbit}} that will come in handy later, but you don't have to do them before beginning with the first experiment.
 
Feedback is very welcome, and you can send me e-mail at [mailto:spivoxity@gmail.com <nowiki>spivoxity@gmail.com</nowiki>], or raise issues on the github page if you prefer: https://github.com/Spivoxity/baremetal-v1.
 
[[Image:cover.png|400px|thumb|right|Front cover]]
[[Image:cover.png|400px|thumb|right|Front cover]]
===Twenty-one experiments in low-level programming===
Welcome to the online version of my book, "Bare metal {{microbit}}", an experiment-based introduction to programming embedded devices at the machine level.  The book shows you how to program the ARM-based BBC {{microbit}} in assembly language and in C, and later how to use a simple, embedded operating system.


==Part 1: Machine code programming==
The book contains 21 experiments, each described in a separate chapter that is linked from this page: the blue links are ready to follow now, and the red links lead to experiments to be added in the future.  At the end of this page are links to [[#Online resources|supporting pages]] that cover the hardware you will need, how to set up the software tools you will use to program it, and definitive documentation for the {{microbit}} board. After you have set up software and hardware, you are ready to begin the [[X1000|Experiment 1]], an easy task where you compile and upload a simple C program to check that everything is working properly.
The first third of the book is about programming at the machine level: instructions, how they are implemented by a computer, and how they can be combined to carry put familiar programming tasks.
 
* [[Introducing the microbit|Introducing the {{microbit}}]].
* {{Exp|X1000|Building a program|Check you can build and upload a simple program (written in pure C) that echoes lines typed on the terminal}}
* {{Exp|X1100|Machine instructions|Investigate the effect of single machine instructions using an interactive program}}
 
==Part 2: Input/output devices==
This part of the book is about programming I/O devices: how input and output happens by reading and writing device registers, and how we can use interrupts to make the computer respond to events.
 
* {{Exp|X2100|Serial communication|Use a serial device to transmit characters}}
* {{Exp|X2400|Neopixels|Use assembly language to make a bit-banged implementation of the protocol for WS2812 'NeoPixel' LEDs}}


==Part 3: Embedded operating system==
* [[About the book]].
The last third of the book introduces {{microbian}}, a tiny embedded operating system based on message passing, and uses it to organise programs that contain multiple processes interleaved with each other.


==Appendices==
{{ChapLinks}}
* [[Appendix A: Hardware setup]]
* [[Appendix B: Software setup]]


==Web only==
==Online resources==
* [[The micro:bit page|The {{microbit}} page]]
* [[Appendix A: Hardware setup]].
* [[Appendix B: Software setup]].
* [[The microbit page|The {{microbit}} page]].




----
----
{{CopyrightLine}}
{{CopyrightLine}}

Latest revision as of 09:00, 15 August 2022

Front cover

Twenty-one experiments in low-level programming

Welcome to the online version of my book, "Bare metal micro:bit", an experiment-based introduction to programming embedded devices at the machine level. The book shows you how to program the ARM-based BBC micro:bit in assembly language and in C, and later how to use a simple, embedded operating system.

The book contains 21 experiments, each described in a separate chapter that is linked from this page: the blue links are ready to follow now, and the red links lead to experiments to be added in the future. At the end of this page are links to supporting pages that cover the hardware you will need, how to set up the software tools you will use to program it, and definitive documentation for the micro:bit board. After you have set up software and hardware, you are ready to begin the Experiment 1, an easy task where you compile and upload a simple C program to check that everything is working properly.

Part 1: Machine code programming

Part 2: Input/output devices

Part 3: An embedded operating system

Bonus programs

Online resources



Copyright © 2019–21 J. M. Spivey. All rights reserved.