微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Proteus 总是在特定时间出错​​在本例中为 1.75 秒

如何解决Proteus 总是在特定时间出错​​在本例中为 1.75 秒

我最近在大学项目中使用 FreeRTOS,但不知何故我的 proteus 总是有这个致命错误(每次它的差异错误但总是致命错误,有时违反模块 DSIM.dll,有时其他 .dll(s))。起初我认为这与我的代码有关,所以我尝试使用另一个示例代码(来自互联网的简单模板,可以使 LED 闪烁,并不复杂)但它仍然在 1.75 秒时出错,即使在那个人的演示中工作出色。我认为这与 xTaskDelay 原因有关,当我评论任务的延迟线时(我认为它的单一任务是因为唯一正在运行的任务只是具有更高优先级的任务)程序工作。提前致谢

#include <Arduino_FreeRTOS.h>
void setup()
//Initialize the Serial Monitor with 9600 baud rate
{
Serial.begin(9600);
Serial.println(F("In Setup function"));
//Set the digital pins 8 to 11 as digital output pins
  pinMode(8,OUTPUT);
  pinMode(9,OUTPUT);
  pinMode(10,OUTPUT);
  pinMode(11,OUTPUT);

//Create three tasks with labels Task1,Task2 and Task3 and assign the priority as 1,2 and 3 respectively. 
//We also create the fourth task labeled as IdelTask when there is no task in 
//operation and it has the highest priority.

 xTaskCreate(MyTask1,"Task1",100,NULL,1,NULL);
 xTaskCreate(MyTask2,"Task2",2,NULL);
 xTaskCreate(MyTask3,"Task3",3,NULL);
 xTaskCreate(MyIdleTask,"IdleTask",NULL);}

//We can change the priority of task according to our desire by changing the numeric’s //between NULL texts.

void loop()

{
//There is no instruction in the loop section of the code.
// Because each task executes on interrupt after specified time
}

//The following function is Task1. We display the task label on Serial monitor.

static void MyTask1(void* pvParameters)
{
 
  while(1)

  { 
    digitalWrite(8,HIGH);

    digitalWrite(9,LOW); 

    digitalWrite(10,LOW);

    digitalWrite(11,LOW); 

    Serial.println(F("Task1"));

    vTaskDelay(100/portTICK_PERIOD_MS);
  }
}

//Similarly this is task 2

static void MyTask2(void* pvParameters)

{  
while(1)

  { digitalWrite(8,LOW);
    digitalWrite(9,HIGH); 
    digitalWrite(10,LOW);
    digitalWrite(11,LOW);   
    Serial.println(F("Task2"));
    vTaskDelay(110/portTICK_PERIOD_MS);
  }
}

//Similarly this is task 3

static void MyTask3(void* pvParameters)
{ 
while(1)
  { 
   digitalWrite(8,LOW);
   digitalWrite(9,LOW); 
   digitalWrite(10,HIGH);
   digitalWrite(11,LOW);
   Serial.println(F("Task3"));
   vTaskDelay(120/portTICK_PERIOD_MS);
  }
}

//This is the idle task which has the lowest priority and calls when no task is running.

static void MyIdleTask(void* pvParameters)

{
  while(1)
   { 
    digitalWrite(8,LOW); 
    digitalWrite(10,HIGH);
    Serial.println(F("Idle state"));
    delay(50);
  }  
}

Error at 1.75

DSIM.dll

Source for the code

解决方法

事实证明 Proteus 应用程序有点损坏,所以我去谷歌下载那些 .dll(s) 文件

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?