
Exploring the BBC Micro:bit Software Stack and OS - matthewwarren
http://www.mattwarren.org/2017/11/28/Exploring-the-BBC-microbit-Software-Stack/
======
ntoll
It's important to point out that _EVERYTHING_ to do with the MicroPython work
on the micro:bit was done by a community of volunteers working in their spare
time. Source code here:
[https://github.com/bbcmicrobit/micropython](https://github.com/bbcmicrobit/micropython)
Documentation here: [https://microbit-
micropython.readthedocs.io/en/latest/](https://microbit-
micropython.readthedocs.io/en/latest/)

I estimate around 80 people volunteered time to bring Python and associated
tools (such as the browser based editor, command line tools and a native
editor called "Mu"
[https://mu.readthedocs.io/en/latest/](https://mu.readthedocs.io/en/latest/))
to micro:bit.

At the heart of all this work was the creator of MicroPython, Damien George
who volunteered a huge number of hours to bringing a full reimplementation of
Python3 (without standard library) to micro:bit. Check it out, it's awesome.
MicroPython is both a reimplementation of Python 3 but on the micro:bit also
has music, a simple speech synthesiser, funky display functions, radio and a
simple file system all built in. :-)

~~~
pjmlp
The work done on MicroPython is amazing, it is the 21st century version of
Basic for tiny devices.

It even allows compiling to native code and use of inline Assembly.

[http://docs.micropython.org/en/v1.9.3/pyboard/reference/spee...](http://docs.micropython.org/en/v1.9.3/pyboard/reference/speed_python.html#the-
native-code-emitter)

[http://docs.micropython.org/en/v1.9.3/pyboard/pyboard/tutori...](http://docs.micropython.org/en/v1.9.3/pyboard/pyboard/tutorial/assembler.html#)

------
matthewwarren
For some background on the design decisions, here's the 'Key design
constraints' from [https://github.com/sparkslabs/microbit-
prototype/tree/master...](https://github.com/sparkslabs/microbit-
prototype/tree/master/doc) (the technical specs of the microbit prototype,
written in Dec 2014) :

> Programmable - The device must be reprogrammable

> Simple to program - via a graphical browser based UI

> Small - maximum 5cm x 5cm

> Cheap - manufacture cost must be approximately £2 or less when produced in
> large scale - for example batches of 100,000 units

------
matthewwarren
Just noticed that the BBC have re-released some of their archive of 'BBC
Micro' related TV programmes from the 1980's, see
[https://www.bbc.co.uk/iplayer/group/p031v2bg](https://www.bbc.co.uk/iplayer/group/p031v2bg)
(probably UK only)

~~~
LeoPanthera
Those have been on the iPlayer for a year or so now. Definitely worth a watch.

------
_Codemonkeyism
I love the Micro:bit and have used it in many "Coding for Managers" workshops.

Currently I switch for my workshops to the Calliope Mini [1], very similar
(they talked to the Micro:bit guys), but has additionally RGB LED, microphone,
sound, Grove sensor connectors (2) and motor drivers for two motors for robots
(but is more expensive).

[1] [https://calliope.cc/](https://calliope.cc/)

~~~
zarify
Nifty, I hadn't seen Calliope before. I'll check it out next time I buy some
experimental kit for my classes.

------
Graham24
"I’d imagine that for a large amount of computer programmers (currently in
their 30’s)..."

40s/50s surely. the 80s is 30 years ago.

~~~
PaulRobinson
In the UK programming was taught on BBC Micros in pretty much every school
from the age of 5-6 years old as part of the school curriculum. I'm in my late
30s and learned Logo and BASIC almost 35 years ago in the early-mid 1980s. I
then went back to it when I was 11 and learned BASIC "properly", and then by
14 was writing C which is around the early-mid-1990s.

Most of my colleagues from the UK went through a similar curve, taking in
Atari and Amiga machines at home not just as games machines but piqued by
their capability to produce software of their own.

The UK 8-bit market was one of the biggest economic helpers the country has
had in generations. We then went about squandering it.

Whilst I was a teenager the school curriculums moved to teaching PowerPoint
and Excel which basically meant STEM entrants at University fell off. I was
one of the last years to be able to learn how to code at school.

Detecting an impeding and urgent skills gap, a couple of years ago a proper
computer science GCSE was kicked off (by the much maligned, but on this
occasion perhaps quite right, Michael Gove MP), but only 11% of pupils in the
UK sat it last year, and most schools are struggling to hire teachers so the
quality of the kids they're turning out is a problem for us as a country and
economy.

This is something I'm spending a lot of time thinking about right now. An
open-source set of text books with teacher notes might help a lot of kids get
exposure to the skills they need for the workplace in 30 years, the way I got
exposure.

Yes, the RPi and microbits stuff is part of that, but there needs to be some
steps beyond that. Kids need to be able to go home, look at the PC or laptop
and think "I could make something on that", and get the guidance needed to do
so.

~~~
peterclary
The BBC Micro didn't have the UK schools market entirely to itself.

I was born in 1971 and both my primary and secondary schools had LINK 480Z
computers by Research Machines. The primary school only had the one, but the
secondary school had a lab with 12 or 16 (I forget) of them. Later on it
replaced them with a larger number of RM Nimbus PCs (again from Research
Machines) which used 80186 processors. Yes, you read that right: 80186
processors. As you'd expect, they were not properly compatible with real PCs.

I was lucky enough to get a BBC Micro at home a couple of years after starting
secondary school; my parents held off because they thought that maybe it was
just a short-term interest. I think they might be convinced by now.

~~~
matthewwarren
Oh yeah, I'd forgotten about the RM machines, they were pretty cool as well!

------
jamesadevine
For more information on the runtime (the underpinnings of MakeCode):
[https://lancaster-university.github.io/microbit-docs/](https://lancaster-
university.github.io/microbit-docs/)

We are using the approach taken with micro:bit to support other resource
constrained devices, like the adafruit circuit playground:
[https://makecode.adafruit.com](https://makecode.adafruit.com)

------
Someone
[http://www.nordicsemi.com/nordic/content_download/108537/184...](http://www.nordicsemi.com/nordic/content_download/108537/1840103)
states ”Nordic Semiconductor’s nrF51822 is the brain of the micro:bit
combining the latest Bluetooth low energy, _ _ANt+_ _ and proprietary wireless
technology with a 32-bit ArM Cortex-M0 microprocessor”

So, the hardware supports ANT+. The software stack doesn’t seem to, however.
Does anybody know whether that is possible/worked on? If not, is there similar
‘beginner’ hardware that does?

------
pjmlp
Interesting, the PXT language (TypeScript subset) does have a native code
backend.

[https://makecode.com/language](https://makecode.com/language)

~~~
matthewwarren
Hmm, I completely missed that, thanks for pointing it out
([https://makecode.com/language#static-compilation-vs-a-
dynami...](https://makecode.com/language#static-compilation-vs-a-dynamic-vm))

I assumed that the PXT worked the same as MicroPython, but it seems like it
actually compiles directly to machine code, nice!

------
hguhghuff
This computer seems the least interesting if all computers I can think of.
It's like they actually tried to make it not have exciting potential.

You have to really work to hobble a modern computer to remove the excitement
factor but somehow the BBC rose to the challenge.

~~~
IanCal
I just had a look to see how to build an android app to make a hot/cold beacon
finder and where to buy beacons.

You know what? I'm already bored. And that's before I've started trying to
install eclipse and what sdks I need and whether to use kotlin and how to
setup the right things.

I mean, I found the google docs and one of the first steps is

> Request an OAuth 2.0 Client ID

Great, going to get some young kids excited by explaining what oauth is and
how to log into the google developers console.

Next up, what XML you need to know to create an interface and add what threads
are and ...

Or:

[https://makecode.microbit.org/projects/hot-or-
cold](https://makecode.microbit.org/projects/hot-or-cold)

Done.

~~~
djaychela
I think that sums a lot of 'progress' up to me; I've had several abortive
attempts to 'get into programming' over the last 20 years or so, and all of
them have floundered early on on various pre-requisites which just seemed too
much to deal with. I'm now persevering with Python (which seems in some way to
suffer less that others, but also because I'm sticking at it this time as I
want to change career), but I can remember giving up when it seemed I had to
write about 50 lines of code just to get a window up with an OK button. I'm
sure the same is true many multiples over with kids, and the micro:bit seems a
good solution to that.

~~~
IanCal
If it helps, I've recently started adding more UIs to things and the main way
I'm doing it is with web pages.

Easy to make, lots of tutorials, requires another language unfortunately but
still a useful skill.

Not always applicable, but can be a good approach.

Best of luck, I know there are some hard steps to take (particularly the stage
of "ok I can write code but what can I actually _do_ with it"), but things
really build after a while. Oh, and I've been coding for maybe 17 years and

1\. I keep writing code that's wrong 2\. I get basic things wrong all the time
3\. I still have to regularly look things up

My wife is learning to code, and I think she felt these things meant she
wasn't doing well at it, but it's really common. I'm just used to it and have
more experience finding my mistakes because I've made them so much.

> and the micro:bit seems a good solution to that.

I think so. I think there's a huge step forwards when you can get _something_
working quickly, then build from there.

~~~
djaychela
Thanks for all that - one of the most honest and helpful comments I've seen on
here, and particularly useful for me! Usually people don't let on about them,
so I feel much better.

I'm buying my youngest step-child a Micro:bit for Christmas. Well, I say it's
for him...

~~~
matthewwarren
> I'm buying my youngest step-child a Micro:bit for Christmas. Well, I say
> it's for him...

I think that I'll be doing something similar ;-)

------
mtgx
It seems like the RISC-V ISA would make more sense for a project like this,
no?

~~~
jacquesm
There is a very long history regarding the BBC and ARM, you could say that
without the BBC ARM would not have existed at all.

~~~
matthewwarren
> you could say that without the BBC ARM would not have existed at all

Huh, I'd not thought about it like that before. Yeah I guess ARM/Acorn does
owe the BBC quite a bit!

