How to Use AVR-Controller App - A simulated AVR ATmega328 CPU for Arduino Uno systems

If you want to build your own controller device, you could leverage an Android device and the AVR-Controller app to simulate an Arduino Uno.

To use AVR-Controller, start by downloading the Android app to your Android smartphone.

Link to AVR-Controller for Android smartphones

AVR-Controller is a simulated AVR CPU that might be helpful to the teacher, student, or hobbyist who wishes to develop and debug code for an AVR ATmega328 CPU which is the CPU in an Arduino Uno board.

Select compatible board

Arduino IDE


If you don't already have Arduino IDE installed, download it and install it. You might also want to leverage VisualINO if you want a visual programming model instead of the C or C++ programming languages.

Once installed, start Arduino IDE as you normally would as if you had an Arduino Uno board attached to your PC.

AVR-Controller is compatible with an ATmega328 which is the CPU in an Arduino Uno, so select that as your board type in Arduino IDE under the Tools menu.


Compile code

Arduino IDE


To create an AVR (Arduino Uno) program to run in AVR-Controller you will develop the program on another device such as a Window or Linux PC or laptop. See this Arduino Controller example for code that will flash AVR-Controller digital outputs on and off. Otherwise pick almost any of the numerous pieces of example code that come with Arduino IDE.

Once you think you're ready to compile and upload your code to an Arduino Uno, instead of uploading to an Arduino Uno board you will select to export compiled binary. This command under the Sketch menu will create a file on your computer with a *.hex extension in the same directory as your Arduino IDE project.


Load machine code

AVR-Controller AVR-Controller


After installing AVR-Controller, start AVR-Controller. You can then load the *.hex memory file into the simulated AVRs main program memory space. Load the *.hex memory file that has the machine code you want to run by loading it through the file open menu.


Run machine code

AVR-Controller


Once you've opened the AVR (Arduino Uno) program stored in a *.hex file, you should be at the main AVR-Controller view.

From the main AVR-Controller view, select Go/Run from the menu to execute the AVR (Arduino Uno) program. The Go/Run command will run the code just like if you had uploaded it to an Arduino Uno board. The window displays a simple representation of the Arduino Uno input and output pins. As your program runs the pins will be white or colored indicating the pin would be at 0 volts or 5 volts. If the program is designed to run forever, you can stop it by selecting Stop from the menu.

Digital outputs will show bits that are on as colored buttons and bits that are off as white buttons. Digital inputs can be clicked on to toggle between if the input is on (colored) or off (white). Clicking on a bit configured as digital output will not change it's state. Analog inputs are controlled by entering a numerical value. Buttons that are grey are there to represent pins that you would see on an Arduino board. Any text that the Ardunio is programmed to send to its serial output port will show up in a simulated 5 line LCD display below the digital and analog controls.

Link to AVR-Controller for Android smartphones


teraKUHN solutions
Hardware Setup Control System Hardware Abstraction Development Tools
Smartphone Controller USB-Controller teraKUHN IO System (KIOS) Debug Z80
Arduino Controller N/A C & C++ coding abstraction macros Debug AVR



Here are some architecture characteristics that can be demonstrated by these two control solutions. These differences can be used for teaching processor and microcontroller concepts.

control solutions
Z80 custom with KIOS AVR Arduino
CISC RISC
von Neumann architecture Harvard architectures
Run-time software abstraction layer Compile time coding abstraction macros
custom electonics board pre built Arduino board



Copyright (C) 2021 R. J. Kuhn. Please note that you are not allowed to reproduce or rehost this page without written permission.