OpenAVR project

Overview

OpenAVR is an open-source AVR-compatible core developed in THDL++. It supports all AVR instructions from ATTiny cores, so you can develop firmware for it in C/C++ using GCC.

Downloading and trying out

Here is a step-by-step guide on downloading, compiling and testing OpenAVR:

  1. Download OpenAVR 1.1 here.

  2. Download the free Xilinx ISE WebPack, or any other VHDL tool of your choice.

  3. Download and install VisualHDL.

  4. Unpack OpenAVR into a directory and open the project file in VisualHDL.

  5. If you are using Xilinx ISE WebPack, simply press F5 in VisualHDL, so that the core will be compiled and run in the simulator. If not, press Ctrl+F7, open the project folder and build the generated VHDL files using your tool. In the simulator find the simulated_clock_provider->uut->leds signal and observe how it chanegs over time. This corresponds to the firmware\test.cpp file in OpenAVR archive.

  6. The OpenAVR package is ready to be compiled for Xilinx 3s700an FPGA chip. Just select "FPGA Bitstream" in VisualHDL Project Explorer and press F7.

Exploring sources/modifying/playing around

Here are the tips on exploring/modifying OpenAVR sources:

  • To modify the test firmware, download WinAVR, edit the firmware\test.cpp file and rebuild the binary file by running _build.bat and rebuild the core in VisualHDL.

  • To select another firmware file, open MCU.thp file and search for SynchronousROM. You will see the file name specified there.

  • To modify the root entity, or hardware settings (e.g. use another FPGA board), go to the end of MCU.thp and modify the simulate_entity and synthesize_hardware statements.

  • To learn more about THDL++, read the THDL++ tutorial.