Code Monkey home page Code Monkey logo

openmodelica_arduino_with_mdd_windows's Introduction

OpenModelica_Arduino_With_MDD on Windows Platform

Embedded Experiments with OpenModelica and Arduino with facility for Embedded C code generation.

Free & Open Source library based on OpenModelica to perform Embedded Experiments with Arduino. Also, there is a facility to generate Embedded C code by using Modelica_DeviceDriver models.

Library description

The library is an open source Modelica package for real-time simulation of circuit designs involving Arduino platforms based on AVR Atmega328P MCUs.

Main features:

Support for Windows. (Soft) real-time synchronization of a simulation.

Please note that the library is known to work with

OpenModelica (partial support starting with OpenModelica v1.11.0, e.g.serial port).

Prerequisites

OpenModelica (>= v1.11.0) (https://www.openmodelica.org/download/download-windows) Modelica_DeviceDrivers (v1.5.1) (https://github.com/modelica/Modelica_DeviceDrivers/releases/tag/v1.5.1)

Compile and Install

Compile: Navigate to Library directory under Resources and to compile a source file named filename.c execute the following command

$ gcc –c –Wall –fPIC ../src/filename.c

To make a shared object file named libSerialComm.so execute the following

$ gcc –shared –fPIC *.o -o libSerialComm.so

Install and Run: Launch OMEdit and load the package Modelica_DeviceDrivers. Also, load the OpenModelica-Arduino package present in Arduino.mo file. Load the Arduino platform with the arduino_firmware.ino code.Create any model using the package and simulate.

Running Test Firmware

Test the package using test firmware provided.

Load the Arduino platform with the arduino_firmware.ino code. Load the test model present in testfirmware.mo file along with Arduino.mo file in OpenModelica. Simulate the model.If no error occurs,the package is good to go.

Running MDD Models

See the AVR package documentation under Modelica_DeviceDrivers -> EmbeddedTargets -> AVR in OMEdit before running the MDD examples.

To run a Modelica_DeviceDrivers Blink example, navigate to MDD_build/Blink directory and execute the following command

Running Manually: Executing Blink example within Modelica_DeviceDrivers EmbeddedTargets Package:- Put the runMDDAvr.mos file in a (build) directory and execute following commands on the command line:

$ omc --simCodeTarget=ExperimentalEmbeddedC runMDDAvr.mos $ avr-gcc -Os -std=c11 -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000UL -Wl,--gc-sections Blink_main.c -o Blink -I /path_to_MDD/Modelica_DeviceDrivers/Resources/Include -I /usr/include/omc/c $ avr-objcopy -O ihex -R .eeprom Blink Blink.hex $ avrdude -F -V -c arduino -p ATMEGA328P -P /dev/ttyACM0 -b 115200 -U flash:w:Blink.hex

For further information: Visit https://build.openmodelica.org/Documentation/Modelica_DeviceDrivers.html. Development and contribution

Main developers:

Manas Ranjan Das, FOSSSEE, IIT-Bombay

Contributions in shape of [Pull Requests] are always welcome.

openmodelica_arduino_with_mdd_windows's People

Contributors

manasdas17 avatar

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.