or, How to read a datasheet.
This is a course about how computers work, starting with logic gates and latches, ending with concurrent processes running under a simple operating system, and spending time on machine-level programming in the middle.
- In Hilary Term, we will study low-level programming with the help of a tiny computer, the BBC micro:bit, which includes an ARM-based microcontroller as its processor. Starting in assembly language and moving on to C, we will learn about the instructions that make up machine code, including arithmetic, branching, memory access, and subroutines. We will also (vitally for embedded systems) learn about controlling I/O devices, such as the buttons and lights on the micro:bit and the serial interface that allows it to talk to a host computer. Once a program reaches a certain degree of complexity, it is no longer sufficient to wait in a tight loop for an event to happen, and we will study the hardware and software aspects of solutions to this problem: using interrupts to respond to external events, and an operating system to structure the program as a family of concurrent processes, each responsible for one part of the task.
- In Trinity Term, we will study the elements of computer hardware, building up from gates and latches to architectural elements such as registers, adders and decoders, and finally a paper model of a processor able to execute a selection of ARM instructions, supported by an architectural simulator.
micro:bit version 2
Most of the materials for the course are written on the assumption that we will be programming the original 'V1' micro:bit, with a Cortex-M0 core implementing the Thumb-1 instruction set, in an nRF51822 microcontroller with 16kB of RAM running at 16MHz. The original micro:bit has been superceded by the V2 board, with a Cortex-M4 core implementing the Thumb-2 instruction set, an nRF52833 microcontroller with 128kB of RAM running at 64MHz, and incorporating a floating point unit. We may be handing out this newer board for use in the lab sessions. Luckily, the new chip can run programs written for the old chip almost without change, so for simplicity we'll continue to study programs for the old chip, noting differences where they are relevant in text boxes like this one. The supporting software for the lab has been adjusted to suit the new chip, mostly in ways that will be invisible to participants, with a version for the old chip available alongside.
Lectures in Lecture Theatre B:
- Mondays, 10.0 am, weeks 2–8.
- Tuesdays, 10.0 am, weeks 1–8.
- Friday, 11.0 am, week 1.
The lecturer will be unavoidably detained on Monday of First Week, so lectures that week will be on Tuesday and Friday.
Although some elements of the lectures will be automatically recorded, the dynamic blend of slides, calculations on the whiteboard, software demonstrations, computer hardware shown via live video and online instrumentation, and problems solved by the lecturer and class working together means that not all elements will be captured, and the recordings may therefore be almost useless. In addition, the content of each lecture may change in response to questions from the audience. Participants who cannot attend lectures in person may find it best to follow the course by reading the extensive lecture notes available on this site, together with copies of the slides.
Lab sessions in the Thom Building, Department of Engineering Science:
- Thursdays, 3.0–5.0 pm, weeks 5–8.
In addition to the official lab times noted above, the lecturer will be available at the same time and in the same place in weeks 3 and 4 to help those who want to get an early start with assembly language programming.
Consultation sessions: the lecturer will be available online to answer questions at set weekly times. This is for the benefit of participants who are prevented from returning to Oxford, but others are welcome to join also.
To be decided.
Information about the course is provided on several other pages.
- Syllabus and synopsis.
- Notes for each lecture.
- Problem sheets.
- Information about the laboratory exercises.
- A reading list.
- A page about the BBC micro:bit, including links to online resources.
- A page about the micro:bian operating system.
- A page of frequently asked questions.
- A glossary, defining terms used in the course.
- A useful page listing the Thumb instructions introduced in each lecture.
- A literate Haskell version of the Thumb simulator, differing in many details, including the names of control signals.
- Notes for the project of extending and porting micro:bian.
- A list of ways of programming the micro:bit.
- A check-list of preparation tasks to negotiate with IT Support.
- Jay Carlson reviews dozens of different microcontrollers costing $1 or less.
- More than you could possibly need to know about bit-twiddling hacks.
- So called because the board dangles from its USB cable like a teabag dangling from its string.