Author Topic: Heartblink; assembly fading led blinky for the STM F0 Discovery Board  (Read 639 times)

0 Members and 1 Guest are viewing this topic.

Offline techman-001Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 748
  • Country: au
  • Electronics technician for the last 50 years
    • Mecrisp Stellaris Unofficial UserDoc
A pure Assembly Language 'fading blinky' from Matthias Koch.

A differential equation is numerically approximated (providing the sine/cosine/triangle function), the result interpreted as a floating point number and converted to integer (to get an exp(x) approximation) and fed into a sigma/delta modulator, the output of which drives the LED.

The exp(x) approximation is to correct for human eyesight

Three choices of led modulation algorithm in the Makefile, sine, cosine or triangle which compile to 58 or 60 bytes.

Fully commented source here:
https://mecrisp-stellaris-folkdoc.sourceforge.io/heartblink.html

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf