Skip to content

Commit cd52239

Browse files
Merge pull request #302 from microbit-foundation/nav-updates
update docs for consolidated navigation
2 parents d17bffe + 95fbcb7 commit cd52239

File tree

11 files changed

+88
-267
lines changed

11 files changed

+88
-267
lines changed

bluetooth/index.md

Lines changed: 63 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ lang: en
1111

1212
## Overview
1313

14-
The micro:bit processor has an on-board [Bluetooth](http://blog.bluetooth.com/a-developers-guide-to-bluetooth/) transceiver. This is combined with a PCB trace aerial and other minor components alongside a software stack that gives the micro:bit a certified and credible Bluetooth capability.
14+
The micro:bit processor has an on-board [Bluetooth](https://www.bluetooth.com/specifications/) transceiver. This is combined with a PCB trace aerial and other minor components alongside a software stack that gives the micro:bit a certified and credible Bluetooth capability.
1515

1616
## Bluetooth software stack
1717

@@ -20,9 +20,68 @@ The micro:bit processor has an on-board [Bluetooth](http://blog.bluetooth.com/a-
2020

2121
Using Bluetooth, you can connect to other devices and send and receive data from and to the micro:bit.
2222

23-
## micro:bit Bluetooth Features
23+
Bluetooth is [distinct from the micro:bit to micro:bit radio feature](https://support.microbit.org/support/solutions/articles/19000083637-using-the-micro-bit-wirelessly-),which is a [proprietary protocol from Nordic and Lancaster University](https://lancaster-university.github.io/microbit-docs/ubit/radio/).
24+
25+
## BBC micro:bit Bluetooth Profile
26+
27+
The micro:bit supports Bluetooth via a single, custom-developed, BBC micro:bit profile. This profile allows it to communicate with other BLE capable devices.
28+
29+
## CODAL
30+
31+
A pre-compiled hex file is available to download for <span class="v2">V2</span> that enables all Bluetooth services.
32+
33+
[Bluetooth all services CODAL](/docs/bluetooth/assets/BLE_All_Services_CODAL_0-0-24-ABDLIMTU-P.hex){: .btn.sm-btn download}
34+
35+
The source for this can be found in the [microbit-v2-samples]https://github.com/lancaster-university/microbit-v2-samples/tree/master/source/samples repository.
36+
37+
### DAL
38+
39+
The BBC micro:bit <span class="v1">V1</span> [Bluetooth profile is defined in the DAL](https://lancaster-university.github.io/microbit-docs/ble/profile/)
40+
41+
You can flash one of two pre-compiled Hex files to the micro:bit <span class="v1">V1</span> that enable bluetooth services. As Bluetooth is memory intensive, these are supplied as either 'without Magnetometer Service' or 'without DFU Service':
42+
43+
[Without magnetometer](/docs/bluetooth/assets/BLE_All_Services_DAL_2-1-1-No-Mag.hex){: .btn.sm-btn download}
44+
45+
[Without DFU](/docs/bluetooth/assets/BLE_All_Services_DAL_2-1-1-No-DFU.hex){: .btn.sm-btn download}
46+
47+
The DAL contains the [C++ source for the BLE service files](https://github.com/lancaster-university/microbit-samples/blob/master/source/examples/bluetooth-services/main.cpp)
48+
49+
There are also some example programs in the [microbit-samples](https://github.com/lancaster-university/microbit-samples) repository:
50+
51+
- [bluetooth-eddystone-uid](https://github.com/lancaster-university/microbit-samples/tree/master/source/examples/bluetooth-eddystone-uid)
52+
53+
- [bluetooth-eddystone-url](https://github.com/lancaster-university/microbit-samples/tree/master/source/examples/bluetooth-eddystone-url)
54+
55+
- [bluetooth-uart](https://github.com/lancaster-university/microbit-samples/tree/master/source/examples/bluetooth-uart)
56+
57+
The micro:bit has a <span class="v2">V2</span>Bluetooth 5.0/<span class="v1">V1</span>Bluetooth 4.1 stack with Bluetooth Low Energy (BLE) and supports the <span class="v1">V1</span>[GAP Peripheral Role](https://bluetooth-developer.blogspot.com/2016/07/microbit-and-bluetooth-roles.html) and <span class="v2">V2</span> GAP Peripheral and Central device roles.
58+
59+
It operates in the ISM (Industrial Scientific Medical) band, as per all Bluetooth devices. This starts at **2.4GHz and ends at 2.41GHz**. BLE divides the frequency band into 50 x 2MHz bands of which 40 are used. These are called **channels** and numbered **0 to 39**. Channels 37, 38 and 39 are used for "advertising".
60+
61+
When devices are connected, they use the other channels in a particular sequence controlled by a feature called **adaptive frequency hopping**. This helps reduce the impact of congestion from other radio users.
62+
63+
Data transfer rates will only be a few hundred Kilobytes per second at best, and throughput depends on how your application uses the Bluetooth features. Throughput depends on the proportion of system protocol overheads to application data. Lots of small packets containing - for example - temperature data would have a lower data transfer rate than using the UART service.
64+
65+
There are some useful [advanced configuration options in the micro:bit runtime code](https://lancaster-university.github.io/microbit-docs/advanced/#compile-time-options-with-yotta)
66+
67+
## Challenge
68+
69+
It would be possible for anyone with the appropriate knowledge to define and implement other Bluetooth profiles.
70+
71+
We are seeking collaborators to help us define the new profile elements that expose some of the <span class="v2">V2</span> features.
72+
73+
## Further information
74+
75+
- [Martin Woolley's Bluetooth Blog](https://bluetooth-developer.blogspot.com/) has a range of information on using Bluetooth with micro:bit
76+
77+
- [BittySoftware](https://bittysoftware.blogspot.com) has a range of Bluetooth enabled software for the micro:bit
78+
79+
- [Original micro:bit "Out of the Box" experience](https://support.microbit.org/a/solutions/articles/19000021613), including some of the attributes in the Bluetooth Profile
80+
81+
- [Full profile with the display unused](https://lancaster-university.github.io/microbit-docs/resources/microbit-1_4_17_pwr0.zip). If you want to write to the display over bluetooth then you should use this file instead of the 'Out of the Box' hex, which uses the display.
82+
83+
- [micro:bit radio API documentation](https://lancaster-university.github.io/microbit-docs/ubit/radio/)
2484

25-
Bluetooth features available on the micro:bit are defined in a [Bluetooth profile](/bluetooth/profile). The micro:bit supports one, custom-developed profile.
2685

2786
## Bluetooth and the micro:bit software
2887

@@ -35,9 +94,4 @@ The processor also has several non-bluetooth, proprietary modes of operation upo
3594
- [Android App](https://play.google.com/store/apps/details?id=com.samsung.microbit) facilitates [pairing and flashing programs to the micro:bit](https://support.microbit.org/en/support/solutions/articles/19000051025-pairing-and-flashing-code-via-bluetooth)
3695
- [iOS App](https://apps.apple.com/gb/app/micro-bit/id1092687276)faciliates [pairing and flashing programs to the micro:bit](https://support.microbit.org/en/support/solutions/articles/19000051025-pairing-and-flashing-code-via-bluetooth)
3796
- [Swift Playgrounds](https://github.com/microbit-foundation/microbit-swift-playgrounds) contains a Playground Book available in the Swift app and a micro:bit Swift API to develop further resources
38-
Scratch.
39-
40-
## Further information
41-
42-
- [Bluetooth Specification](https://www.bluetooth.com/specifications/adopted-specifications)
43-
- [DAL/C++ Bluetooth Reference Documentation](https://lancaster-university.github.io/microbit-docs/ble/profile/#reference-documentation)
97+
- [Scratch](https://scratch.mit.edu/microbit) supports using a range of micro:bit Bluetooth services via the Scratch Link software and a custom built pairing .hex

bluetooth/profile.md

Lines changed: 0 additions & 75 deletions
This file was deleted.

hardware/power-consumption.md

Lines changed: 0 additions & 40 deletions
This file was deleted.
-140 KB
Binary file not shown.

software/hex-format.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,7 @@ MicroPython builds take a firmware.hex image (the MicroPython pre-compiled image
6464
## Microsoft MakeCode Editor
6565

6666
Hex files generated by the [MakeCode Editor](https://makecode.microbit.org) have embedded meta-data inside the .hex file. This is a [JSON encoded blob with various data about the script](https://github.com/Microsoft/pxt/blob/437f53ca6311335c7f3f75a062ec1079b4e7806a/docs/source-embedding.md), and also the source code program. This may be compressed, and it is stored inside the flash memory of the micro:bit (but only if space is available in the flash memory). But it is always inside the .hex file. This embedded source code program ensures that when you drag and drop the .hex file onto the originating editor, it can recover the source program again.
67+
68+
## Reading out a hex file
69+
70+
If you want to [read out the .hex file](https://www.embeddedlog.com/ubittool/usage.html) currently on your micro:bit, you can do so using [uBitTool](https://www.embeddedlog.com/ubittool).

software/index.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,7 @@ Each of the coding environments generates a special file called a .hex file, whi
108108

109109
The micro:bit code is updated by dragging a .hex file onto the MICROBIT drive that appears on your computer, when you plug in the micro:bit. It looks just like a USB memory stick to your computer (the flash drive is actually emulated by the [DAPLink](/software/daplink-interface) software)
110110

111-
It is also possible to 'flash' code to your micro:bit by using a mobile app, and using the Bluetooth communications interface from your mobile phone.
112-
113-
You can read more about [bluetooth flashing](/bluetooth/profile) or [bluetooth apps](/bluetooth/apps-and-examples) by following these links.
111+
It is also possible to 'flash' code to your micro:bit by using a mobile app, and using the [Bluetooth](/bluetooth/) communications interface from your mobile phone.
114112

115113
### micro:bit Low Level (C/C++) Software Stack
116114

software/makecode.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,24 @@ This target depends on several other repositories:
2626
- <https://github.com/lancaster-university/microbit> basic wrapper around the DAL
2727
- <https://github.com/lancaster-university/microbit-dal> the micro:bit DAL
2828

29+
## Compiler
30+
31+
MakeCode uses a built-in compiler to translate a project into a .hex file when you select **Download**.
32+
33+
This has the advantage of not requiring an internet connection in order to code the micro:bit. Once the browser editor at [makecode.microbit.org](https://makecode.microbit.org) loads, it is cached on your computer.
34+
35+
The MakeCode editors contain a copy of the micro:bit runtime [the DAL/CODAL](/software/runtime) which the blocks and javascript APIs reference.
36+
37+
When you press **Download** the compiler converts the code into a machine readable [hex file format](/software/hex-format).
38+
39+
When this .hex file is flashed onto the MICROBIT drive, the KL26/7 interface processor on the micro:bit copies it into the flash memory inside the nRF application processor and the code runs.
40+
41+
## Other Features
42+
43+
MakeCode supports two-way conversion of code, so you can write code as blocks and see what the generated code looks like in Javascript/MakeCode Python. You can also write Javascript/MakeCode Python code, and if possible, MakeCode will convert this back into blocks automatically.
44+
45+
MakeCode also allows you to [write your own block types](https://makecode.com/extensions) and [publish them as Extensions](https://makecode.microbit.org/extensions).
46+
2947
## App
3048

3149
An app is available for [Windows 10](https://www.microsoft.com/en-gb/p/makecode-for-micro-bit/9pjc7sv48lcx?rtc=1&activetab=pivot:overviewtab)

software/python-editor.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,19 @@ The Python editor is based upon the [Ace editor](http://ace.c9.io) and includes
2121

2222
The upstream source code for the Python Editor can be found at [github.com/bbcmicrobit/PythonEditor](https://github.com/bbcmicrobit/PythonEditor)
2323

24-
The micro:bit target depends a closed source versioning repository that facilitates releases at `/v/`, for example the beta editor https://python.microbit.org/v/beta and previous releases.
24+
The micro:bit target depends a closed source versioning repository that facilitates releases at `/v/`, for example the beta editor [https://python.microbit.org/v/beta](https://python.microbit.org/v/beta) and previous releases.
2525

2626
### Offline
2727

2828
It is possible to use the Python Editor offline to generate, upload and download .hex or .py files. However, refreshing the browser resets the editor.
2929

30-
### Mu
31-
32-
[Mu](http://codewith.mu/) is a third party Python editor, that provides a downloadable, offline coding experience for the micro:bit and includes features such as datalogging and code debugging.
33-
3430
### Documentation
3531

3632
- [MicroPython reference](https://microbit-micropython.readthedocs.io/en/v1.0.1/) provides information and examples on using the blocks
3733
- [Developer setup](https://github.com/bbcmicrobit/PythonEditor/blob/master/README.rst)
3834
- [Filesystem](https://github.com/bbcmicrobit/PythonEditor/blob/master/docs/filesystem.md)
3935
- [Translation strategy](https://github.com/bbcmicrobit/PythonEditor/blob/master/docs/translations.md)
4036
- [Embedding the editor](https://github.com/bbcmicrobit/PythonEditor/blob/master/docs/embedEditor.md)
41-
- [MakeCode Technical Docs](https://makecode.com/docs) for general development
4237

4338
### Community
4439

0 commit comments

Comments
 (0)