Due to high demand expect some shipping delays at this time, orders may not ship for 1-2 business days.
0

ASM programming
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

ASM programming

by ADA_MYL on Tue Jun 16, 2020 8:55 pm

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

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

Re: ASM programming

by westfw on Wed Jun 17, 2020 4:02 am

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.

westfw
 
Posts: 1773
Joined: Fri Apr 27, 2007 1:01 pm
Location: SF Bay area

Re: ASM programming

by kevinjwalters on Wed Jun 17, 2020 6:14 am

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.

kevinjwalters
 
Posts: 933
Joined: Sun Oct 01, 2017 3:15 pm

Re: ASM programming

by ADA_MYL on Wed Jun 17, 2020 4:15 pm

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.

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

Re: ASM programming

by kevinjwalters on Wed Jun 17, 2020 5:44 pm

  • 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.

kevinjwalters
 
Posts: 933
Joined: Sun Oct 01, 2017 3:15 pm

Re: ASM programming

by kevinjwalters on Thu Jun 18, 2020 8:00 am

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

kevinjwalters
 
Posts: 933
Joined: Sun Oct 01, 2017 3:15 pm

Re: ASM programming

by kevinjwalters on Wed Jul 08, 2020 1:47 pm

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.

kevinjwalters
 
Posts: 933
Joined: Sun Oct 01, 2017 3:15 pm

Re: ASM programming

by kevinjwalters on Wed Jul 29, 2020 12:45 pm

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.

kevinjwalters
 
Posts: 933
Joined: Sun Oct 01, 2017 3:15 pm

Re: ASM programming

by kevinjwalters on Mon Aug 31, 2020 2:00 pm

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.

kevinjwalters
 
Posts: 933
Joined: Sun Oct 01, 2017 3:15 pm

Re: ASM programming

by kevinjwalters on Tue Oct 20, 2020 3:35 pm

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


kevinjwalters
 
Posts: 933
Joined: Sun Oct 01, 2017 3:15 pm

Re: ASM programming

by kevinjwalters on Mon Nov 23, 2020 12:42 pm

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

kevinjwalters
 
Posts: 933
Joined: Sun Oct 01, 2017 3:15 pm

Re: ASM programming

by kevinjwalters on Tue Dec 08, 2020 5:20 pm

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

kevinjwalters
 
Posts: 933
Joined: Sun Oct 01, 2017 3:15 pm

Please be positive and constructive with your questions and comments.