基于多任务机制的STM32系统程序设计  被引量:5

Program Design of STM32 System Based on Real-time Multi-task Mechanism

在线阅读下载全文

作  者:唐飞 杨伟 TANG Fei;YANG Wei(School of Physics and Electronics,Anqing Normal University,Anqing 246133,China)

机构地区:[1]安庆师范大学物理与电气工程学院

出  处:《安庆师范大学学报(自然科学版)》2019年第4期70-74,共5页Journal of Anqing Normal University(Natural Science Edition)

基  金:安徽省自然科学研究基金(AQKJ2014B018)

摘  要:工业控制中广泛使用单片机作为核心控制器。随着控制系统复杂性的不断提升,单片机的单任务运行机制难以胜任复杂的控制任务。本文针对单任务机制的局限性,研究了嵌入式系统中多任务机制的原理,分析了实现多任务机制的基本条件,提出了实施多任务机制的策略,然后将多任务程序运行机制引入单片机系统,设计了一个基于分时机制的具有一定优先级规则的多任务系统,并使用C语言编写了程序。该程序可读性好、运行效率高、易于调试维护,满足了多任务系统的运行需求,在STM32系统上实现了多任务运行机制。Microcontroller Unit(MCU) is widely used as a core controller in industrial production.As the complexity of the control system continues to increase,the single-function operation mechanism of MCU cannot handle complex control tasks.In view of the limitations of the single-task mechanism,this paper studies the implementation principle of multi-task mechanism in embedded systems,analyzes the basic conditions for implementing multi-task mechanism,and proposes a multitask implementation strategy.Then the multi-task program running mechanism is introduced into MCU,and a multi-tasking system with certain priority rules based on time-sharing mechanism is designed.The program is written in C language.The program is readable,efficient,easy to debug and maintain meets the operation requirements of multi-tasking system,and realizes multi-task operation mechanism on STM32 system.

关 键 词:多任务机制 时间片 结构体 STM32 

分 类 号:TP368.2[自动化与计算机技术—计算机系统结构]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象