Micro-Bit - anyone "played" ?

Go To Last Post
17 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've had a Micro-Bit for a while but it only came to light again after I did some tidying up at the weekend. Now I know it's not Atmel based so this is probably misplaced but has anyone else from here had a play with one of these? Sure there are all kinds of very high level mechanisms for programming it - but does anyone have a "bare metal" setup for programming raw registers in C or C++ ?

 

The "lowest level" programming I have found for it so far is actually its mbed compatibility and that is, itself, reliant on a hardware adaptation layer from Lancaster University. But that still feels a bit too "Arduino" for my tastes.

 

If one just wants to get an arm-gcc and wrap an IDE around it to write some plain C/C++ then what do you do about things like CRT to get the device "warmed up" enough to actually do something? I can likely work this out but equally I don't want to reinvent the wheel. Rather surprisingly I can't get my googling friend to admit to anyone else ever having done this - I just assume I'm not picking the right search terms?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
Sure there are all kinds of very high level mechanisms for programming it - but does anyone have a "bare metal" setup for programming raw registers in C or C++ ?
... or Ada?

https://github.com/AdaCore/Ada_Drivers_Library/tree/master/examples/MicroBit

The Micro:Bit is a very small ARM Cortex-M0 board designed by the BBC for computer education. It's fitted with a Nordic nRF51 Bluetooth enabled microcontroller and an embedded programmer. You can get it at:

...

pyOCD

...

Ada ZFP (Zero Foot Print) run-time

...

Start GNAT Programming studio (GPS) and open the Micro:Bit example project: "Ada_Drivers_Library/examples/MicroBit/microbit_example.gpr".

Press F4 and then press Enter to build the project.

...

gdb

...


https://github.com/AdaCore/Ada_Drivers_Library/tree/master/boards/MicroBit

The AdaCore Blog

GPS for bare-metal developers

by Anthony Leonardo Gracio

Apr 19, 2017

http://blog.adacore.com/gps-for-bare-metal-development

 

Edit : blog

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Tue. May 2, 2017 - 05:39 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You could use MBED and choose a nrf board like a seeed tiny ble, but i think the microbit uses the smaller ram part. There's platformio that might be another choice. Whilst I've done a bit of nrf51822 work, i've not done it on my microbits. About all I have done with my microbits is run micropython. My girls only showed a passing interest in them.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AIUI, and as Kartman says, the thing you're programming is the Cortex-M0 in the nRF51 BLE chip - so the place to go for info would be https://www.nordicsemi.com/ and  https://devzone.nordicsemi.com/q...

 

Most (all?) of Nordic's samples are based on Keil - you can get working BLE on the nRF51 with the free version.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have used the Nordic chip with GCC under Eclipse. Once you get it all set up it works well, but, as in all my Eclipse experience, there's a lot of stuff I leave well alone once I randomly get it working!

Quebracho seems to be the hardest wood.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

John_A_Brown wrote:
Once you get it all set up it works well, but, as in all my Eclipse experience, there's a lot of stuff I leave well alone once I randomly get it working!

To be fair, this is probably not unique to Eclipse; eg, if you were to try to set up by yourself the equivalent of Atmel Studio from scratch with bare releases of GCC, GDB, Visual Studio, etc - it would probably be a similar effort.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The microbit libraries have a bit going on in the background - updating the 5x5 led matrix with animation and processing the accelerometer. They make the cortex m0 work hard!

I've started a project with the nrf52 today. Has not been very successful thus far. With the nrf51, everything worked out of the box - i had a virtual uart link to the iphone working in no time.
With the nrf52, the demo code doesn't seem to work as I would hope. I tried an example using freertos - added another task and it dies. Tried fiddling a zillion stack and heap sizes to no avail. More things to try tomorrow.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
The microbit libraries have a bit going on in the background - updating the 5x5 led matrix
In the examples take a look at the "invaders" for example. It's even spawning three threads of execution so there's clearly an RTOS buried in there too.

 

That's what I wanted to get away from - the whole thing (even just the Lancaster HAL layer) is elevating it to at least the level of Arduino abstraction and possibly even beyond. So if you wanted to light just one of those 25 LEDs in that 5x5 matrix it's not clear how something so "low level" would be achieved. Digging through the code it appears there's one 32 bit port with 5 row and 5 column connnections and an LED is lit at the interception of the two. But that suggests time based multiplexing which then raises the question of what they are doing about current limiting. Does the display() method in the HAL rely on the "animation timer" never stopping/pausing and does the smoke escape if that happens?

 

I begin to wonder about the merits of this thing. The idea from the BBC is to make a whole new generation "computer literate" but offering Lego Next or Arduino style programming (or something even higher level) isn't really preparing a next engineering generation. For a long time to come MCUs are still going to be programmed in C/C++ and setting bits in IO etc.

 

In fact I am still a great fan of the learning route of transistor->gate->half-adder->full-adder->ALU->MPU->MCU with some Asm and C at the lowest level thrown in. I know C++ and Java is all about abstraction and re-use but someone still needs to be available to implement the foundations on which such schemes are based.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Are the schematics available?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
Are the schematics available?
http://tech.microbit.org/hardwar...

 

This pages says:

The schematic will be kept in version control in the micro:bit GitHub account. It will be released by the BBC once final sign-off around license terms has completed.

So I guess we're saying the BBC has not "signed off" yet ?

 

However it was worth googling to that page as it told me things about the LED array (for example) I did not know.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
So I guess we're saying the BBC has not "signed off" yet ?

or that page is out-of-date?

 

There is something here: https://github.com/bbcmicrobit/h... "2 months ago"

 

This version differs slightly from that used in manufacturing the original micro:bit, in that trademarks (which are licensed separately) have been removed.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

AIUI, and as Kartman says, the thing you're programming is the Cortex-M0 in the nRF51 BLE chip - so the place to go for info would be https://www.nordicsemi.com/ and  https://devzone.nordicsemi.com/q...

 

Most (all?) of Nordic's samples are based on Keil - you can get working BLE on the nRF51 with the free version.

Hmmm. The schematic shows a Kinetis Cortex as well. Exactly the same part I've been using for another project. MKL26Z128. I guess they're using it as a USB interface, and to program the nRF51.

Quebracho seems to be the hardest wood.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

John_A_Brown wrote:
The schematic shows a Kinetis Cortex as well ... I guess they're using it as a USB interface, and to program the nRF51.

Yes - I think so.

 

I think that's what gives the mbed drag-and-drop programming (it appears as a storage device). Also a virtual COM port?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

View this email as a web page here.

SparkFun Logo

 

13988-04.jpg

 

Micro:bit has arrived at SparkFun! If you haven't already, order yours today! Don't forget to add a breakout to it for your hacking needs!

 

The BBC micro:bit is a pocket-sized computer that lets you get creative with digital technology. You can code, customize and control your micro:bit from anywhere! You can use your micro:bit for all sorts of unique creations, from robots to musical instruments and more.

 

 

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The reference design schematic is available in various forms at https://github.com/microbit-foun... including PDF - 

https://github.com/microbit-foun...  

 

David

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I picked one up at Fry's (Palo Alto) last weekend.  $12.99.
I haven't played with it yet.