
First steps in Computing using the BBC micro:bit Adrian Oldknow [email protected] 28rd February 2017 0. Introduction. The BBC micro:bit is a powerful, free-standing computer of a rather specialised type. The purpose of this introductory document in the `First Steps’ series is to dig into just what you get for the very few bucks that a fully configured micro:bit costs. This is intended as general information for the interested reader to understand more about the design and features of the micro:bit. A bit like wanting to know what’s under the bonnet of your new car. The starting point is some web-searcving using Google to see what information we can find to help us. Any technological device will have a `technical specification’ to inform users what `lies under the bonnet’. So let’s start with a query: “BBC micro:bit hardware specification”. The first result is on the Micro:bit Foundation’s own site: https://www.microbit.co.uk/device. This gives a useful introduction to the components of the micro:bit, but it does not go into much detail. The second result is on the BBC site: http://www.bbc.co.uk/mediacentre/mediapacks/microbit/specs. This is pitched at a more technologically inclined audience, but is still light on detail. The third result is on Wikipedia: https://en.wikipedia.org/wiki/Micro_Bit . Now we are starting to get down to the nitty-gritty. This has much more technical information – as well as links to sources of more detail. The term `Hardware’ is used to refer to the physical components of the system, which is where we’ll start. The physical design of a computing device is now often referred to as the `machine architecture’. So we find that the BBC micro:bit is a `single-board computer’. 1. The micro:bit’s hardware: CPU. What do you think the acronym `CPU’ could stand for, in the context of computing? It is a very old term called the `Central Processing Unit’ – where the instructions in a computer program are actually carried out. So the `brain’ of the micro: bit is contained in the `16 MHz 32- bit ARM Cortex-M0 microcontroller’ chip. Let’s unpick the detail conveyed here. Hz is short for the unit called the Hertz, which is a clock rate of 1 cycle per second. This is like the metronome marking for a piece of music, or the heart-rate of a human. So 16 MHz means that the micro:bit’s heart is beating 16 million times each second - wow! The `bit’ is the basic unit of computer storage – contracted from `Binary digIT’ – which means a single number which can be either a 1 or a 0. So in 32 bits we can store a number like: 0010 1100 0101 1101 0011 0111 0011 1001 (I put the spaces in between to make it easier to count!) Think of an ordinary whole number like 2017. How do you extract information from it? We learn to decode it as 2 thousands, 0 hundreds, 1 ten and 7 units. We use the decimal system or `base 10’. The binary number 1011 is decoded as 1 eight, 0 fours, 1 two and 1 unit = 8 + 0 + 2 + 1 = eleven. The 32-bit number above is decoded as 0 x 231 + 0 x 230 + 1 x 229 + 0 x 228 + 1 x 227 + …………. + 1 x 8 + 0 x 4 + 0 x 2 + 1 = 744,306,489 For estimates we use 210 = 1024 as roughly a thousand. So 230 is roughly a thousand million. A more convenient way of writing the same number is as: 2C5D3739. This uses the `hexadecimal’ system known as `Hex’ for short. That represents numbers in base 16. Our first 4 binary digits are 0010 which is just 2, the next 4 are 1100 which is 8+4 = 12, the next 4 are 0101 which is 4+1 = 5, the next 4 are 1101 which is 8+4+1 = 13 and so on. In base 16 we start counting 0 to 9 but then we use A for 10, B for 11 and so on up to F for 15. So that is how arrive at 2C5D3739 as the Hex equivalent of the 32-bit binary number – which we can convert here. The computer uses 2-state electronic devices to store information – which we represent by 0 or 1. `ARM’ is the name of the Cambridge-based `ARM Holdings’ company recently sold to the Japanese Softbank Group for a record £24.3bn. ARM was originally the acronym for the `Acorn RISC Machine’ developed by Acorn Computers in Cambridge, which built the original BBC microcomputer in the 1980s. The electronic engineer who set up Acorn is Hermann Hauser, originally from Austria. He was made a Fellow of the Royal Society in 2012 for his pioneering work as an entrepreneur. `RISC’ stands for `reduced instruction set computer’. A `cortex’ is a layer or region of a system, such as the `cerebral cortex’ of the brain. In this context it is just the brand name used by ARM for a particular design of solid-state integrated circuits, or `chips’. The basic component of these circuits is the transistor, which is used to amplify or switch electrical circuits. BBC’s GCSE Bitesize has a nice piece about transistors. Instead of wiring together discrete components, integrated circuits can consist of billions of transistors connected by circuits etched into the surface of a slice of semi- conducting material, such as silicon. The great rise in transistor based devices happened in California in what we now call `Silicon Valley’. Cambridge has become known as `Silicon Fen’. The picture on the right shows what is called the `die’ of an ARM Cortex chip. ARM is an unusual company in that it does not actually manufacture any chips. It produces the complex designs for chips which other companies manufacture under licence from ARM. It makes its money (annual revenue of nearly £1bn) through the licence fees paid to it by manufacturers – its product is called `intellectual property’. That is one reason for the use of the word `computer architecture’. Architects design buildings, they do not construct them! The last word to decode is `microcontroller’. This is commonly used for kind of single-board computer used to control a device such as the engine-management system for a car, or to run a mobile phone, smart television, washing machine etc. These are known as `embedded devices’ - which accounts for the generic name `mbed’ used by ARM for its chips designed for Internet of Things (IoT) devices. 2. The micro:bit’s hardware: memory. The specification includes “256 KB flash memory, 16 KB static ram”. The `KB’ is short for `kilobyte’ and is a measure of the amount of memory. The `byte’ is not so clearly defined, though. Conventionally it is usually equal to 8 bits. Because 8 bits were enough to assign a unique number to every character on a keyboard. There is an international standardised code called ASCII, American Standard Code for Information Interchange, which assigns a numeric code to every character. But the ARM processor is a 32-bit device, which means its registers work with 32 bits. I guess that the micro:bit’s memory is organised in 8-bit bytes, but I can’t find a definitive answer! The term `flash memory’ was coined in the early 80s for a new type of `electrically erasable programmable read-only memory’ (EEPROM). I also guess that the micro:bit’s flash memory is where it stores the programs we `flash’ to it as hex files? So the micro:bit stores our programs in its memory, but what else does it need to remember? I guess that some calculations may require intermediate results to be stored temporarily. We can also create `Variables’ in the programs we write, so they must also be stored in memory. You can find out some interesting information about `static RAM’ here. `RAM’ is short for `random access memory’ – which can store data in a way which can be retrieved very quickly indeed. But this kind of memory is also `volatile’, which means it will not retain information when there is no power to the unit. We know that the micro:bit `remembers’ the last program you flashed to it, so we can rule out RAM as the place where the micro:bit stores programs. 3. The micro:bit’s hardware: Bluetooth Remember that at the moment we are just looking at the contents of a single Nordic nRF51822 chip on the micro:bit – the one called `Processor’ near the top left corner on the back of the unit. Its remaining element is the `2.4 GHz Bluetooth low energy wireless’. This is a radio transmitter and receiver using an ultra-high frequency of 2.4 gigaHerz – or 2 thousand 4 hundred million cycles per second! You may already use Bluetooth in you mobile phone to transfer music and images between it and a computer. If you have a car with a `hands-free’ for your mobile phone, you will have met the need for `pairing’, so that the car knows which mobile phone to connect to. The micro:bit is designed to be able to communicate to other devices, and Bluetooth is one way to do this. There are Apps for Apple and Android devices which you can use to develop your programs. When you have produced your `hex code’, you can then transfer it wirelessly to the flash memory in your paired micro:bit.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages14 Page
-
File Size-