A Quick Look at the micro:bit V2
Contents
Introduction
This website is devoted to the MicroPython programming language for microcontrollers. All code examples throughout the series have been tested on the micro:bit. So it makes sense to take a quick peek at this clever little educational board.
The official microbit.org website tells us; the BBC micro:bit is a pocket-sized computer that introduces you to how software and hardware work together. At the time of writing (September, 2022) the micro:bit is at version 2. More descriptively it is a single-board computer (SBC).
Specifications
At the core of the BBC Micro-Bit V2 is the Nordic nRF52833 general-purpose, multi-protocol System-on-Chip (Soc) or microcontroller. A microcontroller is a single package IC that integrates most or all of the functional elements of a simple computer. It will usually contain:
- A processor (CPU) and usually an oscillator (clock).
- Onboard memory for program storage and execution.
- Ports for input (analog and digital) from simple matrix keypads, switches, sensors, etc.
- Ports for output (simple display devices, signals to relays, motor control, LEDs, etc).
- Analog to Digital Converters (ADC).
- Timers allowing microsecond precision timing to control and communicate with external devices.
- Bluetooth and WiFi transceivers - the nRF52833 has Bluetooth capability.
- Embedded communication protocols - useful for communication with external sensors, etc.
- Temperature sensor - while the nRF52833 has this, not all microcontrollers do.
The nRF52833 contains an ARM Cortex-M4 32-bit microprocessor with a clock speed of 64 MHz. While this seems rather pedestrian for a modern computing device it must be remembered that the micro:bit is not encumbered by the overheads of an operating system. The processor is entirely devoted to running bare-board the currently loaded program.
The processor will be programmed for a single purpose that is broken down into a set of simple tasks. For example, a digital thermometer's program will have the processor running in an endless loop reading the temperature from a temperature sensor chip then writing the result to a simple one-line LCD screen.
Similarly, a robot's program will consist of the processor sensing situational input from such devices as IR collision sensors, cameras, etc then reacting by sending controlling signals to electrical drive and stepper motors.
Unlike a conventional PC, most microcontrollers have separate memory for program and data. The micro:bit has 512kB of Flash memory for the program and 128kB of RAM for non-persistent program data. This is more than enough to operate simple real world projects.
Additional Hardware
As the micro:bit V2 is intended to be an educational device the designers have provided additional hardware "goodies" on the circuit board. These have been connected to input and output pins of the nRF52833 for convenience of use.
Included are:
- Two user push switches - can be separately read as on or off by a program
- 3-Axis digital motion sensor
- Magnetic sensor - useful as a compass
- 5x5 Array of LEDs to flash simple messages
- Light sensor
- Capacitive touch sensor - similar technology to the touch screen on a modern phone
- Microphone
- Speaker
There is a USB port for uploading code and to provide power to the device. A JST Battery Connector allows an external battery pack to be used. This is useful once a program has been uploaded (flashed) and tested. The micro:bit can be operated without a connection to the USB port on a computer.