Giter Site home page Giter Site logo

3d-arduino-simulator's Introduction

3D-Arduino-Simulator

I created 3D Arduino Simulator and make it open-source as a final project of my Algorithms and Programming II class in my freshman. I was playing with Arduino but could not find a simulator where I can upload my compiled hex file and watch simulation on PC.Also I was eager to learn how a CPU works, moreover, how I could write an emulator.

Arduino board includes an 8 bit Atmel AVR CPU, 14 I/O pins supporting serial communication and 6 analog inputs.The first aim was to being able to program digital outputs with compiled hex file created by Arduino IDE.

Atmel ATmega328 has 131 instructions, 32 general purpose I/O registers, a 2 KB SRAM, 1KB EEPROM.Writing a program on Arduino IDE, gives a hex file to upload Arduino.Therefore simulator should be able decode this Intel hex binary, and process each single instruction that includes byte count, address, record type, data and checksum information.Hence, the general simulation strategy is :

  • Fetch, decode and evaluate instructions in the CPU core
  • Update internal CPU modules for changes in the IO registers
  • Check occurrences of CPU interrupts and manage appropriately
  • Update values of CPU pins, Arduino pins and 3D view respectively.

I write flash module with 64kb instruction and 32kb program memory which reads the hex file, an AtmelAVR module to mask instructions, and it also has registers and defined operands.I also added ATmega328 object that keeps and update program counter, 8 register status flags, and update CPU clock accordingly.I defined only 13 instructions as it is enough when using for, while or if statements to control digital output pins.At the end of the project, simulator can demonstrate the states of digital inputs in 3D view with given compiled hex file.

3d-arduino-simulator's People

Contributors

yigitdemirag avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

3d-arduino-simulator's Issues

is the source code complete?

Hello Yigit, I am interested in this project and got it to compile and run in eclipse. However, the application does not seem to reproduce what is described in the readme. For instance there is no 3d visualization of the arduino. What I get is a button 'Execute next instruction' and a list of registers (I guess). Any help you can give is appreciated!
Many thanks, Francisco

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.