ASM programming

For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
ADA_MYL
 
Posts: 2
Joined: Tue Jun 16, 2020 8:52 pm

ASM programming

Post by ADA_MYL »

How can I program in assembler on the Clue.
I would like to use gcc tools for my students.
Any help would be appreciated.

User avatar
westfw
 
Posts: 2010
Joined: Fri Apr 27, 2007 1:01 pm

Re: ASM programming

Post by westfw »

https://www.nordicsemi.com/Software-and ... Toolchains

Also, the Arduino IDE will support ASM in the form of .S files using the "gas" assembler.

However, I would think that the Clue would be a particularly poor choice for Assembly Language programming. It starts out that ARM in general is poorly documented at the ASM level. and poorly supported in Symbol files. It also has complex peripherals, to the extent that Arduino chose to make their Core for the NRF chips run on top of FreeRTOS, which in turn uses Nordic "SoftDevices" that are impenetrable blobs. AFAIK, You don't get the ability to have a small ASM program that makes use of OS calls (as you would on an ARM linux system like an RPi), but you don't get the freedom of writing code for bare metal, either. And you don't get debugging support :-(

IMO, one of the SAMD boards would be a much better choice.

User avatar
kevinjwalters
 
Posts: 1026
Joined: Sun Oct 01, 2017 3:15 pm

Re: ASM programming

Post by kevinjwalters »

I'd associated MicroPython with simple programming for teaching until I watched a Damien George talk and he mentioned it supports inline assembler! This is almost as fun as perl's Inline::C or Inline::ASM! I have no experience of this but it might be worth a look for dipping one's toe in. The syntax is hammered into things that look like python functions.

The example on http://docs.micropython.org/en/v1.9.3/p ... mbler.html is for the pyboard but if something similar works on the micro:bit that gives a cheap option and they are often lying around (UK) schools.

There is also a form of selective compilation and with native and viper code emitters which might be of interest depending on what you're teaching https://docs.micropython.org/en/latest/ ... de-emitter

I'd imagine you already know about it by some schools in the UK refer to, demonstrate or use a little man computer simulator - there are several browser-based ones around. There was a tiny amount of assembler in the OCR syllabus for GCSE exams (age 16) in the UK but that might have been removed. They used an unspecified, made-up syntax that tends to look like 6502, perhaps an accidental nod towards Acorn's BBC B microcomputer that was the first widely used computer in UK schools.

User avatar
ADA_MYL
 
Posts: 2
Joined: Tue Jun 16, 2020 8:52 pm

Re: ASM programming

Post by ADA_MYL »

westfw, kevinjwalters,
Thank you for your inputs. I am not using the Clue as my main platform to teach ASM but as a tool to spark interest in hobby programming.
The Clue has many sensors of interest for students, I want to spark interest in Aviation with these examples.
I will explain the Acceleration sensors for Flight control and Magnetometer for Heading source with CircuitPython.
I have been working in Aviation for the last 30 years and want to drum up interest in the field with students.
Thanks Again.

User avatar
kevinjwalters
 
Posts: 1026
Joined: Sun Oct 01, 2017 3:15 pm

Re: ASM programming

Post by kevinjwalters »

  • The pressure sensor is pretty good on the CLUE, you can see in action on CLUE Sensor Plotter in CircuitPython: Sensors, that's got clear potential for altimeter, VSI, whatever that beeping thing is called in gliders.
  • You might be able to get some interesting data out of the accelerometer if you can attach the CLUE firmly to part of the airframe (cable ties?). I'm sure there's vibrations that would be indicative of various rpms and MR/prop balance issues, the ulab library might be useful there for filtering and you could data log it for later more thorough analysis.
  • You've got temperature (affected by board heating) too but it would take a "brave" person to try and get OAT with it!
  • The full gyro+accel could at least demonstrate INS concepts. I suspect RNAV 10 isn't going to happen :)
I've seen someone talking METARs/TAFs in the context of the PyPortal too. I'll have a rummage for that.

User avatar
kevinjwalters
 
Posts: 1026
Joined: Sun Oct 01, 2017 3:15 pm

Re: ASM programming

Post by kevinjwalters »

This is the PyPortal METAR viewer: https://github.com/bradwbonn/pyportal-metar

User avatar
kevinjwalters
 
Posts: 1026
Joined: Sun Oct 01, 2017 3:15 pm

Re: ASM programming

Post by kevinjwalters »

You could also play around with the Bluetooth Low Energy:
  • You could use 3 CLUEs as beacons with a const Advertisement packet with the type in. If you can find a way to control/limit the direction then you could make an O/M/I setup for other CLUEs to fly over.
  • Bit more invovled but with a Raspberry Pi and an external SDR you can pick up ADS-B and modern Pi's can do Bluetooth so you could relay the data to the CLUEs in the room for display.

User avatar
kevinjwalters
 
Posts: 1026
Joined: Sun Oct 01, 2017 3:15 pm

Re: ASM programming

Post by kevinjwalters »

Almost primary RADAR, it is ToF using something similar to TFmini Infrared Time of Flight Distance Sensor, no azimuth but looks good: Adafruit CLUE nRF52840 & CircuitPython - LIDAR RADAR.

User avatar
kevinjwalters
 
Posts: 1026
Joined: Sun Oct 01, 2017 3:15 pm

Re: ASM programming

Post by kevinjwalters »

On the PyPortal front, there's also a TRS tracker for one part of the world and I'm sure that could be adapted for elsewhere: PyPortal Hurricane Tracker.

User avatar
kevinjwalters
 
Posts: 1026
Joined: Sun Oct 01, 2017 3:15 pm

Re: ASM programming

Post by kevinjwalters »

I've not tried the code but this looks interesting for calculating yaw, pitch, roll from sensors like the ones on the CLUE:

User avatar
kevinjwalters
 
Posts: 1026
Joined: Sun Oct 01, 2017 3:15 pm

Re: ASM programming

Post by kevinjwalters »

Matrix Portal Flow Visualizer - one demo image shows slats, slots and flaps.

User avatar
kevinjwalters
 
Posts: 1026
Joined: Sun Oct 01, 2017 3:15 pm

Re: ASM programming

Post by kevinjwalters »

Turns out it's fairly easy to make that Flow Visualizer run on the PyPortal: PyPortal Flow Visualizer (YouTube).

Locked
Please be positive and constructive with your questions and comments.

Return to “CLUE Board”