arm thumb2 assembly

Questions and discussion about running MicroPython on a micro:bit board.
Target audience: MicroPython users with a micro:bit.
Post Reply
Posts: 85
Joined: Tue Nov 07, 2017 11:45 pm

arm thumb2 assembly

Post by rhubarbdog » Mon Aug 20, 2018 4:17 am

Has any one got examples of using the arm thumb2 assembly language.
In particular i want to have a function that takes a pin and a bytearray as parameters.
in a while loop until a terminal condition is met the code is

Code: Select all

while not Terminal_Condition:
Any digital sensors that use a 1 wire protocol to transmit their data can't be used on the microbit, micropython just runs too slow. I've looked on github and someone has written an extension to microbit micropython to handle bit banging. It's just never been accepted.
I thought writing a bit bang function in assembler may be the answer it's just there's a lack of examples out there.


Posts: 238
Joined: Sun Apr 17, 2016 1:55 pm

Re: arm thumb2 assembly

Post by shaoziyang » Mon Aug 20, 2018 7:47 am

Code: Select all

from microbit import *'S')

def get_serial_number(type=hex):
    NRF_FICR_BASE = 0x10000000
    DEVICEID_INDEX = 25 # deviceid[1]

    def reg_read(r0):
        ldr(r0, [r0, 0])
    return type(reg_read(NRF_FICR_BASE + (DEVICEID_INDEX*4)))
while True:
    if button_a.was_pressed():

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

Re: arm thumb2 assembly

Post by dhylands » Mon Aug 20, 2018 5:18 pm

I have an example here: ... (the _write_packet routine).

User avatar
Posts: 3161
Joined: Fri Jul 18, 2014 8:01 am
Location: UK

Re: arm thumb2 assembly

Post by pythoncoder » Tue Aug 21, 2018 8:51 am

Peter Hinch

Post Reply