BBC Micro Bits - with Python

Questions and discussion about running MicroPython on a micro:bit board.
Target audience: MicroPython users with a micro:bit.
Turbinenreiter
Posts: 288
Joined: Sun May 04, 2014 8:54 am

BBC Micro Bits - with Python

Post by Turbinenreiter » Thu Mar 12, 2015 5:12 pm

The BBC will be giving away mini-computers to 11-year-olds across the country as part of its push to make the UK more digital.

One million Micro Bits - a stripped-down computer similar to a Raspberry Pi - will be given to all pupils starting secondary school in the autumn term.
When it launches in September it will be compatible with three coding languages - Touch Develop, Python and C++.
http://www.bbc.com/news/technology-31834927

It seems like a Microcontroller to me - will this run Micro Python?

Damien
Site Admin
Posts: 647
Joined: Mon Dec 09, 2013 5:02 pm

Post by Damien » Thu Mar 12, 2015 8:13 pm

Good question! If it is also compatible with C++ then I assume it has some offline compiler for all the supported languages and just downloads a binary image each time you change the code.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: BBC Micro Bits - with Python

Post by dhylands » Thu Mar 12, 2015 9:13 pm

I found this high-res photo: http://cdni.wired.co.uk/1920x1280/k_n/M ... andsOn.jpg and it looks like its an ATMega32u4

So I don't think you'll be running python on the board, certainly not MicroPython at any rate.

Turbinenreiter
Posts: 288
Joined: Sun May 04, 2014 8:54 am

Re: BBC Micro Bits - with Python

Post by Turbinenreiter » Thu Mar 12, 2015 9:57 pm

Does the PSF know about us?

Looks like its gonna be controlled by python running on the host. Or they built a compiler, which I highly doubt.

Damien
Site Admin
Posts: 647
Joined: Mon Dec 09, 2013 5:02 pm

Re: BBC Micro Bits - with Python

Post by Damien » Thu Mar 12, 2015 10:15 pm

Turbinenreiter wrote:Does the PSF know about us?
Sort of... I gave 3 invited talks at PyCon UK last year which were well received, and attended by some of the core Python devs. But I don't think knowledge of uPy has permeated to all in the PSF.

Damien
Site Admin
Posts: 647
Joined: Mon Dec 09, 2013 5:02 pm

Post by Damien » Fri Mar 13, 2015 9:23 pm

Apparently they did consider using MicroPython.

Damien
Site Admin
Posts: 647
Joined: Mon Dec 09, 2013 5:02 pm

Re: BBC Micro Bits - with Python

Post by Damien » Fri Mar 13, 2015 10:52 pm

See here for a small discussion on the MicroBit and uPy: https://mail.python.org/pipermail/pytho ... 03569.html

Damien
Site Admin
Posts: 647
Joined: Mon Dec 09, 2013 5:02 pm

Re: BBC Micro Bits - with Python

Post by Damien » Sat Mar 14, 2015 7:23 pm

I tried compiling uPy using avr-gcc (for a generic 8-bit AVR arch) just to see if it's at all feasible to try and put uPy on an Atmel 8-bit device.

The result: no, not going to fit :(

I got the bare-arm/ "port" compiling with avr-gcc and the final code size was 123742 bytes compared with 73420 using arm-none-eabi-gcc. Thus 8-bit AVR code density is roughly 1.7 times that of Thumb2! So uPy is never going to fly on an 8-bit Atmel :(

For reference, code density of x86 is roughly 1.8 times Thumb2.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: BBC Micro Bits - with Python

Post by dhylands » Sat Mar 14, 2015 9:51 pm

It might fit on one of the larger devices, the like ATMega2560 (which has 256K flash).

But the whole Harvard architecture throws a wrench in things since you can't access code the same way that you access data.

So it may be possible, but I don't think its worth the effort.

Damien
Site Admin
Posts: 647
Joined: Mon Dec 09, 2013 5:02 pm

Post by Damien » Sat Mar 14, 2015 10:01 pm

The 16 bit dspic has some fancy way of taking the address of a function in ROM even though the ROM is larger than the addressable range of a 16 bit pointer.

Post Reply