Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register
  • Index
  • » Users
  • » manasdas17@gmail.com
  • » Profile

Posts

Posts

Sep-03-18 10:46:28
Embedded C code generation with ATmega16

Trying out a LED blinking program with ATmega16 controller with an external 16Mhz crystal.LED connected to PORT A of pin 4(PA4).Though Embedded C code is generated and able to flash it to ATmega board but no blinking happens.

Please find the code below

Code:

model MDD_traffic_light_led_blink

  inner Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.Microcontroller mcu(platform = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Platform.ATmega16)  annotation(
    Placement(visible = true, transformation(origin = {-58, 62}, extent = {{-24, -24}, {24, 24}}, rotation = 0)));
  Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.DigitalWriteBoolean digitalWriteBoolean1(pin = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Pin.'4', port = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Port.A)  annotation(
    Placement(visible = true, transformation(origin = {57, -3}, extent = {{-19, -19}, {19, 19}}, rotation = 0)));
  Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.SynchronizeRealtime synchronizeRealtime1(timer = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerSelect.Timer1)  annotation(
    Placement(visible = true, transformation(origin = {54, 68}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Blocks.Sources.BooleanExpression booleanExpression1(y = true)  annotation(
    Placement(visible = true, transformation(origin = {-50, -8}, extent = {{-28, -20}, {28, 20}}, rotation = 0)));
equation
  connect(booleanExpression1.y, digitalWriteBoolean1.u) annotation(
    Line(points = {{-20, -8}, {32, -8}, {32, -2}, {34, -2}}, color = {255, 0, 255}));

annotation(
    uses(Modelica_DeviceDrivers(version = "1.5.0"), Modelica(version = "3.2.2")));end MDD_traffic_light_led_blink;

I am using stk500v2 to upload the code to ATmeag16.

Aug-28-14 10:01:31
Topic: BondLib
Error in BondLib loading in OMEdit

Ok.Even the Spice3 library is also n't working as when i am trying to execute any example in Spice3,its showing following errors :


[:0:0-0:0] Warning: Assuming fixed start value for the following 2 variables:
         vin2.T0:DISCRETE(start = vin2.TD fixed = false protected = true )  "Start time of current period".Modelica.Electrical.Spice3.Examples.Nand, .Modelica.Electrical.Spice3.Sources.V_pulse, .Modelica.SIunits.Time type: Real
         vin1.T0:DISCRETE(start = vin1.TD fixed = false protected = true )  "Start time of current period".Modelica.Electrical.Spice3.Examples.Nand, .Modelica.Electrical.Spice3.Sources.V_pulse, .Modelica.SIunits.Time type: Real
[:0:0-0:0] Error: Duplicate modification of element  {start  =(untyped) 2.0e-5}  and final  = (typed)2e-05 DAE.PROP(Real(quantity = "Transconductance", unit = "A/V2"), C_CONST), value: 2e-05 on component m_transconductance.
[:0:0-0:0] Error: Duplicate modification of element  {start  =(untyped) 0.0}  and final  = (typed)0.0 DAE.PROP(Real(quantity = "InversePotential", unit = "1/V"), C_CONST), value: 0.0 on component m_lambda.
[/usr/lib/omlibrary/Modelica 3.2.1/Electrical/Spice3.mo:4636:5-4637:139] Error: Variable mn1.p: Duplicate modification of element  {start  =(untyped) 2.0e-5}  and final  = (typed)2e-05 DAE.PROP(Real(quantity = "Transconductance", unit = "A/V2"), C_CONST), value: 2e-05 on component m_transconductance.
[/usr/lib/omlibrary/Modelica 3.2.1/Electrical/Spice3.mo:4636:5-4637:139] Error: Variable mn1.p: Duplicate modification of element  {start  =(untyped) 0.0}  and final  = (typed)0.0 DAE.PROP(Real(quantity = "InversePotential", unit = "1/V"), C_CONST), value: 0.0 on component m_lambda.
[/usr/lib/omlibrary/Modelica 3.2.1/Electrical/Spice3.mo:4636:5-4637:139] Error: Variable mn2.p: Duplicate modification of element  {start  =(untyped) 2.0e-5}  and final  = (typed)2e-05 DAE.PROP(Real(quantity = "Transconductance", unit = "A/V2"), C_CONST), value: 2e-05 on component m_transconductance.
[/usr/lib/omlibrary/Modelica 3.2.1/Electrical/Spice3.mo:4636:5-4637:139] Error: Variable mn2.p: Duplicate modification of element  {start  =(untyped) 0.0}  and final  = (typed)0.0 DAE.PROP(Real(quantity = "InversePotential", unit = "1/V"), C_CONST), value: 0.0 on component m_lambda.
[/usr/lib/omlibrary/Modelica 3.2.1/Electrical/Spice3.mo:4636:5-4637:139] Error: Variable mp2.p: Duplicate modification of element  {start  =(untyped) 0.0}  and final  = (typed)0.0 DAE.PROP(Real(quantity = "InversePotential", unit = "1/V"), C_CONST), value: 0.0 on component m_lambda.
[/usr/lib/omlibrary/Modelica 3.2.1/Electrical/Spice3.mo:4636:5-4637:139] Error: Variable mp1.p: Duplicate modification of element  {start  =(untyped) 2.0e-5}  and final  = (typed)2e-05 DAE.PROP(Real(quantity = "Transconductance", unit = "A/V2"), C_CONST), value: 2e-05 on component m_transconductance.
[/usr/lib/omlibrary/Modelica 3.2.1/Electrical/Spice3.mo:4636:5-4637:139] Error: Variable mp1.p: Duplicate modification of element  {start  =(untyped) 0.0}  and final  = (typed)0.0 DAE.PROP(Real(quantity = "InversePotential", unit = "1/V"), C_CONST), value: 0.0 on component m_lambda.
[/usr/lib/omlibrary/Modelica 3.2.1/Electrical/Spice3.mo:4636:5-4637:139] Error: Variable mp2.p: Duplicate modification of element  {start  =(untyped) 2.0e-5}  and final  = (typed)2e-05 DAE.PROP(Real(quantity = "Transconductance", unit = "A/V2"), C_CONST), value: 2e-05 on component m_transconductance.



Is there any library available for Spice model simulation.If yes,plz let me know as i am trying to simulate spice models in OpenModelica.

Regards,
Manas

Aug-28-14 10:00:35
Topic: BondLib
Error in BondLib loading in OMEdit

Ok.Even the Spice3 library is also n't working as when i am trying to execute any example in Spice3,its showing following errors :


[:0:0-0:0] Warning: Assuming fixed start value for the following 2 variables:
         vin2.T0:DISCRETE(start = vin2.TD fixed = false protected = true )  "Start time of current period".Modelica.Electrical.Spice3.Examples.Nand, .Modelica.Electrical.Spice3.Sources.V_pulse, .Modelica.SIunits.Time type: Real
         vin1.T0:DISCRETE(start = vin1.TD fixed = false protected = true )  "Start time of current period".Modelica.Electrical.Spice3.Examples.Nand, .Modelica.Electrical.Spice3.Sources.V_pulse, .Modelica.SIunits.Time type: Real
[:0:0-0:0] Error: Duplicate modification of element  {start  =(untyped) 2.0e-5}  and final  = (typed)2e-05 DAE.PROP(Real(quantity = "Transconductance", unit = "A/V2"), C_CONST), value: 2e-05 on component m_transconductance.
[:0:0-0:0] Error: Duplicate modification of element  {start  =(untyped) 0.0}  and final  = (typed)0.0 DAE.PROP(Real(quantity = "InversePotential", unit = "1/V"), C_CONST), value: 0.0 on component m_lambda.
[/usr/lib/omlibrary/Modelica 3.2.1/Electrical/Spice3.mo:4636:5-4637:139] Error: Variable mn1.p: Duplicate modification of element  {start  =(untyped) 2.0e-5}  and final  = (typed)2e-05 DAE.PROP(Real(quantity = "Transconductance", unit = "A/V2"), C_CONST), value: 2e-05 on component m_transconductance.
[/usr/lib/omlibrary/Modelica 3.2.1/Electrical/Spice3.mo:4636:5-4637:139] Error: Variable mn1.p: Duplicate modification of element  {start  =(untyped) 0.0}  and final  = (typed)0.0 DAE.PROP(Real(quantity = "InversePotential", unit = "1/V"), C_CONST), value: 0.0 on component m_lambda.
[/usr/lib/omlibrary/Modelica 3.2.1/Electrical/Spice3.mo:4636:5-4637:139] Error: Variable mn2.p: Duplicate modification of element  {start  =(untyped) 2.0e-5}  and final  = (typed)2e-05 DAE.PROP(Real(quantity = "Transconductance", unit = "A/V2"), C_CONST), value: 2e-05 on component m_transconductance.
[/usr/lib/omlibrary/Modelica 3.2.1/Electrical/Spice3.mo:4636:5-4637:139] Error: Variable mn2.p: Duplicate modification of element  {start  =(untyped) 0.0}  and final  = (typed)0.0 DAE.PROP(Real(quantity = "InversePotential", unit = "1/V"), C_CONST), value: 0.0 on component m_lambda.
[/usr/lib/omlibrary/Modelica 3.2.1/Electrical/Spice3.mo:4636:5-4637:139] Error: Variable mp2.p: Duplicate modification of element  {start  =(untyped) 0.0}  and final  = (typed)0.0 DAE.PROP(Real(quantity = "InversePotential", unit = "1/V"), C_CONST), value: 0.0 on component m_lambda.
[/usr/lib/omlibrary/Modelica 3.2.1/Electrical/Spice3.mo:4636:5-4637:139] Error: Variable mp1.p: Duplicate modification of element  {start  =(untyped) 2.0e-5}  and final  = (typed)2e-05 DAE.PROP(Real(quantity = "Transconductance", unit = "A/V2"), C_CONST), value: 2e-05 on component m_transconductance.
[/usr/lib/omlibrary/Modelica 3.2.1/Electrical/Spice3.mo:4636:5-4637:139] Error: Variable mp1.p: Duplicate modification of element  {start  =(untyped) 0.0}  and final  = (typed)0.0 DAE.PROP(Real(quantity = "InversePotential", unit = "1/V"), C_CONST), value: 0.0 on component m_lambda.
[/usr/lib/omlibrary/Modelica 3.2.1/Electrical/Spice3.mo:4636:5-4637:139] Error: Variable mp2.p: Duplicate modification of element  {start  =(untyped) 2.0e-5}  and final  = (typed)2e-05 DAE.PROP(Real(quantity = "Transconductance", unit = "A/V2"), C_CONST), value: 2e-05 on component m_transconductance.



Is there any library available for Spice model simulation.If yes,plz let me know as i am trying to simulate spice models in OpenModelica.

Regards,
Manas

Aug-28-14 09:28:55
Topic: BondLib
Error in BondLib loading in OMEdit

Thanx.I got the library.But when i tried to open BondLib in OMEdit,i got the following warning

[/usr/lib/omlibrary/BondLib 2.3/package.mo:709:40-709:112] Warning: The file was not encoded in UTF-8:
  "<html> The following improvements were made between Version 1.3 and Vers...".
  Defaulting to 7-bit ASCII with unknown characters replaced by '?'.
  To change encoding when loading a file: loadFile(encoding="ISO-XXXX-YY").
  To change it in a package: add a file package.encoding at the top-level.
  Note: The Modelica Language Specification only allows files encoded in UTF-8.

And none of the examples aren't opening in OMEdit.I tried NandGate in ModelicaSpice.

Regards,
Manas

Aug-28-14 06:28:35
Topic: BondLib
Error in BondLib loading in OMEdit

But there is no BondLib ported with Openmodelica distribution.

Regards,
Manas

Aug-27-14 04:36:47
Topic: BondLib
Error in BondLib loading in OMEdit

How to load BondLib 2.3 in Openmodelica. am getting error while trying to load it to OMEdit.

Regards,
Manas

Sep-03-13 11:23:44
error executing simulate command

while executing the following "simulate(BouncingBall,stopTime=3.0)"
i got the error as
record SimulationResult
    resultFile = "",
    simulationOptions = "startTime = 0.0, stopTime = 3.0, numberOfIntervals = 500, tolerance = 0.000001, method = 'dassl', fileNamePrefix = 'BouncingBall', options = '', outputFormat = 'mat', variableFilter = '.*', measureTime = false, cflags = '', simflags = ''",
    messages = "Simulation execution failed for model: BouncingBall
/bin/sh: 1: /home/fossee/Documents/openmodelica/binary: not found

",
    timeFrontend = 0.574199305,
    timeBackend = 0.07576126300000001,
    timeSimCode = 0.031371718,
    timeTemplates = 0.08858041900000001,
    timeCompile = 1.991460298
end SimulationResult;
Warning: The initial conditions are not fully specified. Use +d=initialization for more information.


plz let me know why simulation is nt taking place.

Thanks,
Manas

  • Index
  • » Users
  • » manasdas17@gmail.com
  • » Profile
You are here: