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

Issue in Using Modelica_Device_Driver with ATmega16

Issue in Using Modelica_Device_Driver 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.

Edited by: manasdas17@gmail.com - Sep-03-18 11:04:21
There are 0 guests and 0 other users also viewing this topic
You are here: