**simuc** is used to simulate a megaAvr microcontroller.
-If the cpu is stopped by command or `avr-gdb`, some information is printed on standard output:
+The git repository for this program can be found on the git repository [https://git.htl-mechatronik.at/public/?p=sx/simavr.git;a=home](https://git.htl-mechatronik.at/public/?p=sx/simavr.git;a=home).
+The software `simuc` itself is located in the subfolder [examples/simuc](https://git.htl-mechatronik.at/public/?p=sx/simavr.git;a=tree;f=examples/simuc;hb=HEAD)
+
+----------------------------------------------------
+
+## Installation
+
+If the Debian/Ubuntu htl package is included the software is already installed.
+
+In any other case "ready to use" debian packages are located on [http://www.htl-mechatronik.at/ubuntu-new/pool/partner/](http://www.htl-mechatronik.at/ubuntu-new/pool/partner/) and can be installed after download with `apt install ...`.
+
+The package is available for 4 supported architectures:
+
+* **[amd64](http://www.htl-mechatronik.at/ubuntu-new/pool/partner/htl-simuc_0.0.6~1_amd64.deb)** Linux (Debian, Ubuntu, ...) PC 64 bit
+* **[i386](http://www.htl-mechatronik.at/ubuntu-new/pool/partner/htl-simuc_0.0.6~1_arm64.deb)** Linux (Debian, Ubuntu, ...) PC 32 bit
+* **[arm64](http://www.htl-mechatronik.at/ubuntu-new/pool/partner/htl-simuc_0.0.6~1_arm64.deb)** ARM 64 Bit (Respberry Pi 3,4 ... with RaspbianOs 64 Bit)
+* **[armhf](http://www.htl-mechatronik.at/ubuntu-new/pool/partner/htl-simuc_0.0.6~1_armhf.deb)** ARM 32 Bit (Raspberry Pi 2,3,4 ... with RaspbianOs 32 Bit)
+
+----------------------------------------------------
+
+## Overview
+
+If the microcontroller CPU is stopped by command or `avr-gdb`, some information is printed on standard output:
* Number of cycles and elapsed time
* Status Flags
* General Purpose registers r0..r31
* address registers X, Y and Z
* Stack pointer SP and stack content
-
-Commands available via standard input (keyboard):
-* *Enter* print current cycles, elapsed time and LED status
-* `interrupt`: stop cpu
-* `continue`: continue cpu run
-* `stack`: print complete stack content on standard output
+* LED status for some type boards (Arduino, Sure Electronics, ...)
+
+**Commands** available via standard input (keyboard):
+* ***Enter*** print current cycles, elapsed time and LED status
+* `break` + *Enter*:
+ ... stop microcontroller CPU (breakpoint)
+* `continue` + *Enter*:
+ ... continue microcontroller CPU
+* `reset` + *Enter*:
+ ... simulate external reset (registers will be cleared, SRAM contents remain unchanged)
+* `power` + *Enter*:
+ ... simulate power on reset (registers and SRAM will be cleared)
+* `stack` + *Enter*:
+ ... print complete stack content on standard output
+
+It is sufficient to enter only as many characters of the command until the command is unique.
+`b` for *break*, `c` for *continue*, `r` for *reset*, `p` for *power* and `s` for *stack*
Microcontrollers UART interface(s) is/are connected to local devices and can be used with terminal programs (like `picocom`).
-After start of `simuc` the program waits for an keyboard action to start simulation. So you are able to connect with avr-gdb before the simulation is executing some machine code.
+After start of `simuc` the program waits for a command (via keyboard) to start simulation. So you are able to connect with *avr-gdb* before the simulation is executing some machine code.
1) start `simuc` with proper options and arguments
2) start new shell and execute `avr-gdb`
3) inside (gdb) connect to simuc with the gdb shell command `target remote :1234`
4) load symbols with gdb command `file ...`
5) optionally set source directory with `directory ...`
-6) press enter in the shell of simuc
-7) now debug avr program step by step with gdb commands `stepi`, `step`, `nexti`, `next` or continue execution with `continue`
+6) press `b` and enter in the shell of simuc (break on first machine command)
+7) now debug avr program step by step with gdb commands `stepi` (`si`), `step` (`s`), `nexti` (`ni`), `next` (`n`) or continue execution with `continue` (`c`)
+
+Don't forget to compile your program with the option **`-g`** (include gdb debugging information in elf-file)!
-------------------------------------------------------------
```sh
$ sudo apt install gcc make gcc-avr avr-libc
$ sudo apt install libelf-dev
-$ sudo apt install freeglut3 freeglut3-dev
+$ sudo apt install freeglut3-dev
$ sudo apt install libncurses5 libncurses5-dev
```
user@host:~ $ git clone https://git.htl-mechatronik.at/public/sx/simavr.git
```
+The main branch is named `sx-master` because the branch `master` remains unchanged with the original simavr repository on [https://github.com/buserror/simavr](https://github.com/buserror/simavr) (commit [7003af0](https://github.com/buserror/simavr/commit/7003af0)).
+
+
### Make complete simavr
```sh
```
Debian packet available in folder `dpkg`
+
+Find "ready to use" debian packages on [http://www.htl-mechatronik.at/ubuntu-new/pool/partner/](http://www.htl-mechatronik.at/ubuntu-new/pool/partner/).