基于HCS12微控制器中文介绍
- 格式:ppt
- 大小:1.05 MB
- 文档页数:29
MC9S12DG128实验使用手册目录第一章概述 (2)第二章硬件电路原理 (4)2.1子板硬件原理 (4)2.1.1、MCU引脚接口部分 (5)2.1.2、串口通信部分 (6)2.1.3、电源部分 (6)2.1.4、复位电路部分 (6)2.1.5、I/O端口电路部分 (7)2.1.6、晶振电路与BDM插头部分 (7)2.2母板硬件原理 (8)2.2.1、电源部分 (9)2.2.2、MC9S12DG128开发板与各接口部分 (9)2.2.3、串口通信部分 (11)2.2.4、LED数码管显示部分 (12)2.2.5、8位数字量输入输出部分 (13)2.2.6、红外发射接收部分 (15)2.2.7、LCD显示部分 (15)2.2.8、模拟量输入部分 (15)2.2.9、蜂鸣器和喇叭部分 (15)2.2.10、键盘输入部分 (16)2.2.11、继电器部分 (16)2.2.12、打印机部分 (17)2.2.13、CAN总线部分 (17)第三章MC9S12DG128教学平台快速入门 (18)3.1硬件连接 (18)3.2软件应用 (20)第一章概述天津工业大学Freescale MCU/DSP研发中心开发的DG128实验系统,其功能基本上和美国MCUSLK系统相同,而且根据中国的教学情况重新设计了一些功能、力求达到更好的实验效果。
DG128实验系统由主板和独立的MCU子板构成。
DG128实验系统的主板插槽和美国的MCUSLK系统相互兼容,主板的插槽可以插包括S12、S08、 HC08各系列MCU子板。
MCU子板可以单独调试运行,也可以插在主板上调试,充分利用主板丰富的硬件资源。
MC9S12DG128具有16位中央处理器(HCS12 CPU)、128KB Flash EEPROM、8KB RAM、2KB EEPROM,以及定时器通道、键盘中断和A/D通道等接口。
MC9S12DG128实验系统可以直接与CodeWarrior相连,具有下载程序、在线单步运行、断点调试、连续运行、修改寄存器和存储单元等特点,可以很方便的进行教学。
基于HCS12X单片机的多传感器智能车控制系统设计【摘要】本文基于飞思卡尔HCS12X控制单元,利用多传感器的信息融合技术设计了一款可以自主循迹行驶的智能车。
系统主要融合了GPS,视觉传感器,激光雷达传感器对智能车进行定位及轨迹控制。
该控制系统在安全性,可靠性,易操作性等方面都进行了综合的优化。
实验表明:该智能车可以按照设计路径自主行驶。
【关键词】智能车;HCS12X单片机;视觉传感器Multi-sensor Combination Intelligent Vehicle Control System's Design Based on HCS12XHANYi-lun WANGBin-long WENXue-lei(College of Mechanical and Electronic Engineering, Shandong University of Science and Technology, Qingdao Shandong, 266510)【Abstract】In this paper, the intelligent vehicle control system’s design based on HCS12X MCU. The Multi-sensor combination technology be used in this control system. This system can control vehicle’s position and Navigate the vehicle with GPS, vision sensor and laser radar sensor. This control system have an optimal decision in safety, reliability and handleability. The experiment showed that the smart vehicle can driving in the designed road by itself.【Key words】Intelligent vehicle; HCS12X MCU; Vision sensor0 引言随着近年来科学技术的高速发展,电子化、信息化、智能化成为了未来车辆的发展趋势。
MC9S12XS128 单片机简介1、HCS12X 系列单片机简介Freescale公司的16位单片机主要分为HC12、HCS12 HCS12X三个系列。
HC12核心是16 位高速CPU12 核,总线速度8MHZ;HCS12 系列单片机以速度更快的CPU12 内核为核心,简称S12 系列,典型的S12 总线速度可以达到25MHZ。
HCS12X 系列单片机是Freescale 公司于2005 年推出的HCS12 系列增强型产品,基于S12 CPU 内核,可以达到25MHz 的HCS12 的2-5 倍性能。
总线频率最高可达40 MHz。
S12X 系列单片机目前又有几个子系列:MC9S12XA系列、MC9S12XB系列、MC9S12XD系列、MC9S12XE系列、MC9S12XF系列、MC9S12XH 系列和MC9S12XS 系列。
MC9S12XS128 就是S12X 系列中的一个成员。
2、MC9S12XS128 性能概述MC9S12XS128 是16 位单片机,由16 位中央处理单元( CPU12X)、128KB 程序Flash(P-lash)8KB RAM、8KB数据Flash(D-lash)组成片内存储器。
主要功能模块包括:内部存储器内部PLL 锁相环模块 2 个异步串口通讯SCI 1 个串行外设接口SPIMSCAN 模块1 个8 通道输入/输出比较定时器模块TIM 周期中断定时器模块PIT16 通道A/D 转换模块ADC1 个8 通道脉冲宽度调制模块PWM 输入/输出数字I/O 口3、输入/ 输出数字I/O 口MC9S12XS128 有3 种封装,分别为64 引脚、80 引脚、112 引脚封装。
其全名分别为MC9S12XS128MAE、MC9S12XS128MAA、MC9S12XS128MAL。
MC9S12XS 系列具有丰富的输入/ 输出端口资源,同时集成了多种功能模块,端口包括PORTA、PORTB、PORTE、PORTK、PORTT PORTS PORTM PORTR PORTH PORTJ和PORTAD 共11 个端口。
HCS12微控制器系列教程---第一讲:PWM 模块介绍该教程以MC9S12DG128单片机为核心进行讲解,全面阐释该16位单片机资源。
本文为第一讲,开始介绍S12 MCU的PWM模块。
PWM 调制波有8 个输出通道,每一个输出通道都可以独立的进行输出。
每一个输出通道都有一,一个周期控制寄存器和两个可供选择的时钟源。
每一个PWM 输出个精确的计数器(计算脉冲的个数)通道都能调制出占空比从0—100% 变化的波形。
PWM 的主要特点有:1、它有8 个独立的输出通道,并且通过编程可控制其输出波形的周期。
2、每一个输出通道都有一个精确的计数器。
3、每一个通道的PWM 输出使能都可以由编程来控制。
4、PWM输出波形的翻转控制可以通过编程来实现。
5、周期和脉宽可以被双缓冲。
当通道关闭或PWM计数器为0时,改变周期和脉宽才起作用。
6、8 字节或16 字节的通道协议。
,他们提供了一个宽范围的时钟频率。
7、有4 个时钟源可供选择(A、SA、B、SB)8、通过编程可以实现希望的时钟周期。
9、具有遇到紧急情况关闭程序的功能。
10、每一个通道都可以通过编程实现左对齐输出还是居中对齐输出。
HCS12微控制器系列教程---第二讲:PWM 寄存器简介1、PWM启动寄存器PWMEPWME 寄存器每一位如图1所示:复位默认值:0000 0000B图1 PWME 寄存器每一个PWM 的输出通道都有一个使能位PWMEx 。
它相当于一个开关,用来启动和关闭相应通道的PWM 波形输出。
当任意的PWMEx 位置1,则相关的PWM输出通道就立刻可用。
用法:PWME7=1 --- 通道7 可对外输出波形PWME7=0 --- 通道7 不能对外输出波形注意:在通道使能后所输出的第一个波形可能是不规则的。
当输出通道工作在串联模式时(PWMCTL寄存器中的CONxx置1),那么)使能相应的16位PWM 输出通道是由PWMEx的高位控制的,例如:设置PWMCTL_CON01 = 1,通道0、1级联,形成一个16位PWM 通道,由通道1 的使能位控制PWM 的输出。
中文2075字外文资料原文Design and Implement of Responder Based on Freescale HCS12Single Chip MicrocomputerResponder is also known as the first signal discriminator, which is widely used in various competitions. It can judge the number of the first player accurately, fairly and intuitively. Currently, a variety of quiz responder has emerged on the market, in which a small responder is commonly designed with small-scale digital integrated circuit. Although the technology has been quite mature,but it is simple function, low intelligence, high fault, simple display, less flexibility, not convenience for upgrade, it has been unable to meet all kinds of requirements for intellectual competitions and variety shows. Therefore, it is necessary to develop some kinds of responder which are more suitable for applications.In recent years, with the rapid development of science and technology, the applications of single-chip microcomputer are becoming widely, which promotes the development of traditional measurement and control technology. In this paper, Freescale HCS12 [1-3] is designed as a core component to achieve an intelligent digital responder with 8-channel [4-8], it has some breakthroughs on technology, function and other aspects, comparing with the past responder. It is characterized by simple structure, powerful, good reliability, practicability, so that the competition can really carried out on just, fair and open rules.The basic functions of responder designed in this paper are:(1) The system can limit the competition time and answer time of the alarm;(2) The system can identify the answer signal and identify the player's number;(3) The system can calculate score for each player and display the scores.Responder can accommodate 8 players numbered 1 to 8. In addition, LED digital tubes are designed to display the latched data. After race host clears the system, if participants press switch, and after answer is certificated whether it is correct or not, the number of first player to answer in action is immediately shown by digital tubes. Responder should have a strong ability to distinguish players to answer in the action, its resolution reaches at least a few ms After the requirements and functions of responder are analyzed, the following circuits are required in general:1、Responder circuitThe circuit has two functions: one is to identify the number of the player who press button, and to save the number; the other is to prohibit the other players from buttoning or to make other buttons not available2、Timing circuitsHost can set competition time and answer time by the time pre-set-circuit. If nobody can answer question within the set time, all players will not get score, then the host will announce the answer. Besides, if someone gets the chance to answer the question, but does not give the right result before the allowable time, he or she won't get the score, the overtime signal will be also send, the host will declare the right answer. Freescale HCS12 contains timer module, the timer module can be directly used.3、Overtime circuitHCS12 will send overtime signal when time goes beyond the set time, this signal will be transferred to the PC computer by the serial port. The next question will be proceeded to answer.4、Scores count and display circuit.When host presses the answer key, it is time to start to answer, if one player presses the answer key, his or her number will be recorded, his or her score will be counted and displayed on the LED digital tubes.Bedside the circuits designed above, some necessary logicdesigns are also necessary. The logic designs are as following:First, the host will read the question which will show in the LCD; next, the PC computer will send letter "k", which means that play is beginning to competition. At the same time, timing circuit starts to work, if nobody gets the chance to answer the question within permitted time, microcontroller will send the word "chao shi" to PC computer; If someone presses the competition key within the specified time, microcontroller will send his or her number. If the time goes beyond the permitted time, PC computer will send "next" which means turning to the next question, the next question will be automatically showed to answer. If some player gets the chance to answer the question, his or her number and scores will decrease 1 automatically and show in the digital tubes, then microcontroller sends "next" to go on the next question. If the score is few than 0 after decreasing, player is eliminated. The right answer will show on the LCD. Finally, if all the questions are done, microcontroller will send "e" to end the game, then the scores of all players will be computed, the highest one will be shown on the digital tubes.Responder hardware is firstly designed;Responder hardware is taken directly from the hardware resources of Freescale HCS12 development board developed by Suzhou University. The development board takes MC9S12DG128 as the core, using modular design approach, it extracts part of I/O resources,and it also provides each module with a corresponding interface circuit. Italso provides A/D input channels, PWM low-pass filter circuits, 16-key keyboard input channels, 8-bit digital I/O circuits, SPI I/O circuits, SCI communication circuits,IC but I/O expansion circuits and so.In this paper, the hardware modules, the pin connections and the corresponding interfaces of the development board are listed and unified to redesign by actual needs of the system.Before the start of the main program, the total interruptions are turned off and each module is initialized. The initialization of each module has been done in the corresponding initialization subprogram of each module. Here we only need call the corresponding initialization subprogram. After the initialization of each module is completed,the total interruptions should be turned on. The main body of the main program is a loop structure; there are also several sub-cycles in the main loop, which are used for the cycle waiting of each loop. After the completion of the initialization, the system has been waited for the signal of competition start with the circular mode until the signal comes. When this signal is received, the system checks whether the cycle time is overtime, if it is overtime, the system changes to the next question, otherwise, the system checks the competition signal, if some player competes to answer, then the system checks whether the answer time is out, if the time is not out, the system judges whether the result is true, if the result is right, the player is added 1 point, otherwise, the player is subtracted 1 point, and the system enters the next question. To the player whose score will be subtracted, the system needs to check whether the score is low than 0, if it does, this player's input channel is turned off. To be noted that, if the competition flag is 1, it should be clearedResponder is one of the essential devices in various knowledge and intellectual contests, the development of better and more intelligent digital responder is very significant. Responder designed in this paper can achieve a responder's basic functions through experimental prototype testing.It reaches the design target with reasonable design, simple structure, good commonality, strong function, reliable answer and quick reaction. However, as hardware limitations of development board, some functions have not been able to achieve, such as the development board does not have enough LED digital tubes to display all player's scores simultaneously, the host can not adjust answer time according the difficulty of the question and so on. These issues will remain to be addressed in future development.外文资料译文基于Freescale HCS12系列单片机设计和实现抢答器抢答器也被称为第一信号鉴别器,它被广泛应用于各种比赛。
基于HCS12的实时嵌入式燃料电池控制系统出生年:1983.1性别:男籍贯:山东费县职称:助理工程师研究方向:电气系统收刊地址:天津空港经济区西十道5号科研所六室收件人:王宗欣邮编:300308手机号码:151********燃料电池控制器是燃料电池中非常关键的部分,对于燃料电池稳定而安全的工作有积极的作用。
针对燃料电池控制中要求较高的实时性与可靠性,利用摩托罗拉16位单片机MC9S12DP256b把实时嵌入式系统UC/OS-II成功移植到控制中。
本文结合HCS12单片机和Codewarrior编译器的特点详细介绍了内核的优化实现,并利用实例说明了嵌入式操作系统带来的优点。
标签:UC/OS-II;燃料电池控制器(FCC);MC9S12DP256b;移植;内核0引言随着汽车工业的发展,人类对传统能源(如原油)的需求日益扩大,从而带来空气污染和资源枯竭两大问题,燃料电池作为一种新型的绿色能源开始受到人类的关注。
结合由同济大学承担的国家863电动汽车重大专项——燃料电池轿车项目,需要开发适用于质子交换膜燃料电池稳定而安全工作的燃料电池控制器。
考虑到燃料电池控制器硬件资源的需求,研究中利用了摩托罗拉公司的16位单片机MC9S12DP256b。
为了进一步满足控制中高可靠性与实时性的要求,把内核公开的UC/OS-II实时嵌入式操作系统移植到此单片机中,从而使开发具有更好的扩展性。
本文首次把实时嵌入式操作系统应用到燃料电池控制中,取得了良好的效果。
1系统平台介绍1.1硬件MC9S12DP256bMC9S12DP256b是摩托罗拉16位单片机HCS12家族中的一员,它的处理单元采用了16位的STAR12 CPU。
此单片机内嵌了很多资源,包括256K FLASH,4K EEPROM,12K RAM,8通道定时器以及多种通信接口。
此单片机可通过单线BDM进行程序的编译,下载和在线调试。
1.2软件平台CodewarriorCodewarrior是Metrowerks公司开发的一个编程环境。