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...
-
If you want to write assembly, ditch the arduino IDE and just use the avr toolchain straight.– BrettFolkinsCommented 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.– Jester JeffreyCommented Jan 6, 2016 at 6:24
-
Why do you want to? Seriously.– Nick Gammon ♦Commented Feb 5, 2016 at 10:11
3 Answers
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.
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.
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.