2

I've been given a digispark and am looking to write straight assembly code for it. Anyone know how to get started with this? I've been successful in getting the Arduino IDE set-up but would really like to avoid writing assembly in-line...

3
  • If you want to write assembly, ditch the arduino IDE and just use the avr toolchain straight. Commented Jan 6, 2016 at 0:44
  • @BrettAM I've really been trying to figure it out. Know of any good tutorials that might help? Appreciate the response. Commented Jan 6, 2016 at 6:24
  • Why do you want to? Seriously.
    – Nick Gammon
    Commented Feb 5, 2016 at 10:11

3 Answers 3

1

There seems to be some specific attiny flag required but by the gcc in order to make the genereated hex file work with digispark. Take a look here https://github.com/pda/digispark-asm.

1
  • A specific flag? You mean -mmcu=attiny85? Commented Feb 6, 2016 at 11:48
1

I've been given a digispark and am looking to write straight assembly code for it. Anyone know how to get started with this? I've been successful in getting the Arduino IDE set-up but would really like to avoid writing assembly in-line...

The Arduino IDE build support assembly files (.S). Nerd Ralph has written a blog on the subject. There you will find all the details and how to write both inline and pure assembly files. He is really god at digging out all the details and sharing his findings.

1

In 2021, I use VSC + Platformio.

I create a main.asm file in which I put the code from https://github.com/pda/digispark-asm.

In the "platformio.ini" file I define the digispark as :

[platformio]

default_envs = digispark-tiny

[env:digispark-tiny]

platform = atmelavr

board = digispark-tiny

I run the code, upload it to a digispark and this works amazingly well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.