(College of Information& Control Engineering,Southwest University of Science& Technology,Mianyang 621 002,China) Abstract:Embedded controller is designed with Atmegal 28 single-chip.A/D converter in Atmegal 28 is adoptedin analog input channel and AD421 D/A converter is used in the output channel,and the high-speed photo-coupler isused in digital input and output channe1.OsTaskStklnit()function and correlative files are modified with Iccavrcompiler.Data type is defined to realize the transplant of Micro C/OS—Ⅱ. Key words:Atmegal 28;Embedded controller;CANbus;Micro C/OS-Ⅱ 1 引言 嵌入式控制器是机电设备实现自动化的核心部件。故以大型机电设备为控制对象,利用高性能Atmega 128微处理器, 设计了具有现场总线(CANBUS)网络通信和一定通用性的多功能嵌入式智能控制器。 2 硬件设计 系统的硬件结构如图1。