This is a simple starting point to write AVR code on avr-gcc and simulate it using Simulide. This simple example is based on the Blinking LED example for the Atmega328P. The reason for this is to create a simple, modern, minimal IDE like exprience on Linux (neovim) without any fancy closed source software like Atmel Studio.
src/contains the source code for the simulation.CmakePresets.jsoncontains the cmake presets for thegcc-avrtoolchain.build/AVRcontains the build files for the simulation.
Here's a video of the simulation in action.
The quick and dirty way
sudo pacman -S cmake avr-gcc avrdude avr-libc libusb
yay -S simulideInstall Simulide (I suggest building from source) and avr-gcc using your package manager.
I mean, you can use Windows, but why would you?
Run the following to configure the cmake presets for the AVR toolchain.
cmake --preset AVRThe custom cmake compiler for Simulide is cmake_avrgcc.xml you can
symlink/copy it to the default custom compiler location at
/usr/share/simulide/data/codeeditor/compilers/compilers.
sudo ln -s cmake_avrgcc.xml /usr/share/simulide/data/codeeditor/compilers/compilersNow, drag and drop the simulation file blink.sim1 to the Simulide editor.
That's it, now you can just drag and drop the source file from src/ to the
Simulide editor and compile it using the cmake_avrgcc compiler and upload the
hex file to the simulation.
You can run the following to flash the hex file to an actual AVR device through the USB port.
cmake --build --preset flash-blinkThis project is licensed under the MIT License - see the LICENSE file for details.
